/* CG Electronics CRM dashboard: one stylesheet for the login page and every view.
   1. LOOK TOKENS      the TalkC dashboard look (the old panel, app/public/app.html): Night mode by default and Day mode
                       under html.light. Settings → Appearance picks one; it is kept on this device in localStorage
                       'panel-theme', the key the old panel uses too (theme.js sets the class before the page draws).
   2. LOOK DECORATIONS the parts of the look that are not colours: card hovers, the logo tiles, plain labels.
                       A rule here that must beat section 3 starts with "html " (section 3 comes later in this file).
   3. LAYOUT + PARTS   tokens only: the same for every look.
   The earlier looks (a, b "Control room", c) are in design/crm-looks/, with the same token names. */

/* ══ 1. LOOK TOKENS ═════════════════════════════════════════════════════════════════════════════ */
:root {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --accent-2: #34d399;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Devanagari", "Nirmala UI", "Kohinoor Devanagari", sans-serif;
  --surface-2: #273548;
  --line: rgba(71, 85, 105, .45);
  --line-2: rgba(100, 116, 139, .5);
  --faint: #64748b;
  --accent-soft: rgba(59, 130, 246, .12);
  --on-accent: #ffffff;
  --accent-fill: #2563eb;        /* buttons, pressed switches: white text on blue, as in the old panel */
  --accent-fill-hover: #1d4ed8;
  --ok-ink: #4ade80;
  --warn-ink: #fbbf24;
  --bad-ink: #f87171;
  --radius-sm: 8px;
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, .55);
  --shadow-hover: 0 4px 24px rgba(0, 0, 0, .2);
  --glow: 0 0 0 3px rgba(59, 130, 246, .25);
  --font-display: var(--font);
  --font-mono: var(--font);      /* the old panel has no typewriter labels; numbers get even-width digits (section 2) */
  /* tints of the accent and status colours */
  --accent-line: rgba(59, 130, 246, .35);
  --accent-wash: rgba(59, 130, 246, .06);
  --accent-2-soft: rgba(52, 211, 153, .10);
  --accent-2-line: rgba(52, 211, 153, .35);
  --ok-soft: rgba(74, 222, 128, .10);
  --ok-line: rgba(74, 222, 128, .30);
  --warn-soft: rgba(251, 191, 36, .10);
  --warn-line: rgba(251, 191, 36, .30);
  --bad-soft: rgba(248, 113, 113, .10);
  --bad-line: rgba(248, 113, 113, .30);
  --hover: rgba(51, 65, 85, .35);
  --track: rgba(51, 65, 85, .6);
  /* surfaces of the frame */
  --rail-bg: rgba(30, 41, 59, .95);
  --top-bg: rgba(15, 23, 42, .85);
  --input-bg: rgba(15, 23, 42, .8);
  --scrim: rgba(0, 0, 0, .5);
  --nav-ink: #cbd5e1;
  --nav-icon: #94a3b8;
  --star: #fbbf24;
  --star-off: #334155;
  --node-ring: #475569;
  --label-bg: rgba(15, 23, 42, .85);
  --console-bg: rgba(30, 41, 59, .9);
  --kpi-bg: linear-gradient(135deg, rgba(30, 41, 59, .9), rgba(15, 23, 42, .9));
  --fade: 15, 23, 42;            /* the page colour as r, g, b: the login map fades into it */
  /* the map: districts with no data, then a blue ramp low → high (lightness rises, 2:1 at the low end) */
  --map-none: #243246;
  --map-dots: #3b4b63;
  --map-1: #2563eb; --map-2: #3b82f6; --map-3: #60a5fa; --map-4: #93c5fd; --map-5: #bfdbfe;
  --map-line: #0f172a;
  --map-edge: rgba(96, 165, 250, .55);
  --map-pick: #f8fafc;
  /* AI call kinds, in a fixed order (checked for colour-blind separation; always shown with their label) */
  --kind-payment: #3987E5;
  --kind-instalment: #D95926;
  --kind-warranty: #199E70;
  --kind-callback: #C98500;
  --kind-lead: #D55181;
  --kind-repair: #0CA30C;
  --kind-report: #9085E9;
  --kind-complaint: #E66767;
}
/* Day mode (the old panel's light theme) */
html.light {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #2563eb;
  --accent-2: #059669;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: 0 1px 3px rgba(15, 23, 42, .05);
  --surface-2: #f1f4f8;
  --line: #e5e9f0;
  --line-2: #cbd5e1;
  --faint: #64748b;
  --accent-soft: rgba(37, 99, 235, .08);
  --accent-fill: #2563eb;
  --accent-fill-hover: #1d4ed8;
  --ok-ink: #15803d;
  --warn-ink: #b45309;
  --bad-ink: #b91c1c;
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, .18);
  --shadow-hover: 0 6px 20px rgba(15, 23, 42, .08);
  --glow: 0 0 0 3px rgba(37, 99, 235, .18);
  --accent-line: rgba(37, 99, 235, .30);
  --accent-wash: rgba(37, 99, 235, .05);
  --accent-2-soft: rgba(5, 150, 105, .08);
  --accent-2-line: rgba(5, 150, 105, .30);
  --ok-soft: rgba(22, 163, 74, .08);
  --ok-line: rgba(22, 163, 74, .30);
  --warn-soft: rgba(217, 119, 6, .08);
  --warn-line: rgba(217, 119, 6, .30);
  --bad-soft: rgba(220, 38, 38, .07);
  --bad-line: rgba(220, 38, 38, .28);
  --hover: rgba(15, 23, 42, .04);
  --track: rgba(15, 23, 42, .08);
  --rail-bg: rgba(255, 255, 255, .96);
  --top-bg: rgba(255, 255, 255, .88);
  --input-bg: #ffffff;
  --scrim: rgba(15, 23, 42, .35);
  --nav-ink: #334155;
  --nav-icon: #64748b;
  --star: #f59e0b;
  --star-off: #e2e8f0;
  --node-ring: #cbd5e1;
  --label-bg: rgba(255, 255, 255, .92);
  --console-bg: #ffffff;
  --kpi-bg: linear-gradient(135deg, #ffffff, #f6f8fb);
  --fade: 244, 246, 249;
  /* lightness falls as the number rises (2:1 at the low end) */
  --map-none: #e8edf3;
  --map-dots: #cbd5e1;
  --map-1: #60a5fa; --map-2: #3b82f6; --map-3: #2563eb; --map-4: #1d4ed8; --map-5: #1e3a8a;
  --map-line: #ffffff;
  --map-edge: rgba(37, 99, 235, .5);
  --map-pick: #0f172a;
}

