/* ShopDesk v0.1 — clean shop-console theme */
:root {
  --bg: #f4f6f9; --card: #ffffff; --ink: #1d2430; --muted: #6b7686;
  --line: #e2e8f0; --accent: #0f6cbd; --accent-dk: #0a4f8a;
  --ok: #1a7f37; --warn: #b54708; --bad: #c0392b; --info: #0f6cbd;
  --input-bg: #ffffff; --hover: #eef2f7;
}
/* dark mode — toggled per user on their profile page */
[data-theme="dark"] {
  --bg: #10151d; --card: #1a2230; --ink: #e6ebf2; --muted: #9aa6b8;
  --line: #2b3648; --accent: #4da3e6; --accent-dk: #2f7fc2;
  --ok: #3fb950; --warn: #d29922; --bad: #f47067; --info: #4da3e6;
  --input-bg: #232d3d; --hover: #232d3d;
}
[data-theme="dark"] .topbar { background: #0b0f16; }
[data-theme="dark"] input, [data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--input-bg); color: var(--ink); border-color: var(--line);
}
[data-theme="dark"] .btn.ghost { border-color: var(--line); color: var(--ink); }
.who-link { color: inherit; }
.who-link:hover { text-decoration: underline; }
/* ticket thread */
.reply { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 10px; }
.reply-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.reply.internal { background: var(--hover); border-style: dashed; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
       background: var(--bg); color: var(--ink); font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar */
.topbar { background: #14202e; color: #fff; padding: 0 18px; height: 52px;
          display: flex; align-items: center; gap: 18px; position: sticky;
          top: 0; z-index: 50; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.brand span { color: #7db9f0; font-weight: 400; font-size: 12px; margin-left: 8px;}
nav.main { display: flex; gap: 4px; flex: 1; }
nav.main a { color: #cdd8e4; padding: 8px 12px; border-radius: 6px; font-size: 13.5px;}
nav.main a:hover { background: #22344a; text-decoration: none; color: #fff;}
nav.main a.active { background: var(--accent); color: #fff; }
.topbar .who { font-size: 12.5px; color: #aeb9c7; }
.topbar select { background: #22344a; color: #fff; border: 1px solid #33475f;
                 border-radius: 6px; padding: 5px 8px; font-size: 12.5px; }

/* layout */
.wrap { max-width: 1280px; margin: 0 auto; padding: 18px; }
.pagehead { display: flex; align-items: center; justify-content: space-between;
            margin: 4px 0 14px; }
.pagehead h1 { font-size: 21px; margin: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .g2,.g3,.g4{ grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line);
        border-radius: 10px; padding: 16px; }
.card h2 { font-size: 15px; margin: 0 0 10px; }
.card h3 { font-size: 13.5px; margin: 14px 0 8px; color: var(--muted);
           text-transform: uppercase; letter-spacing: .4px; }
.kpi { font-size: 26px; font-weight: 700; }
.kpi small { font-size: 12px; color: var(--muted); font-weight: 400; }
.sub { color: var(--muted); font-size: 12.5px; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px;
     text-transform: uppercase; letter-spacing: .3px; padding: 8px 10px;
     border-bottom: 2px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top;}
tr:hover td { background: #f8fafc; }

/* status pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px;
        font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-scheduled { background: #e8eef5; color: #3b4a5e; }
.st-checked-in { background: #dbeafe; color: #1d4ed8; }
.st-in-progress { background: #fef3c7; color: #92400e; }
.st-waiting-parts, .st-waiting-approval { background: #ffedd5; color: #9a3412; }
.st-ready { background: #dcfce7; color: #166534; }
.st-picked-up { background: #e2e8f0; color: #475569; }
.st-cancelled { background: #fee2e2; color: #991b1b; }
.st-open { background: #dbeafe; color: #1d4ed8; }
.st-paid { background: #dcfce7; color: #166534; }
.st-void { background: #fee2e2; color: #991b1b; }
.st-ok { background: #dcfce7; color: #166534; }
.st-attention { background: #fef3c7; color: #92400e; }
.st-urgent { background: #fee2e2; color: #991b1b; }
.st-pending { background: #e8eef5; color: #3b4a5e; }
.st-na { background: #f1f5f9; color: #94a3b8; }
.st-approved, .st-sent { background: #dbeafe; color: #1d4ed8; }
.st-declined { background: #fee2e2; color: #991b1b; }
.st-draft { background: #e8eef5; color: #3b4a5e; }
.st-partial { background: #ffedd5; color: #9a3412; }
.st-none { background: #f1f5f9; color: #94a3b8; }

/* forms */
label { display: block; font-size: 12.5px; color: var(--muted); margin: 8px 0 4px;}
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 13.5px; font-family: inherit; background: #fff;}
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd7f5; border-color: var(--accent);}
textarea { min-height: 70px; resize: vertical; }
.formrow { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.formrow3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0;
       padding: 8px 16px; border-radius: 7px; font-size: 13.5px; cursor: pointer;
       font-weight: 600; }
.btn:hover { background: var(--accent-dk); text-decoration: none; color:#fff;}
.btn.ghost { background: #eef2f7; color: var(--ink); }
.btn.ghost:hover { background: #e2e8f0; }
.btn.danger { background: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.inline { display: inline; }
.inline input, .inline select { width: auto; }

/* login */
.loginwrap { max-width: 380px; margin: 90px auto; }
.loginwrap .card { padding: 28px; }
.loginwrap h1 { margin: 0 0 4px; font-size: 22px; }

/* misc */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px;}
.flash.ok { background: #dcfce7; color: #166534; }
.flash.err { background: #fee2e2; color: #991b1b; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.logbox { background: #0f172a; color: #cbd5e1; border-radius: 8px; padding: 12px;
          max-height: 320px; overflow: auto; white-space: pre-wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.right { text-align: right; }
.mt { margin-top: 14px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13.5px;}
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.totals td { font-weight: 700; }
@media print {
  .topbar, .toolbar, .noprint, #sidebar, #rpanel, .kb-fab { display: none !important; }
  body { background: #fff; }
  .mainwrap { margin: 0 !important; }
  .mainwrap .wrap { max-width: none !important; padding: 0 !important; }
  .card { box-shadow: none !important; break-inside: avoid; }
}

/* ===== ShopDesk v0.2: sidebar + slide-out panel + board + mobile ===== */
.topbar .iconbtn { background: transparent; border: 0; color: #fff; font-size: 19px;
  cursor: pointer; padding: 6px 10px; border-radius: 6px; }
.topbar .iconbtn:hover { background: #22344a; }
.topbar .panelbtn { font-size: 13.5px; }
.topbar .spacer { flex: 1; }
.topbar .logout { color: #aeb9c7; font-size: 12.5px; }
.topbar .who em { font-style: normal; color: #7db9f0; }
.shell { display: flex; align-items: stretch; min-height: calc(100vh - 52px); }

#sidebar { width: 224px; flex: 0 0 224px; background: #1b2a3d; color: #cdd8e4;
  position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto;
  transition: margin-left .2s ease; display: flex; flex-direction: column; }
body:not(.side-open) #sidebar { margin-left: -224px; }
#sidebar nav { padding: 10px 0; flex: 1; }
#sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 11px 18px;
  color: #cdd8e4; font-size: 14px; }
#sidebar nav a:hover { background: #243a54; text-decoration: none; color: #fff; }
#sidebar nav a.active { background: var(--accent); color: #fff; }
#sidebar .ni { width: 20px; text-align: center; font-size: 15px; }
#sidebar .navsec { padding: 14px 18px 4px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; color: #7d8ea3; }
#sidebar .sideloc { padding: 12px 18px; font-size: 11.5px; color: #7d8ea3;
  border-top: 1px solid #2a3d55; }
.mainwrap { flex: 1; min-width: 0; }
.scrim { display: none; }

/* right slide-out panel */
.rpanel { position: fixed; top: 0; right: 0; height: 100vh; width: 370px;
  max-width: 94vw; background: #fff; z-index: 120; display: flex;
  flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,.22);
  transform: translateX(105%); transition: transform .25s ease; }
.rpanel.open { transform: none; }
.rpanel-head { display: flex; align-items: center; border-bottom: 1px solid var(--line);
  padding: 8px 8px 0; gap: 6px; }
.rpanel-tabs { display: flex; gap: 2px; flex: 1; }
.rpanel-tabs button { border: 0; background: none; padding: 10px 14px; font-size: 13.5px;
  font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; }
.rpanel-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.rpanel-body { flex: 1; overflow-y: auto; padding: 16px; }
.rpanel-body h2 { margin-top: 0; }
.prow { display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* workflow board */
.viewtoggle .btn.active { background: var(--accent-dk); color: #fff; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr);
  gap: 12px; overflow-x: auto; padding: 4px 2px 14px; align-items: start;
  scroll-snap-type: x proximity; }
.bcol { background: #e9eef5; border-radius: 12px; padding: 10px; min-height: 140px;
  scroll-snap-align: start; }
.bcol-head { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; padding: 0 2px; }
.bcol-body { min-height: 80px; }
.bcol.dragover { outline: 2px dashed var(--accent); background: #dde8f5; }
.bcard { background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 11px; margin-bottom: 9px; cursor: grab;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.bcard:active { cursor: grabbing; }
.bcard.dragging { opacity: .96; box-shadow: 0 14px 30px rgba(0,0,0,.28); }
.bcard-top { display: flex; justify-content: space-between; align-items: baseline; }
.bcard-cust { font-weight: 600; margin-top: 2px; }
.bcard-veh { color: var(--muted); font-size: 12.5px; }
.bcard-concern { margin-top: 4px; font-size: 12.5px; }
.bcard-foot { display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; }
.bcard-placeholder { border: 2px dashed #9db8d2; border-radius: 9px;
  background: #f0f6fc; margin-bottom: 9px; }
.boardtoast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #991b1b; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13.5px; z-index: 200; display: none; }
.boardtoast.on { display: block; }

/* timeline view */
.timeline { position: relative; }
.tday { font-weight: 700; margin: 16px 0 8px; color: var(--muted);
  text-transform: uppercase; font-size: 12px; letter-spacing: .5px; }
.trow { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--line); align-items: start; }
.ttime { color: var(--muted); font-size: 12.5px; padding-top: 2px; }

/* permission groups */
.permgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px;
  margin: 8px 0; }
.permgrid label { display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 13.5px; color: var(--ink); }
.permgrid input { width: auto; }

/* ===== mobile ===== */
@media (max-width: 900px) {
  #sidebar { position: fixed; left: 0; top: 52px; z-index: 110; margin: 0;
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,.25); }
  body.side-open #sidebar { transform: none; }
  body:not(.side-open) #sidebar { margin-left: 0; }
  .scrim.on { display: block; position: fixed; left: 0; right: 0; top: 52px; bottom: 0;
    background: rgba(10,18,28,.45); z-index: 100; }
  .topbar { padding: 0 10px; gap: 8px; }
  .brand { font-size: 15px; } .brand span { display: none; }
  .topbar .who em { display: none; }
  .topbar .who { max-width: 110px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; }
  .locsel select { max-width: 128px; }
  .wrap { padding: 12px; }
  .pagehead { flex-direction: column; align-items: stretch; gap: 10px; }
  .pagehead h1 { font-size: 18px; }
  .g2, .g3, .g4, .formrow, .formrow3 { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px; } /* stops iOS focus zoom */
  .btn { min-height: 44px; display: inline-flex; align-items: center;
    justify-content: center; }
  .btn.small { min-height: 38px; }
  .card { overflow-x: auto; }
  table { font-size: 13px; }
  td, th { padding: 8px 7px; }
  .rpanel { width: 100vw; max-width: 100vw; }
  .trow { grid-template-columns: 1fr; gap: 2px; }
  .permgrid { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 120px 1fr; }
}

/* ---------- digital vehicle inspections ---------- */
.insp-head { position: sticky; top: 0; z-index: 30; background: #fff;
  border-bottom: 1px solid #e5e7eb; padding: 10px 12px; }
.insp-counts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px;
  font-size: 13px; }
.insp-sec { margin: 18px 0 6px; font-size: 17px; }
.itask { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 12px; margin-bottom: 10px; }
.itask-name { font-weight: 600; margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg label { display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center;
  min-height: 44px; border: 2px solid #d1d5db; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #4b5563; background: #f9fafb;
  text-align: center; padding: 4px; }
.seg input:checked + span.st-good { background: #16a34a; border-color: #16a34a; color: #fff; }
.seg input:checked + span.st-attention { background: #eab308; border-color: #eab308; color: #422006; }
.seg input:checked + span.st-immediate { background: #dc2626; border-color: #dc2626; color: #fff; }
.seg input:checked + span.st-na { background: #6b7280; border-color: #6b7280; color: #fff; }
.seg input:focus-visible + span { outline: 2px solid #2563eb; outline-offset: 2px; }
.itask-finding { display: grid; gap: 8px; margin-top: 10px; }
.itask-media { margin-top: 10px; }
.media-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px; margin-top: 8px; }
.mitem { position: relative; border: 1px solid #e5e7eb; border-radius: 8px;
  overflow: hidden; background: #f9fafb; }
.mitem img, .mitem video { width: 100%; height: 90px; object-fit: cover; display: block; }
.mitem audio { width: 100%; height: 40px; }
.mitem .mdel { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6);
  color: #fff; border: none; border-radius: 50%; width: 26px; height: 26px;
  font-size: 15px; line-height: 1; cursor: pointer; }
.voice.rec { background: #dc2626; border-color: #dc2626; color: #fff;
  animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.saved-tick { color: #16a34a; font-size: 12px; margin-left: 6px; opacity: 0;
  transition: opacity .3s; }
.saved-tick.show { opacity: 1; }
.tag { display: inline-block; background: #eef2ff; border: 1px solid #c7d2fe;
  border-radius: 14px; padding: 3px 8px; margin: 2px 4px 2px 0; font-size: 13px; }
.tag .x { background: none; border: none; color: #4f46e5; cursor: pointer;
  font-size: 15px; padding: 0 0 0 4px; }
.insp-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden;
  margin-top: 8px; display: flex; }
.insp-bar i { display: block; height: 100%; }
/* dark mode for inspection cards */
[data-theme="dark"] .itask { background: var(--card); border-color: var(--line); }
[data-theme="dark"] .insp-head { background: var(--card); border-color: var(--line); }
[data-theme="dark"] .seg span { background: var(--input-bg); border-color: var(--line);
  color: var(--ink); }
[data-theme="dark"] .mitem { background: var(--input-bg); border-color: var(--line); }
[data-theme="dark"] .insp-bar { background: var(--line); }
/* mobile-first inspection: big touch targets, no iOS auto-zoom */
@media (max-width: 640px) {
  .seg { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .seg span { min-height: 58px; font-size: 15px; }
  .itask { padding: 14px 12px; margin-bottom: 12px; }
  .itask-name { font-size: 15px; }
  .media-btns .btn { flex: 1 1 30%; min-height: 52px; font-size: 15px; }
  .insp-head { padding: 8px 10px; }
  .insp-head h1 { font-size: 16px !important; }
  .insp-counts { font-size: 12px; gap: 6px; }
  .insp-sec { font-size: 16px; position: sticky; top: 118px; z-index: 20;
    background: var(--bg); padding: 6px 0; }
  .finding-sel, .finding-text { font-size: 16px !important; min-height: 50px; }
  .itask input, .itask select, .itask textarea { font-size: 16px; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .mitem img, .mitem video { height: 110px; }
}

/* ---------- board + inventory search ---------- */
.searchbar { margin-bottom: 12px; }
.searchbar input { flex: 1; min-width: 200px; }
.bcard-tag { margin: 6px 0 2px; }

/* ---------- reports ---------- */
.reptabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.reptab { border: 1px solid var(--line, #d7dde5); background: #fff; border-radius: 999px;
  padding: 7px 16px; font-size: 14px; cursor: pointer; }
.reptab.active { border-color: #2f6fed; color: #2f6fed; background: #eef3ff; font-weight: 600; }
.repchead { margin: 18px 0 2px; font-size: 16px; }
.repcard { position: relative; display: flex; border: 1px solid var(--line, #d7dde5);
  border-radius: 12px; padding: 16px; background: #fff; text-decoration: none; color: inherit; }
a.repcard:hover, .repcard .repbody:hover { border-color: #2f6fed; }
.repbody { flex: 1; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.reptile { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 2px; }
.reptile[data-cat="Financials"] { color: #2f6fed; }
.reptile[data-cat="Employees"] { color: #1e7a3c; }
.reptile[data-cat="Guests"], .reptile[data-cat="Customers"] { color: #a86e00; }
.reptile[data-cat="Parts"] { color: #5b3fb5; }
.reptitle { font-size: 16px; font-weight: 700; }
.repdesc { font-size: 13px; color: var(--muted, #667); }
.repstar { position: absolute; top: 10px; right: 10px; }
.repstar button { border: 0; background: none; font-size: 22px; cursor: pointer; color: #b9c2cc; padding: 4px; }
.repstar button.on { color: #d99a00; }
.chartcard .chartwrap { position: relative; height: 260px; }
.tablewrap { overflow-x: auto; }
.backlink { font-size: 14px; font-weight: 400; color: var(--muted, #667); text-decoration: none; margin-right: 8px; }
.backlink:hover { color: #2f6fed; }
@media print { .reptabs, .repstar, .toolbar { display: none; } }

/* ---------- time clock widget ---------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-in { background: #22a06b; box-shadow: 0 0 0 3px rgba(34,160,107,.18); }
.dot-out { background: #d9534f; box-shadow: 0 0 0 3px rgba(217,83,79,.15); }
.dot-break { background: #e8a13d; box-shadow: 0 0 0 3px rgba(232,161,61,.18); }
.clockwidget { position: relative; }
.clockbtn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line, #d7dde5);
  background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.clocklbl { white-space: nowrap; }
.clockpanel { position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: #fff;
  border: 1px solid var(--line, #d7dde5); border-radius: 12px; padding: 14px; z-index: 60;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); }
.clockhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.clockpanel label { font-size: 12px; color: var(--muted, #667); }
.clockpanel select { width: 100%; margin: 4px 0 10px; }
.clockbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
/* ---------- login status ---------- */
.statustable .dot { margin-right: 2px; }
/* ---------- job clock ---------- */
.jc-time { font-size: 12px; color: var(--muted, #667); white-space: nowrap; }
.jc-done { color: #22a06b; font-weight: 700; }

/* ---------- repair-order tabs ---------- */
.wotabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 14px 0 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wotabs button { border: 0; background: none; padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.wotabs button:hover { color: var(--ink); }
.wotabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.wotab-pane { padding-top: 2px; }
/* odometer in/out box */
.odobox { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; }
.odo-field { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.odo-field input { width: 92px; padding: 6px 8px; }
.odo-field input:disabled { background: var(--bg); color: var(--muted); }
.odo-sep { color: var(--muted); }

/* ---------- shop picker ---------- */
.shopsearch { margin: 12px 0; max-width: 420px; }
.shopsearch input { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 6px; }
.shopcard-form { margin: 0; }
.shopcard { display: flex; flex-direction: column; gap: 4px; width: 100%; min-height: 132px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px;
  cursor: pointer; color: var(--ink); font-family: inherit; }
button.shopcard:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.shopname { font-size: 17px; font-weight: 700; }
.shopcity { color: var(--muted); font-size: 13px; }
.shopaddr { color: var(--muted); font-size: 12px; }
a.shopcard { text-decoration: none; align-items: center; justify-content: center; text-align: center;
  border-style: dashed; border-width: 2px; color: var(--accent); font-weight: 600; font-size: 15px; }
a.shopcard:hover { text-decoration: none; border-color: var(--accent); background: #f0f7ff; }
.shopnew-plus { font-size: 30px; line-height: 1; }
.card.narrow { max-width: 600px; }
.neg { color: var(--bad); }
.pos { color: var(--ok); }
/* journal entry rows */
.jline { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.jline select { flex: 2; }
.jline input[type=number] { width: 110px; }
.jline input.lmemo { flex: 1; }
.jline select.lloc { flex: none; width: 92px; }
.wotabs form { margin: 0; }
/* server status lights + reboot progress */
.svclight { display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  margin-right: 8px; vertical-align: -1px; background: #9aa4b2; }
.svclight.up { background: #22a06b; box-shadow: 0 0 9px #22a06b; }
.svclight.down { background: #c0392b; box-shadow: 0 0 9px #c0392b; }
.svclight.na { background: #9aa4b2; }
.livedot { display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 4px; vertical-align: 0; background: #9aa4b2; }
.livedot.on { background: #22a06b; box-shadow: 0 0 7px #22a06b;
  animation: pulse 2s infinite; }
.livedot.off { background: #c0392b; box-shadow: 0 0 7px #c0392b; }
@keyframes pulse { 50% { opacity: .55; } }
.pbar { height: 14px; background: var(--line); border-radius: 8px;
  overflow: hidden; margin: 10px 0; }
.pfill { height: 100%; width: 0; background: var(--accent); border-radius: 8px;
  transition: width .6s ease; }
.reboot-pane { border-left: 4px solid var(--accent); }
/* system resource bars */
.resrow { margin: 14px 0; }
.reslabel { display: flex; justify-content: space-between; gap: 12px;
  margin-bottom: 4px; }
.pfill.ok { background: #22a06b; }
.pfill.warn { background: #d97706; }
.pfill.bad { background: #c0392b; }
.optlist span { margin-right: 14px; white-space: nowrap; }
.ok-t { color: #22a06b; }
.bad-t { color: #c0392b; }

/* ---------- RO financial tracker bar ---------- */
.ro-fintrack { position: sticky; bottom: 0; z-index: 40; display: flex; align-items: stretch;
  gap: 0; overflow-x: auto; background: #1d2430; color: #f2f5f9;
  border-top: 3px solid #0f141c; margin: 24px -16px -16px; padding: 10px 16px; }
.ft-item { display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 2px 16px; border-right: 1px solid rgba(255,255,255,.12); white-space: nowrap; }
.ft-item:last-child { border-right: 0; }
.ft-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #9aa7ba; }
.ft-val { font-size: 17px; font-weight: 700; }
.ft-total .ft-val { color: #7fd6a4; }
.ft-discform { gap: 6px; align-items: center; }
.ft-cur { color: #9aa7ba; font-weight: 700; }
.ft-discount { width: 84px; background: #0f141c; color: #f2f5f9; border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px; padding: 4px 8px; font-size: 14px; font-weight: 700; }
.ft-discount:focus { outline: 2px solid #4d9fff; }
/* ---------- split button ---------- */
.splitbtn { position: relative; display: inline-flex; }
.splitbtn .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-toggle { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255,255,255,.35);
  padding-left: 10px; padding-right: 10px; }
.splitmenu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 170px; background: #fff;
  border: 1px solid var(--line, #d7dde5); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14);
  z-index: 60; overflow: hidden; }
.splitmenu a { display: block; padding: 10px 14px; color: inherit; text-decoration: none; font-size: 14px; }
.splitmenu a:hover { background: #f2f5f9; }
.clockname { font-weight: 700; margin-left: 7px; font-size: 13px; }

/* ---------- schedule calendar ---------- */
.cal { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: #eef2f7;
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #5b6b80; }
.cal-dow > div { padding: 8px 4px; text-align: center; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); }
.cal-day { min-height: 92px; border-right: 1px solid var(--line); padding: 4px; cursor: pointer; }
.cal-day:last-child { border-right: 0; }
.cal-day.other { background: #f7f9fb; }
.cal-day.other .cal-num { color: #a0aec0; }
.cal-day.today .cal-num { background: var(--accent); color: #fff; border-radius: 999px;
  min-width: 24px; display: inline-block; text-align: center; }
.cal-day.droptarget { background: #e3f0ff; box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { font-size: 13px; font-weight: 600; padding: 2px 4px; }
.cal-events { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.cal-chip { font-size: 12px; padding: 3px 6px; border-radius: 6px; color: #fff; cursor: grab;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.cal-chip .ct { font-weight: 700; margin-right: 4px; opacity: .92; }
.cal-chip.dragging { opacity: .9; box-shadow: 0 8px 20px rgba(0,0,0,.25); cursor: grabbing; }
.st-scheduled { background: #2b6cb0; }
.st-confirmed { background: #2f855a; }
.st-arrived { background: #0e7c86; }
.st-no_show { background: #c05621; }
.st-canceled { background: #718096; text-decoration: line-through; }
/* ---------- modals ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15,20,28,.5); z-index: 300;
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 12px 12px; }
.modal-back[hidden] { display: none; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px;
  max-height: 84vh; overflow-y: auto; padding: 18px 20px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  margin-bottom: 12px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.kv span { color: #718096; }
.statuspills { display: flex; flex-wrap: wrap; gap: 6px; }
.pillbtn { border: 1px solid var(--line); background: #f7f9fb; color: #4a5568;
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.pillbtn.on { color: #fff; border-color: transparent; }
.pillbtn.on.st-scheduled { background: #2b6cb0; }
.pillbtn.on.st-confirmed { background: #2f855a; }
.pillbtn.on.st-arrived { background: #0e7c86; }
.pillbtn.on.st-no_show { background: #c05621; }
.pillbtn.on.st-canceled { background: #718096; }
.danger { color: #c0392b; }

/* ---------- line approval ---------- */
.linesec { margin: 14px 0 6px; font-size: 14px; text-transform: uppercase;
  letter-spacing: .05em; color: #5b6b80; }
.appr { min-width: 110px; }
.appr-pending { border: 1px dashed #a0aec0; background: #fff; color: #4a5568; }
.appr-approved { background: #2f855a; border-color: #2f855a; color: #fff; }
.appr-declined { background: #c0392b; border-color: #c0392b; color: #fff; }
.appr-deferred { background: #d69e2e; border-color: #d69e2e; color: #fff; }
.appr-choices { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 6px; }
.appr-choice { border: 2px solid var(--line); background: #f7f9fb; border-radius: 12px;
  padding: 16px 8px; font-size: 26px; cursor: pointer; display: flex;
  flex-direction: column; align-items: center; gap: 6px; color: #4a5568; }
.appr-choice span { font-size: 14px; font-weight: 700; }
.appr-choice.pick-approved.sel { border-color: #2f855a; background: #e6f4ec; color: #2f855a; }
.appr-choice.pick-declined.sel { border-color: #c0392b; background: #fdecea; color: #c0392b; }
.appr-choice.pick-deferred.sel { border-color: #d69e2e; background: #fef6e0; color: #b7791f; }
.methodrow { display: flex; gap: 18px; margin-top: 6px; font-size: 15px; }
.methodrow label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.methodrow input { width: auto; }
/* ---------- appointment banner ---------- */
.appt-banner { border-left: 4px solid var(--accent); margin-bottom: 12px; }

/* ---------- customer form ---------- */
.checkstack { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.checkline input { width: auto; margin: 0; }
.warnbox { border-left: 4px solid #d69e2e; background: #fef6e0; margin: 10px 0; }

/* ---------- integrations hub ---------- */
.integ-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 14px; }
.integ-card { display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 26px 20px 20px; text-decoration: none; color: inherit; text-align: center;
  transition: transform .12s ease, box-shadow .12s ease; }
.integ-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
.integ-logo { height: 84px; display: flex; align-items: center; justify-content: center; }
.integ-logo img { max-height: 84px; max-width: 190px; object-fit: contain; }
.integ-tag { font-weight: 700; font-size: 14px; }
.integ-blurb { font-size: 13px; color: var(--muted); }
.integ-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 16px; }
.integ-head img { max-height: 56px; max-width: 220px; object-fit: contain; }
.integ-head h1 { margin: 0; }
.st-warn { background: #fef3c7; color: #92400e; }
.st-muted { background: #e2e8f0; color: #64748b; }

/* compact integration buttons */
.integ-grid.compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.integ-card.mini { padding: 12px 8px 10px; gap: 6px; border-radius: 10px; }
.integ-card.mini .integ-logo { height: 44px; }
.integ-card.mini .integ-logo img { max-height: 44px; max-width: 110px; }
.integ-card.mini .integ-tag { font-size: 12px; }
.integ-card.mini .pill { font-size: 10.5px; padding: 2px 8px; }

/* hover tooltip on integration buttons */
.integ-card { position: relative; }
.integ-tip {
  display: none;
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  width: max-content; max-width: 230px;
  background: #1a202c; color: #f7fafc; font-size: 12.5px; line-height: 1.45;
  padding: 9px 12px; border-radius: 8px; text-align: left; z-index: 60;
  box-shadow: 0 10px 26px rgba(0,0,0,.28); pointer-events: none;
}
.integ-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #1a202c;
}
.integ-card:hover .integ-tip, .integ-card:focus-visible .integ-tip { display: block; }

/* ---------- RO info pane (right slide-out sections) ---------- */
.pane-tools { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pset { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; background: var(--card); }
.pset-head { width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; font-size: 15px; font-weight: 700; border: 0; cursor: pointer; color: #fff; }
.pset-ro { background: #0e7c86; }
.pset-vehicle { background: #6b8f1f; }
.pset-customer { background: #dd6b20; }
.pset-head .chev { font-size: 13px; opacity: .9; }
.pset-body { padding: 6px 14px 14px; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow.col { flex-direction: column; align-items: stretch; }
.pk { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.pv { font-size: 14px; text-align: right; }
.prow.col .pv { text-align: left; }
.pv-input { width: 170px; padding: 6px 8px; font-size: 13.5px; }
.pv-input.wide { width: 100%; }
.pv-input.sm { width: 80px; }
.pnotes p { margin: 6px 0; font-size: 13.5px; }
.psub { border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; overflow: hidden; }
.psub-head { width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; font-size: 14px; font-weight: 600; border: 0; cursor: pointer;
  background: #f1f5f9; color: #1d2430; }
.psub .pset-body { padding: 4px 12px 12px; }
.specmini { width: 100%; font-size: 13px; }
.specmini td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.recall { border-left: 3px solid #d69e2e; padding: 6px 10px; margin: 8px 0; background: #fffbeb; border-radius: 0 6px 6px 0; }
.recall p { margin: 4px 0; font-size: 13px; }
.pane-ok { color: #2f855a; font-weight: 600; }
@media (max-width: 900px) { .pv-input { width: 140px; } }
.danger-card { border: 2px solid var(--bad); }

/* knowledge base */
.topbar .kbicon { display: inline-flex; align-items: center; padding: 5px; border-radius: 6px; }
.topbar .kbicon:hover { background: #22344a; }
.topbar .kbicon img { width: 24px; height: 24px; display: block; border-radius: 5px; }
.kb-search form { display: flex; gap: 8px; }
.kb-search input { flex: 1; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line, #d7dee7); border-radius: 8px; }
.kb-h { margin: 22px 0 10px; font-size: 16px; }
.kb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.kb-qcard { display: block; padding: 14px; border: 1px solid var(--line, #d7dee7); border-radius: 10px; background: var(--card, #fff); font-weight: 600; font-size: 14px; }
.kb-qcard:hover { border-color: var(--acc, #2b6cb0); }
.kb-list { padding: 0; overflow: hidden; }
.kb-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line, #e5eaf0); }
.kb-row:last-child { border-bottom: 0; }
.kb-row:hover { background: var(--hover, #f4f7fa); }
.kb-title { font-weight: 600; }
.kb-chev { margin-left: auto; color: var(--mut, #8a94a0); }
.kb-cat { font-size: 12px; color: var(--mut, #8a94a0); background: var(--hover, #eef2f6); border-radius: 20px; padding: 3px 10px; }
.kb-res { flex-wrap: wrap; }
.kb-snip { flex-basis: 100%; font-size: 13px; color: var(--mut, #6b7684); font-weight: 400; }
.kb-article { padding: 22px 26px; max-width: 860px; }
.kb-article h1 { margin-top: 0; }
.kb-article h3 { margin-top: 22px; }
.kb-article img { max-width: 100%; height: auto; border: 1px solid var(--line, #d7dee7); border-radius: 8px; margin: 8px 0; }
.kb-article p, .kb-article li { line-height: 1.55; }
.kb-article [id] { scroll-margin-top: 70px; }

/* internal team chat */
.navbadge { background: #e53e3e; color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 20px; padding: 1px 7px; margin-left: auto; }
.chatwrap { display: flex; gap: 0; height: calc(100vh - 170px); min-height: 420px;
  border: 1px solid var(--line, #d7dee7); border-radius: 12px; overflow: hidden;
  background: var(--card, #fff); }
.chat-side { width: 270px; flex-shrink: 0; border-right: 1px solid var(--line, #d7dee7);
  overflow-y: auto; display: flex; flex-direction: column; }
.chat-side-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line, #e5eaf0); }
.chat-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--mut, #8a94a0); padding: 10px 14px 4px; }
.chat-chan { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: 0; padding: 9px 14px; cursor: pointer; font-size: 14px;
  color: inherit; }
.chat-chan:hover { background: var(--hover, #f4f7fa); }
.chat-chan.active { background: var(--hover, #e8eef4); font-weight: 600; }
.chat-chan .navbadge { margin-left: auto; }
.chat-empty { padding: 10px 14px; color: var(--mut, #8a94a0); font-size: 13px; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line, #e5eaf0); }
.chat-head .sub { font-size: 12px; color: var(--mut, #8a94a0); }
.chat-back { display: none; }
.chat-settings { border-bottom: 1px solid var(--line, #e5eaf0); padding: 10px 14px;
  background: var(--hover, #f8fafc); max-height: 260px; overflow-y: auto; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; max-width: 85%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .msg-body { background: #e3f0ff; }
[data-theme="dark"] .msg.mine .msg-body { background: #1d3a5f; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #4a6fa5; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.msg-body { background: var(--hover, #f1f4f8); border-radius: 12px; padding: 8px 12px; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.msg-head span { color: var(--mut, #8a94a0); }
.macts { margin-left: auto; display: none; gap: 2px; }
.msg:hover .macts { display: inline-flex; }
.mact { background: none; border: 0; cursor: pointer; font-size: 13px; padding: 2px; opacity: .7; }
.mact:hover { opacity: 1; }
.msg-text { font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.msg-text .edited { color: var(--mut, #8a94a0); font-size: 11px; }
.msg-img { max-width: 240px; max-height: 180px; border-radius: 8px; margin-top: 6px; display: block; }
.msg-file { display: inline-block; margin-top: 6px; font-size: 13px; }
.reacts { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.react { border: 1px solid var(--line, #d7dee7); background: var(--card, #fff); border-radius: 20px;
  padding: 1px 8px; font-size: 12.5px; cursor: pointer; }
.react.on { border-color: var(--acc, #2b6cb0); background: #e3f0ff; }
.seen { font-size: 11px; color: var(--mut, #8a94a0); margin-top: 2px; text-align: right; }
.chat-typing { min-height: 20px; font-size: 12.5px; color: var(--mut, #8a94a0); padding: 0 14px; font-style: italic; }
.chat-compose { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line, #e5eaf0); align-items: flex-end; }
.chat-compose textarea { flex: 1; resize: none; border: 1px solid var(--line, #d7dee7);
  border-radius: 20px; padding: 9px 14px; font-size: 14.5px; font-family: inherit; max-height: 120px; }
.chat-compose .iconbtn { font-size: 20px; padding: 6px; }
.chat-filebar { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 13px;
  border-top: 1px solid var(--line, #e5eaf0); background: var(--hover, #f8fafc); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
  align-items: center; justify-content: center; z-index: 200; }
.modal[hidden] { display: none; }
.modal-box { background: var(--card, #fff); border-radius: 12px; width: min(420px, 92vw);
  max-height: 80vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line, #e5eaf0); }
.modal-list { overflow-y: auto; padding: 8px; }
.chat-user { display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 10px 12px; cursor: pointer; font-size: 14px; border-radius: 8px; color: inherit; }
.chat-user:hover { background: var(--hover, #f4f7fa); }
.emoji-box { width: min(360px, 92vw); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 12px; overflow-y: auto; }
.emoji-grid button { background: none; border: 0; font-size: 22px; cursor: pointer; padding: 6px; border-radius: 8px; }
.emoji-grid button:hover { background: var(--hover, #f4f7fa); }
.crow { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.crow input, .crow select { flex: 1; }
.crow.slim { margin: 4px 0; }
.crow.slim span { flex: 1; }
.membpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; margin: 8px 0; }
.membpick label { font-size: 14px; display: flex; gap: 6px; align-items: center; }
.membpick.static { display: flex; flex-wrap: wrap; gap: 6px; }
.memb { background: var(--hover, #eef2f6); border-radius: 20px; padding: 3px 12px; font-size: 13px; }
.btn.danger { background: #c53030; color: #fff; }
@media (max-width: 900px) {
  .chatwrap { height: calc(100vh - 150px); }
  .chat-side { width: 100%; border-right: 0; }
  .chatwrap.in-thread .chat-side { display: none; }
  .chat-main { display: none; width: 100%; }
  .chatwrap.in-thread .chat-main { display: flex; }
  .chat-back { display: inline-flex; }
  .msg { max-width: 95%; }
}

/* hidden attribute must beat display rules */
[hidden]{display:none !important;}

/* ===== floating chat dock (all pages except full Messages) ===== */
#chatDockBtn {
  position: fixed; right: 18px; bottom: 18px; z-index: 9000;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: #1b6fd0; color: #fff; font-size: 26px;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
#chatDockBtn:hover { background: #185fb4; }
#chatDockBadge {
  position: absolute; top: -4px; right: -4px;
  background: #d23b3b; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 10px; padding: 0 5px;
}
#chatDockPanel {
  position: fixed; right: 18px; bottom: 84px; z-index: 9000;
  width: 320px; max-height: 420px; display: flex; flex-direction: column;
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.dock-panel-head {
  padding: 10px 14px; font-weight: 700; background: #1b6fd0; color: #fff;
  display: flex; justify-content: space-between; align-items: center;
}
.dock-full { color: #cfe3ff; font-size: 12px; font-weight: 400; }
#chatDockList { overflow-y: auto; }
.dock-chan {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 14px; border: 0; border-bottom: 1px solid #eee;
  background: #fff; cursor: pointer; text-align: left;
}
.dock-chan:hover { background: #f4f8fd; }
.dock-ava {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 36px;
  background: #dbe7f5; color: #1b6fd0; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.dock-chan-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dock-chan-main b { font-size: 13.5px; }
.dock-chan-main i { font-style: normal; font-size: 12px; color: #777;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-unread {
  background: #d23b3b; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 10px; padding: 0 5px;
}
.dock-empty { padding: 18px; color: #888; font-size: 13px; text-align: center; }

#chatWins {
  position: fixed; right: 84px; bottom: 18px; z-index: 8999;
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-win {
  width: 300px; height: 380px; display: flex; flex-direction: column;
  background: #fff; border-radius: 12px 12px 0 0; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.chat-win-head {
  background: #1b6fd0; color: #fff; padding: 9px 12px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px;
}
.chat-win-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-win-x, .chat-win-close { opacity: .8; padding: 0 4px; font-size: 14px; }
.chat-win-x:hover, .chat-win-close:hover { opacity: 1; }
.chat-win-body { flex: 1; overflow-y: auto; padding: 10px; background: #f7f9fc; }
.chat-win.min .chat-win-body,
.chat-win.min .chat-win-typing,
.chat-win.min .chat-win-send { display: none; }
.chat-win.min { height: auto; }
.chat-win-typing { font-size: 11.5px; color: #888; padding: 2px 10px; min-height: 4px; }
.chat-win-send { display: flex; border-top: 1px solid #e5e5e5; }
.chat-win-send .dwinput {
  flex: 1; border: 0; padding: 10px 12px; font-size: 13.5px; outline: none;
}
.chat-win-send .dwsend {
  border: 0; background: #1b6fd0; color: #fff; padding: 0 14px; cursor: pointer;
  font-size: 16px;
}
.dwmsg { margin-bottom: 8px; max-width: 88%; }
.dwmsg .dwbody {
  display: inline-block; padding: 7px 11px; border-radius: 14px;
  background: #e9eef5; font-size: 13.5px; word-wrap: break-word;
}
.dwmsg.mine { margin-left: auto; text-align: right; }
.dwmsg.mine .dwbody { background: #1b6fd0; color: #fff; }
.dwmsg .dwfrom { font-size: 11px; color: #888; margin-bottom: 2px; }
.dwmsg .dwtime { font-size: 10.5px; color: #aaa; margin-top: 2px; }
.dwmsg .edited { font-size: 11px; opacity: .75; }

/* flash a minimized window header on new message */
@keyframes dockflash {
  0%, 100% { background: #1b6fd0; }
  50% { background: #e08a1e; }
}
.chat-win.flash .chat-win-head { animation: dockflash 1s ease-in-out infinite; }

@media (max-width: 640px) {
  #chatWins { right: 8px; left: 8px; bottom: 84px; }
  .chat-win { width: 100%; height: 60vh; }
  .chat-win.min { height: auto; }
  #chatDockPanel { right: 8px; left: 8px; width: auto; }
  #chatDockBtn { right: 12px; bottom: 12px; }
}
