/* ============================================================
   s2u house style — tokens + components.

   See DESIGN.md for the doctrine. Every s2u tool uses this file;
   no app ships inline <style> beyond what the login page needs
   pre-session.
   ============================================================ */

/* Self-hosted. These two files are variable fonts covering the full
   400–700 weight range per family (Google's "variable" woff2 subset).
   See DESIGN.md §1 and public/assets/fonts/. */
@font-face {
  font-family: 'Outfit';
  src: url('/assets/fonts/outfit-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* --- brand (verbatim from ship2user.com CSS) --------------- */
  --s2u-navy:        #002D52;
  --s2u-navy-2:      #0a3a66;   /* hover lift on navy */
  --s2u-blue:        #004F8C;
  --s2u-blue-50:     #EFF6FF;
  --s2u-olive:       #7A8110;
  --s2u-lime:        #A8BC1F;
  --s2u-lime-bright: #C7C825;
  --s2u-red:         #FA202A;
  --s2u-red-50:      #fef2f2;
  --s2u-ok:          #15803D;
  --s2u-ok-50:       #f0fdf4;

  /* --- neutrals --------------------------------------------- */
  --s2u-bg:          #F7F8FA;
  --s2u-surface:     #FFFFFF;
  --s2u-surface-2:   #F3F4F6;
  --s2u-text:        #101828;
  --s2u-text-2:      #364153;
  --s2u-muted:       #6A7282;
  --s2u-border:      #D1D5DC;
  --s2u-border-2:    #E5E7EB;

  /* --- store palette (fixed; see DESIGN.md §2) --------------- */
  --store-hvo:  #004F8C;
  --store-nbs:  #D97706;
  --store-phd:  #DB2777;
  --store-acd:  #0D9488;
  --store-wspc: #7C3AED;
  --store-nsh:  #15803D;
  --store-s2u:  #4A5565;

  /* --- type scale ------------------------------------------- */
  /* Aligned to Chat-Dash (Tailwind font-sans = the system UI font: SF Pro
     on Mac, Segoe UI on Windows). Dave 2026-10-23. Space Grotesk stays
     only for the sidebar app-name label, as in Chat-Dash. */
  --font-sys:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: var(--font-sys);
  --font-body: var(--font-sys);
  --font-mono: var(--font-sys);
  --font-code: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* --- metrics ---------------------------------------------- */
  --radius:    10px;
  --radius-sm: 6px;
  --shadow-1:  0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-2:  0 4px 14px rgba(16, 24, 40, 0.06);
  --sidebar-w: 220px;
  --sidebar-w-rail: 56px;

  color-scheme: light;
}

/* --- resets ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--s2u-bg);
  color: var(--s2u-text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--s2u-text);
  margin: 0;
}
a { color: var(--s2u-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num  { font-variant-numeric: tabular-nums slashed-zero; text-align: right; }
.muted { color: var(--s2u-muted); }
.ok    { color: var(--s2u-ok); }
.danger{ color: var(--s2u-red); }
.warn  { color: var(--s2u-olive); }

/* --- shell -------------------------------------------------- */

.s2u-app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.18s ease;
}
/* Manual override: forcibly collapsed/expanded regardless of width. */
.s2u-app[data-sidebar="collapsed"] { grid-template-columns: var(--sidebar-w-rail) 1fr; }
.s2u-app[data-sidebar="expanded"]  { grid-template-columns: var(--sidebar-w)      1fr; }

.s2u-sidebar {
  background: var(--s2u-navy);
  color: #cfd7e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
/* Brand header — exact Chat-Dash spec (Sidebar.jsx lines 889-902):
   px-3 py-3 = 12px both axes; wordmark 30px tall, width auto, max-width 100%;
   label text-xs font-black mt-1 = 12px / weight 900 / white / 4px top margin.
   Stacked vertically (wordmark on row 1, app-name directly below). */
.s2u-sidebar .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  gap: 0;
  text-decoration: none;
}
.s2u-sidebar .brand .logo-full {
  display: block;
  height: 30px;
  width: auto;
  max-width: 100%;
}
.s2u-sidebar .brand .logo-mark {
  display: none;
  height: 24px;
  width: auto;
}
.s2u-sidebar .brand .app-name {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
  margin-top: 4px;
  margin-left: 0;
}
.s2u-sidebar nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.s2u-sidebar nav a.item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 14px;
  border-radius: var(--radius-sm);
  color: #cfd7e1;
  text-decoration: none;
  position: relative;
  font-size: 13px;
  cursor: pointer;
  border-left: 2px solid transparent;
  margin-left: -2px;
}
.s2u-sidebar nav a.item:hover { background: rgba(255,255,255,0.06); text-decoration: none; }
.s2u-sidebar nav a.item .ic { flex: 0 0 18px; display: inline-flex; align-items: center; justify-content: center; opacity: 0.85; }
.s2u-sidebar nav a.item .lbl { flex: 1 1 auto; }
.s2u-sidebar nav a.item .badge {
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.s2u-sidebar nav a.item .badge.danger { background: var(--s2u-red); color: #fff; }
.s2u-sidebar nav a.item.active {
  background: rgba(199, 200, 37, 0.08);
  border-left-color: var(--s2u-lime-bright);
  color: #fff;
}
.s2u-sidebar nav a.item.active .ic { opacity: 1; color: var(--s2u-lime-bright); }
.s2u-sidebar .foot {
  margin-top: auto;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: rgba(255,255,255,0.65);
}
.s2u-sidebar .foot .me { display: block; margin: 6px 2px 10px; color: #cfd7e1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s2u-sidebar .foot a, .s2u-sidebar .foot button {
  background: transparent; border: 0; color: rgba(255,255,255,0.75);
  padding: 4px 0; cursor: pointer; font: inherit;
}
.s2u-sidebar .foot a:hover, .s2u-sidebar .foot button:hover { color: #fff; text-decoration: underline; }
.s2u-sidebar .foot .toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.75);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.s2u-sidebar .foot .toggle:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.s2u-sidebar .foot .toggle .chev { font-size: 14px; line-height: 1; }

/* --- workspace --------------------------------------------- */
.s2u-work { min-width: 0; display: flex; flex-direction: column; }
.s2u-topbar {
  background: var(--s2u-surface);
  border-bottom: 1px solid var(--s2u-border-2);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
}
.s2u-topbar h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.s2u-topbar .subtitle { color: var(--s2u-muted); font-size: 12px; }
.s2u-topbar .spacer { flex: 1 1 auto; }
.s2u-main {
  padding: 20px 28px 60px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.hidden { display: none !important; }

/* --- cards -------------------------------------------------- */
.card {
  background: var(--s2u-surface);
  border: 1px solid var(--s2u-border-2);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: -2px 0 12px;
}
.card-head .title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
}
.card-head .meta { color: var(--s2u-muted); font-size: 12px; }
.card-head .spacer { flex: 1 1 auto; }

.label-eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--s2u-muted);
  font-weight: 600;
}

