/* ════════════════════════════════════════════════════════════════════
   linq Brand Kit — canonical stylesheet (single source of truth)
   One file. Tokens + chrome (sidebar/topbar/page) + .lq- components.
   No !important. No hardcoded hex outside :root. Drop into static/css/.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Surfaces ─────────────────────────────────────────────── */
  --bg:            #F4F0E8;   /* Bone — paper / page */
  --bg-warm:       #EAE2CE;   /* Bone-warm — strips */
  --panel:         #FAF6EE;   /* Panel cream — cards */
  --panel-soft:    #F5EFE3;   /* alt rows / hover */

  /* ── Ink + text ───────────────────────────────────────────── */
  --ink:           #0F1623;   /* primary text */
  --surface-dark:  #2C2A3A;   /* dark chrome — sidebar + emphasis cards */
  --surface-dark-2:#36344A;   /* lifted dark row */
  --text:          #0F1623;
  --text-muted:    rgba(15,22,35,0.60);
  --text-faint:    rgba(15,22,35,0.40);
  --on-dark:       #F2EBDF;   /* text on dark surfaces */
  --on-dark-muted: rgba(242,237,226,0.58);

  /* ── Brand ────────────────────────────────────────────────── */
  --ocean:         #3B5BDB;   /* primary action / brand */
  --ocean-deep:    #2C46B0;
  --ocean-soft:    rgba(59,91,219,0.10);
  --signal:        #EA6A2C;   /* accent — the dot */
  --signal-deep:   #C9551F;
  --signal-soft:   #FBE2D2;

  /* ── Semantic ─────────────────────────────────────────────── */
  --sage:          #1F9D55;   --sage-soft:   rgba(31,157,85,0.12);
  --amber:         #C98A1E;   --amber-soft:  rgba(201,138,30,0.14);
  --red:           #D14848;   --red-soft:    rgba(209,72,72,0.12);
  --violet:        #7C5CD6;   --violet-soft: rgba(124,92,214,0.12);
  --ai:            #0EA5B5;   --ai-soft:     rgba(14,165,181,0.12);  /* AI-answered (distinct from ocean) */

  /* ── Lines ────────────────────────────────────────────────── */
  --border:        rgba(15,22,35,0.12);
  --border-soft:   rgba(15,22,35,0.07);
  --border-strong: rgba(15,22,35,0.22);

  /* ── Radii ────────────────────────────────────────────────── */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;

  /* ── Type ─────────────────────────────────────────────────── */
  --font-display: 'Public Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Archivo Narrow', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ── Elevation (soft, warm-tinted) ────────────────────────── */
  --e-1: 0 1px 2px rgba(15,22,35,.05);
  --e-2: 0 10px 30px -12px rgba(15,22,35,.14);
  --e-3: 0 32px 70px -28px rgba(15,22,35,.30);

  --sidebar-w: 252px;
  --sidebar-bg: var(--surface-dark);
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-display);
  color: var(--text);
  background:
    radial-gradient(900px 650px at 88% 4%, rgba(234,106,44,0.05), transparent 60%),
    radial-gradient(820px 560px at 2% 94%, rgba(59,91,219,0.045), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
a { color: inherit; }

/* ══════════════════════════════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════════════════════════════ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--on-dark-muted);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; height: 100vh;
}
.side-logo { display: flex; align-items: center; gap: 11px; padding: 4px 8px 0; text-decoration: none; }
.side-logo .wm { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; color: #fff; line-height: 1; }
.side-logo .edit-chip {
  margin-left: auto; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--on-dark-muted);
  border: 1px solid rgba(255,255,255,0.18); border-radius: var(--r-sm); padding: 3px 9px; cursor: pointer;
}
.side-search {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--r-pill); padding: 9px 14px; color: rgba(255,255,255,0.6);
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.02em;
}
.side-search .kbd { margin-left: auto; font-size: 0.7rem; border: 1px solid rgba(255,255,255,0.22); border-radius: 5px; padding: 1px 6px; }

.nav-group { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav-group::-webkit-scrollbar { width: 0; height: 0; }
.nav-label {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.40);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 11px;
  border-radius: var(--r-sm); color: rgba(255,255,255,0.78); text-decoration: none;
  font-size: 0.92rem; font-weight: 500; transition: background .15s, color .15s;
}
.nav-item i { font-size: 1.05rem; width: 20px; text-align: center; opacity: 0.9; }
.nav-item .badge {
  margin-left: auto; font-family: var(--font-mono); font-size: 0.74rem;
  background: rgba(255,255,255,0.14); color: #fff; padding: 1px 8px;
  border-radius: var(--r-pill); letter-spacing: 0.02em;
}
.nav-item .dot-live { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px rgba(31,157,85,0.22); }
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: #fff; color: var(--ink); font-weight: 600; }
.nav-item.active i { opacity: 1; color: var(--ocean); }
.nav-item.active .badge { background: var(--signal); color: #fff; }

.side-foot { display: flex; align-items: center; gap: 11px; padding: 12px 8px 2px; border-top: 1px solid rgba(255,255,255,0.12); }
.side-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,var(--signal),var(--violet)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,0.22); }
.side-foot .who { line-height: 1.25; min-width: 0; }
.side-foot .who b { color: #fff; font-size: 0.86rem; font-weight: 600; display: block; }
.side-foot .who span { color: rgba(255,255,255,0.5); font-size: 0.74rem; font-family: var(--font-mono); }
.side-foot .bi-chevron-expand { margin-left: auto; color: rgba(255,255,255,0.4); }

/* ── Main + Topbar ───────────────────────────────────────────── */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 36px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
  background: rgba(242,235,223,0.82); backdrop-filter: blur(10px);
}
.crumb { display: flex; align-items: center; gap: 9px; font-size: 0.95rem; font-weight: 600; }
.crumb .muted { color: var(--text-faint); font-weight: 500; }
.crumb i { color: var(--text-faint); font-size: 0.8rem; }
.tb-search {
  flex: 1; max-width: 440px; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 9px 16px; color: var(--text-faint); font-size: 0.88rem;
}
.tb-search .lbl { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; color: var(--text-muted); }
.tb-search .kbd { margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.tb-spacer { flex: 1; }
.tb-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--panel); color: var(--text-muted); cursor: pointer; position: relative; text-decoration: none; }
.tb-icon:hover { border-color: var(--border-strong); }
.tb-icon .ping { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; background: var(--signal); border-radius: 50%; border: 2px solid var(--panel); }
.tb-icon.live-dot::after { content:''; position:absolute; top:9px; right:10px; width:7px; height:7px; border-radius:50%; background:var(--sage); }

.page { padding: 30px 36px 64px; max-width: 1380px; width: 100%; }

/* ══════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-display); font-size: 0.88rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: var(--r-pill); padding: 9px 16px; transition: border-color .15s, background .15s, transform .1s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ocean); border-color: var(--ocean); color: #fff; }
.btn.primary:hover { background: var(--ocean-deep); border-color: var(--ocean-deep); }
.btn.signal { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.signal:hover { background: var(--signal-deep); border-color: var(--signal-deep); }
.btn.dark { background: var(--surface-dark); border-color: var(--surface-dark); color: var(--on-dark); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 0.82rem; }

/* ══════════════════════════════════════════════════════════════════
   EYEBROW + PAGE HEAD
   ══════════════════════════════════════════════════════════════════ */