/* ══ 2. LOOK DECORATIONS (the TalkC dashboard) ═══════════════════════════════════════════════════ */
body { font-variant-numeric: tabular-nums; }
.panel { background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease; }
html .panel:hover { border-color: var(--line-2); box-shadow: var(--shadow-hover); }
html .kpi { background: var(--kpi-bg); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
html .kpi:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--shadow-hover); }
/* the colours of the Dashboard numbers: a soft wash with a matching border at night, plain white cards by day (old panel) */
.t-blue { --tone: #60a5fa; --tint: rgba(59, 130, 246, .15); }
.t-green { --tone: #4ade80; --tint: rgba(34, 197, 94, .15); }
.t-amber { --tone: #fbbf24; --tint: rgba(245, 158, 11, .15); }
.t-purple { --tone: #c084fc; --tint: rgba(168, 85, 247, .15); }
.t-red { --tone: #f87171; --tint: rgba(239, 68, 68, .15); }
.t-cyan { --tone: #22d3ee; --tint: rgba(6, 182, 212, .15); }
html .kpi.t-blue { background: linear-gradient(135deg, rgba(59, 130, 246, .15), rgba(59, 130, 246, .05)); border-color: rgba(59, 130, 246, .3); }
html .kpi.t-green { background: linear-gradient(135deg, rgba(34, 197, 94, .15), rgba(34, 197, 94, .05)); border-color: rgba(34, 197, 94, .3); }
html .kpi.t-amber { background: linear-gradient(135deg, rgba(245, 158, 11, .15), rgba(245, 158, 11, .05)); border-color: rgba(245, 158, 11, .3); }
html .kpi.t-purple { background: linear-gradient(135deg, rgba(168, 85, 247, .15), rgba(168, 85, 247, .05)); border-color: rgba(168, 85, 247, .3); }
html .kpi.t-red { background: linear-gradient(135deg, rgba(239, 68, 68, .15), rgba(239, 68, 68, .05)); border-color: rgba(239, 68, 68, .3); }
html.light .t-blue { --tone: #2563eb; --tint: rgba(37, 99, 235, .1); }
html.light .t-green { --tone: #16a34a; --tint: rgba(22, 163, 74, .1); }
html.light .t-amber { --tone: #d97706; --tint: rgba(217, 119, 6, .1); }
html.light .t-purple { --tone: #9333ea; --tint: rgba(147, 51, 234, .1); }
html.light .t-red { --tone: #dc2626; --tint: rgba(220, 38, 38, .1); }
html.light .t-cyan { --tone: #0891b2; --tint: rgba(8, 145, 178, .1); }
html.light .kpi[class*="t-"] { background: var(--kpi-bg); border-color: var(--line); }
.q.oncall { background: linear-gradient(90deg, var(--accent-soft), transparent 75%); }
/* the logo tile: the old panel's blue to cyan, on the login page too */
html .mark { background: linear-gradient(135deg, #f97316, #f59e0b); color: #fff; } /* Orange Ball: an orange "OB" tile */
/* buttons and switches: white on blue */
html .btn-primary { background: var(--accent-fill); color: #fff; font-weight: 600; }
html .btn-primary:hover { background: var(--accent-fill-hover); filter: none; box-shadow: 0 4px 12px rgba(59, 130, 246, .3); }
html .seg button[aria-pressed="true"] { background: var(--accent-fill); color: #fff; }
html .switch input:checked + .tr { background: var(--accent-fill); }
html .input:focus-within, html .in:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
/* plain labels: sentence case in the normal font, as in the old panel */
html .panel-h h2 { font: 600 14px/1.3 var(--font); letter-spacing: 0; text-transform: none; }
html .seg button { font: 500 12.5px/1 var(--font); letter-spacing: 0; text-transform: none; }
html .cap { font-size: 12px; font-weight: 500; letter-spacing: .01em; text-transform: none; }
html .chip { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
html .kind { font-size: 11px; letter-spacing: .02em; text-transform: none; }
html .st { font-size: 11px; letter-spacing: .02em; text-transform: none; }
html .pill { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: none; }
html :is(.back, .link, .show, .loading, .console-foot, .hud) { letter-spacing: .02em; text-transform: none; }
html :is(.tbl th, .kv-list dt, .dir, .mlabel, .map-list, .lb small, .hbars .lbl small, .al .tag, .cnt) { letter-spacing: .06em; }
/* the login page: the old panel's soft blue light from the top, the map behind fades into the page */
.login-b { background: radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, .08) 0%, transparent 60%); }
html .console { border-radius: 12px; }
.vignette { background: linear-gradient(90deg, rgba(var(--fade), .92) 0%, rgba(var(--fade), .35) 38%, rgba(var(--fade), 0) 60%), radial-gradient(80% 70% at 62% 50%, rgba(var(--fade), 0) 40%, rgba(var(--fade), .85) 100%); }
@media (max-width: 560px) { .vignette { background: radial-gradient(90% 70% at 50% 40%, rgba(var(--fade), 0) 30%, rgba(var(--fade), .9) 100%); } }

/* ══ 3. LAYOUT + PARTS (tokens only) ════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--font-mono); }
.cap { font: 600 10.5px/1.25 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ok-t { color: var(--ok-ink); } .warn-t { color: var(--warn-ink); } .bad-t { color: var(--bad-ink); } .acc-t { color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; display: inline-block; }
.blink { animation: blink 1.6s ease-in-out infinite; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; }

/* ---------- the frame: a top bar over a side menu, as in the TalkC panel ---------- */
.top { position: sticky; top: 0; z-index: 50; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--top-bg); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; font: 800 12.5px/1 var(--font); letter-spacing: -.02em; }
.brand b { font-size: 15px; font-weight: 700; white-space: nowrap; }
.brand > span > b { display: block; line-height: 1.2; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.org { font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); position: relative; flex: none; }
.icon-btn:hover { color: var(--text); background: var(--hover); }
.icon-btn[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.icon-btn .i { width: 18px; height: 18px; }
.icon-btn .ping { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--ok-ink); background: var(--ok-soft); border: 1px solid var(--ok-line); white-space: nowrap; }
.live-pill .dot { width: 6px; height: 6px; }
.me { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--nav-ink); min-width: 0; margin-left: 4px; }
.me b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--font); color: var(--accent); background: var(--accent-soft); flex: none; text-transform: uppercase; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 6px; border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.btn-ghost:hover { color: var(--text); background: var(--hover); }
.btn-ghost .i { width: 15px; height: 15px; }
.app { display: flex; min-height: calc(100vh - 56px); position: relative; z-index: 1; }
.rail { position: sticky; top: 56px; height: calc(100vh - 56px); width: 240px; flex: none; overflow-y: auto; background: var(--rail-bg); border-right: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; z-index: 40; scrollbar-width: thin; }
body.nav-hide .rail { display: none; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 8px; color: var(--nav-ink); font-size: 14px; font-weight: 500; }
.nav a .i { width: 17px; height: 17px; stroke-width: 1.8; }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.cnt { margin-left: auto; font: 600 10.5px/1 var(--font-mono); color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 3px 6px; border-radius: 6px; white-space: nowrap; }
.cnt.bad { color: var(--bad-ink); background: var(--bad-soft); border-color: var(--bad-line); }
.cnt.ok { color: var(--ok-ink); background: var(--ok-soft); border-color: var(--ok-line); }
.rail-foot { margin-top: auto; padding: 12px 12px 6px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.sys-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sys-row b { margin-left: auto; font-weight: 600; font-size: 11.5px; }
.sys-row .dot { width: 6px; height: 6px; }
.sys-row .i { width: 14px; height: 14px; }
.scrim { display: none; }
.main { flex: 1; min-width: 0; padding: 24px 24px 40px; }

/* ---------- view head ---------- */
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.head > div:first-child { min-width: 0; }
.head h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.head p { margin-top: 3px; }
.head-tools { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font: 600 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
.back .i { width: 14px; height: 14px; transform: rotate(180deg); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; padding: 3px; background: var(--surface); gap: 2px; max-width: 100%; }
.seg button { height: 28px; padding: 0 12px; border: 0; background: none; border-radius: 6px; font: 600 10.5px/1 var(--font-mono); letter-spacing: .12em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); }
.seg-sm button { height: 24px; padding: 0 9px; font-size: 10px; }
.sync { font: 500 11px var(--font-mono); color: var(--faint); letter-spacing: .06em; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.sync .dot { color: var(--accent); width: 6px; height: 6px; }
.sync.stale .dot { color: var(--warn); }

/* ---------- panels ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; position: relative; }
.panel-h { display: flex; align-items: center; gap: 8px 10px; padding: 13px 16px 12px; border-bottom: 1px solid var(--line); min-height: 48px; flex-wrap: wrap; }
.panel-h h2 { font: 600 11.5px/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text); }
.panel-h .meta { font: 500 11px/1.3 var(--font-mono); color: var(--faint); letter-spacing: .04em; }
.panel-h .end { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-b { padding: 14px 16px; }
.panel-note { padding: 10px 16px 12px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.link { color: var(--accent); font: 600 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; background: none; border: 0; padding: 0; }
.link .i { width: 14px; height: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2 > .panel + .panel { margin-top: 0; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-side > .panel + .panel, .stack > .panel + .panel { margin-top: 0; }
.stack { display: grid; gap: 16px; min-width: 0; align-content: start; }
.mt { margin-top: 16px; }

/* ---------- Home: the TalkC panel's Dashboard layout ---------- */
.home { display: grid; gap: 20px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bar .sync { margin-left: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: block; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; color: inherit; overflow: hidden; }
.kt { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kt .i { width: 18px; height: 18px; color: var(--tone, var(--muted)); stroke-width: 1.9; }
.kt small { font-size: 10px; font-weight: 500; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.kv { font-size: 24px; font-weight: 700; line-height: 1.15; color: var(--tone, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv .of { font-size: 13px; font-weight: 600; color: var(--faint); margin-left: 2px; }
.kl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ks { font-size: 11px; color: var(--faint); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ks strong { color: var(--tone, var(--text)); font-weight: 600; }
.kpi.mini { padding: 14px 12px; text-align: center; }
.kpi.mini .kv { font-size: 20px; }
.kpi.mini .kl { font-size: 11.5px; }
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pcard { padding: 16px; }
.pc-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.pc-h .dot { width: 8px; height: 8px; }
.pc-v { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.pc-v b { font-size: 22px; font-weight: 700; line-height: 1; }
.pc-v span { font-size: 12px; color: var(--muted); }
.pc-v .pc-x { margin-left: auto; color: var(--ok-ink); font-weight: 600; }
.pc-s { font-size: 12px; color: var(--faint); margin-top: 8px; }
.pc-s b { color: var(--accent); font-weight: 600; }
.pbar { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; margin-top: 10px; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); opacity: .75; }
.lines { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.lines li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.lines b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lines small { display: block; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lines .timer { font-size: 13px; font-weight: 600; }
.dir { font: 700 10px/1 var(--font); padding: 4px 6px; border-radius: 5px; color: var(--accent); border: 1px solid var(--accent-line); background: var(--accent-wash); flex: none; }
.dir.out { color: var(--accent-2); border-color: var(--accent-2-line); background: var(--accent-2-soft); }
.wide { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.wide > .panel + .panel { margin-top: 0; }
.qa { display: grid; gap: 8px; padding: 14px 16px 16px; }
.qa a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; background: var(--bg); }
.qa a:hover { background: var(--hover); }
.qa b { display: block; font-size: 13.5px; font-weight: 500; }
.qa small { display: block; font-size: 11px; color: var(--faint); margin-top: 1px; }
.qi { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; color: var(--tone, var(--accent)); background: var(--tint, var(--accent-soft)); }
.qi .i { width: 16px; height: 16px; stroke-width: 1.9; }

/* ---------- Repairs: three step columns, one short card per job ---------- */
.rsum { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.rsum > * { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rsum b { color: var(--text); font-weight: 700; }
.rsum button { cursor: pointer; }
.rsum button:hover { border-color: var(--faint); }
.rsum .bad { color: var(--bad-ink); background: var(--bad-soft); border-color: var(--bad-line); }
.rsum .bad b { color: var(--bad-ink); }
.rsum button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bad-line); }
.board3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.rcol { --step: var(--accent); min-width: 0; }
.rcol.warn { --step: var(--warn); } .rcol.ok { --step: var(--ok); }
.rcol-h { display: flex; align-items: center; gap: 8px; padding: 0 2px 10px; margin-bottom: 12px; border-bottom: 2px solid var(--step); }
.rcol-h b { font-size: 14px; font-weight: 600; }
.rcol-h .n { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 9px; }
.stepn { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--step); border: 1.5px solid var(--step); flex: none; }
.rcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; transition: border-color .2s ease, box-shadow .2s ease; }
.rcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-hover); }
.rcard.late { border-color: var(--bad-line); }
.rc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rc-top b { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-prod { font-size: 13.5px; margin-top: 6px; overflow-wrap: anywhere; }
.rc-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.rc-meta, .rc-place { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 8px; overflow-wrap: anywhere; }
.rc-meta.acc { color: var(--accent); }
.rc-place { font-size: 12px; color: var(--faint); margin-top: 4px; }
.rc-meta .i, .rc-place .i { width: 14px; height: 14px; margin-top: 1px; }
.rc-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.rc-code { margin-left: auto; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.rcol-empty { font-size: 12.5px; color: var(--faint); padding: 18px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius); text-align: center; }
.more-links { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-top: 22px; }
.more-links .link[aria-expanded="true"] .i { transform: rotate(180deg); }
.flist { list-style: none; margin: 0; padding: 4px 0; }
.flist li { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.4fr) auto 90px; align-items: center; gap: 12px; padding: 9px 16px; font-size: 13px; }
.flist li + li { border-top: 1px solid var(--line); }
.flist li > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flist .rc-code { margin-left: 0; }

/* ---------- the new campaign form: 3 numbered steps ---------- */
.camp-form { --step: var(--accent); }
.cstep { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; padding: 16px 0; }
.cstep:first-child { padding-top: 2px; }
.cstep + .cstep { border-top: 1px solid var(--line); }
.cstep .stepn { margin-top: 1px; }
.cbody { min-width: 0; display: grid; gap: 8px; }
.cbody > .cap { margin-bottom: -2px; }
.cbody > .seg { justify-self: start; }
.cpart { display: grid; gap: 8px; margin-top: 6px; }
.cpart[hidden] { display: none; }
.cfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; font-size: 12px; }
.cfoot .btn { cursor: pointer; }
.camp-form .hint { font-size: 12px; margin: 0; }

/* ---------- Inventory: product cards, as on the TalkC panel ---------- */
.inv-note { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.offers-bar { margin-bottom: 16px; }
.offers-bar > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-size: 13.5px; }
.offers-bar > summary::-webkit-details-marker { display: none; }
.offers-bar > summary .faint { font-size: 12.5px; }
.offers-bar > summary .i { margin-left: auto; width: 16px; height: 16px; color: var(--muted); transition: transform .2s ease; }
.offers-bar[open] > summary { border-bottom: 1px solid var(--line); }
.offers-bar[open] > summary .i { transform: rotate(180deg); }
.offers-tools { display: flex; justify-content: flex-end; padding: 10px 14px 0; }
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.prod { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease; }
.prod:hover { border-color: var(--line-2); box-shadow: var(--shadow-hover); }
.prod-photo { position: relative; height: 168px; background: var(--bg); display: grid; place-items: center; }
.prod-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.nophoto { display: grid; justify-items: center; gap: 6px; color: var(--faint); font-size: 12px; }
.nophoto .i { width: 24px; height: 24px; }
.prod-type { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(2, 6, 23, .78); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.prod-body { padding: 12px 14px; display: grid; gap: 4px; flex: 1; align-content: start; }
.prod-name { font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.prod-brand { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.prod-price { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.prod-price b { font-size: 16px; font-weight: 700; }
.prod-price s { font-size: 12px; color: var(--faint); }
.prod-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ptag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--hover); white-space: nowrap; }
.ptag.ok { color: var(--ok-ink); background: var(--ok-soft); }
.ptag.warn { color: var(--warn-ink); background: var(--warn-soft); }
.ptag.bad { color: var(--bad-ink); background: var(--bad-soft); }
.prod-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }
.icon-btn.danger { color: var(--bad-ink); }
.icon-btn.danger:hover { background: var(--bad-soft); }
/* the product form: a wide pop-up in parts, as the panel's Edit product */
dialog.dlg.dlg-wide { width: min(760px, calc(100vw - 32px)); }
.dlg.dlg-wide .dlg-foot { position: sticky; bottom: -20px; margin: 0 -20px -20px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--line); }
.fs { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0; min-width: 0; display: grid; gap: 10px; }
.fs > legend { padding: 0 6px; margin-left: -6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fs .hint { font-size: 12px; color: var(--faint); margin: 0; }
.form-grid .wide-f { grid-column: 1 / -1; }
.ph-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.ph { position: relative; width: 92px; height: 92px; border-radius: 10px; border: 1px solid var(--line-2); overflow: hidden; background: #fff; }
.ph img { width: 100%; height: 100%; object-fit: contain; }
.ph-main { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 999px; background: rgba(2, 6, 23, .75); color: #fff; font-size: 9.5px; font-weight: 600; }
.ph-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(2, 6, 23, .75); color: #fff; font-size: 15px; line-height: 22px; padding: 0; cursor: pointer; }
.ph.add { display: grid; place-items: center; align-content: center; gap: 4px; background: var(--bg); border-style: dashed; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.ph.add:hover { color: var(--text); border-color: var(--faint); }
.ph.add .i { width: 20px; height: 20px; }

/* ---------- small charts (charts.js) ---------- */
.segbar { display: flex; gap: 2px; width: 100%; height: 6px; }
.segbar i { display: block; height: 100%; border-radius: 99px; min-width: 4px; }
.segbar.zero { background: var(--track); border-radius: 99px; } /* not "empty": that is the empty-state box */
.meterline { width: 100%; height: 6px; border-radius: 99px; background: var(--track); position: relative; overflow: hidden; }
.meterline i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--accent); }
.stars { display: inline-flex; position: relative; color: var(--star-off); line-height: 0; }
.stars .on { position: absolute; inset: 0 auto 0 0; overflow: hidden; display: inline-flex; color: var(--star); white-space: nowrap; }
.stars .i { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 1; margin-right: 3px; }
.stars.sm .i { width: 13px; height: 13px; margin-right: 2px; }
.hbars { list-style: none; margin: 0; padding: 4px 0 6px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, 38%) 88px; align-items: center; gap: 12px; padding: 8px 16px; }
.hbars li + li { border-top: 1px solid var(--line); }
.hbars .lbl { min-width: 0; }
.hbars .lbl b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbars .lbl small { display: block; font: 500 10px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.hbar { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--track); position: relative; }
.hbar i { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 2px; }
.hbars .v { font: 600 12px var(--font-mono); text-align: right; white-space: nowrap; }
.hbars .v small { display: block; font-weight: 500; color: var(--faint); font-size: 10.5px; margin-top: 2px; white-space: normal; }
.hbars .lbl small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring { display: block; flex: none; }
.ring .track { fill: none; stroke: var(--track); }
.ring .val { fill: none; stroke: var(--accent); stroke-linecap: round; }
.ring text { font: 650 13px var(--font); fill: var(--text); }

/* ---------- the map (map.js) ---------- */
.mapp { display: flex; flex-direction: column; }
.map { position: relative; padding: 4px 16px 0; flex: 1; display: flex; align-items: center; justify-content: center; }
.map-in { position: relative; width: 100%; }
.nmap { width: 100%; height: auto; display: block; overflow: visible; }
.nmap .d { fill: var(--map-none); stroke: var(--map-line); stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill .2s; }
.nmap.land .d { fill: url(#crm-dots); stroke: var(--map-edge); stroke-opacity: .4; }
.nmap .d.z { fill: url(#crm-dots-z); }
.nmap .d.s1 { fill: var(--map-1); } .nmap .d.s2 { fill: var(--map-2); } .nmap .d.s3 { fill: var(--map-3); } .nmap .d.s4 { fill: var(--map-4); } .nmap .d.s5 { fill: var(--map-5); }
.nmap.pick .d { cursor: pointer; }
.nmap.pick .d:hover, .nmap .d:focus-visible { stroke: var(--map-pick); stroke-width: 1.5px; outline: none; }
.nmap .d.sel { stroke: var(--map-pick); stroke-width: 2.5px; }
.nmap .bub { fill: var(--accent); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.nmap .bub.dim { fill: var(--map-3); }
.nmap .ring-anim { fill: none; stroke: var(--accent-2); stroke-width: 1.6; transform-box: fill-box; transform-origin: center; animation: ring 2.4s ease-out infinite; pointer-events: none; }
.nmap .shop { fill: var(--surface); stroke: var(--text); stroke-width: 1.3; pointer-events: none; }
.mlabel { position: absolute; transform: translate(-50%, calc(-100% - 10px)); font: 600 10px/1 var(--font-mono); letter-spacing: .1em; color: var(--text); white-space: nowrap; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; background: var(--label-bg); border: 1px solid var(--line-2); pointer-events: none; }
.mlabel em { font-style: normal; color: var(--accent); margin-left: 5px; }
.map-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 130px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 12px; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.map-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.map-tip span { color: var(--muted); }
.readout { position: absolute; top: 10px; right: 16px; text-align: right; pointer-events: none; }
.readout b { display: block; font: 650 26px/1 var(--font); color: var(--text); letter-spacing: -.02em; margin: 6px 0 5px; }
.readout .cap { font-size: 9.5px; }
.map-foot { display: flex; align-items: center; gap: 8px 14px; padding: 10px 16px 12px; border-top: 1px solid var(--line); font: 500 11px var(--font-mono); color: var(--faint); letter-spacing: .06em; flex-wrap: wrap; }
.map-foot .k { display: inline-flex; align-items: center; gap: 6px; }
.map-foot .k i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--accent); }
.map-foot .link { margin-left: auto; }
.credit { padding: 0 16px 12px; font: 400 8.5px/1.4 var(--font); color: var(--faint); overflow-wrap: anywhere; }
.legend { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; padding: 10px 16px; font: 500 11px var(--font-mono); color: var(--muted); }
.legend .sw { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend .sw i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .sw i.z { background: var(--map-none); box-shadow: inset 0 0 0 1px var(--line-2); }
.map-list { display: none; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0 16px 12px; font: 600 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.map-list li { padding: 4px 7px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-2); }
.map-list em { font-style: normal; color: var(--accent); margin-left: 4px; }
.dnums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.dnums > div { background: var(--surface); padding: 12px 16px; min-width: 0; }
.dnums b { display: block; font-size: 20px; font-weight: 650; line-height: 1.1; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dnums small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ---------- AI call queue (timeline) ---------- */
.chips { display: flex; gap: 6px; padding: 12px 16px 4px; flex-wrap: wrap; }
.chips.flat { padding: 0; }
.chip { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface-2); font: 600 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip .n { color: var(--faint); }
.chip .kd { width: 6px; height: 6px; border-radius: 50%; background: var(--k); }
.chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }
.chip[aria-pressed="true"] .n { color: var(--accent); opacity: .75; }
.k-pay { --k: var(--kind-payment); } .k-emi { --k: var(--kind-instalment); } .k-war { --k: var(--kind-warranty); } .k-cb { --k: var(--kind-callback); }
.k-lead { --k: var(--kind-lead); } .k-rep { --k: var(--kind-repair); } .k-rpt { --k: var(--kind-report); } .k-cmp { --k: var(--kind-complaint); }
.qlist { list-style: none; margin: 0; padding: 8px 0 10px; }
.q { display: grid; grid-template-columns: 52px 20px minmax(0, 1fr) 150px auto; align-items: center; gap: 0 12px; padding: 9px 16px; position: relative; }
.q .t { font: 600 12.5px var(--font-mono); color: var(--text); letter-spacing: .02em; }
.q .t small { display: block; font-size: 10px; color: var(--faint); letter-spacing: .06em; margin-top: 2px; }
.node { align-self: stretch; position: relative; display: grid; place-items: center; }
.node::before { content: ""; position: absolute; top: -9px; bottom: -9px; left: 50%; width: 1px; margin-left: -.5px; background: var(--line-2); }
.qlist > :first-child .node::before { top: 50%; }
.qlist > :last-child .node::before { bottom: 50%; }
.node i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--node-ring); background: var(--surface); position: relative; z-index: 1; }
.q.done .node i { background: var(--ok); border-color: var(--ok); }
.q.retry .node i { border-color: var(--warn); }
.q.oncall::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--accent); }
.q.oncall .node i { background: var(--accent); border-color: var(--accent); }
.qm { min-width: 0; }
.qm .nm { display: flex; align-items: baseline; gap: 4px 9px; min-width: 0; flex-wrap: wrap; }
.qm b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.qm .ph { font: 500 11.5px var(--font-mono); color: var(--faint); white-space: nowrap; }
.qm .why { display: flex; align-items: center; gap: 4px 10px; margin-top: 5px; font-size: 12.5px; color: var(--muted); min-width: 0; flex-wrap: wrap; }
.qm .why .txt { min-width: 0; overflow-wrap: anywhere; }
.kind { display: inline-flex; align-items: center; gap: 6px; font: 600 10px/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--nav-ink); white-space: nowrap; flex: none; }
.kind::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--k); }
.st { font: 700 10.5px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st small { font: 500 12px/1.25 var(--font); letter-spacing: 0; text-transform: none; color: var(--muted); overflow-wrap: anywhere; }
.st.ok { color: var(--ok); } .st.warn { color: var(--warn-ink); } .st.on { color: var(--accent); } .st.plan { color: var(--muted); } .st.bad { color: var(--bad-ink); }
.act { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.now { display: grid; grid-template-columns: 52px 20px minmax(0, 1fr); gap: 0 12px; align-items: center; padding: 0 16px; height: 20px; }
.now .t { font: 700 10px var(--font-mono); color: var(--accent); letter-spacing: .14em; }
.now .node::before { top: -9px; bottom: -9px; }
.now .line { height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }

/* ---------- buttons ---------- */
.btn { height: 32px; padding: 0 11px; border-radius: 8px; font: 600 12.5px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn .i { width: 15px; height: 15px; stroke-width: 1.9; }
.btn-call { border-color: var(--accent-line); color: var(--accent); background: var(--accent-wash); }
.btn-call:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 700; }
.btn-primary:hover { border-color: transparent; filter: brightness(1.08); }
.btn-ok { border-color: var(--ok-line); color: var(--ok-ink); background: var(--ok-soft); }
.btn-danger { border-color: var(--bad-line); color: var(--bad-ink); background: var(--bad-soft); }
.btn-quiet { color: var(--muted); background: transparent; }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .5; cursor: default; pointer-events: none; }
.btn-lg { width: 100%; height: 50px; font-size: 15px; border-radius: 10px; }
.btn-lg .i { width: 18px; height: 18px; }

/* ---------- alerts ---------- */
.alerts { list-style: none; margin: 0; padding: 4px 0; }
.al { display: grid; grid-template-columns: 3px minmax(0, 1fr) auto; gap: 0 14px; padding: 11px 16px 11px 0; }
.al + .al { border-top: 1px solid var(--line); }
a.al:hover, .al a:hover b { color: var(--accent); }
.sev { border-radius: 0 3px 3px 0; background: var(--bad); }
.al.warn .sev { background: var(--warn); }
.al.info .sev { background: var(--accent); }
.al .tag { font: 700 9.5px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--bad-ink); display: inline-flex; align-items: center; gap: 7px; }
.al.warn .tag { color: var(--warn-ink); } .al.info .tag { color: var(--accent); }
.al .tag .i { width: 13px; height: 13px; stroke-width: 2; }
.al b { display: block; font-size: 13.5px; font-weight: 600; margin-top: 6px; overflow-wrap: anywhere; }
.al p { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.al time { font: 500 11px var(--font-mono); color: var(--faint); white-space: nowrap; }

/* ---------- ranking ---------- */
.lb { list-style: none; margin: 0; padding: 4px 0 6px; }
.lb li { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(48px, 90px) 26px 92px; align-items: center; gap: 12px; padding: 10px 16px; }
.lb li + li { border-top: 1px solid var(--line); }
.lb .rk { font: 700 12px var(--font-mono); color: var(--faint); }
.lb li:first-child .rk { color: var(--accent); }
.lb b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb small { display: block; font: 500 10px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb .bar { height: 6px; border-radius: 3px; background: var(--track); position: relative; }
.lb .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent); }
.lb .n { font: 700 12.5px var(--font-mono); text-align: right; }
.lb .v { font: 600 12px var(--font-mono); text-align: right; color: var(--muted); white-space: nowrap; }

/* ---------- activity ---------- */
.feed { list-style: none; margin: 0; padding: 6px 0; }
.feed li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 8px 16px; font-size: 12.5px; }
.feed li + li { border-top: 1px solid var(--line); }
.feed time { font: 600 11px var(--font-mono); color: var(--faint); padding-top: 1px; }
.feed span { color: var(--muted); overflow-wrap: anywhere; }

/* ---------- lists (rows) ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; gap: 6px 16px; padding: 12px 16px; align-items: center; position: relative; }
.row + .row { border-top: 1px solid var(--line); }
a.row:hover, .row.go:hover { background: var(--hover); cursor: pointer; }
.row > * { min-width: 0; }
.row .ttl { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.row .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.row .code { font: 600 12px var(--font-mono); color: var(--accent); letter-spacing: .04em; white-space: nowrap; }
.row .num { text-align: right; font: 600 13px var(--font-mono); white-space: nowrap; }
.row .num small { display: block; font: 500 11px var(--font-mono); color: var(--faint); margin-top: 3px; }
.row .when { font: 500 11.5px var(--font-mono); color: var(--faint); white-space: nowrap; }
.row .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row .lines { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.row .note { font-size: 12.5px; color: var(--muted); margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line-2); overflow-wrap: anywhere; }
.r-customers { grid-template-columns: 34px minmax(0, 1.4fr) minmax(0, 1fr) 90px 110px 120px; }
.r-orders { grid-template-columns: 118px minmax(0, 1.2fr) minmax(0, 1.4fr) 130px 140px 280px; }
.r-orders > .actions, .r-repairs > .actions, .r-complaints > .actions, .r-pay > .actions { justify-content: flex-end; }
.r-calls { grid-template-columns: 118px minmax(0, 1fr) minmax(0, 1.8fr) 230px; }
.r-pay { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 120px 110px auto; }
.r-leads { grid-template-columns: 118px minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, 1fr) 210px; }
.r-repairs { grid-template-columns: 118px minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 1fr) 330px; }
.r-complaints { grid-template-columns: 118px minmax(0, 2fr) minmax(0, 1.2fr) 210px 110px; }
.r-tickets { grid-template-columns: 150px minmax(0, 1fr) auto; }
.row.urgent { background: linear-gradient(90deg, var(--bad-soft), transparent 65%); }
.alarm-panel { border-color: var(--bad-line); }
.sec-h { font-size: 15px; font-weight: 600; margin: 22px 0 10px; }
.r-reviews { grid-template-columns: 96px minmax(0, 2fr) minmax(0, 1.2fr) 90px; }
.r-calls2 { grid-template-columns: 70px minmax(0, 1.1fr) minmax(0, 1.6fr) 160px auto; }
.r-owned { grid-template-columns: minmax(0, 1.6fr) 120px 140px minmax(0, 1fr); }
.r-camp { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(170px, 1fr) auto; }
.r-stock { grid-template-columns: minmax(0, 1.8fr) 110px 120px 110px auto; }

.r-orders.nocust { grid-template-columns: 92px minmax(0, 1.6fr) 130px 120px minmax(110px, auto); }
.r-offer { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
.r-ccalls { grid-template-columns: 118px minmax(0, 1fr) minmax(180px, 300px); }
.row > .editor { grid-column: 1 / -1; margin: 6px -16px -12px; }
.compact .row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.compact .row > * { grid-column: 1 / -1; }
.compact .row > .num { text-align: left; }
.compact .row .actions { justify-content: flex-start; margin-top: 4px; }
.compact .q { grid-template-columns: 52px 20px minmax(0, 1fr); grid-template-areas: "t n m" ". n st" ". n act"; gap: 6px 12px; }
.compact .q .t { grid-area: t; } .compact .q .node { grid-area: n; } .compact .q .qm { grid-area: m; } .compact .q .st { grid-area: st; } .compact .q .act { grid-area: act; justify-content: flex-start; }
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.kind-set { display: grid; gap: 9px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.kind-f { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); }
.kind-f .in { width: 76px; flex: none; }
.kind-f .in[type="time"] { width: 104px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 5px; font: 700 9.5px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: var(--muted); background: var(--hover); border: 1px solid var(--line-2); vertical-align: middle; }
.pill.ok { color: var(--ok-ink); background: var(--ok-soft); border-color: var(--ok-line); }
.pill.warn { color: var(--warn-ink); background: var(--warn-soft); border-color: var(--warn-line); }
.pill.bad { color: var(--bad-ink); background: var(--bad-soft); border-color: var(--bad-line); }
.pill.on { color: var(--accent); background: var(--accent-wash); border-color: var(--accent-line); }
.pill.ai { color: var(--accent-2); background: var(--accent-2-soft); border-color: var(--accent-2-line); }
.pill .i { width: 11px; height: 11px; stroke-width: 2.2; }
.pills { display: inline-flex; gap: 5px; flex-wrap: wrap; vertical-align: middle; }

/* ---------- stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { padding: 12px 14px; min-width: 0; }
.stat .sv { font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .ss { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.stat.warn { border-color: var(--warn-line); } .stat.bad { border-color: var(--bad-line); } .stat.ok { border-color: var(--ok-line); }

/* ---------- tables (numbers by place) ---------- */
.tbl-wrap { overflow-x: auto; scrollbar-width: thin; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { font: 600 10px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
.tbl .num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl td b { font-weight: 600; }
.tbl td small { display: block; color: var(--faint); font-size: 11px; margin-top: 2px; }
.tbl .barcell { width: 28%; min-width: 150px; }
.tbl .barcell .bc { display: flex; align-items: center; gap: 10px; }
.tbl .barcell .hbar { flex: 1 1 auto; min-width: 40px; height: 6px; }
.tbl .barcell b { font: 600 12px var(--font-mono); white-space: nowrap; }

/* ---------- forms ---------- */
.f { display: grid; gap: 6px; min-width: 0; }
.f > .cap { color: var(--muted); }
.f .hint { font-size: 12px; color: var(--faint); }
.in { width: 100%; min-width: 0; height: 38px; padding: 0 11px; border-radius: 8px; background: var(--input-bg); border: 1px solid var(--line-2); color: var(--text); font-size: 13.5px; outline: 0; }
.in:focus { border-color: var(--accent-line); }
textarea.in { height: auto; min-height: 72px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
select.in { padding-right: 28px; }
.in.sm { height: 32px; font-size: 13px; padding: 0 9px; }
select.in.more { width: 92px; height: 28px; font-size: 12px; padding: 0 6px; border-radius: 7px; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.form-row > .faint { align-self: center; }
.in.num { text-align: right; font-family: var(--font-mono); }
.in::placeholder { color: var(--faint); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; }
.form-row { display: flex; align-items: flex-end; gap: 10px 12px; flex-wrap: wrap; }
.form-row > .f { flex: 1 1 160px; }
.form-foot { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 14px; }
.form-msg { font-size: 12.5px; color: var(--muted); }
.form-msg.ok { color: var(--ok-ink); }
.err { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--bad-soft); border: 1px solid var(--bad-line); color: var(--bad-ink); font-size: 13px; overflow-wrap: anywhere; }
.err .i { width: 16px; height: 16px; margin-top: 1px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .tr { width: 36px; height: 20px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch .tr::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + .tr { background: var(--accent); }
.switch input:checked + .tr::after { transform: translateX(16px); background: var(--on-accent); }
.switch input:focus-visible + .tr { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch.bad input:checked + .tr { background: var(--bad); }
.ck-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ck { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 12.5px; color: var(--muted); cursor: pointer; }
.ck input { accent-color: var(--accent); margin: 0; }
.ck:has(input:checked) { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 12px; }
.stock-grid label { display: grid; grid-template-columns: minmax(0, 1fr) 76px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.stock-grid label span { overflow-wrap: anywhere; }
.stock-grid.phones { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stock-grid.phones label { grid-template-columns: minmax(0, 1fr) 132px; }
.stock-grid label small { display: block; font-size: 10.5px; color: var(--faint); }
.editor { padding: 14px 16px 16px; background: var(--surface-2); border-top: 1px solid var(--line); }
.kv-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 16px; margin: 0; }
.kv-list div { min-width: 0; }
.kv-list dt { font: 600 10px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.kv-list dd { margin: 5px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }

/* ---------- people ---------- */
.who-card { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.who-card .avatar { width: 52px; height: 52px; border-radius: 12px; font-size: 16px; }
.who-card h1 { font-size: 23px; font-weight: 650; letter-spacing: -.018em; line-height: 1.15; overflow-wrap: anywhere; }
.who-card .meta { margin-top: 6px; color: var(--muted); font-size: 13px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.who-card > div:nth-child(2) { flex: 1 1 260px; min-width: 0; }
.dnc { display: grid; gap: 6px; justify-items: start; max-width: 300px; }
.dnc small { color: var(--faint); font-size: 12px; }
.inst { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.inst span { min-width: 54px; padding: 6px 7px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface-2); font: 600 10.5px/1.2 var(--font-mono); color: var(--muted); text-align: center; }
.inst span small { display: block; font-weight: 500; color: var(--faint); margin-top: 2px; font-size: 9.5px; }
.inst .paid { color: var(--ok-ink); border-color: var(--ok-line); background: var(--ok-soft); }
.inst .overdue { color: var(--bad-ink); border-color: var(--bad-line); background: var(--bad-soft); }
.inst .next { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }
.plan-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---------- recordings ---------- */
.rec { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rec audio { width: 100%; max-width: 300px; height: 34px; min-width: 0; }
.rec .none { font-size: 12px; color: var(--faint); }

/* ---------- empty, loading, error ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 34px 20px; color: var(--muted); }
.empty .i { width: 30px; height: 30px; color: var(--faint); stroke-width: 1.4; }
.empty b { color: var(--text); font-size: 14.5px; font-weight: 600; }
.empty p { font-size: 13px; max-width: 420px; }
.empty.sm { padding: 18px 16px; }
.loading { display: grid; place-items: center; min-height: 40vh; color: var(--faint); font: 600 11px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; gap: 12px; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.fail { max-width: 520px; margin: 10vh auto; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); font: 500 11.5px var(--font-mono); color: var(--faint); flex-wrap: wrap; }
.searchbox { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 8px; background: var(--input-bg); border: 1px solid var(--line-2); color: var(--faint); min-width: 0; flex: 1 1 220px; max-width: 360px; }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 13.5px; }
.searchbox .i { width: 16px; height: 16px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar .end { margin-left: auto; }

/* ---------- dialog, toasts ---------- */
dialog.dlg { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: auto; }
dialog.dlg::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dlg form { display: grid; gap: 14px; padding: 20px; }
.dlg h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.dlg .dlg-text { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.dlg .dlg-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--ok-line); box-shadow: var(--shadow-lg); font-size: 13px; animation: toast-in .2s ease-out; overflow-wrap: anywhere; }
.toast .i { width: 16px; height: 16px; color: var(--ok-ink); margin-top: 1px; }
.toast.bad { border-color: var(--bad-line); }
.toast.bad .i { color: var(--bad-ink); }

/* ---------- login ---------- */
.login-b { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; overflow: hidden; }
.stage { flex: 1; display: grid; place-items: center start; position: relative; padding: 48px 16px 40px max(16px, 8vw); }
.bgmap { position: absolute; right: 2vw; top: 50%; width: min(1180px, 78vw); transform: translateY(-50%); pointer-events: none; }
.bgmap svg { width: 100%; height: auto; display: block; overflow: visible; }
.bgmap .d { fill: url(#crm-dots-lg); stroke: var(--map-edge); stroke-width: .8px; vector-effect: non-scaling-stroke; stroke-opacity: .2; }
.bgmap .route { fill: none; stroke: var(--accent-line); stroke-width: 1.2; stroke-dasharray: 3 5; animation: dash 6s linear infinite; }
.bgmap .city { fill: var(--accent); }
.bgmap .city.g { fill: var(--accent-2); }
.bgmap .lbl { font: 600 9px var(--font-mono); letter-spacing: 1.4px; fill: var(--muted); text-transform: uppercase; }
.bgmap .lbl.hi { fill: var(--accent); }
.bgmap .ring-anim { fill: none; stroke: var(--accent-2); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: ring 2.6s ease-out infinite; }
.vignette { position: absolute; inset: 0; pointer-events: none; }
.console { position: relative; width: 100%; max-width: 432px; padding: 30px 30px 26px; border-radius: 16px; background: var(--console-bg); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.console-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.console h1 { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin: 26px 0 8px; line-height: 1.15; }
.console .lead { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.field { display: block; margin-bottom: 16px; }
.field > .cap { display: block; margin-bottom: 8px; color: var(--muted); }
.input { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 10px 0 14px; border-radius: 10px; background: var(--input-bg); border: 1px solid var(--line-2); transition: border-color .15s, box-shadow .15s; }
.input:focus-within { border-color: var(--accent-line); }
.input .i { width: 17px; height: 17px; color: var(--faint); }
.input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; color: var(--text); }
.input input::placeholder { color: var(--faint); }
.show { border: 0; background: none; color: var(--muted); font: 600 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; padding: 6px; }
.show .i { width: 15px; height: 15px; }
.console .err { margin: -4px 0 16px; }
.console-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; font: 500 11px var(--font-mono); color: var(--faint); letter-spacing: .06em; text-align: center; }
.console-foot .i { width: 14px; height: 14px; }
.hud { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px 28px; padding: 13px 20px; border-top: 1px solid var(--line); background: var(--top-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font: 600 10.5px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); flex-wrap: wrap; }
.hud span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.hud .dot { color: var(--ok); width: 6px; height: 6px; }
.hud b { color: var(--text); font-weight: 600; }
.login-credit { position: relative; padding: 0 20px 10px; font: 400 9.5px/1.45 var(--font); color: var(--faint); text-align: center; overflow-wrap: anywhere; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes dash { to { stroke-dashoffset: -40; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- smaller screens ---------- */
@media (max-width: 1366px) {
  .lb li { grid-template-columns: 22px minmax(0, 1fr) 48px 22px 84px; gap: 10px; }
  .r-orders { grid-template-columns: 118px minmax(0, 1.1fr) minmax(0, 1.3fr) 120px 130px 250px; }
  .r-orders .deliv { display: none; }
}
@media (max-width: 1280px) {
  .r-calls { grid-template-columns: 118px minmax(0, 1fr) minmax(0, 1.5fr); }
  .r-calls .rec { grid-column: 2 / -1; }
}
@media (max-width: 1120px) {
  .map-in { max-width: 640px; }
  .wide { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-side { grid-template-columns: minmax(0, 1fr); }
  .r-leads, .r-repairs, .r-complaints, .r-calls2, .r-camp { grid-template-columns: 118px minmax(0, 1fr) minmax(0, 1fr); }
  .r-leads > :nth-child(n+4), .r-repairs > :nth-child(n+4), .r-complaints > :nth-child(n+4), .r-calls2 > :nth-child(n+4), .r-camp > :nth-child(n+4) { grid-column: 2 / -1; }
  .r-camp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .r-camp > :nth-child(n+3) { grid-column: 1 / -1; }
  .row .actions { justify-content: flex-start; }
  .r-orders { grid-template-columns: 118px minmax(0, 1fr) minmax(0, 1.2fr) 120px; }
  .r-orders > :nth-child(n+5) { grid-column: 2 / -1; }
  .r-orders > .actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .prods { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .prod-photo { height: 132px; }
  .board3 { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .flist li { grid-template-columns: 60px minmax(0, 1fr) auto; }
  .flist li > :nth-child(3), .flist li > :nth-child(5) { display: none; }
}
@media (max-width: 900px) {
  .rail { position: fixed; top: 56px; bottom: 0; left: 0; height: auto; width: 260px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); visibility: hidden; }
  body.nav-hide .rail { display: flex; }
  body.nav-open .rail { transform: none; visibility: visible; }
  body.nav-open .scrim { display: block; position: fixed; inset: 56px 0 0 0; z-index: 35; background: var(--scrim); }
  .main { padding: 16px 16px 40px; }
  .top { padding: 0 8px 0 6px; gap: 6px; }
  .org, .me b, .top .btn-ghost span { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duo { grid-template-columns: minmax(0, 1fr); }
  .r-customers { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .r-customers > :nth-child(3) { grid-column: 2 / -1; grid-row: 2; }
  .r-customers > :nth-child(4), .r-customers > :nth-child(5) { display: none; }
  .r-customers > :nth-child(6) { grid-column: 3; grid-row: 1; }
  .r-orders, .r-pay, .r-reviews, .r-owned, .r-stock { grid-template-columns: minmax(0, 1fr) auto; }
  .r-orders > *, .r-pay > *, .r-reviews > *, .r-owned > *, .r-stock > * { grid-column: 1 / -1; }
  .r-orders > .num, .r-pay > .num, .r-reviews > .num, .r-stock > .num { text-align: left; }
  .r-offer, .r-ccalls, .r-orders.nocust { grid-template-columns: minmax(0, 1fr) auto; }
  .r-offer > *, .r-ccalls > *, .r-orders.nocust > * { grid-column: 1 / -1; }
  .r-calls { grid-template-columns: minmax(0, 1fr) auto; }
  .r-calls > * { grid-column: 1 / -1 !important; }
  .row .actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .head h1 { font-size: 21px; }
  .head-tools { width: 100%; justify-content: space-between; }
  .sync { display: none; }
  .head-tools .seg { width: 100%; } .head-tools .seg button { flex: 1; padding: 0 6px; }
  .kpi { padding: 14px; }
  .kv { font-size: 21px; } .kv.money { font-size: 17px; }
  .me, .head [data-act="reload"] { display: none; }
  .brand b { font-size: 14px; }
  .readout b { font-size: 20px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
  .chips::-webkit-scrollbar { display: none; }
  .q { grid-template-columns: 44px 16px minmax(0, 1fr); grid-template-areas: "t n m" ". n st" ". n act"; gap: 6px 10px; padding: 11px 14px; }
  .q .t { grid-area: t; } .q .node { grid-area: n; } .q .qm { grid-area: m; } .q .st { grid-area: st; } .q .act { grid-area: act; justify-content: flex-start; }
  .q .node::before { top: -11px; bottom: -11px; }
  .now { grid-template-columns: 44px 16px minmax(0, 1fr); gap: 0 10px; padding: 0 14px; }
  .mlabel:not(:first-of-type) { display: none; }
  .lb li { grid-template-columns: 22px minmax(0, 1fr) 40px 20px 80px; gap: 8px; padding: 10px 14px; }
  .hbars li { grid-template-columns: minmax(0, 1fr) 70px 80px; padding: 8px 14px; }
  .r-leads, .r-repairs, .r-complaints, .r-calls2, .r-camp, .r-tickets { grid-template-columns: minmax(0, 1fr); }
  .r-leads > *, .r-repairs > *, .r-complaints > *, .r-calls2 > *, .r-camp > * { grid-column: 1 / -1 !important; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .sv { font-size: 19px; }
  .panel-b, .toolbar { padding-left: 14px; padding-right: 14px; }
  .row { padding: 12px 14px; }
  .console { padding: 24px 20px 22px; }
  .console h1 { font-size: 23px; margin-top: 22px; }
  .stage { place-items: center; padding: 32px 16px 28px; }
  .bgmap { width: 250vw; right: auto; left: -95vw; top: 14%; }
  .bgmap .lbl { display: none; }
  .hud { gap: 10px 18px; padding: 12px 14px; font-size: 9.5px; }
  .hud .opt { display: none; }
  .searchbox { max-width: none; }
  .toolbar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .toolbar .seg button { padding: 0 7px; letter-spacing: .05em; }
  .toolbar .seg::-webkit-scrollbar { display: none; }
  .dnums b { font-size: 18px; }
  .map-list { display: flex; }
}

/* ─── Orange Ball additions ─── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.dlg .field { margin-bottom: 12px; }
.dlg .field .in, .dlg .field select { width: 100%; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.plain li { display: flex; align-items: center; gap: 8px; }
.tbl tr.muted td { opacity: .6; }
.tbl td.end { text-align: right; white-space: nowrap; }
/* the field staff page: one column, built for a phone */
.staff-page .main.staff-main { max-width: 640px; margin: 0 auto; padding: 16px 14px 40px; }
.staff-page .field .in { width: 100%; }
details.panel > summary { cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
/* Catalogue: the Brain bar, draft services, the Brain text */
.brainbar .bb-top { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.brainbar .bb-top b { display: inline-flex; align-items: center; gap: 6px; }
.brainbar .bb-top span { color: var(--muted); font-size: 13px; }
.brainbar .bb-top .btn { margin-left: auto; }
.meter { height: 6px; border-radius: 99px; background: var(--line); margin-top: 10px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.brainbar.warn .meter > span { background: #d97706; }
.svc.draft { opacity: .78; }
.svc .panel-h h2 { text-transform: none; letter-spacing: 0; font: 600 14px/1.3 var(--font); }
pre.brain-text { white-space: pre-wrap; word-break: break-word; font: 12.5px/1.55 var(--font-mono); background: var(--bg, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; max-height: 60vh; overflow: auto; }
label.check { display: inline-flex; align-items: center; gap: 8px; margin: 4px 14px 4px 0; font-size: 13px; }
/* Bookings: five step columns (two rows on a laptop, one column on a phone), staff answers, the assign list */
.board5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1400px) { .board5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .board5 { grid-template-columns: 1fr; } }
.ans { display: inline-block; font-size: 11.5px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line-2); margin: 0 4px 2px 0; white-space: nowrap; }
.ans-yes { color: var(--ok, #16a34a); border-color: currentColor; }
.ans-no, .ans-not_reached { color: var(--bad-ink, #dc2626); border-color: currentColor; }
.staff-list { display: grid; gap: 4px; max-height: 260px; overflow: auto; }
label.check.staff-pick { display: flex; margin: 0; padding: 6px 4px; border-bottom: 1px solid var(--line); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
dl.facts dt { color: var(--muted); }
ul.plain.small { font-size: 12.5px; gap: 4px; }
.dlg h3 { font-size: 13px; font-weight: 600; }
/* Schedule: staff × days */
.tbl.sch th, .tbl.sch td { vertical-align: top; }
.tbl.sch th.today, .sch-cell.today { background: rgba(96, 165, 250, .07); }
.sch-cell.closed { background: repeating-linear-gradient(135deg, transparent, transparent 6px, rgba(148, 163, 184, .06) 6px, rgba(148, 163, 184, .06) 12px); }
.sch-who small, .sch-block small { display: block; font-size: 11px; color: var(--faint); font-weight: 400; }
.sch-cell { min-width: 120px; }
.sch-block { display: block; width: 100%; text-align: left; margin-bottom: 6px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: inherit; font-size: 12px; cursor: pointer; }
.sch-block.ans-yes { border-left: 3px solid var(--ok, #16a34a); }
.sch-block.ans-no, .sch-block.ans-not_reached { border-left: 3px solid var(--bad-ink, #dc2626); }
.sch-block.ans-wait { border-left: 3px solid var(--warn, #d97706); }
.sch-block.st-done { opacity: .6; }
/* the staff page's job cards */
.job .panel-h h2 { text-transform: none; letter-spacing: 0; font: 700 15px/1.3 var(--font); }
.job-what { font-size: 15px; margin-bottom: 8px; }
.job-line { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 6px 0; }
.job-line .i { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.job-buttons { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.job-buttons .btn { flex: 1; min-height: 44px; justify-content: center; }
.notices ul li { display: flex; gap: 8px; align-items: flex-start; }
/* Tickets and reviews */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 640px) { .grid3 { grid-template-columns: 1fr; } }
.inline-form { display: inline-flex; }
.tbl.tk tbody tr { cursor: pointer; }
.tbl.tk tbody tr:hover td { background: rgba(148, 163, 184, .06); }
.tbl.tk tr.urgent td { background: rgba(220, 38, 38, .08); }
.tk-urgent { font-weight: 700; color: var(--bad-ink, #dc2626); margin-bottom: 8px; }
.trend { display: flex; align-items: flex-end; gap: 4px; height: 44px; margin-top: 6px; }
.trend span { display: grid; justify-items: center; align-content: end; gap: 1px; width: 14px; position: relative; }
.trend i { display: block; width: 6px; background: rgba(96, 165, 250, .45); border-radius: 2px 2px 0 0; }
.trend b { display: block; width: 6px; background: rgba(22, 163, 74, .65); border-radius: 2px 2px 0 0; position: absolute; bottom: 12px; left: 8px; }
.trend small { font-size: 8px; color: var(--faint); }
.stars { color: #f59e0b; letter-spacing: 1px; }
/* Home and the Daily Report */
.rows .row.urgent { background: rgba(220, 38, 38, .08); }
.panel.focus { box-shadow: 0 0 0 2px var(--accent); }
/* Daily Report (view-report.js, redesigned 2026-11-28): the day in sentences and five numbers against the day before;
   every call with what it led to; the day's bookings and tickets beside the calls; the rest only when it has something */
.rp-nav [aria-label="The day before"] .i { transform: rotate(180deg); }
.rp-nav .btn .i { width: 15px; height: 15px; margin: 0; }
.rp-sum { padding: 20px 22px 18px; display: grid; gap: 18px; }
.rp-lede { margin: 0; max-width: 72ch; font-size: 18px; line-height: 1.5; font-weight: 500; color: var(--text); text-wrap: pretty; }
.rp-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.rp-kpi { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 13px 14px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: inherit; text-decoration: none; }
.rp-kpi:hover { border-color: var(--line-2); }
.rp-kpi:focus-visible { outline: none; box-shadow: var(--glow); }
.rp-kpi .l { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.rp-kpi .v { font-size: 26px; font-weight: 650; line-height: 1.2; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-kpi .s { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-d { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; color: var(--faint); }
.rp-d .i { width: 14px; height: 14px; stroke-width: 2; }
.rp-d.good { color: var(--ok-ink); } .rp-d.bad { color: var(--bad-ink); } .rp-d.warn { color: var(--warn-ink); }
.rp-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.rp-side { display: grid; gap: 16px; min-width: 0; }
.rp-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
/* how the calls split: one bar per outcome, one colour, the count at the end */
.rp-meters { display: grid; gap: 9px; }
.rp-meters:not(.mt) { margin-bottom: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rp-meter { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr) minmax(28px, auto); align-items: center; gap: 12px; font-size: 13px; }
.rp-meter .nm { color: var(--muted); }
.rp-meter .bar { height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.rp-meter .bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.rp-meter b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-meters.pick { gap: 2px; }
button.rp-meter { width: calc(100% + 12px); margin: 0 -6px; padding: 5px 6px; border: 0; border-radius: 6px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.rp-meter:hover:not(:disabled) { background: var(--hover); }
button.rp-meter:focus-visible { outline: none; box-shadow: var(--glow); }
button.rp-meter:disabled { cursor: default; }
button.rp-meter.on { background: var(--accent-soft); }
button.rp-meter.on .nm { color: var(--text); font-weight: 600; }
.rp-showing { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 2px; font-size: 13px; color: var(--muted); }
/* the calls, oldest first */
.rp-calls { list-style: none; margin: 0; padding: 0; }
.rp-call { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.rp-call:first-child { border-top: 0; }
.rp-call > time { padding-top: 2px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rp-call.practice { opacity: .55; }
.rp-c { display: grid; gap: 6px; min-width: 0; }
.rp-c .rp-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 6px 12px; }
.rp-c .rp-top > .rp-o { justify-self: end; }
.rp-c .who { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 14px; }
.rp-c .who > .i { width: 15px; height: 15px; color: var(--muted); }
.rp-c .who b { font-weight: 600; overflow-wrap: anywhere; }
.rp-c .who .faint { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rp-c .sum { margin: 0; max-width: 80ch; font-size: 13px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-c .tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rp-c .tools .btn .i { width: 14px; height: 14px; }
.rp-rec > summary { list-style: none; display: inline-flex; }
.rp-rec > summary::-webkit-details-marker { display: none; }
.rp-rec[open] { flex-basis: 100%; }
.rp-rec audio { display: block; width: 100%; max-width: 420px; height: 36px; margin-top: 6px; }
/* what a call led to: words and an icon, never colour alone */
.rp-o { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rp-o > .i { width: 13px; height: 13px; stroke-width: 2.2; }
.rp-o.booked { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok-ink); }
.rp-o.follow_up { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn-ink); }
.rp-o.talked { color: var(--text); }
.rp-ref { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
/* the day's bookings and tickets */
.rp-list { list-style: none; margin: 0; padding: 0; }
.rp-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.rp-list li:first-child { border-top: 0; padding-top: 2px; }
.rp-list li > .faint { grid-column: 1; font-size: 12.5px; }
.rp-list li > .pills { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.rp-item { justify-self: start; padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; }
a.rp-item:hover, button.rp-item:hover { text-decoration: underline; text-underline-offset: 2px; }
span.rp-item { cursor: default; }
.rp-item b { font-weight: 650; margin-right: 4px; font-variant-numeric: tabular-nums; }
.rp-clamp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* field work, money, reviews */
.rp-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px 16px; margin: 0; }
.rp-stats div { display: grid; gap: 2px; }
.rp-stats dt { font-size: 12px; color: var(--muted); }
.rp-stats dd { margin: 0; font-size: 20px; font-weight: 650; }
.rp-stats .zero dd { color: var(--faint); font-weight: 500; }
.rp-big { margin: 0; display: grid; gap: 2px; font-size: 26px; font-weight: 650; line-height: 1.2; }
.rp-big span { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.rp-quiet { display: flex; align-items: center; gap: 8px; margin: 16px 2px 0; font-size: 13px; color: var(--muted); }
.rp-quiet .i { width: 15px; height: 15px; color: var(--ok-ink); }
/* the dashboard's changes, folded */
.rp-act > summary.panel-h { border-bottom: 0; }
.rp-act[open] > summary.panel-h { border-bottom: 1px solid var(--line); }
.rp-act > summary .end .i { width: 16px; height: 16px; transition: transform .15s ease; }
.rp-act[open] > summary .end .i { transform: rotate(180deg); }
.rp-log { list-style: none; margin: 0; padding: 6px 16px 12px; max-height: 420px; overflow: auto; }
.rp-log li { display: grid; grid-template-columns: 48px minmax(70px, 120px) minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.rp-log li:first-child { border-top: 0; }
.rp-log time { color: var(--muted); font-variant-numeric: tabular-nums; }
.rp-log .by { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1180px) { .rp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .rp-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .rp-sum { padding: 16px; }
  .rp-lede { font-size: 16px; }
  .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-kpi .v { font-size: 22px; }
  .rp-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .rp-call { grid-template-columns: 42px minmax(0, 1fr); gap: 10px; }
  .rp-c .rp-top { grid-template-columns: minmax(0, 1fr); }
  .rp-c .rp-top > .rp-o { justify-self: start; }
  .rp-meter { grid-template-columns: minmax(96px, 130px) minmax(0, 1fr) auto; gap: 8px; }
  .rp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-log li { grid-template-columns: 44px minmax(0, 1fr); }
  .rp-log .by { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rp-act > summary .end .i { transition: none; } }

/* Calls: the list of calls and the words of one call */
.row .say { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.mt-s { margin-top: 6px; }
ul.talk { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
ul.talk li { padding: 8px 11px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--line); max-width: 88%; }
ul.talk li b { display: block; font: 600 10px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
ul.talk li.ai { justify-self: start; }
ul.talk li.caller { justify-self: end; border-color: var(--accent-line); }
/* a chosen filter or tab (Calls, Tickets, Bookings, Settings) */
.btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }

/* Contacts: the list, Valid Bookings, one person and their history */
.search-in { min-width: 280px; }
.r-vb { grid-template-columns: 110px minmax(0, 1.1fr) minmax(0, 1.6fr) 190px 100px; }
.who-end { margin-left: auto; text-align: right; display: grid; gap: 6px; justify-items: end; }
.who-end .faint { font-size: 12px; }
.big-rs { font-size: 22px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.last-talk { margin-top: 10px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
ul.tl { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 0; }
.tl-i { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 12px 0; }
.tl-i + .tl-i { border-top: 1px solid var(--line); }
.tl-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.tl-i .ttl { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.tl-i .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.tl-i .say { font-size: 13.5px; line-height: 1.45; margin-top: 4px; overflow-wrap: anywhere; }
.tl-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tl-acts .rec { flex: 1 1 220px; }
details.visits { margin-top: 8px; font-size: 12.5px; }
details.visits summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.visits ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }
@media (max-width: 1120px) { .kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .r-vb { grid-template-columns: minmax(0, 1fr) auto; }
  .r-vb > * { grid-column: 1 / -1; }
  .r-vb > .num { text-align: left; }
  .search-in { min-width: 0; width: 100%; }
  .inline-form:has(.search-in) { display: flex; width: 100%; }
  .who-end { margin-left: 0; text-align: left; justify-items: start; }
}
@media (max-width: 560px) { .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* a "Booking not finished" ticket: the AI's notes and the Call and confirm button (view-tickets.js) */
.confirm-box p { margin: 0; }
.confirm-box .small { font-size: 13px; }
.confirm-box .btn + .small { margin-left: 8px; }

/* Tickets (2026-11-28): the category bar (AI can call / a person handles), the AI-call bar and the tick column (view-tickets.js) */
.tk-cats { display: grid; gap: 8px; margin-top: 12px; }
.tk-cats .grp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-cats .grp > .cap { font: 600 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); min-width: 132px; }
.tk-bulk { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tk-bulk .hint { font-size: 12px; color: var(--muted); }
.tbl.tk th.pick, .tbl.tk td.pick { width: 36px; text-align: center; cursor: default; }
.tbl.tk td.pick input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Filter bars (Tickets, Bookings; 2026-11-28): labelled groups of segmented buttons, compact inputs, the search at the end */
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fbar .fgrp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.fbar .fcap { font: 600 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.fbar .in.sm { width: auto; max-width: 100%; }
.fbar select.in.sm { max-width: 240px; }
.fbar input[type="date"].in.sm { width: 150px; }
.fbar .fsearch { margin-left: auto; }
.fbar .fsearch .in.sm { width: 250px; }
@media (max-width: 700px) {
  .fbar .seg { flex-wrap: wrap; }
  .fbar .fsearch { margin-left: 0; width: 100%; }
  .fbar .fsearch .in.sm { width: 100%; }
}

/* Dashboard: five cards (money today, 2026-11-28) */
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1240px) { .kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpis.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Bookings (2026-11-28): money and the customer's answer on a card, later visits of a booking, the All bookings list, a booking's details */
.rc-money { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.rc-money .i { width: 14px; height: 14px; flex: none; }
.rc-money.warn-t { color: var(--warn-ink, #b45309); }
.rc-money a { color: inherit; text-decoration: underline; }
.rc-later { font-size: 12px; color: var(--faint); }
.bk-list td { vertical-align: top; }
.bk-list td.num, .bk-list th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bk-list tbody tr { cursor: pointer; }
.bk-list tbody tr:hover td { background: rgba(148, 163, 184, .06); }
.bk-list .code { font-family: var(--font-mono); white-space: nowrap; }
.bk-detail h3 { margin: 18px 0 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bk-detail .bk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bk-detail .bk-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.bk-detail .bk-money div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.bk-detail .bk-money b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.bk-detail .bk-money span { font-size: 11.5px; color: var(--muted); }
.bk-detail ul.plain li { margin: 4px 0; }
.bk-detail .rec { margin-top: 4px; }
.tbl.tk td.mono { white-space: nowrap; }
/* the booking's calls: one call per row, its recording playable (a plain list row is a flex row: the player shrank to nothing) */
.bk-detail ul.bk-calls li { display: block; }
.bk-detail ul.bk-calls .rec audio { min-width: 240px; }
/* a date picker among small buttons in a page head (Daily Report): as wide as its date */
.head-tools .pills .in.sm { width: auto; }

/* Knowledge (2026-11-28, view-knowledge.js): the Brain meter, topic cards, standalone questions, the questions editor, the unanswered list */
.kb-meter { display: grid; gap: 8px; }
.kb-meter-top { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; font-size: 13px; }
.kb-meter-top .i { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; }
.kb-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.kb-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; align-content: start; background: var(--surface-2); min-width: 0; }
.kb-card-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.kb-facts { margin: 0; white-space: pre-wrap; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.kb-card details summary { cursor: pointer; color: var(--muted); }
.kb-dim { opacity: .6; }
.kb-qs li { display: block; }
.kb-qlist li.kb-q { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.kb-qlist li.kb-q:first-child { border-top: 0; }
.kb-qlist li.kb-q > div { min-width: 0; }
.kb-qrow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
@media (max-width: 640px) { .kb-qrow { grid-template-columns: 1fr; } }
.kb-asks li { display: block; }
.kb-asks .rec audio { min-width: 240px; }
.kb-un .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.kb-found .plain li { display: block; }
.kb-found-list li + li { margin-top: 10px; }