/* --- KPI tiles --------------------------------------------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpi {
  background: var(--s2u-surface);
  border: 1px solid var(--s2u-border-2);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 6px;
}
.kpi .lbl {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--s2u-muted);
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.kpi .val {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 26px;
  font-variant-numeric: tabular-nums slashed-zero;
  color: var(--s2u-text);
  line-height: 1.1;
}
.kpi .delta {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--s2u-muted);
}
.kpi .delta.up { color: var(--s2u-ok); }
.kpi .delta.down { color: var(--s2u-red); }
.kpi .delta .arrow { font-size: 10px; margin-right: 2px; }

/* --- tables ------------------------------------------------ */
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
table.table thead th {
  position: sticky; top: 0;
  background: var(--s2u-surface);
  text-align: left;
  font-weight: 600;
  color: var(--s2u-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--s2u-border);
  z-index: 1;
}
table.table thead th.num { text-align: right; }
table.table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--s2u-border-2);
  vertical-align: middle;
  font-size: 13.5px;
}
table.table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums slashed-zero;
}
/* Compact sales cells: primary CAD line stays nowrap, secondary lines
   wrap and tighten so the YTD column doesn't clip at laptop widths. */
table.table.sales thead th { padding: 10px 8px; }
table.table.sales tbody td { padding: 10px 8px; }
table.table.sales tbody td.num .primary { white-space: nowrap; }
table.table.sales tbody td.num .secondary { white-space: normal; line-height: 1.3; }
table.table.sales tbody td.num { white-space: normal; }
table.table.docs thead th, table.table.docs tbody td { padding: 10px 8px; }
table.table.docs tbody td.num { white-space: nowrap; }
table.table tbody tr { transition: background 0.08s ease; }
table.table tbody tr.clickable { cursor: pointer; }
table.table tbody tr.clickable:hover { background: var(--s2u-blue-50); }
table.table tbody tr.selected { background: var(--s2u-blue-50); }
table.table tbody tr.total td {
  border-top: 2px solid var(--s2u-border);
  font-weight: 600;
  background: var(--s2u-surface-2);
}

/* --- pill/chip --------------------------------------------- */
.pill, .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--s2u-border);
  color: var(--s2u-text-2);
  background: #fff;
  line-height: 1.6;
  vertical-align: middle;
  white-space: nowrap;
}
.pill[data-status="draft"]     { color: var(--s2u-muted); }
.pill[data-status="sent"],
.pill[data-status="viewed"]    { color: var(--s2u-blue); border-color: var(--s2u-blue); background: var(--s2u-blue-50); }
.pill[data-status="acked"],
.pill[data-status="shipped"],
.pill[data-status="accepted"],
.pill[data-status="converted"],
.pill[data-status="paid"]      { color: var(--s2u-ok); border-color: var(--s2u-ok); background: var(--s2u-ok-50); }
.pill[data-status="blocked"]   { color: var(--s2u-red); border-color: var(--s2u-red); background: var(--s2u-red-50); }
.pill[data-status="cancelled"],
.pill[data-status="declined"]  { color: var(--s2u-muted); text-decoration: line-through; }
.pill[data-status="expired"],
.pill[data-status="lost"],
.pill[data-status="revised"]   { color: var(--s2u-muted); }
.pill[data-status="ok"]        { color: var(--s2u-ok); border-color: var(--s2u-ok); background: var(--s2u-ok-50); }
.pill[data-status="down"]      { color: var(--s2u-red); border-color: var(--s2u-red); background: var(--s2u-red-50); }

.chip::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--chip-c, var(--s2u-muted));
}
.chip[data-store="hvo"]  { --chip-c: var(--store-hvo); }
.chip[data-store="nbs"]  { --chip-c: var(--store-nbs); }
.chip[data-store="phd"]  { --chip-c: var(--store-phd); }
.chip[data-store="acd"]  { --chip-c: var(--store-acd); }
.chip[data-store="wspc"] { --chip-c: var(--store-wspc); }
.chip[data-store="nsh"]  { --chip-c: var(--store-nsh); }
.chip[data-store="s2u"]  { --chip-c: var(--store-s2u); }

/* --- buttons ----------------------------------------------- */
.btn, button.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--s2u-border);
  background: var(--s2u-surface);
  color: var(--s2u-text);
  cursor: pointer;
  transition: background 0.08s ease, border-color 0.08s ease, color 0.08s ease;
  line-height: 1.3;
}
.btn:hover:not(:disabled) { background: var(--s2u-surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* Compact variant for inline per-row actions (PO list PDF column, etc.) */
.btn.btn-xs { font-size: 11px; padding: 3px 8px; border-radius: 4px; }

/* Small red dot on a sidebar nav item (Settings) when something's failing. */
.nav-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--s2u-red);
  margin-left: 6px;
  box-shadow: 0 0 0 2px rgba(250, 32, 42, 0.18);
}
.nav-dot.hidden { display: none; }

/* Secondary line inside a KPI tile — e.g. the 90D run-rate shown
   beneath the big 30D number on the Sales page. */