.lq-eyebrow {
  display: inline-flex; align-items: center; font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--text-muted);
}
.lq-eyebrow::before { content:''; width: 6px; height: 6px; background: var(--signal); border-radius: 50%; margin-right: 0.7em; flex-shrink: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head h1 { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 10px; line-height: 1.05; }
.page-head .count { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.95rem; margin-top: 4px; }
.page-head .sub { color: var(--text-muted); font-size: 0.96rem; margin-top: 4px; }
.head-actions { display: flex; align-items: center; gap: 10px; }

/* ══════════════════════════════════════════════════════════════════
   SEGMENTED CONTROL / FILTER TABS / VIEW + STATUS CHIPS
   ══════════════════════════════════════════════════════════════════ */
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg button, .seg a {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; font-weight: 500;
  border: 0; background: transparent; color: var(--text-muted); padding: 6px 15px;
  border-radius: var(--r-pill); cursor: pointer; text-decoration: none;
}
.seg button.active, .seg a.active { background: var(--surface-dark); color: var(--on-dark); }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tab {
  font-size: 0.88rem; font-weight: 600; color: var(--text-muted); cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 8px 18px; transition: border-color .15s, color .15s, background .15s; text-decoration: none;
}
.filter-tab:hover { border-color: var(--border-strong); color: var(--text); }
.filter-tab.active { background: var(--signal-soft); border-color: rgba(234,106,44,0.3); color: var(--signal-deep); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.view-chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 0.84rem; font-weight: 500;
  color: var(--text-muted); background: transparent; border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 7px 14px; cursor: pointer; text-decoration: none;
}
.view-chip i { font-size: 0.9rem; opacity: 0.7; }
.view-chip:hover { border-color: var(--border-strong); color: var(--text); }
.view-chip.input { color: var(--text-faint); border-style: dashed; }

/* status filter chip (dot + label) */
.stat-chip {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono);
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
  color: var(--text-muted); cursor: pointer; padding: 5px 4px; background: none; border: 0;
}
.stat-chip::before { content:''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stat-chip.s-submitted { color: var(--amber); }
.stat-chip.s-assigned  { color: var(--ocean); }
.stat-chip.s-enroute   { color: var(--violet); }
.stat-chip.s-progress  { color: var(--signal-deep); }
.stat-chip.s-done      { color: var(--sage); }
.stat-chip.s-invoiced  { color: var(--sage); }
.stat-chip.s-cancelled { color: var(--text-faint); }

/* technician avatar chip (replaces the rainbow chips) */
.tech-chip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; font-weight: 500;
  color: var(--text); background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 4px 12px 4px 4px; cursor: pointer; text-decoration: none;
}
.tech-chip:hover { border-color: var(--border-strong); }
.tech-chip .av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 0.7rem; font-weight: 700; font-family: var(--font-mono); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════
   PILLS (status)
   ══════════════════════════════════════════════════════════════════ */
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid transparent; white-space: nowrap;
}
.pill::before { content:''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ocean  { color: var(--ocean);       background: var(--ocean-soft);  border-color: rgba(59,91,219,0.22); }
.pill.signal { color: var(--signal-deep); background: var(--signal-soft); border-color: rgba(234,106,44,0.28); }
.pill.sage   { color: var(--sage);        background: var(--sage-soft);   border-color: rgba(31,157,85,0.22); }
.pill.amber  { color: var(--amber);       background: var(--amber-soft);  border-color: rgba(201,138,30,0.26); }
.pill.violet { color: var(--violet);      background: var(--violet-soft); border-color: rgba(124,92,214,0.24); }
.pill.red    { color: var(--red);         background: var(--red-soft);    border-color: rgba(209,72,72,0.22); }
.pill.ghost  { color: var(--text-muted);  background: rgba(15,22,35,0.05);border-color: var(--border); }

/* ══════════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════════ */
.lq-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-direction: column; }
.lq-card.pad-lg { padding: 28px 30px; }
.lq-card.dark { background: var(--surface-dark); color: var(--on-dark); border-color: rgba(255,255,255,0.1); position: relative; }
.lq-card.dark .lq-eyebrow { color: rgba(242,237,226,0.6); }
.lq-card.dark .card-head h2 { color: #fff; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.card-head .link { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.card-head .link:hover { color: var(--signal); }
.lq-card.dark .card-head .link { color: rgba(242,237,226,0.6); }

/* ══════════════════════════════════════════════════════════════════
   KPI STRIP + REPORT STAT CARDS
   ══════════════════════════════════════════════════════════════════ */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.kpi { background: var(--panel); padding: 20px 22px; display: flex; flex-direction: column; gap: 11px; }
.kpi .k-label { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.kpi .k-label i { color: var(--text-faint); font-size: 0.95rem; }
.kpi .k-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 2.5rem; font-weight: 500; letter-spacing: -0.02em; line-height: 0.95; }
.kpi .k-num .u { color: var(--signal); }
.kpi .k-foot { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.delta.up { color: var(--sage); } .delta.down { color: var(--red); }

/* standalone stat card (reports top row) */
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.stat-card .s-label { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--text-muted); }
.stat-card .s-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 2.6rem; font-weight: 500; letter-spacing: -0.02em; line-height: 0.9; }
.s-num.ocean { color: var(--ocean); } .s-num.signal { color: var(--signal); } .s-num.sage { color: var(--sage); }

/* ══════════════════════════════════════════════════════════════════
   TABLES + LIST ROWS
   ══════════════════════════════════════════════════════════════════ */
.lq-table { width: 100%; border-collapse: collapse; }
.lq-table thead th { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.13em; color: var(--text-muted); text-align: left; padding: 8px 14px 12px; border-bottom: 1px solid var(--border); }
.lq-table tbody td { padding: 14px; font-size: 0.92rem; border-bottom: 1px dashed var(--border); vertical-align: middle; }
.lq-table tbody tr:last-child td { border-bottom: 0; }
.lq-table tbody tr { transition: background .12s; cursor: pointer; }
.lq-table tbody tr:hover { background: var(--panel-soft); }
.lq-table .id { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.84rem; letter-spacing: 0.03em; }
.lq-table .strong { font-weight: 600; }
.lq-table .strong small { display: block; font-weight: 400; color: var(--text-muted); font-size: 0.78rem; }
.lq-table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.lq-table .muted { color: var(--text-muted); }

/* job list row (card-style list, like the screenshot but cleaned up) */
.list-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.list-row { display: grid; grid-template-columns: 96px 1fr 1.1fr auto auto; align-items: center; gap: 18px; padding: 16px 22px; border-bottom: 1px dashed var(--border); cursor: pointer; transition: background .12s; text-decoration: none; color: inherit; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--panel-soft); }
.list-row .id { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.86rem; letter-spacing: 0.03em; }
.list-row .title { font-weight: 600; font-size: 0.98rem; }
.list-row .loc { color: var(--text-muted); font-size: 0.9rem; display: inline-flex; align-items: center; gap: 7px; }
.list-row .loc i { font-size: 0.85rem; color: var(--text-faint); }
.list-row .when { font-family: var(--font-mono); font-size: 0.84rem; color: var(--text-muted); white-space: nowrap; }

/* brand-dot — tiny colored circle in the site's accent colour, used on jobs &
   inquiries list rows in place of a full text brand pill. The brand name lives
   on title= / aria-label= so hover + screen readers still get it. */
.brand-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--card-border, rgba(15,22,35,.15));
  vertical-align: middle;
  margin-left: 6px;
  flex-shrink: 0;
}

/* avatar */
.av { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-family: var(--font-mono); flex-shrink: 0; }
.av.sm { width: 26px; height: 26px; font-size: 0.72rem; }
.av.md { width: 34px; height: 34px; font-size: 0.8rem; }
.tech { display: inline-flex; align-items: center; gap: 8px; }
.tech.empty { color: var(--text-faint); }
.tech.empty .av { background: rgba(15,22,35,0.08); color: var(--text-faint); }

/* ══════════════════════════════════════════════════════════════════
   SETTINGS — toggle rows, tab bar
   ══════════════════════════════════════════════════════════════════ */
.tab-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600;
  color: var(--text-muted); background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 9px 16px; cursor: pointer; text-decoration: none; transition: border-color .15s, color .15s;
}
.tab i { font-size: 0.95rem; opacity: 0.8; }
.tab:hover { border-color: var(--border-strong); color: var(--text); }
.tab.active { background: var(--surface-dark); border-color: var(--surface-dark); color: var(--on-dark); }
.tab.active i { color: var(--signal); opacity: 1; }

.setting-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.setting-section-head .ico { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--signal-soft); color: var(--signal-deep); display: grid; place-items: center; font-size: 1.05rem; flex-shrink: 0; }
.setting-section-head h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.setting-desc { color: var(--text-muted); font-size: 0.92rem; margin: 4px 0 0 46px; max-width: 64ch; }

.toggle-row { display: flex; align-items: center; gap: 16px; padding: 16px 4px; border-bottom: 1px dashed var(--border); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .t-label { font-weight: 600; font-size: 0.96rem; }
.toggle-row .t-sub { color: var(--text-muted); font-size: 0.84rem; margin-top: 2px; }
.toggle-row .grow { flex: 1; min-width: 0; }

.switch { position: relative; width: 46px; height: 27px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: rgba(15,22,35,0.16); border-radius: var(--r-pill); transition: background .18s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked ~ .track { background: var(--ocean); }
.switch input:checked ~ .knob { transform: translateX(19px); }

/* select (settings) */
.lq-select { position: relative; }
.lq-select select {
  appearance: none; font-family: var(--font-display); font-size: 0.92rem; font-weight: 500; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 11px 40px 11px 15px; cursor: pointer; min-width: 200px;
}
.lq-select::after { content: '\F282'; font-family: 'bootstrap-icons'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; font-size: 0.8rem; }
.lq-select select:focus { outline: none; border-color: var(--ocean); }

/* ══════════════════════════════════════════════════════════════════
   CHART CHROME (reports)
   ══════════════════════════════════════════════════════════════════ */
.chart-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px 26px; }
.chart-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.03em; }
.legend span::before { content:''; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--ocean)); }