.kpi .kpi-extra {
  font-size: 11px;
  color: var(--s2u-text-2);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* --- Per-vendor collapsible sections on Vendors & Costs page --- */
.vendor-section {
  border-top: 1px solid var(--s2u-border);
}
.vendor-section:first-child { border-top: 0; }
.vendor-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px;
  cursor: pointer;
}
.vendor-head:hover { background: var(--s2u-surface-2); }
.vendor-chev {
  display: inline-block; width: 12px; font-size: 10px;
  color: var(--s2u-text-2);
}
.vendor-name { font-weight: 600; }
.vendor-body { padding: 6px 18px 16px 24px; }
.vendor-body.hidden { display: none; }

/* Per-vendor Auto-draft POs toggle. Inline on the vendor head. */
.vendor-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 12px;
  padding: 3px 10px;
  font: 500 11px/1.2 var(--font-body);
  color: var(--s2u-text-2);
  background: var(--s2u-surface);
  border: 1px solid var(--s2u-border);
  border-radius: 999px;
  cursor: pointer;
}
.vendor-toggle:hover { border-color: var(--s2u-navy); }
.vendor-toggle:disabled { opacity: 0.5; cursor: wait; }
.vendor-toggle .vendor-toggle-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
}
.vendor-toggle.on {
  background: var(--s2u-navy); color: #fff; border-color: var(--s2u-navy);
}
.vendor-toggle.on:hover { background: var(--s2u-navy-2); border-color: var(--s2u-navy-2); }

/* --- Chat-Dash-style filter pills (PO page, extendable) --- */
.pos-pills {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 10px;
  margin-top: 10px;
}
.pos-pill-group { display: inline-flex; align-items: center; gap: 4px; }
.pos-pill-label {
  font-size: 10px; color: var(--s2u-text-2); text-transform: uppercase;
  letter-spacing: 0.08em; margin-right: 4px;
}
.pos-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; font-size: 11px; font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--s2u-border);
  background: var(--s2u-surface);
  color: var(--s2u-text);
  cursor: pointer;
  transition: background 0.08s ease, border-color 0.08s ease, color 0.08s ease;
  font-family: var(--font-body);
}
.pos-pill:hover { border-color: var(--s2u-navy); color: var(--s2u-navy); }
.pos-pill.active {
  background: var(--s2u-navy); border-color: var(--s2u-navy); color: #fff;
}
.pos-pill .pos-pill-count {
  font-size: 10px; opacity: 0.75;
  background: rgba(0,0,0,0.08); padding: 1px 6px; border-radius: 999px;
}
.pos-pill.active .pos-pill-count { background: rgba(255,255,255,0.2); opacity: 1; }
.pos-pill-clear {
  color: var(--s2u-red); border-color: var(--s2u-red);
  background: transparent; font-weight: 600;
}
.pos-pill-clear:hover { background: var(--s2u-red-50); }

/* --- PO row expand (replaces the old side detail panel) --- */
.pos-adhoc {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding: 10px 12px;
  background: var(--s2u-surface-2);
  border-radius: var(--radius-sm); border: 1px solid var(--s2u-border);
}
.pos-adhoc.hidden { display: none; }
.pos-row-open td { background: var(--s2u-surface-2); }
.pos-row .pos-chev {
  display: inline-block; width: 10px; color: var(--s2u-text-2);
  margin-right: 6px; font-size: 10px;
}
.pos-row-detail > td { background: var(--s2u-surface-2); padding: 14px 18px; }
.pos-detail-wrap { padding: 2px 0; }
.pos-detail-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 8px;
}
.pos-detail-head .btn.btn-xs { font-size: 11px; }
.btn.btn-primary {
  background: var(--s2u-navy);
  border-color: var(--s2u-navy);
  color: #fff;
  font-weight: 600;
}
.btn.btn-primary:hover:not(:disabled) { background: var(--s2u-navy-2); border-color: var(--s2u-navy-2); }
.btn.btn-secondary {
  background: var(--s2u-surface);
  border-color: var(--s2u-navy);
  color: var(--s2u-navy);
  font-weight: 600;
}
.btn.btn-secondary:hover:not(:disabled) { background: var(--s2u-blue-50); }
.btn.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--s2u-text-2);
}
.btn.btn-ghost:hover:not(:disabled) { background: var(--s2u-surface-2); }
.btn.btn-danger {
  background: var(--s2u-red);
  border-color: var(--s2u-red);
  color: #fff;
  font-weight: 600;
}
.btn.btn-danger:hover:not(:disabled) { filter: brightness(0.92); }
.btn.sm { padding: 4px 10px; font-size: 12px; }

/* --- inputs ------------------------------------------------ */
input, select, textarea {
  font: inherit;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--s2u-text);
  background: #fff;
  border: 1px solid var(--s2u-border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--s2u-blue);
  box-shadow: 0 0 0 3px rgba(0, 79, 140, 0.12);
}
textarea { resize: vertical; min-height: 80px; }
input[readonly] { background: var(--s2u-surface-2); color: var(--s2u-text-2); }

/* --- form layout ------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { color: var(--s2u-muted); font-size: 11px; display: block; margin-bottom: 4px;
  font-weight: 500; letter-spacing: 0.03em; }

/* --- misc layout helpers ----------------------------------- */
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer, .grow { flex: 1 1 auto; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.stack-6 > * + * { margin-top: 6px; }
.stack-10 > * + * { margin-top: 10px; }

.grid-kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.grid-kv dt { color: var(--s2u-muted); font-size: 12px; }
.grid-kv dd { margin: 0; color: var(--s2u-text); }

/* --- skeletons --------------------------------------------- */
@keyframes s2u-shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skel {
  background-color: var(--s2u-surface-2);
  background-image: linear-gradient(90deg, var(--s2u-surface-2) 0, #ebeef3 40px, var(--s2u-surface-2) 80px);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  border-radius: var(--radius-sm);
  animation: s2u-shimmer 1.2s linear infinite;
  display: inline-block;
  height: 14px;
  min-width: 60px;
  vertical-align: middle;
}
.skel.lg { height: 22px; }
.skel.xl { height: 32px; }
.skel.block { display: block; width: 100%; margin: 6px 0; }

/* --- empty state ------------------------------------------- */
.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--s2u-muted);
  font-size: 13px;
}
.empty .emoji { font-size: 28px; margin-bottom: 10px; opacity: 0.6; }