.report-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: border-color .15s, transform .1s, box-shadow .15s; text-decoration: none; color: inherit; }
.report-card:hover { border-color: var(--border-strong); box-shadow: var(--e-2); transform: translateY(-2px); }
.report-card .r-ico { width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 1.2rem; background: var(--ocean-soft); color: var(--ocean); }
.report-card h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.report-card p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════════ */
.grid { display: grid; gap: 22px; }
.grid.g2 { grid-template-columns: 1fr 1fr; }
.grid.g3 { grid-template-columns: repeat(3,1fr); }
.grid.g4 { grid-template-columns: repeat(4,1fr); }
.grid.report-main { grid-template-columns: 1.6fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.mb-l { margin-bottom: 26px; } .mb-m { margin-bottom: 18px; } .mb-s { margin-bottom: 12px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mini-note { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); letter-spacing: 0.04em; margin-top: 22px; }

@media (max-width: 1100px) {
  .grid.g4, .kpi-strip { grid-template-columns: repeat(2,1fr); }
  .grid.g3, .grid.g2, .grid.report-main { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════
   SHARED PRIMITIVES (system-wide gaps from the redesign handoff)
   ══════════════════════════════════════════════════════════════════ */

/* ── KPI card with sparkline + delta (the canonical stat unit) ─── */
.kpi-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.kpi-card .kc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kpi-card .kc-label { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--text-muted); display: inline-flex; align-items: center; gap: 8px; }
.kpi-card .kc-label i { color: var(--text-faint); font-size: 0.95rem; }
.kpi-card .kc-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 2.3rem; font-weight: 500; letter-spacing: -0.02em; line-height: 0.95; }
.kpi-card .kc-num .u { color: var(--signal); }
.kpi-card .kc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-card .kc-delta { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; }
.kpi-card .kc-delta.up { color: var(--sage); } .kpi-card .kc-delta.down { color: var(--red); } .kpi-card .kc-delta.flat { color: var(--text-muted); }
.kpi-card .kc-since { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-faint); }
.lq-spark { width: 84px; height: 30px; display: block; flex-shrink: 0; }
.lq-spark polyline { fill: none; stroke: var(--ocean); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lq-spark .area { fill: var(--ocean-soft); stroke: none; }

/* ── Empty state ──────────────────────────────────────────────── */
.lq-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 32px; gap: 12px; }
.lq-empty .e-ico { width: 56px; height: 56px; border-radius: var(--r-md); background: var(--bg-warm); color: var(--text-faint); display: grid; place-items: center; font-size: 1.6rem; }
.lq-empty h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.lq-empty p { color: var(--text-muted); font-size: 0.9rem; max-width: 38ch; line-height: 1.5; }
.lq-empty .btn { margin-top: 4px; }

/* ── Loading skeleton ─────────────────────────────────────────── */
.sk { position: relative; overflow: hidden; background: rgba(15,22,35,0.06); border-radius: var(--r-sm); }
.sk::after { content:''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent); transform: translateX(-100%); animation: sk-shimmer 1.4s infinite; }
@keyframes sk-shimmer { 100% { transform: translateX(100%); } }
.sk.line { height: 12px; margin-bottom: 10px; } .sk.line.short { width: 55%; } .sk.line.med { width: 75%; }
.sk.title { height: 20px; width: 40%; margin-bottom: 16px; } .sk.circle { border-radius: 50%; } .sk.block { height: 120px; border-radius: var(--r-md); }

/* ── Toasts / inline alerts ───────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px; border-radius: var(--r-md); border: 1px solid; font-size: 0.9rem; font-weight: 500; }
.alert i { font-size: 1.05rem; margin-top: 1px; flex-shrink: 0; }
.alert.success { background: var(--sage-soft);  border-color: rgba(31,157,85,0.3);  color: #166534; }
.alert.error   { background: var(--red-soft);   border-color: rgba(209,72,72,0.32); color: #9a2a2a; }
.alert.warn    { background: var(--amber-soft); border-color: rgba(201,138,30,0.34);color: #8a5a12; }
.alert.info    { background: var(--ocean-soft); border-color: rgba(59,91,219,0.28); color: var(--ocean-deep); }

/* ── Sticky bulk-action bar ───────────────────────────────────── */
.bulk-bar { display: flex; align-items: center; gap: 14px; background: var(--surface-dark); color: var(--on-dark); border-radius: var(--r-pill); padding: 10px 12px 10px 20px; box-shadow: var(--e-3); }
.bulk-bar .bb-count { font-family: var(--font-mono); font-size: 0.84rem; letter-spacing: 0.04em; }
.bulk-bar .bb-count b { color: var(--signal); }
.bulk-bar .bb-sep { width: 1px; height: 22px; background: rgba(255,255,255,0.16); }
.bulk-bar .bb-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; font-weight: 600; color: var(--on-dark); background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.16); border-radius: var(--r-pill); padding: 7px 14px; cursor: pointer; }
.bulk-bar .bb-btn:hover { background: rgba(255,255,255,0.18); }
.bulk-bar .bb-btn.danger { color: #ffb4b4; }
.bulk-bar .bb-close { margin-left: 4px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--on-dark-muted); cursor: pointer; }
.bulk-bar .bb-close:hover { background: rgba(255,255,255,0.12); }

/* ── Context menu (right-click) ───────────────────────────────── */
.ctx-menu { width: 220px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--e-3); padding: 6px; }
.ctx-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-sm); font-size: 0.88rem; font-weight: 500; color: var(--text); cursor: pointer; }
.ctx-item i { font-size: 0.95rem; color: var(--text-muted); width: 18px; text-align: center; }
.ctx-item .sc { margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.ctx-item:hover { background: var(--panel-soft); }
.ctx-item.danger { color: var(--red); } .ctx-item.danger i { color: var(--red); }
.ctx-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.ctx-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); padding: 8px 11px 4px; }

/* ── Drawer (slide-in panel) ──────────────────────────────────── */
.drawer { width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--e-3); display: flex; flex-direction: column; overflow: hidden; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.drawer-head .x { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-muted); cursor: pointer; border: 1px solid var(--border); }
.drawer-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }

/* ── Command palette (Ctrl-K) ─────────────────────────────────── */
.cmdk { width: 560px; max-width: 92vw; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--e-3); overflow: hidden; }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.cmdk-input i { font-size: 1.1rem; color: var(--text-faint); }
.cmdk-input input { flex: 1; border: 0; background: transparent; font-family: var(--font-display); font-size: 1.02rem; color: var(--text); outline: none; }
.cmdk-input input::placeholder { color: var(--text-faint); }
.cmdk-input .kbd { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; }
.cmdk-list { padding: 8px; max-height: 340px; overflow-y: auto; }
.cmdk-sec { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); padding: 10px 12px 5px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 0.92rem; cursor: pointer; }
.cmdk-item i { width: 20px; text-align: center; color: var(--text-muted); }
.cmdk-item .meta { margin-left: auto; font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-faint); }
.cmdk-item.active, .cmdk-item:hover { background: var(--surface-dark); color: var(--on-dark); }
.cmdk-item.active i, .cmdk-item:hover i { color: var(--signal); }
.cmdk-item.active .meta, .cmdk-item:hover .meta { color: var(--on-dark-muted); }

/* ── Progress bar (goals, capacity) ───────────────────────────── */
.lq-progress { height: 8px; border-radius: var(--r-pill); background: rgba(15,22,35,0.08); overflow: hidden; }
.lq-progress > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--ocean); }
.lq-progress > span.signal { background: var(--signal); } .lq-progress > span.sage { background: var(--sage); }

/* ── Responsive table → card-stack (below 720px) ──────────────── */
@media (max-width: 720px) {
  .lq-table.stackable thead { display: none; }
  .lq-table.stackable tbody tr { display: block; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 12px; padding: 6px 0; }
  .lq-table.stackable tbody td { display: flex; justify-content: space-between; gap: 16px; border: 0; padding: 8px 16px; text-align: right; }
  .lq-table.stackable tbody td::before { content: attr(data-label); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); text-align: left; }
}

/* ══════════════════════════════════════════════════════════════════
   TOPBAR TITLE (single header — hoisted from .page-head)
   ══════════════════════════════════════════════════════════════════ */