/* --- toast ------------------------------------------------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.toast {
  background: var(--s2u-text);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  font-size: 13px;
  max-width: 360px;
}
.toast.err { background: var(--s2u-red); }
.toast.ok  { background: var(--s2u-ok); }

/* --- modal overlay ----------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 15;
  background: rgba(16, 24, 40, 0.4);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--s2u-surface);
  border: 1px solid var(--s2u-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-2);
  max-width: 520px;
  width: 92%;
}
.modal h2 { font-size: 16px; margin-bottom: 10px; }

/* --- meter (completeness bar) ------------------------------ */
.meter { height: 6px; background: var(--s2u-surface-2); border-radius: 3px; overflow: hidden; width: 100%; }
.meter > span { display: block; height: 100%; background: var(--s2u-ok); }
.meter.low > span { background: var(--s2u-red); }
.meter.mid > span { background: var(--s2u-olive); }

/* --- bar chart (inline SVG) -------------------------------- */
.bars { width: 100%; height: 180px; display: block; }
.bars rect { fill: var(--chart-c, var(--s2u-blue)); transition: opacity 0.1s; }
.bars rect.wk { fill: var(--s2u-muted); opacity: 0.28; }
.bars rect:hover { opacity: 0.78; }
.bars .axis { font-family: var(--font-body); font-size: 11px; fill: var(--s2u-muted); }
.chart-legend { font-size: 11px; color: var(--s2u-muted); display: flex; align-items: center; gap: 12px; }
.chart-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.chart-tooltip {
  position: absolute; background: var(--s2u-text); color: #fff;
  padding: 6px 9px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 12px;
  pointer-events: none; white-space: nowrap;
  box-shadow: var(--shadow-2); z-index: 5; opacity: 0;
  transform: translate(-50%, -100%); transition: opacity 0.08s;
}
.chart-wrap { position: relative; }

/* --- responsive -------------------------------------------- */
/* Collapsed-sidebar styles. Triggered either by viewport-driven media
   query OR by the user via the data-sidebar="collapsed" override. */
@media (max-width: 1200px) {
  .s2u-app:not([data-sidebar="expanded"]) { grid-template-columns: var(--sidebar-w-rail) 1fr; }
  .s2u-app:not([data-sidebar="expanded"]) .collapse-hide { display: none !important; }
  .s2u-app:not([data-sidebar="expanded"]) .collapse-show { display: inline-flex !important; }
  .s2u-app:not([data-sidebar="expanded"]) .s2u-sidebar .brand { padding: 12px 8px; align-items: center; justify-content: center; }
  .s2u-app:not([data-sidebar="expanded"]) .s2u-sidebar nav a.item { justify-content: center; padding: 10px 0; margin: 0; border-left: 0; }
  .s2u-app:not([data-sidebar="expanded"]) .s2u-sidebar nav a.item.active { background: rgba(199, 200, 37, 0.1); }
  .s2u-app:not([data-sidebar="expanded"]) .s2u-sidebar .foot { padding: 10px 6px 14px; }
  .s2u-app:not([data-sidebar="expanded"]) .s2u-sidebar .foot .toggle { padding: 8px 6px; font-size: 0; }
  .s2u-app:not([data-sidebar="expanded"]) .s2u-sidebar .foot .toggle .chev { font-size: 14px; }
}
.s2u-app[data-sidebar="collapsed"] .collapse-hide { display: none !important; }
.s2u-app[data-sidebar="collapsed"] .collapse-show { display: inline-flex !important; }
.s2u-app[data-sidebar="collapsed"] .s2u-sidebar .brand { padding: 12px 8px; align-items: center; justify-content: center; }
.s2u-app[data-sidebar="collapsed"] .s2u-sidebar nav a.item { justify-content: center; padding: 10px 0; margin: 0; border-left: 0; }
.s2u-app[data-sidebar="collapsed"] .s2u-sidebar nav a.item.active { background: rgba(199, 200, 37, 0.1); }
.s2u-app[data-sidebar="collapsed"] .s2u-sidebar .foot { padding: 10px 6px 14px; }
.s2u-app[data-sidebar="collapsed"] .s2u-sidebar .foot .toggle { padding: 8px 6px; font-size: 0; }
.s2u-app[data-sidebar="collapsed"] .s2u-sidebar .foot .toggle .chev { font-size: 14px; }

.collapse-show { display: none; }
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .s2u-topbar { padding: 12px 16px; }
  .s2u-main { padding: 14px 16px 40px; }
}

/* --- mobile (≤700px) -------------------------------------- */
/* Sidebar off, slim sticky top bar on. Base type 13px with 10px
   labels + tabular numerics. All tables stack. Sales gets a
   custom store-block layout; other pages use a generic
   label-in-TD stack. */