.topbar { gap: 16px; }
.topbar .tb-titlewrap { display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; min-width: 0; }
.topbar .tb-parent { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); line-height: 1; }
.topbar .tb-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; }
.topbar .tb-sub { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; align-self: center; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar .tb-spacer { flex: 1 1 auto; min-width: 8px; }
.topbar .head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar .head-actions .seg { flex-shrink: 0; }
.topbar .tb-icon { flex-shrink: 0; }
@media (max-width: 1200px) { .topbar .tb-sub { display: none; } }

/* dashboard greeting (kept in-page, not a duplicate of the topbar section) */
.dash-greeting { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.dash-greeting h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 8px; line-height: 1.05; }
.dash-greeting .count, .dash-greeting .sub { color: var(--text-muted); font-size: 0.95rem; margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════════
   MULTI-SELECT — checkbox, selected row, fixed bulk bar
   ══════════════════════════════════════════════════════════════════ */
.lq-check { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--panel); cursor: pointer; position: relative; flex-shrink: 0; vertical-align: middle; margin: 0; }
.lq-check:hover { border-color: var(--ocean); }
.lq-check:checked { background: var(--ocean); border-color: var(--ocean); }
.lq-check:checked::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lq-table th.sel-col, .lq-table td.sel-col { width: 42px; padding-right: 0; text-align: center; }
.lq-table tbody tr.is-sel { background: var(--signal-soft); }
.list-card.selectable .list-row { grid-template-columns: 26px 96px 1fr 1.1fr auto auto; }
.list-card.selectable .list-row .lq-check { align-self: center; }
.list-card .list-row.is-sel { background: var(--signal-soft); }

.bulk-bar.is-fixed { position: fixed; left: 50%; bottom: 26px; z-index: 60; transform: translateX(-50%) translateY(18px); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.bulk-bar.is-fixed.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ══════════════════════════════════════════════════════════════════
   INBOX (two-pane) — conversations + thread
   ══════════════════════════════════════════════════════════════════ */
.lq-inbox { display: grid; grid-template-columns: 340px 1fr; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; height: calc(100vh - 200px); min-height: 520px; }
.inbox-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.inbox-list-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.inbox-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px; }
.inbox-seg button { flex: 1; font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.04em; border: 0; background: transparent; color: var(--text-muted); padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer; }
.inbox-seg button.active { background: var(--surface-dark); color: var(--on-dark); }
.inbox-convs { overflow-y: auto; flex: 1; min-height: 0; }
.conv { display: flex; gap: 11px; padding: 13px 16px; border-bottom: 1px dashed var(--border); cursor: pointer; }
.conv:hover { background: var(--panel-soft); }
.conv.active { background: var(--signal-soft); }
.conv .c-body { flex: 1; min-width: 0; }
.conv .c-top { display: flex; align-items: baseline; gap: 8px; }
.conv .c-name { font-weight: 600; font-size: 0.9rem; }
.conv .c-time { margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.conv .c-prev { font-size: 0.84rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv .c-unread { width: 18px; height: 18px; border-radius: 50%; background: var(--ocean); color: #fff; font-family: var(--font-mono); font-size: 0.68rem; display: grid; place-items: center; flex-shrink: 0; align-self: center; }
.inbox-thread { display: flex; flex-direction: column; min-height: 0; }
.thread-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.thread-head .th-meta { min-width: 0; } .thread-head .th-meta b { font-size: 0.96rem; } .thread-head .th-meta div { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); }
.thread-body { flex: 1; overflow-y: auto; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); }
.msg { max-width: 72%; padding: 11px 15px; border-radius: var(--r-lg); font-size: 0.9rem; line-height: 1.45; }
.msg .m-time { display: block; font-family: var(--font-mono); font-size: 0.68rem; margin-top: 5px; opacity: 0.6; }
.msg.in { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--surface-dark); color: var(--on-dark); border-bottom-right-radius: 4px; }
.thread-compose { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.thread-compose input { flex: 1; border: 1px solid var(--border); background: var(--bg); border-radius: var(--r-pill); padding: 11px 16px; font-family: var(--font-display); font-size: 0.92rem; outline: none; }
.thread-compose input:focus { border-color: var(--ocean); }

/* ══════════════════════════════════════════════════════════════════
   CALENDAR (week grid)
   ══════════════════════════════════════════════════════════════════ */
.lq-cal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: 56px repeat(7, 1fr); }
.cal-h { padding: 12px 10px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border-soft); text-align: center; }
.cal-h:first-child { border-left: 0; }
.cal-h .d { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.cal-h .n { font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
.cal-h.today .n { color: var(--signal); }
.cal-time { padding: 8px 8px 0; text-align: right; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); border-top: 1px solid var(--border-soft); }
.cal-cell { min-height: 58px; border-left: 1px solid var(--border-soft); border-top: 1px solid var(--border-soft); padding: 4px; position: relative; }
.cal-ev { display: block; font-size: 0.76rem; font-weight: 600; padding: 4px 7px; border-radius: 6px; margin-bottom: 3px; border-left: 3px solid; line-height: 1.25; }
.cal-ev .t { font-family: var(--font-mono); font-weight: 400; opacity: 0.7; font-size: 0.7rem; }
.cal-ev.ocean  { background: var(--ocean-soft);  border-color: var(--ocean);  color: var(--ocean-deep); }
.cal-ev.signal { background: var(--signal-soft); border-color: var(--signal); color: var(--signal-deep); }
.cal-ev.sage   { background: var(--sage-soft);   border-color: var(--sage);   color: #166534; }
.cal-ev.violet { background: var(--violet-soft); border-color: var(--violet); color: #5b3fa8; }

/* ══════════════════════════════════════════════════════════════════
   DASHBOARD — page tabs, exception tiles, dispatch kanban, team strip
   ══════════════════════════════════════════════════════════════════ */
.page-tabs { display: inline-flex; gap: 4px; margin-bottom: 22px; }
.page-tab { font-size: 0.92rem; font-weight: 600; color: var(--text-muted); padding: 8px 16px; border-radius: var(--r-sm); text-decoration: none; cursor: pointer; }
.page-tab:hover { background: var(--panel); color: var(--text); }
.page-tab.active { background: var(--surface-dark); color: var(--on-dark); }

.section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.section-label h2 { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.section-label .hint { font-size: 0.8rem; color: var(--text-faint); }

/* exception tiles */
.exc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.exc-tile { background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--border-strong); border-radius: var(--r-lg); padding: 18px 20px; cursor: pointer; transition: box-shadow .15s, transform .1s; }
.exc-tile:hover { box-shadow: var(--e-2); transform: translateY(-2px); }
.exc-tile.alert { border-top-color: var(--red); }
.exc-tile.warn  { border-top-color: var(--amber); }
.exc-tile.info  { border-top-color: var(--ocean); }
.exc-tile.money { border-top-color: var(--signal); }
.exc-tile .et-label { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.exc-tile .et-label i { font-size: 1rem; color: var(--text-muted); }
.exc-tile .et-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 2.3rem; font-weight: 500; letter-spacing: -0.02em; line-height: 0.95; }
.exc-tile.alert .et-num { color: var(--red); } .exc-tile.money .et-num { color: var(--signal); }
.exc-tile .et-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }

/* dispatch kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.kb-col { background: #F0EBE0; border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 120px; }
.kb-head { display: flex; align-items: center; gap: 9px; padding: 13px 15px; }
.kb-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.kb-head .lbl { font-weight: 700; font-size: 0.9rem; }
.kb-head .cnt { margin-left: auto; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 1px 9px; }
.kb-body { display: flex; flex-direction: column; gap: 9px; padding: 0 11px 11px; }
.kb-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 13px; cursor: grab; box-shadow: var(--e-1); }
.kb-card:hover { border-color: var(--border-strong); }
.kb-card .kc-cust { font-weight: 600; font-size: 0.88rem; }
.kb-card .kc-svc { font-size: 0.8rem; color: var(--text-muted); margin: 2px 0 9px; }
.kb-more { text-align: center; font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); padding: 9px; cursor: pointer; }
.kb-more:hover { color: var(--signal); }
.kb-empty { display: grid; place-items: center; color: var(--text-faint); font-size: 0.82rem; border: 1px dashed var(--border); border-radius: var(--r-md); margin: 0 11px 11px; padding: 22px; }
.pill.notech { color: var(--red); background: var(--red-soft); border-color: rgba(209,72,72,0.22); }

/* team availability strip */
.team-strip { display: flex; gap: 12px; flex-wrap: wrap; }
.team-card { display: flex; align-items: center; gap: 11px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 16px 10px 10px; }
.team-card .av { position: relative; }
.team-card .av .s { position: absolute; bottom: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); }
.s.free { background: var(--sage); } .s.busy { background: var(--signal); } .s.off { background: var(--text-faint); }
.team-card .tc-name { font-weight: 600; font-size: 0.9rem; }
.team-card .tc-stat { font-family: var(--font-mono); font-size: 0.74rem; }
.tc-stat.free { color: var(--sage); } .tc-stat.busy { color: var(--signal-deep); } .tc-stat.off { color: var(--text-faint); }

@media (max-width: 1100px){ .exc-grid { grid-template-columns: repeat(2,1fr); } }

/* ══════════════════════════════════════════════════════════════════
   SWIPEABLE ANALYTICS CARD (flick between metrics — great on mobile)
   ══════════════════════════════════════════════════════════════════ */
.swipe-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.swipe-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 6px; }
.swipe-head h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.swipe-dots { display: flex; gap: 6px; }
.swipe-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(15,22,35,.16); cursor: pointer; transition: width .2s, background .2s; }
.swipe-dots button.on { width: 20px; background: var(--ocean); }
.swipe-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.swipe-track::-webkit-scrollbar { display: none; }
.swipe-panel { flex: 0 0 100%; scroll-snap-align: start; padding: 12px 20px 22px; }
.swipe-panel .sp-label { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.swipe-panel .sp-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 2.8rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1; margin: 12px 0 10px; }
.swipe-panel .sp-num .u { color: var(--signal); }
.swipe-panel .sp-foot { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); }
.swipe-panel .sp-chart { margin-top: 16px; }
.swipe-hint { display: none; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); letter-spacing: 0.06em; }

/* ══════════════════════════════════════════════════════════════════
   MOBILE BACK BUTTON + helpers
   ══════════════════════════════════════════════════════════════════ */
.hamburger { display: none; }
.mobile-tabbar { display: none; }
.sidebar-overlay { display: none; }

/* ══════════════════════════════════════════════════════════════════
   TABLET  (≤1023px)  — sidebar becomes an off-canvas drawer
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 284px; z-index: 90; transform: translateX(-100%); transition: transform .26s ease; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .sidebar.open { transform: none; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(15,22,35,.45); z-index: 85; opacity: 0; pointer-events: none; transition: opacity .26s; }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
  .topbar { padding: 11px 16px; gap: 12px; }
  .hamburger { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--panel); color: var(--text); cursor: pointer; font-size: 1.15rem; }
  .topbar .tb-title { font-size: 1.05rem; }
  .page { padding: 18px 18px 96px; }
  .map-layout, .job-summary, .grid.report-main { grid-template-columns: 1fr; }
  .mobile-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 62px; z-index: 80; background: var(--surface-dark); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--on-dark-muted); text-decoration: none; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.04em; }
  .mobile-tabbar a i { font-size: 1.25rem; }
  .mobile-tabbar a.active { color: #fff; }
  .mobile-tabbar a.active i { color: var(--signal); }
  .mobile-tabbar a.mt-fab { justify-content: flex-end; padding-bottom: 8px; color: var(--on-dark-muted); }
  .mobile-tabbar a.mt-fab .circ { width: 56px; height: 56px; border-radius: 50%; background: var(--signal); color: #fff; display: grid; place-items: center; margin-top: -26px; margin-bottom: 3px; box-shadow: 0 6px 16px rgba(234,106,44,.45); border: 3px solid var(--surface-dark); }
  .mobile-tabbar a.mt-fab .circ i { font-size: 1.5rem; }
}

/* ══════════════════════════════════════════════════════════════════
   PHONE  (≤640px)  — card rails instead of long vertical stacks
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Header row was overflowing (title + actions + icons on one line forced
     the page wider than the viewport → sideways scroll). Let the topbar wrap
     and drop the head-actions onto their own full-width row BELOW the header:
     row 1 = hamburger · title · icons, row 2 = the page action buttons. */
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar .tb-spacer { order: 1; }
  .topbar .tb-icon { order: 2; }
  .topbar .head-actions { order: 3; flex-basis: 100%; width: 100%; gap: 8px; }
  .topbar .head-actions .btn { flex: 1 1 auto; justify-content: center; }
  .topbar .head-actions .btn .bi-chevron-down { display: none; }
  .page-tabs { overflow-x: auto; }

  /* KPI / exception / 4-up grids → horizontal swipe rail with peek */
  .kpi-strip, .exc-grid, .grid.g4, .grid.g3, .team-strip {
    display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 12px;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    background: transparent; border: 0; padding: 2px 16px 8px; margin: 0 -16px;
  }
  .kpi-strip::-webkit-scrollbar, .exc-grid::-webkit-scrollbar, .grid.g4::-webkit-scrollbar,
  .grid.g3::-webkit-scrollbar, .team-strip::-webkit-scrollbar { display: none; }
  .kpi-strip > *, .exc-grid > *, .grid.g4 > *, .grid.g3 > * {
    flex: 0 0 80%; scroll-snap-align: start;
    border: 1px solid var(--border); border-radius: var(--r-lg);
  }
  .team-strip > * { flex: 0 0 auto; scroll-snap-align: start; }
  .swipe-hint { display: inline; }

  /* stacks */
  .grid.g2, .grid.report-main, .job-summary, .map-layout { grid-template-columns: 1fr; }
  .photo-zones { grid-template-columns: 1fr; }
  .kanban { grid-auto-columns: 82%; }
  .lq-inbox { grid-template-columns: 1fr; height: auto; }
  .lq-inbox .inbox-thread { display: none; }            /* list-first on phone */
  .lq-inbox.show-thread .inbox-list { display: none; }
  .lq-inbox.show-thread .inbox-thread { display: flex; min-height: 60vh; }
  .map-stage { min-height: 320px; }

  /* tighten page heads / cards */
  .dash-greeting { flex-direction: column; align-items: flex-start; gap: 14px; }
  .dash-greeting .row { width: 100%; }
  .dash-greeting .row .btn { flex: 1; justify-content: center; }
  .lq-card { padding: 18px; }
  .filter-tabs, .chip-row { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 4px; }
  .filter-tabs::-webkit-scrollbar, .chip-row::-webkit-scrollbar { display: none; }
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tab-bar::-webkit-scrollbar { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   DISPATCHER cockpit (promoted from page-local — first user is
   dashboard/dispatcher.html). Reuse on any operator surface that
   needs a pulse strip, an active-call card, a callback list, or
   an inline quick-book form. All tokens, no hardcoded hex.
   ══════════════════════════════════════════════════════════════════ */

/* live-status line that sits under the page tabs */
.disp-top   { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.disp-live  { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.live-clock { font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.04em; color: var(--text-muted); display: inline-flex; align-items: center; gap: 8px; }
.live-clock .rec { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 0 rgba(31,157,85,.5); animation: lq-pulse-dot 2.2s infinite; }
.disp-tally { font-size: 0.9rem; color: var(--text-muted); }
.disp-tally b { color: var(--text); font-weight: 700; }

@keyframes lq-pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(31,157,85,.45); } 70% { box-shadow: 0 0 0 7px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }
@keyframes lq-ring-dot  { 0% { box-shadow: 0 0 0 0 rgba(31,157,85,.5); } 70% { box-shadow: 0 0 0 11px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }

/* pulse strip — N compact live counters with hairline dividers (cousin of .kpi-strip, half the chrome) */
.pulse-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.pulse { background: var(--panel); padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; transition: background .14s; text-decoration: none; color: inherit; }
.pulse:hover { background: var(--panel-soft); }
.pulse .p-label { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--text-muted); display: flex; align-items: center; gap: 7px; }
.pulse .p-label i { color: var(--text-faint); font-size: 0.9rem; }
.pulse .p-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 2rem; font-weight: 500; letter-spacing: -0.02em; line-height: 0.95; }
.pulse .p-sub { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-faint); }
.pulse.hot .p-num  { color: var(--signal); }
.pulse.live .p-label .ring { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); animation: lq-ring-dot 1.6s infinite; }

/* intake row + money row layouts (used by dispatcher; reusable on any 3-up / 2-up card row) */
.intake-grid { display: grid; grid-template-columns: 1.15fr 1fr 1.1fr; gap: 16px; }
.queue-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* mini head used inside .lq-card when the card holds a sub-section, not a full page section */
.card-mini-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-mini-head h3 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.card-mini-head .tag { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--text-muted); }
.card-mini-head .link { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); text-decoration: none; }
.card-mini-head .link:hover { color: var(--signal); }

/* active incoming-call card */
.call-card { border: 1px solid rgba(31,157,85,0.4); background: linear-gradient(180deg, rgba(31,157,85,0.05), transparent 60%), var(--panel); border-radius: var(--r-md); padding: 15px 16px; }
.call-card .cc-line { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage); margin-bottom: 11px; }
.call-card .cc-line .ring { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); animation: lq-ring-dot 1.4s infinite; }
.call-id { display: flex; align-items: center; gap: 12px; }
.call-id .av { width: 42px; height: 42px; font-size: 0.92rem; background: var(--ocean); }
.call-id .ci-name { font-weight: 700; font-size: 1.02rem; }
.call-id .ci-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; }
.call-actions { display: flex; gap: 8px; margin-top: 14px; }
.call-actions .btn { flex: 1; justify-content: center; }
.btn.answer { background: var(--sage); border-color: var(--sage); color: #fff; }
.btn.answer:hover { background: #178045; border-color: #178045; color: #fff; }

/* callback / missed row */
.cb-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.cb-row:last-child { border-bottom: 0; }
.cb-row .av { width: 34px; height: 34px; font-size: 0.78rem; background: var(--violet); }
.cb-row .cb-body { min-width: 0; flex: 1; }
.cb-row .cb-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-row .cb-meta { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-muted); margin-top: 1px; }
.cb-row .btn    { flex-shrink: 0; white-space: nowrap; }

/* quick-book form */
.qbook  { display: flex; flex-direction: column; gap: 12px; }
.qfield label { display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.qfield input, .qfield select {
  width: 100%; appearance: none; font-family: var(--font-display); font-size: 0.92rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px; outline: none;
}
.qfield select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230F162366'%3E%3Cpath d='M4.5 6l3.5 3.5L11.5 6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 14px; padding-right: 36px; }
.qfield input:focus, .qfield select:focus { border-color: var(--ocean); }
.qfield input::placeholder { color: var(--text-faint); }
.qb-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* board head — section title + view toggle (Board / List / Map) on the same row */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; }
.board-head .seg { flex-shrink: 0; }