.s2u-topbar-mobile { display: none; }
.mobile-nav { display: none; }
.mobile-only { display: none !important; }
@media (max-width: 700px) {
  body { font-size: 13px; }

  /* --- shell --- */
  .s2u-app { grid-template-columns: 1fr !important; }
  .s2u-sidebar { display: none !important; }
  .s2u-topbar { display: none !important; }

  .s2u-topbar-mobile {
    display: flex;
    position: sticky; top: 0; z-index: 50;
    background: var(--s2u-navy);
    color: #fff;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    min-height: 44px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .s2u-topbar-mobile .brand { display: inline-flex; align-items: center; text-decoration: none; }
  .s2u-topbar-mobile .brand img { height: 28px; width: auto; display: block; }
  .s2u-topbar-mobile .mobile-title {
    font-family: var(--font-head);
    font-size: 14px; font-weight: 600;
    flex: 1 1 auto;
    text-align: center;
    color: #fff;
  }
  .s2u-topbar-mobile .menu-btn {
    background: transparent; border: 0;
    color: #fff;
    font-size: 20px; line-height: 1;
    padding: 4px 10px;
    cursor: pointer;
  }

  .mobile-nav {
    display: none;
    background: var(--s2u-navy);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky; top: 44px; z-index: 49;
  }
  .mobile-nav.open { display: flex; flex-direction: column; }
  .mobile-nav a {
    color: #cfd7e1;
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-decoration: none;
    display: flex; align-items: center; gap: 10px;
  }
  .mobile-nav a:last-child { border-bottom: 0; }
  .mobile-nav a.active { color: #fff; background: rgba(199,200,37,0.1); }
  .mobile-nav a .ic { opacity: 0.85; }
  .mobile-nav .me { padding: 10px 16px; font-size: 11px; color: rgba(255,255,255,0.65); border-top: 1px solid rgba(255,255,255,0.06); }
  .mobile-nav .signout { color: rgba(255,255,255,0.8); background: transparent; border: 0; padding: 10px 16px; text-align: left; font: inherit; }

  /* --- main --- */
  .s2u-main { padding: 12px; max-width: 100%; }
  .card { padding: 12px; border-radius: 8px; }
  .card + .card { margin-top: 8px; }
  .card-head { gap: 8px; flex-wrap: wrap; }
  .card-head .title { font-size: 13px; }

  .mobile-only { display: block !important; }
  .mobile-hide { display: none !important; }

  /* --- KPI 2×2 --- */
  .kpi-row { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .kpi { padding: 10px; }
  .kpi .lbl { font-size: 10px; letter-spacing: 0.08em; }
  .kpi .val { font-size: 20px; font-variant-numeric: tabular-nums slashed-zero; }
  .kpi .delta { font-size: 11px; }

  /* --- Sales store blocks (custom) --- */
  .mobile-sales-headers {
    position: sticky; top: 44px; z-index: 10;
    background: var(--s2u-surface);
    display: grid;
    grid-template-columns: minmax(84px, 1.1fr) 1fr 1fr 1fr;
    column-gap: 8px;
    padding: 8px 2px 6px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--s2u-muted);
    border-bottom: 1px solid var(--s2u-border-2);
  }
  .mobile-sales-headers > div + div { text-align: right; }
  .store-block {
    display: grid;
    grid-template-columns: minmax(84px, 1.1fr) 1fr 1fr 1fr;
    column-gap: 8px;
    row-gap: 2px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--s2u-border-2);
    align-items: center;
  }
  .store-block.total { border-top: 2px solid var(--s2u-border); font-weight: 600; margin-top: 4px; padding-top: 10px; }
  .store-block .chip-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; grid-row: 1 / 2; }
  .store-block .val-cell {
    text-align: right;
    font-size: 13px; font-weight: 600;
    font-variant-numeric: tabular-nums slashed-zero;
    grid-row: 1 / 2;
    line-height: 1.2;
  }
  .store-block .chip-sub { font-size: 10px; color: var(--s2u-muted); grid-row: 2 / 3; grid-column: 1 / 2; line-height: 1.3; }
  .store-block .sub-cell { font-size: 10px; color: var(--s2u-muted); text-align: right; grid-row: 2 / 3; line-height: 1.3; }
  .store-block .today-badge {
    font-size: 10px;
    background: var(--s2u-blue-50);
    color: var(--s2u-blue);
    padding: 1px 6px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums slashed-zero;
    white-space: nowrap;
  }
  .store-block.clickable { cursor: pointer; }

  /* --- Generic table stack (for #/costs, #/pos, #/vendors) --- */
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tr {
    display: block;
    padding: 8px 2px;
    border-bottom: 1px solid var(--s2u-border-2);
  }
  .table tr:last-child { border-bottom: 0; }
  .table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 2px 0 !important;
    text-align: right;
    border: none !important;
    gap: 10px;
    min-width: 0;
  }
  .table td.num { font-variant-numeric: tabular-nums slashed-zero; }
  .table td[data-label]::before {
    content: attr(data-label);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--s2u-muted);
    font-weight: 500;
    text-align: left;
    flex: 0 0 auto;
  }
  /* Columns without a label: keep normal (chips, etc) */

  /* --- overflow guard: no page-level horizontal scroll --- */
  body, .s2u-main, .card { overflow-x: hidden; }
  table, .table { max-width: 100%; }

  /* --- top-bar actions wrap --- */
  #page-actions { flex-wrap: wrap; gap: 6px; }
}