/* money queue row — customer / svc · amount · action (or pill + amount) */
.q-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px dashed var(--border); }
.q-row:last-child { border-bottom: 0; }
.q-row .q-main { min-width: 0; }
.q-row .q-cust { font-weight: 600; font-size: 0.92rem; }
.q-row .q-svc  { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); margin-top: 1px; }
.q-row .q-amt  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.96rem; }
.q-row .q-amt.muted { color: var(--text-faint); font-weight: 400; }

/* kanban-card bottom row (pill + timestamp) — used by .kb-card consumers that need a tech/status + time line */
.kb-card .kc-row  { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.kb-card .kc-time { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }

@media (max-width: 1100px) {
  .pulse-strip { grid-template-columns: repeat(3, 1fr); }
  .intake-grid { grid-template-columns: 1fr; }
  .queue-grid  { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pulse-strip { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 12px; background: transparent; border: 0; padding: 2px 16px 8px; margin: 0 -16px; scroll-snap-type: x mandatory; }
  .pulse-strip::-webkit-scrollbar { display: none; }
  .pulse-strip > * { flex: 0 0 60%; scroll-snap-align: start; border: 1px solid var(--border); border-radius: var(--r-lg); }
  .disp-top { gap: 12px; }
  .qb-two   { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════
   TECHNICIAN "My Day" — desktop cockpit + mobile-first shell.
   Built for dashboard/tech.html. Two layouts in one template:
     .tech-desktop   shown ≥1024px (lives inside the shared shell)
     .tech-mobile    shown <1024px (full-bleed; shell chrome hidden
                     by body.lq-bleed-mobile below)
   All page-local classes from the design prototypes are promoted
   here so other field surfaces (technician detail, mobile portal,
   bookable widget) can reuse them.
   ══════════════════════════════════════════════════════════════════ */

/* viewport layer switch — only one layout renders at a time.
   The mobile content renders INSIDE the standard linq shell
   (sidebar + topbar + dark .mobile-tabbar from base_lq.html) so
   header + footer match the rest of the platform — no custom
   chrome, no bleed mode. */
.tech-desktop { display: block; }
.tech-mobile  { display: none; }
@media (max-width: 1023px) {
  .tech-desktop { display: none; }
  .tech-mobile  { display: flex; flex-direction: column; gap: 14px; }
}

@keyframes tech-pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(234, 106, 44, .5); }
  70%  { box-shadow: 0 0 0 9px rgba(234, 106, 44, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 106, 44, 0); }
}

/* ──────────────────────────────────────────────────────────────
   DESKTOP — shift bar + 4-up stat strip + my-grid + nextjob hero
   + route map + side stack (msgs / parts / checklist)
   ────────────────────────────────────────────────────────────── */

.shift-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 20px; }
.shift-state { display: flex; align-items: center; gap: 11px; }
.shift-state .clk { width: 42px; height: 42px; border-radius: var(--r-md);
  background: var(--sage-soft); color: var(--sage); display: grid;
  place-items: center; font-size: 1.2rem; }
.shift-state .ss-lbl { font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.shift-state .ss-val { font-weight: 700; font-size: 1rem; }
.shift-state .ss-val em { font-style: normal; color: var(--sage); }
.shift-state .ss-val.off em { color: var(--text-faint); }

/* status segmented control (Available / En route / On site / Break) */
.status-seg { display: inline-flex; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 3px; gap: 2px; }
.status-seg button, .status-seg a { font-family: var(--font-mono); font-size: 0.76rem;
  letter-spacing: 0.04em; border: 0; background: transparent; color: var(--text-muted);
  padding: 7px 14px; border-radius: var(--r-pill); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.status-seg button .bd, .status-seg a .bd { width: 7px; height: 7px;
  border-radius: 50%; background: currentColor; }
.status-seg button.on.avail,   .status-seg a.on.avail   { background: var(--sage);   color: #fff; }
.status-seg button.on.enroute, .status-seg a.on.enroute { background: var(--violet); color: #fff; }
.status-seg button.on.onsite,  .status-seg a.on.onsite  { background: var(--signal); color: #fff; }
.status-seg button.on.brk,     .status-seg a.on.brk     { background: var(--amber);  color: #fff; }

/* day-stats strip (4-up like .kpi-strip but lighter type weight) */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 24px; }
.tstat { background: var(--panel); padding: 16px 20px; display: flex;
  flex-direction: column; gap: 8px; }
.tstat .ts-lbl { font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-muted);
  display: flex; align-items: center; gap: 7px; }
.tstat .ts-lbl i { color: var(--text-faint); }
.tstat .ts-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 1.9rem; font-weight: 500; line-height: 0.95; letter-spacing: -0.02em; }
.tstat .ts-num .u { color: var(--signal); font-size: 1.3rem; }
.tstat .ts-sub { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }

/* main "My Day" grid — left column (hero + route), right column (side stack) */
.my-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px;
  align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 20px; }

/* nextjob hero — dark surface with signal-orange radial glow */
.nextjob { background: var(--surface-dark); color: var(--on-dark);
  border-radius: var(--r-lg); padding: 24px 26px; position: relative;
  overflow: hidden; margin-bottom: 20px; }
.nextjob::after { content: ''; position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(234,106,44,.16), transparent 68%);
  pointer-events: none; }
.nj-eyebrow { font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--signal);
  display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.nj-eyebrow .pulse-dot { width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal); animation: tech-pulse-dot 1.6s infinite; }
.nj-top { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; }
.nj-cust { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.05; }
.nj-svc { font-family: var(--font-mono); font-size: 0.86rem;
  color: var(--on-dark-muted); margin-top: 5px; }
.nj-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 18px 0 4px; }
.nj-meta .m { display: flex; align-items: center; gap: 9px; font-size: 0.92rem; }
.nj-meta .m i { color: var(--signal); font-size: 1rem; }
.nj-meta .m b { font-weight: 700; }
.nj-meta .m span { color: var(--on-dark-muted); }
.nj-note { display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-md); padding: 11px 14px; margin: 18px 0;
  font-size: 0.88rem; color: rgba(242,237,226,.86); }
.nj-note i { color: var(--amber); margin-top: 2px; }
.nj-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.nj-actions .btn, .nj-actions button { border: 0; }
.btn.nav { background: var(--signal); color: #fff; flex: 1;
  justify-content: center; min-width: 150px; }
.btn.nav:hover { background: var(--signal-deep); color: #fff; }
.btn.dk { background: rgba(255,255,255,.10); color: var(--on-dark); }
.btn.dk:hover { background: rgba(255,255,255,.18); color: var(--on-dark); }
.btn.nj-prog { background: rgba(255,255,255,.10); color: var(--on-dark);
  border: 1px solid rgba(255,255,255,.16); }
.btn.nj-prog:hover { background: rgba(255,255,255,.18); color: var(--on-dark); }

/* today's route — map placeholder + ordered stop list */
.route-map { height: 140px; border-radius: var(--r-md);
  border: 1px solid var(--border); margin-bottom: 6px; position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(15,22,35,.04) 0 2px, transparent 2px 11px),
    linear-gradient(180deg, #EAF0EA, #E7EAEF); }
.route-map .rm-lbl { position: absolute; left: 12px; bottom: 10px;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
  background: rgba(255,255,255,.7); padding: 3px 8px; border-radius: 6px; }
.route-map .rm-go { position: absolute; right: 12px; top: 12px; }

.stop { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px;
  align-items: center; padding: 13px 6px;
  border-bottom: 1px dashed var(--border); position: relative; }
.stop:last-child { border-bottom: 0; }
.stop .st-time { font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--text-muted); text-align: right; }
.stop .st-node { position: relative; }
.stop .st-cust { font-weight: 600; font-size: 0.94rem; }
.stop .st-svc { font-family: var(--font-mono); font-size: 0.76rem;
  color: var(--text-muted); margin-top: 1px; }
.stop.done .st-cust { color: var(--text-muted); }
.stop.current { background: var(--signal-soft); border-radius: var(--r-md);
  border-bottom-color: transparent; }
.stop .st-dot { width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--panel); position: absolute; left: -20px; top: 4px;
  box-shadow: 0 0 0 1px var(--border); }