/* --- utility ----------------------------------------------- */
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.pl-6 { padding-left: 6px; }
.pt-10 { padding-top: 10px; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mb-0 { margin-bottom: 0; }
.gap-6 { gap: 6px; }
.gap-10 { gap: 10px; }
.gap-14 { gap: 14px; }
.nowrap { white-space: nowrap; }
.strike { text-decoration: line-through; }
.center { text-align: center; }

/* --- QuoteDock list (Dave 2026-10-23) --------------------------------
   Store pills: exact copy of Chat-Dash StoreFilter.jsx (Tailwind classes
   translated 1:1 — text-[10px] px-1.5 py-0.5 rounded border font-semibold,
   per-store 100/700-800/200 tints, active = navy fill). Count = open
   quotes. Click a pill to scope the KPIs + list; click it again for All. */
.qd-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.qd-pill {
  position: relative; font: 600 10px/1.4 inherit; padding: 2px 6px;
  border-radius: 4px; border: 1px solid; cursor: pointer;
  transition: color .15s, background-color .15s, border-color .15s;
}
.qd-pill[data-store="all"]  { background: #fff;    color: #64748b; border-color: #cbd5e1; }
.qd-pill[data-store="all"]:hover  { border-color: #60a5fa; }
.qd-pill[data-store="hvo"]  { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.qd-pill[data-store="hvo"]:hover  { border-color: #60a5fa; }
.qd-pill[data-store="nbs"]  { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.qd-pill[data-store="nbs"]:hover  { border-color: #fb923c; }
.qd-pill[data-store="phd"]  { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.qd-pill[data-store="phd"]:hover  { border-color: #f87171; }
.qd-pill[data-store="acd"]  { background: #ccfbf1; color: #0f766e; border-color: #99f6e4; }
.qd-pill[data-store="acd"]:hover  { border-color: #2dd4bf; }
.qd-pill[data-store="wspc"] { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.qd-pill[data-store="wspc"]:hover { border-color: #c084fc; }
.qd-pill[data-store="nsh"]  { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.qd-pill[data-store="nsh"]:hover  { border-color: #4ade80; }
.qd-pill.active, .qd-pill.active:hover { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }

.kpi .val .alt { font-size: 15px; color: var(--s2u-muted); margin-left: 6px; font-weight: 500; }
.kpi-row.compact .kpi { padding: 10px 14px; gap: 3px; }
.kpi-row.compact .kpi .val { font-size: 22px; }

.qd-search { width: 260px; max-width: 45vw; padding: 5px 9px; font-size: 13px; }

table.table.qd-list thead th { padding: 6px 8px; }
table.table.qd-list tbody td { padding: 4px 7px; font-size: 12.5px; white-space: nowrap; }
table.table.qd-list thead th { padding: 6px 7px; }
table.table.qd-list .pill, table.table.qd-list .chip { padding-top: 1px; padding-bottom: 1px; }
table.table.qd-list td.cust { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
table.table.qd-list td.em   { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
table.table.qd-list td a { color: inherit; text-decoration: none; }
table.table.qd-list td a:hover { color: var(--s2u-blue); text-decoration: underline; }
table.table.qd-list td.exp.soon { color: #b45309; font-weight: 600; }
table.table.qd-list td.exp.past { color: var(--s2u-red); font-weight: 600; }
table.table.qd-list td.acts { text-align: right; }
.qd-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-left: 2px; padding: 0;
  border: 1px solid transparent; border-radius: 4px; background: none;
  color: var(--s2u-muted); cursor: pointer;
}
.qd-act:hover { border-color: var(--s2u-border); color: var(--s2u-text); background: var(--s2u-surface-2); }
.qd-act.del:hover { color: var(--s2u-red); border-color: var(--s2u-red); background: var(--s2u-red-50); }
.qd-act:disabled { opacity: .35; cursor: default; }
.qd-act svg { width: 14px; height: 14px; }

.pill[data-status="checkout"]     { color: #b45309; border-color: #f59e0b; background: #fffbeb; }
.pill[data-status="needs_review"] { color: var(--s2u-red); border-color: var(--s2u-red); background: var(--s2u-red-50); }

/* QuoteDock list on phones: 3 compact lines per quote (Dave: small font,
   compact, quick scroll-and-read) instead of the generic label stack. */
@media (max-width: 700px) {
  .qd-pills { gap: 3px; }
  .qd-search { width: 150px; }
  table.table.qd-list tbody tr {
    display: grid; column-gap: 8px; row-gap: 1px; padding: 6px 2px;
    grid-template-columns: auto auto auto minmax(0,1fr) auto;
    grid-template-areas: "mflag mflag mflag mflag mflag" "qno store st . tot" "cust cust cust fu ph" "em em em exp acts";
    align-items: center;
  }
  table.table.qd-list tbody td { display: block; padding: 0 !important; font-size: 12px; text-align: left; overflow: hidden; text-overflow: ellipsis; }
  table.table.qd-list td.qno  { grid-area: qno; }
  table.table.qd-list td.store{ grid-area: store; }
  table.table.qd-list td.st   { grid-area: st; overflow: visible; }
  table.table.qd-list td.tot, table.table.qd-list td.acts { justify-self: end; }
  table.table.qd-list td.exp { justify-self: end; padding-right: 4px !important; }
  table.table.qd-list td.tot  { grid-area: tot; text-align: right; font-weight: 600; }
  table.table.qd-list td.cust { grid-area: cust; max-width: none; }
  table.table.qd-list td.exp  { grid-area: exp; text-align: right; font-size: 11px; }
  table.table.qd-list td.exp::before { content: "exp "; color: var(--s2u-muted); font-weight: 400; }
  table.table.qd-list td.em   { grid-area: em; max-width: none; color: var(--s2u-muted); font-size: 11px; }
  table.table.qd-list td.ph   { grid-area: ph; font-size: 11.5px; justify-self: end; overflow: visible; }
  table.table.qd-list td.acts { grid-area: acts; text-align: right; }
  table.table.qd-list td.cr   { display: none; }
  table.table.qd-list td.fu   { grid-area: fu; overflow: visible; justify-self: end; }
  table.table.qd-list .qd-fu  { font-size: 9.5px; padding: 3px 6px; }
  table.table.qd-list .chip, table.table.qd-list .pill { font-size: 9px; }
  .kpi-row.compact .kpi .val { font-size: 18px; }
  .kpi .val .alt { font-size: 12px; margin-left: 4px; }
}

/* "soon" tag on not-yet-built nav sections (Freight-Grid, Accounting). */
.soon { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.6); }
.mobile-nav .soon { border-color: var(--s2u-border); color: var(--s2u-muted); }
.s2u-sidebar nav a.item.soon-item .lbl { opacity: .65; }
.card.empty { text-align: center; padding: 48px 20px; }
.card.empty .title { font-weight: 600; font-size: 16px; margin-bottom: 6px; }

/* Quote-Dock: open quotes expiring in < 7 days — loud on purpose. */
table.table.qd-list tbody tr.expiring td { background: #fef2f2; }
table.table.qd-list tbody tr.expiring td:first-child { box-shadow: inset 4px 0 0 #dc2626; }
table.table.qd-list tbody tr.expiring:hover td { background: #fee2e2; }
.qd-expflag {
  display: block; margin-top: 3px; width: max-content;
  font: 800 10px/1.5 var(--font-body, inherit); letter-spacing: .06em;
  color: #fff; background: #dc2626; border-radius: 3px; padding: 1px 6px;
}
.qd-act.urgent { color: #fff; background: #dc2626; border-color: #dc2626; }
.qd-act.urgent:hover { background: #b91c1c; color: #fff; }
@media (max-width: 700px) {
  table.table.qd-list tbody tr.expiring { background: #fef2f2; box-shadow: inset 4px 0 0 #dc2626; padding-left: 12px; }
  table.table.qd-list tbody tr.expiring td { background: transparent; box-shadow: none; }
  table.table.qd-list td.qno { overflow: visible; }
}

table.table.qd-list td.mflag { display: none; }
@media (max-width: 700px) {
  table.table.qd-list td.mflag { display: block; grid-area: mflag; }
  table.table.qd-list td.mflag .qd-expflag { margin: 0 0 2px; }
  table.table.qd-list td.qno .qd-expflag { display: none; }
}

/* FX-Dash master list */
table.table.fx-list thead th[data-k]:hover { color: var(--s2u-text); }
table.table.fx-list thead th.sorted { color: var(--s2u-text); }
table.table.fx-list thead th.sorted::after { content: attr(data-dir); font-size: 9px; margin-left: 4px; }
table.table.fx-list td.cust { max-width: 300px; }
table.table.fx-list td.em { max-width: 140px; }
table.table.fx-list td.fx-cost { cursor: pointer; }
table.table.fx-list td.fx-cost:hover { background: var(--s2u-blue-50); }
table.table.fx-list td.danger { color: var(--s2u-red); font-weight: 600; }
.fx-cost-in { width: 84px; padding: 2px 4px; font-size: 12.5px; text-align: right; }
.fx-cost-cur { padding: 2px; font-size: 11px; margin-right: 3px; }
@media (max-width: 700px) {
  table.table.fx-list tbody tr { display: grid; grid-template-columns: auto minmax(0,1fr) auto; column-gap: 8px; padding: 6px 2px;
    grid-template-areas: "st sku mg" "ti ti ti" "co sa up"; }
  table.table.fx-list tbody td { display: block; padding: 0 !important; font-size: 12px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  table.table.fx-list tbody td:nth-child(1) { grid-area: st; }
  table.table.fx-list tbody td:nth-child(2) { grid-area: sku; }
  table.table.fx-list tbody td:nth-child(3) { grid-area: ti; max-width: none; }
  table.table.fx-list tbody td:nth-child(5) { grid-area: co; }
  table.table.fx-list tbody td:nth-child(5)::before { content: "cost "; color: var(--s2u-muted); }
  table.table.fx-list tbody td:nth-child(8) { grid-area: sa; }
  table.table.fx-list tbody td:nth-child(8)::before { content: "sells "; color: var(--s2u-muted); }
  table.table.fx-list tbody td:nth-child(9) { grid-area: mg; text-align: right; font-weight: 600; }
  table.table.fx-list tbody td:nth-child(4), table.table.fx-list tbody td:nth-child(6),
  table.table.fx-list tbody td:nth-child(7), table.table.fx-list tbody td:nth-child(10),
  table.table.fx-list tbody td:nth-child(11) { display: none; }
}

.qd-expbadge { display: inline-block; font-weight: 800; font-size: 11px; letter-spacing: .04em;
  color: #fff; background: #dc2626; border-radius: 3px; padding: 1px 6px; }
@media (max-width: 700px) { table.table.qd-list td.exp .qd-expbadge { display: none; } }
@media (max-width: 700px) { table.table.qd-list td.exp.badge::before { content: none; } }

/* Sidebar "Hub" label keeps Space Grotesk 900 (Chat-Dash Sidebar.jsx). */
.s2u-sidebar .brand .app-name { font-family: "Space Grotesk", var(--font-sys) !important; }

/* Numbers: system font with even-width digits (replaces the old mono). */
.num, td.num { font-variant-numeric: tabular-nums; }
.kpi .val { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* FX-Dash: a size smaller, same padding. */
table.table.fx-list tbody td { font-size: 12px; }
table.table.fx-list thead th { font-size: 10px; }
table.table.fx-list .chip { font-size: 9.5px; }

/* --- Margin by store (s2u-Tracker) ------------------------------------- */
.seg { display: inline-flex; border: 1px solid var(--s2u-border); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 4px 12px; font: 600 12px/1.4 var(--font-sys); color: var(--s2u-muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--s2u-border); }
.seg button.active { background: #1e3a5f; color: #fff; }
.kpi-row.mini { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 2px 0 12px; }
.kpi-row.mini .kpi { padding: 9px 12px; gap: 2px; box-shadow: none; }
.kpi-row.mini .kpi .lbl { font-size: 10px; }
.kpi-row.mini .kpi .val { font-size: 19px; }
.kpi-row.mini .kpi.on { border-color: #93c5fd; background: #f0f7ff; }
.val.gp, td.gp { color: #1d4ed8; font-weight: 700; }
table.table.gp-table td.gp { font-size: 15px; }
table.table.gp-table tr.total td { font-weight: 700; }
table.table.gp-table tr.total td.gp { font-size: 19px; color: #1d4ed8; background: #eff6ff; }
.est { margin-left: 5px; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #92400e; background: #fef3c7; border-radius: 3px; padding: 0 4px; vertical-align: 2px; }

/* Quote-Dock kill (skull) / delete (X) */
.qd-act.kill:hover { color: #7c2d12; border-color: #fdba74; background: #fff7ed; }

/* 4 action icons fit at 1440px: tighter icon buttons, narrower email. */
table.table.qd-list:not(.fx-list) td.em { max-width: 150px; }
table.table.qd-list:not(.fx-list) td.cust { max-width: 150px; }
.qd-act { width: 22px; height: 22px; margin-left: 1px; }
.qd-act svg { width: 13px; height: 13px; }

/* Estimated values (assumptions) — grey + italic + "est." tag. */
td.est-val { color: #94a3b8 !important; font-style: italic; font-weight: 400 !important; }
td.est-val .est { font-style: normal; }

/* Quote-Dock KPI tiles (2026-10-27): small equal-weight CA$ · US$ parts, then CAD total */
.qd-kpi .qd-parts { font-size: 12px; color: var(--s2u-muted); font-variant-numeric: tabular-nums; margin-top: 4px; }
.qd-kpi .qd-parts .sep { margin: 0 6px; opacity: .6; }
.qd-kpi .val { margin-top: 2px; }

/* Margin by store — run-rate view: 90D run-rate under each figure (2026-10-27) */
#costs-margin-table td .rr90 { font-size: 11px; font-weight: 500; color: var(--s2u-muted); margin-top: 2px; letter-spacing: 0; }
#costs-margin-table td.gp .rr90 { color: var(--s2u-muted); }

/* Quote follow-ups (2026-10-27) */
.qd-list td.fu { white-space: nowrap; }
.qd-fu { font: 600 11px/1 var(--font-sys, system-ui); border: 1px solid #d1d5db; background: #fff; color: #374151; border-radius: 999px; padding: 4px 8px; cursor: pointer; white-space: nowrap; }
.qd-fu.next { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.qd-fu.ok { border-color: #86efac; color: #047857; background: #f0fdf4; }
.qd-fu.off { color: #6b7280; background: #f9fafb; }
.qd-fu-menu { position: absolute; z-index: 60; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px; min-width: 240px; }
.qd-fu-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; font: 13px var(--font-sys, system-ui); color: #111827; border-radius: 6px; cursor: pointer; }
.qd-fu-menu button:hover:not(:disabled) { background: #f3f4f6; }
.qd-fu-menu button:disabled { color: #9ca3af; cursor: default; }
.qd-fu-menu .sep { height: 1px; background: #e5e7eb; margin: 4px 2px; }
.qd-fu-ctl { display: inline-flex; gap: 6px; align-items: center; margin-right: 10px; flex-wrap: wrap; }
.qd-sw { display: inline-flex; align-items: center; gap: 5px; font: 600 11px var(--font-sys, system-ui); border: 1px solid #d1d5db; background: #f9fafb; color: #6b7280; border-radius: 999px; padding: 4px 9px; cursor: pointer; }
.qd-sw .dot { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; }
.qd-sw.on { color: #047857; border-color: #86efac; background: #f0fdf4; }
.qd-sw.on .dot { background: #10b981; }
.qd-fu-src { font-size: 11px; color: var(--s2u-muted); }
@media (max-width: 700px) { .qd-fu-ctl { width: 100%; order: 5; margin: 6px 0 0; } }

.qd-fu-src.qd-connect { color: var(--s2u-blue, #1d4ed8); font-weight: 600; text-decoration: underline; }

/* ===== s2u-Tracker redesign (2026-10-27) — packed, small type ===== */
.tr-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tr-bar .meta { color: var(--s2u-muted); font-size: 11px; }
.tr-bar .spacer { flex: 1; }
.tr-seglbl { font: 600 10px/1 var(--font-sys); letter-spacing: .06em; text-transform: uppercase; color: var(--s2u-muted); }
.seg button.active { background: var(--s2u-navy); color: #fff; }
.tr-kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.tr-k { background: var(--s2u-surface); border: 1px solid var(--s2u-border-2); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.tr-k .l { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--s2u-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-k .v { font-size: 17px; font-weight: 800; margin-top: 2px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-k .v.gp { color: #1d4ed8; }
.tr-k .s { font-size: 10px; color: var(--s2u-muted); margin-top: 1px; line-height: 1.3; }
.tr-up { color: var(--s2u-ok); font-weight: 600; }
.tr-dn { color: #B91C1C; font-weight: 600; }
.card.tr-card { padding: 10px 12px; margin-bottom: 10px; }
.tr-card .card-head { margin-bottom: 6px; gap: 10px; flex-wrap: wrap; }
.tr-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tr-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.tr-table th { font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--s2u-muted); font-weight: 600; text-align: right; padding: 5px 6px; border-bottom: 1px solid var(--s2u-border); white-space: nowrap; }
.tr-table th.grp { text-align: center; border-bottom: 1px solid var(--s2u-border-2); color: #94A3B8; }
.tr-table td { padding: 5px 6px; border-bottom: 1px solid #F1F5F9; text-align: right; white-space: nowrap; vertical-align: top; }
.tr-table th:first-child, .tr-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--s2u-surface); z-index: 1; }
.tr-table td .sub { display: block; font-size: 10px; color: var(--s2u-muted); }
.tr-table td.gp { color: #1d4ed8; font-weight: 700; }
.tr-table .bl { border-left: 1px solid var(--s2u-border-2); }
.tr-table tr.click { cursor: pointer; }
.tr-table tr.click:hover td { background: #F8FAFC; }
.tr-table tr.tot td { font-weight: 700; background: #F8FAFC; border-top: 1px solid #CBD5E1; }
.tr-table .chip { font-size: 11px; }
.tr-usd { font-size: 9px; color: var(--s2u-muted); margin-left: 4px; }
.tr-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tr-cc { background: var(--s2u-surface); border: 1px solid var(--s2u-border-2); border-radius: 8px; padding: 10px 12px; position: relative; min-width: 0; }
.tr-cc .hd { display: flex; align-items: baseline; gap: 8px; }
.tr-cc .hd b { font-size: 12.5px; }
.tr-cc .hd .meta { color: var(--s2u-muted); font-size: 11px; }
.tr-cc .hd .big { margin-left: auto; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tr-cc .leg { display: flex; gap: 12px; font-size: 10.5px; color: var(--s2u-muted); margin: 2px 0; }
.tr-cc .leg span { display: inline-flex; align-items: center; gap: 5px; }
.tr-cc .leg i { width: 14px; height: 0; border-top: 2px solid #1d4ed8; display: inline-block; }
.tr-cc .leg i.ly { border-top: 2px dashed #9CA3AF; }
.tr-cc svg { display: block; width: 100%; height: 170px; }
.tr-tip { position: absolute; pointer-events: none; background: #111827; color: #fff; font-size: 11px; padding: 5px 7px; border-radius: 5px; display: none; white-space: nowrap; z-index: 5; }
.tr-wait { display: flex; flex-direction: column; justify-content: center; min-height: 120px; background: var(--s2u-surface-2); }
#tr-chart-store button { padding: 3px 9px; font-size: 11px; }
@media (max-width: 1100px) { .tr-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tr-charts { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .tr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-k .v { font-size: 16px; }
  #tr-chart-store { overflow-x: auto; max-width: 100%; }
}
.tr-cc .hd .big.gpc { color: #1d4ed8; }
#tr-grain button { padding: 3px 9px; font-size: 11px; }