.stop.done .st-dot    { background: var(--sage); }
.stop.current .st-dot { background: var(--signal); }
.stop.next .st-dot    { background: rgba(15,22,35,.2); }

/* mini head for the side-stack cards (msgs / parts / checklist) */
.mini-head { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 13px; }
.mini-head h3 { font-size: 1rem; font-weight: 700; display: flex;
  align-items: center; gap: 9px; }
.mini-head .link { font-family: var(--font-mono); font-size: 0.74rem;
  color: var(--text-muted); text-decoration: none; }
.mini-head .link:hover { color: var(--signal); }

/* dispatch messages */
.msg-row { display: flex; gap: 11px; padding: 10px 0;
  border-bottom: 1px dashed var(--border); }
.msg-row:last-child { border-bottom: 0; }
.msg-row .av { width: 32px; height: 32px; font-size: 0.72rem; background: var(--ocean); }
.msg-row .m-name { font-weight: 600; font-size: 0.86rem; }
.msg-row .m-name .t { font-family: var(--font-mono); font-weight: 400;
  font-size: 0.72rem; color: var(--text-faint); margin-left: 6px; }
.msg-row .m-text { font-size: 0.85rem; color: var(--text-muted); margin-top: 1px; }

/* on-my-truck parts */
.part-row { display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px dashed var(--border); }
.part-row:last-child { border-bottom: 0; }
.part-row .p-name { font-weight: 600; font-size: 0.88rem; flex: 1; }
.part-row .p-qty { font-family: var(--font-mono); font-size: 0.84rem; font-weight: 600; }
.part-row .p-qty.muted { color: var(--text-faint); font-weight: 400; }

/* my-checklist */
.chk-row { display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px dashed var(--border); cursor: pointer; }
.chk-row:last-child { border-bottom: 0; }
.chk-box { width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--border-strong); display: grid; place-items: center;
  flex-shrink: 0; color: transparent; transition: background .14s, border-color .14s; }
.chk-row.done .chk-box { background: var(--sage); border-color: var(--sage);
  color: #fff; font-size: 0.7rem; }
.chk-row .chk-lbl { font-size: 0.9rem; flex: 1; }
.chk-row.done .chk-lbl { color: var(--text-faint); text-decoration: line-through; }

@media (max-width: 1100px) {
  .my-grid    { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1023px) {
  .shift-bar  { gap: 12px; }
  .status-seg { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .status-seg::-webkit-scrollbar { display: none; }
  .nj-actions .btn { flex: 1 1 auto; }
}

/* ──────────────────────────────────────────────────────────────
   MOBILE — VERBATIM PORT of design_handoff_technician/technician-
   mobile.html, scoped under .phone so the prototype's classes
   stay 1:1 with the design (no renaming, no flattening). The
   only adjustments are that .m-tabbar is fixed/absolute to the
   .phone (so it docks to the card on desktop and the viewport on
   real phones), and the desktop .stop rule above stays untouched
   because mobile's .stop is scoped under .phone.
   ────────────────────────────────────────────────────────────── */

/* status segmented (Available / En route / On site / Break + clock-out) */
.tech-mobile .m-status { display: flex; gap: 7px; overflow-x: auto;
  padding: 4px 0 4px; scrollbar-width: none; }
.tech-mobile .m-status::-webkit-scrollbar { display: none; }
.tech-mobile .m-status button { flex: 0 0 auto; font-family: var(--font-mono);
  font-size: 0.8rem; font-weight: 500; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-muted);
  padding: 9px 15px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.tech-mobile .m-status button .bd { width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; }
.tech-mobile .m-status button.on.avail   { background: var(--sage);   border-color: var(--sage);   color: #fff; }
.tech-mobile .m-status button.on.enroute { background: var(--violet); border-color: var(--violet); color: #fff; }
.tech-mobile .m-status button.on.onsite  { background: var(--signal); border-color: var(--signal); color: #fff; }
.tech-mobile .m-status button.on.brk     { background: var(--amber);  border-color: var(--amber);  color: #fff; }
.tech-mobile .m-status .clkout { margin-left: auto; color: var(--text-muted); }

.tech-mobile .sec-label { font-family: var(--font-mono); font-size: 0.72rem;
  font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin: 8px 2px 0;
  display: flex; align-items: center; justify-content: space-between; }
.tech-mobile .sec-label a { color: var(--text-muted); text-decoration: none; }

/* next job hero — dark surface with signal-orange radial glow */
.tech-mobile .mj { background: var(--surface-dark); color: var(--on-dark);
  border-radius: var(--r-lg); padding: 18px 18px 16px;
  position: relative; overflow: hidden; }
.tech-mobile .mj::after { content: ''; position: absolute; right: -50px; top: -50px;
  width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(circle, rgba(234,106,44,.18), transparent 68%); }
.tech-mobile .mj .mj-eye { font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal);
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tech-mobile .mj .mj-eye .pd { width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal); animation: phone-pulse 1.6s infinite; }
@keyframes phone-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(234,106,44,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(234,106,44,0); }
  100% { box-shadow: 0 0 0 0 rgba(234,106,44,0); }
}
.tech-mobile .mj .mj-cust { font-size: 1.4rem; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.05; }
.tech-mobile .mj .mj-svc { font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--on-dark-muted); margin-top: 4px; }
.tech-mobile .mj .mj-row { display: flex; align-items: center; gap: 9px;
  font-size: 0.9rem; margin-top: 11px; }
.tech-mobile .mj .mj-row i { color: var(--signal); width: 18px; text-align: center; }
.tech-mobile .mj .mj-row span { color: var(--on-dark-muted); }
.tech-mobile .mj .mj-note { display: flex; gap: 9px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-md); padding: 10px 12px; margin: 14px 0;
  font-size: 0.84rem; color: rgba(242,237,226,.86); }
.tech-mobile .mj .mj-note i { color: var(--amber); margin-top: 1px; }
.tech-mobile .mj-cta { display: flex; gap: 9px; margin-top: 6px; }
.tech-mobile .mj-cta .btn { border: 0; height: 48px; }
.tech-mobile .btn.bignav { background: var(--signal); color: #fff; flex: 1;
  justify-content: center; font-size: 0.95rem; }
.tech-mobile .btn.bignav:hover { background: var(--signal-deep); color: #fff; }
.tech-mobile .btn.icbtn { background: rgba(255,255,255,.12); color: #fff;
  width: 48px; padding: 0; justify-content: center; }
.tech-mobile .btn.icbtn:hover { background: rgba(255,255,255,.20); color: #fff; }
.tech-mobile .mj-advance { width: 100%; margin-top: 9px; height: 46px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  color: #fff; justify-content: center; }
.tech-mobile .mj-advance:hover { background: rgba(255,255,255,.20); color: #fff; }

/* stat chips */
.tech-mobile .m-stats { display: flex; gap: 10px; overflow-x: auto;
  padding: 2px 0 2px; scrollbar-width: none; }
.tech-mobile .m-stats::-webkit-scrollbar { display: none; }
.tech-mobile .m-stat { flex: 0 0 auto; min-width: 118px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px; }
.tech-mobile .m-stat .l { font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
  display: flex; gap: 6px; align-items: center; }
.tech-mobile .m-stat .l i { color: var(--text-faint); }
.tech-mobile .m-stat .v { font-family: var(--font-mono);
  font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 500;
  margin-top: 6px; line-height: 1; }
.tech-mobile .m-stat .v .u { color: var(--signal); font-size: 1rem; }

/* card + route stops (scoped under .tech-mobile so they don't collide
   with the desktop tech .stop rule that lives above this block) */
.tech-mobile .m-card { background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 16px; }
.tech-mobile .stop { display: grid; grid-template-columns: 46px 1fr auto;
  gap: 11px; align-items: center; padding: 11px 0;
  border-bottom: 1px dashed var(--border); }
.tech-mobile .stop:last-child { border-bottom: 0; }
.tech-mobile .stop .t { font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text-muted); text-align: right; }
.tech-mobile .stop .c { font-weight: 600; font-size: 0.9rem; }
.tech-mobile .stop .s { font-family: var(--font-mono); font-size: 0.74rem;
  color: var(--text-muted); margin-top: 1px; }
.tech-mobile .stop.done .c { color: var(--text-muted); }
.tech-mobile .stop.current { background: var(--signal-soft);
  border-radius: var(--r-md); border-bottom-color: transparent;
  padding-left: 10px; padding-right: 10px; margin: 0 -10px; }

.tech-mobile .msg { display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--border); }
.tech-mobile .msg:last-child { border-bottom: 0; }
.tech-mobile .msg .av { width: 30px; height: 30px; font-size: 0.7rem;
  background: var(--ocean); }
.tech-mobile .msg .n { font-weight: 600; font-size: 0.84rem; }
.tech-mobile .msg .n .t { font-family: var(--font-mono); font-weight: 400;
  font-size: 0.7rem; color: var(--text-faint); margin-left: 5px; }
.tech-mobile .msg .x { font-size: 0.83rem; color: var(--text-muted); margin-top: 1px; }

.tech-mobile .part { display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed var(--border); }
.tech-mobile .part:last-child { border-bottom: 0; }
.tech-mobile .part .pn { flex: 1; font-weight: 600; font-size: 0.86rem; }
.tech-mobile .part .pq { font-family: var(--font-mono); font-weight: 600;
  font-size: 0.84rem; }
.tech-mobile .part .pq.muted { color: var(--text-faint); font-weight: 400; }

/* ══════════════════════════════════════════════════════════════════
   RECORD FAMILY — forms, detail layout, entity header, timeline,
   key-value, line-items, document header. Shared by every
   detail / new / edit screen so the 15 sub-pages stay one system.
   Verbatim from design_handoff_record_family/linq-kit.css.
   ══════════════════════════════════════════════════════════════════ */

/* ── Forms ────────────────────────────────────────────────────── */
.lq-form { display: flex; flex-direction: column; gap: 20px; max-width: 940px; }
.form-section { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px 26px; }
.form-section > .fs-head { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.form-section > .fs-head .ico { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--ocean-soft); color: var(--ocean); display: grid; place-items: center; font-size: 1rem; flex-shrink: 0; }
.form-section > .fs-head h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.form-section > .fs-head .fs-sub { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-faint); margin-left: auto; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field-grid.g1 { grid-template-columns: 1fr; }
.field-grid.g3 { grid-template-columns: 1fr 1fr 1fr; }

.lq-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.lq-field.span-2 { grid-column: 1 / -1; }
.lq-field > label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.lq-field > label .req { color: var(--signal); }
.lq-field > label .opt { color: var(--text-faint); letter-spacing: 0.06em; }
.lq-input, .lq-textarea, .lq-field > select {
  width: 100%; appearance: none; font-family: var(--font-display); font-size: 0.94rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.lq-field > select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230F162366'%3E%3Cpath d='M4.5 6l3.5 3.5L11.5 6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 14px; padding-right: 36px; }
.lq-textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.lq-input::placeholder, .lq-textarea::placeholder { color: var(--text-faint); }
.lq-input:focus, .lq-textarea:focus, .lq-field > select:focus { border-color: var(--ocean); box-shadow: 0 0 0 3px var(--ocean-soft); }
.lq-input.with-pre { padding-left: 30px; }
.field-pre { position: relative; }
.field-pre > .pre { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); color: var(--text-faint); font-size: 0.92rem; pointer-events: none; }
.field-hint { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.field-row { display: flex; gap: 10px; }

.form-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 16px 0 4px; }
.form-actions .spacer { flex: 1; }
.form-actions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding-bottom: 12px; z-index: 4; }

/* ── Detail layout + right rail ───────────────────────────────── */
.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 24px; align-items: start; }
.detail-rail { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 88px; }
.detail-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
@media (max-width: 1100px) { .detail-layout { grid-template-columns: 1fr; } .detail-rail { position: static; } }

/* ── Entity header (record hero) ──────────────────────────────── */
.entity-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.entity-head .eh-av { width: 60px; height: 60px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; font-weight: 700; font-family: var(--font-mono); font-size: 1.3rem; flex-shrink: 0; }
.entity-head .eh-id { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.entity-head h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 3px 0 0; }
.entity-head .eh-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 9px; }
.entity-head .eh-meta .m { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; color: var(--text-muted); }
.entity-head .eh-meta .m i { color: var(--text-faint); font-size: 0.9rem; }
.entity-head .eh-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
@media (max-width: 680px) { .entity-head .eh-actions { margin-left: 0; width: 100%; } .entity-head { flex-wrap: wrap; } }

/* ── Key-value list (rail facts) ──────────────────────────────── */
.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.kv-row:last-child { border-bottom: 0; }
.kv-k { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); flex-shrink: 0; }
.kv-v { font-weight: 600; font-size: 0.9rem; text-align: right; }
.kv-v.link { color: var(--ocean); cursor: pointer; }

/* ── Activity timeline ────────────────────────────────────────── */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .tl-dot { position: absolute; left: -22px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2px solid var(--border-strong); }
.tl-item .tl-dot.ocean { border-color: var(--ocean); background: var(--ocean); } .tl-item .tl-dot.sage { border-color: var(--sage); background: var(--sage); } .tl-item .tl-dot.signal { border-color: var(--signal); background: var(--signal); } .tl-item .tl-dot.violet { border-color: var(--violet); background: var(--violet); } .tl-item .tl-dot.amber { border-color: var(--amber); background: var(--amber); }
.tl-item .tl-time { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--text-faint); }
.tl-item .tl-title { font-weight: 600; font-size: 0.92rem; margin: 2px 0 1px; }
.tl-item .tl-body { font-size: 0.88rem; color: var(--text-muted); }

/* ── Line-items (invoice / estimate editor + view) ────────────── */
.line-items { width: 100%; border-collapse: collapse; }
.line-items thead th { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); text-align: left; padding: 6px 12px 11px; border-bottom: 1px solid var(--border); }
.line-items thead th.r, .line-items td.r { text-align: right; }
.line-items tbody td { padding: 12px; border-bottom: 1px dashed var(--border); font-size: 0.92rem; vertical-align: top; }
.line-items .li-desc b { font-weight: 600; } .line-items .li-desc small { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }
.line-items .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.li-add { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-family: var(--font-mono); font-size: 0.82rem; color: var(--ocean); cursor: pointer; text-decoration: none; }
.doc-totals { display: flex; flex-direction: column; gap: 0; margin-left: auto; width: 300px; max-width: 100%; margin-top: 18px; }
.tot-row { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 0; font-size: 0.92rem; }
.tot-row .tk { color: var(--text-muted); } .tot-row .tv { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.tot-row.grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 14px; }
.tot-row.grand .tk { font-weight: 700; color: var(--ink); font-size: 1.02rem; } .tot-row.grand .tv { font-size: 1.5rem; font-weight: 700; }
.tot-row.due .tv { color: var(--signal-deep); }

/* ── Document header (invoice / estimate paper) ───────────────── */
.doc-paper { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 34px 38px; }
.doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid var(--border); margin-bottom: 26px; flex-wrap: wrap; }
.doc-head .dh-brand { display: flex; align-items: center; gap: 11px; }
.doc-head .dh-brand .wm { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; }
.doc-head .dh-right { text-align: right; }
.doc-head .dh-kind { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); }
.doc-head .dh-no { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; }
.doc-party { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
.doc-party .dp-lbl { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 7px; }
.doc-party .dp-name { font-weight: 700; font-size: 1.02rem; } .doc-party .dp-body { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; margin-top: 3px; }

/* ── Tabs for record pages (reuse .page-tabs visual, scrollable) ─ */
.record-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.record-tabs::-webkit-scrollbar { display: none; }
.record-tab { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); padding: 11px 15px; border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.record-tab:hover { color: var(--text); }
.record-tab.active { color: var(--ink); border-bottom-color: var(--signal); }
.record-tab .cnt { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-faint); margin-left: 5px; }

/* ── Rail card (promoted from page-local — recurs in every detail) ─ */
.rail-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; }
.rail-card .rc-head { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.rail-card .rc-head a { color: var(--ocean); text-decoration: none; font-size: 0.7rem; }

/* ── Chip-button (icon-only round button used in entity-head actions) ── */
.chip-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel); color: var(--text-muted); display: grid; place-items: center; cursor: pointer; text-decoration: none; transition: border-color .15s, color .15s; }
.chip-btn:hover { border-color: var(--border-strong); color: var(--text); }

/* ── Customer/tech line (avatar + name + sub used in rail cards) ── */
.cust-line { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cust-line:last-child { margin-bottom: 0; }
.cust-line .nm { font-weight: 700; font-size: 1rem; }
.cust-line .sub { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); }

/* ── Tag pill (hashtag style used on jobs / customers) ── */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-muted); background: rgba(15,22,35,.05); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px 11px; text-decoration: none; }
.tag:hover { color: var(--text); border-color: var(--border-strong); }

/* ── Balance display (large dollar number used on invoice rail) ── */
.balance { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 2.4rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1; color: var(--signal-deep); }
