/* ===========================================================================
   Caldera Vibe — theme.css
   Design system, ported from the AiBLE CRM's v2 interface.

   Why a layer and not a rewrite
   -----------------------------
   styles.css carries the layout of 27 view files across a live app. Rewriting
   it to change how things LOOK would put every one of those layouts at risk
   for a cosmetic gain. So styles.css keeps owning STRUCTURE — grids, widths,
   what sits where — and this file owns the VISUAL LANGUAGE: colour, elevation,
   radius, motion, state, density and dark mode.

   It loads after styles.css and overrides by cascade order, never by
   !important. Rolling back is removing one <link>. Nothing else has to change,
   and no view file is touched.

   Caldera's own token names (--ink, --amber, --canvas, --sidebar …) are kept
   and redefined rather than renamed, so all 216 existing var() usages inherit
   dark mode and every future palette change for free.

   Contents
     1  tokens — light        7  cards + surfaces     13 toasts
     2  tokens — dark         8  tables               14 avatar menu
     3  base + motion         9  inputs + selects     15 skeleton
     4  sidebar + nav        10  buttons              16 density / motion
     5  top bar              11  tags + KPIs          17 print
     6  utility controls     12  drawer
   =========================================================================== */

/* ---------------------------------------------------------------- 1. LIGHT */
:root{
  color-scheme: light;

  /* ink */
  --ink:#141a21; --ink-soft:#4b5560; --muted:#8a929c; --ink-4:#a8b0b9;

  /* ground — warm paper, carried over from Caldera's existing palette */
  --canvas:#f4f1ea; --bg-2:#ece8df;
  --surface:#ffffff; --surface-2:#faf8f4; --surface-3:#f1ede4;

  /* strokes */
  --line:#e2ded3; --line-2:#efebe2; --line-3:#cfc9ba;

  /* brand — amber. --amber is the ACCENT (text, borders, icons);
     --amber-solid is the FILL that carries white text. They diverge in dark
     mode, where a fill dark enough for white text is too dark to read as a
     label. */
  --amber:#a86a14; --amber-600:#8a5610; --amber-solid:#b5751a;
  --amber-soft:#f8eed6; --amber-line:#e6c98a;

  --blue:#2e5c8a;  --blue-soft:#e9f1f9;  --blue-line:#c3d8ea;
  --green:#3b6d2f; --green-soft:#eaf3e0; --green-line:#c5ddb2;
  --red:#a32d2d;   --red-soft:#fae9e9;   --red-line:#eccccc;
  --purple:#6a4c93;--purple-soft:#f0ebf7;
  --cyan:#0e7c73;  --cyan-soft:#e4f3f1;

  --hover:#f7f4ed;

  /* sidebar */
  --sidebar:#1a2027; --sidebar-2:#232b34; --sidebar-3:#2d3741;
  --sidebar-line:#2b333c; --sidebar-ink:#d2d7dd; --sidebar-ink-2:#8792a0;

  /* geometry */
  --radius:10px; --r-sm:7px; --r-lg:14px; --r-pill:999px;

  /* elevation — two-part shadows: a tight contact shadow plus a wide ambient
     one. A single blurred shadow reads as fog; two read as a physical object
     sitting on a surface. */
  --e1:0 1px 2px rgba(20,26,33,.05), 0 1px 3px rgba(20,26,33,.06);
  --e2:0 1px 2px rgba(20,26,33,.05), 0 4px 12px rgba(20,26,33,.07);
  --e3:0 2px 4px rgba(20,26,33,.05), 0 12px 28px rgba(20,26,33,.10);
  --e4:0 4px 8px rgba(20,26,33,.06), 0 28px 60px rgba(20,26,33,.16);
  --shadow:var(--e2);
  --ring:0 0 0 3px rgba(181,117,26,.22);

  /* motion */
  --dur-1:110ms; --dur-2:190ms; --dur-3:320ms;
  --ease:cubic-bezier(.32,.72,0,1);
  --ease-out:cubic-bezier(.16,1,.3,1);
  --ease-bump:cubic-bezier(.34,1.56,.64,1);

  --skeleton-1:#eae6dc; --skeleton-2:#f6f3ec;
  --backdrop:rgba(24,20,14,.40);
  --on-brand:#ffffff;
}

/* ----------------------------------------------------------------- 2. DARK */
/* Not an inversion. A dark UI needs its own decisions: surfaces lift by
   getting LIGHTER (there is no shadow to see against black), accents move up
   in lightness to stay legible, and tint washes become low-alpha overlays
   rather than pale pastels. */
:root[data-theme="dark"]{
  color-scheme: dark;

  --ink:#edeae3; --ink-soft:#b3aea3; --muted:#8b857a; --ink-4:#6b6559;

  --canvas:#14120f; --bg-2:#0f0e0b;
  --surface:#1c1a16; --surface-2:#232019; --surface-3:#2b271f;

  --line:#332e26; --line-2:#262219; --line-3:#443d31;

  /* The accent lifts for legibility on a dark ground; the FILL darkens, so
     white text on a solid amber button still has contrast. */
  --amber:#e0a94f; --amber-600:#eabf72; --amber-solid:#8a5610;
  --amber-soft:rgba(224,169,79,.13); --amber-line:rgba(224,169,79,.30);

  --blue:#7fb2e0;  --blue-soft:rgba(127,178,224,.13);  --blue-line:rgba(127,178,224,.28);
  --green:#79c168; --green-soft:rgba(121,193,104,.13); --green-line:rgba(121,193,104,.28);
  --red:#e8766f;   --red-soft:rgba(232,118,111,.13);   --red-line:rgba(232,118,111,.30);
  --purple:#b191dd;--purple-soft:rgba(177,145,221,.13);
  --cyan:#4cc0b4;  --cyan-soft:rgba(76,192,180,.13);

  --hover:#272319;

  --sidebar:#0f0e0b; --sidebar-2:#171410; --sidebar-3:#211d16;
  --sidebar-line:#2a251c; --sidebar-ink:#ddd7cb; --sidebar-ink-2:#857e71;

  /* Depth in dark comes from a light top edge, not a drop shadow. */
  --e1:0 1px 2px rgba(0,0,0,.40), inset 0 1px 0 rgba(255,255,255,.03);
  --e2:0 2px 6px rgba(0,0,0,.44), inset 0 1px 0 rgba(255,255,255,.04);
  --e3:0 8px 24px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.05);
  --e4:0 24px 60px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.06);
  --shadow:var(--e2);
  --ring:0 0 0 3px rgba(224,169,79,.28);

  --skeleton-1:#232019; --skeleton-2:#2b271f;
  --backdrop:rgba(8,6,4,.68);
  --on-brand:#ffffff;
}

/* ---------------------------------------------------- 3. BASE + TRANSITIONS */
body{background:var(--canvas);color:var(--ink)}
.shell,.sidebar,.main,.topbar,.card,.content,.modal{
  transition:background-color var(--dur-2) var(--ease),
             border-color var(--dur-2) var(--ease),
             color var(--dur-2) var(--ease)}

/* Scrollbars, so the left panel and every inner scroller stop looking like a
   browser default dropped into a designed surface. */
*{scrollbar-width:thin;scrollbar-color:var(--line-3) transparent}
*::-webkit-scrollbar{width:10px;height:10px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:var(--line-3);border-radius:var(--r-pill);
  border:3px solid transparent;background-clip:content-box}
*::-webkit-scrollbar-thumb:hover{background:var(--muted);background-clip:content-box;
  border:3px solid transparent}
.sidebar *::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14);background-clip:content-box;
  border:3px solid transparent}
.sidebar *::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.26);background-clip:content-box;
  border:3px solid transparent}
.sidebar{scrollbar-color:rgba(255,255,255,.16) transparent}

/* ------------------------------------------------------- 4. SIDEBAR + NAV */
.sidebar{
  background:
    radial-gradient(120% 60% at 0% 0%, var(--sidebar-3) 0%, transparent 55%),
    linear-gradient(180deg, var(--sidebar-2) 0%, var(--sidebar) 62%);
  border-right:1px solid var(--sidebar-line)}
.sidebar .brandmark{border-bottom:1px solid var(--sidebar-line)}
.sidebar .brand-logo{border-radius:9px;
  box-shadow:0 2px 10px rgba(181,117,26,.38), inset 0 1px 0 rgba(255,255,255,.18)}

.nav{scroll-behavior:smooth;overscroll-behavior:contain}
.nav-group{text-transform:uppercase;letter-spacing:.12em;font-size:9.5px;
  font-weight:700;color:var(--sidebar-ink-2);opacity:.75}
.nav a,.nav .nav-item{position:relative;border-radius:var(--r-sm);margin:1px 6px;
  color:var(--sidebar-ink-2);
  transition:background-color var(--dur-1) var(--ease),
             color var(--dur-1) var(--ease),
             padding-left var(--dur-2) var(--ease-out)}
.nav a:hover,.nav .nav-item:hover{background:rgba(255,255,255,.055);
  color:var(--sidebar-ink);padding-left:15px}
/* The active item is a tinted slab with an amber rail, not a solid block —
   a solid block fights the brand mark for attention. */
.nav a.active,.nav .nav-item.active{
  background:linear-gradient(90deg, rgba(181,117,26,.30), rgba(181,117,26,.08));
  color:#fff}
.nav a.active::before,.nav .nav-item.active::before{
  content:"";position:absolute;left:-6px;top:6px;bottom:6px;width:3px;
  border-radius:0 3px 3px 0;background:var(--amber-solid);
  animation:cx-rail var(--dur-3) var(--ease-bump) both}
@keyframes cx-rail{from{transform:scaleY(0)}to{transform:scaleY(1)}}
.nav .nav-ico{transition:transform var(--dur-2) var(--ease-bump)}
.nav a:hover .nav-ico,.nav .nav-item:hover .nav-ico{transform:scale(1.12)}

.sidebar-foot{border-top:1px solid var(--sidebar-line)}
.user-av{box-shadow:0 2px 8px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.14)}

/* ------------------------------------------------------------- 5. TOP BAR */
/* Sticky and translucent; it grows a hairline and a shadow only once the page
   has actually scrolled — .cx-scrolled is set by ui.js. */
.topbar{
  background:color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
  backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid transparent;
  transition:border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease)}
.cx-scrolled .topbar{border-bottom-color:var(--line);box-shadow:var(--e1)}
.topbar h2{letter-spacing:-.02em}
.tb-clock{background:var(--surface-2);border-color:var(--line);color:var(--ink-soft);
  font-variant-numeric:tabular-nums}

/* The profile block becomes the menu trigger. */
.tb-profile{height:34px;padding:0 9px 0 4px;border:1px solid transparent;
  border-radius:var(--r-sm);background:transparent;cursor:pointer;
  transition:background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease)}
.tb-profile:hover{background:var(--surface-2);border-color:var(--line)}
.tb-profile[aria-expanded="true"]{background:var(--amber-soft);border-color:var(--amber-line)}
.tb-av{background:var(--amber-solid);color:var(--on-brand);
  box-shadow:0 1px 3px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18)}
.tb-caret{font-size:10px;color:var(--muted);transition:transform var(--dur-2) var(--ease)}
.tb-profile[aria-expanded="true"] .tb-caret{transform:rotate(180deg);color:var(--amber)}
/* Sign-out moves into the menu; the bare button stays in the DOM as a
   fallback for any session where ui.js did not load. */
.cx-ready .tb-signout{display:none}

/* ------------------------------------------------- 6. UTILITY CONTROLS */
.cx-util{display:flex;align-items:center;gap:4px}
.cx-util button{display:grid;place-items:center;width:32px;height:32px;
  border:1px solid transparent;border-radius:var(--r-sm);background:transparent;
  color:var(--muted);cursor:pointer;
  transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease)}
.cx-util button:hover{background:var(--surface-2);border-color:var(--line);color:var(--ink)}
.cx-util button.on{color:var(--amber);background:var(--amber-soft);border-color:var(--amber-line)}
.cx-util svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round}

/* Rail: collapses the sidebar to an icon strip.
   buildNav() emits <span class="lbl">, not .nav-label — targeting the wrong
   class left every label in place while the sidebar shrank to 68px, which is
   what made the first build look broken. styles.css already uses span.lbl for
   its own narrow-screen collapse, so this reuses that contract. */
:root[data-rail="on"] .sidebar{width:68px;overflow:hidden}
:root[data-rail="on"] .sidebar .brand-name,
:root[data-rail="on"] .sidebar .brand-sub,
:root[data-rail="on"] .nav-group,
:root[data-rail="on"] .nav-item span.lbl,
:root[data-rail="on"] .nav .nav-label,
:root[data-rail="on"] .user-meta{display:none}
:root[data-rail="on"] .nav{padding:12px 6px}
:root[data-rail="on"] .nav-item,:root[data-rail="on"] .nav a{
  justify-content:center;padding-left:0;padding-right:0;margin-left:4px;margin-right:4px}
:root[data-rail="on"] .nav-item:hover,:root[data-rail="on"] .nav a:hover{padding-left:0}
/* The accent rail would sit outside a 68px strip and be clipped, so the
   active item reads as a filled slab instead. */
:root[data-rail="on"] .nav-item.active::before,
:root[data-rail="on"] .nav a.active::before{display:none}
:root[data-rail="on"] .nav-item.active{background:var(--amber-solid);color:#fff}
:root[data-rail="on"] .brandmark,
:root[data-rail="on"] .sidebar-foot,
:root[data-rail="on"] .user-row{justify-content:center;padding-left:0;padding-right:0}
:root[data-rail="on"] .brandmark .brand-logo{margin:0}
.sidebar{transition:width var(--dur-3) var(--ease-out)}
/* Below 860px styles.css already turns the sidebar into an overlay drawer, so
   the rail must not also shrink it. */
/* The inverted mobile rail rule lived here and is gone (11 Nov 2026): below 860px
   the sidebar is a drawer, so "rail" is a desktop-only idea. See the block at the
   end of this file. */

/* --------------------------------------------------- 7. CARDS + SURFACES */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--e1);
  transition:box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease),
             border-color var(--dur-2) var(--ease)}
.card:hover{box-shadow:var(--e2)}
.section-intro{background:var(--surface-2);border:1px solid var(--line-2);
  border-radius:var(--r-lg);color:var(--ink-soft)}
.note-box{background:var(--surface-2);border:1px solid var(--line-2);border-radius:var(--radius)}
.empty{color:var(--muted)}

.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--e1);position:relative;overflow:hidden;
  transition:box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease)}
.kpi:hover{box-shadow:var(--e2);transform:translateY(-1px)}
/* A hairline of the accent across the top gives the tile a lit edge rather
   than a flat fill — the "3D" read without a drop shadow on a small object. */
.kpi::after{content:"";position:absolute;inset:0 0 auto 0;height:2px;
  background:var(--amber-solid);opacity:.85}
.kpi.accent-green::after{background:var(--green)}
.kpi.accent-blue::after{background:var(--blue)}
.kpi.accent-red::after{background:var(--red)}
.kpi.accent-amber::after{background:var(--amber-solid)}
.kpi .k-val{letter-spacing:-.02em}

/* ---------------------------------------------------------------- 8. TABLES */
table.data,table.tbl,table.tm,table.dg{border-color:var(--line)}
table.data thead th,table.tbl thead th,table.tm thead th{
  position:sticky;top:0;z-index:2;
  background:var(--surface-2);color:var(--ink-soft);
  border-bottom:1px solid var(--line);
  text-transform:uppercase;letter-spacing:.06em;font-size:10.5px;font-weight:700}
table.data tbody tr,table.tbl tbody tr,table.tm tbody tr{
  transition:background-color var(--dur-1) var(--ease)}
table.data tbody tr:hover,table.tbl tbody tr:hover,table.tm tbody tr:hover{
  background:var(--hover)}
table.data td,table.tbl td,table.tm td{border-bottom:1px solid var(--line-2)}
.tbl-wrap{border-radius:var(--radius);border:1px solid var(--line);overflow:auto}
.tbl-count,.pg-lbl{color:var(--muted)}

/* Row actions: history · edit · delete. Kept permanently visible rather than
   revealed on hover — they are the point of the row for most operators, and a
   hover-only control is invisible on a touch screen and to anyone scanning for
   what they can do. */
.row-act{white-space:nowrap}
.btn-mini{border:1px solid var(--line);background:var(--surface);color:var(--ink-soft);
  border-radius:var(--r-sm);padding:3px 7px;font-size:12px;line-height:1.4;
  margin-left:3px;cursor:pointer;
  transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
             border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease)}
.btn-mini:hover{background:var(--surface-2);color:var(--ink);border-color:var(--line-3)}
.btn-mini:active{transform:translateY(1px)}
.btn-ic-edit:hover{color:var(--amber);border-color:var(--amber-line);background:var(--amber-soft)}
.btn-ic-del:hover{color:var(--red);border-color:var(--red-line);background:var(--red-soft)}

/* Two-line cell: a name with a quiet qualifier under it. styles.css never
   defined these — they came from visit.html's own inline stylesheet — so the
   Sales Order and Direct Customer tables were rendering the name and its
   qualifier run together on one line. Defining them here fixes that and gives
   every future view the same primitive. */
.nm{display:block;font-weight:600;color:var(--ink);line-height:1.35}
.sub{display:block;font-size:11px;color:var(--muted);line-height:1.35}

/* ------------------------------------------------------ 9. INPUTS + SELECT */
input,select,textarea{background:var(--surface);color:var(--ink);
  border:1px solid var(--line);border-radius:var(--r-sm);
  transition:border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease),
             background-color var(--dur-1) var(--ease)}
input:hover,select:hover,textarea:hover{border-color:var(--line-3)}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--amber);
  box-shadow:var(--ring);background:var(--surface)}
input:disabled,select:disabled,textarea:disabled{background:var(--surface-3);
  color:var(--muted);cursor:not-allowed}
.fld label{color:var(--ink-soft);font-weight:600;letter-spacing:.01em}
.req{color:var(--red)}

/* searchable select — core.js swaps any list over 6 options for this */
.ssel{position:relative}
.ssel-input{width:100%}
.ssel-list{position:absolute;z-index:70;left:0;right:0;top:calc(100% + 4px);
  max-height:290px;overflow:auto;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--e3);
  padding:4px;animation:cx-pop var(--dur-2) var(--ease-out) both}
@keyframes cx-pop{from{opacity:0;transform:translateY(-4px)}}
.ssel-item{padding:7px 10px;border-radius:var(--r-sm);font-size:13px;cursor:pointer;
  transition:background-color var(--dur-1) var(--ease)}
.ssel-item:hover{background:var(--hover)}
.ssel-item.sel{background:var(--amber-soft);color:var(--amber);font-weight:600}
.ssel-empty{padding:9px 10px;font-size:12px;color:var(--muted)}

/* --------------------------------------------------------------- 10. BUTTONS */
.btn{border-radius:var(--r-sm);font-weight:600;
  transition:background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
             box-shadow var(--dur-1) var(--ease), transform var(--dur-1) var(--ease)}
.btn:active{transform:translateY(1px)}
.btn-go{background:var(--amber-solid);color:var(--on-brand);border-color:transparent;
  box-shadow:var(--e1), inset 0 1px 0 rgba(255,255,255,.16)}
.btn-go:hover{background:var(--amber-600);box-shadow:var(--e2), inset 0 1px 0 rgba(255,255,255,.16)}
.btn-ghost{background:var(--surface);border-color:var(--line);color:var(--ink-soft)}
.btn-ghost:hover{background:var(--surface-2);color:var(--ink);border-color:var(--line-3)}
.btn-primary{background:var(--ink);color:var(--canvas)}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none}
.act-bar{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--e1)}

/* ----------------------------------------------------- 11. TAGS, PILLS, KPIs */
.tag{border-radius:var(--r-pill);font-weight:600;font-size:11px;letter-spacing:.01em;
  padding:2px 9px;border:1px solid transparent}
.tag-gray{background:var(--surface-3);color:var(--ink-soft);border-color:var(--line)}
.tag-amber{background:var(--amber-soft);color:var(--amber);border-color:var(--amber-line)}
.tag-green{background:var(--green-soft);color:var(--green);border-color:var(--green-line)}
.tag-blue{background:var(--blue-soft);color:var(--blue);border-color:var(--blue-line)}
.tag-red{background:var(--red-soft);color:var(--red);border-color:var(--red-line)}
.tag-purple{background:var(--purple-soft);color:var(--purple)}
.tag-cyan{background:var(--cyan-soft);color:var(--cyan)}
.alert{border-radius:var(--radius);border:1px solid var(--line)}
.alert-amber{background:var(--amber-soft);border-color:var(--amber-line);color:var(--ink)}
.alert-green{background:var(--green-soft);border-color:var(--green-line);color:var(--ink)}
.alert-red{background:var(--red-soft);border-color:var(--red-line);color:var(--ink)}
.alert-blue{background:var(--blue-soft);border-color:var(--blue-line);color:var(--ink)}
.warn-txt{color:var(--red);font-weight:600}

/* Surfaces styles.css paints a literal #fff. In light mode that is identical
   to --surface, so these went unnoticed; in dark mode each one is a white
   patch — the row edit/delete buttons, every table's search box, the month
   picker, the multi-select list, the hierarchy rows and the import preview
   card. Re-pointed at the tokens so they follow the theme. */
.btn-edit,.tbl-search,.mon-pick,.ms-list,.hb-row,.hb-pri-on{background:var(--surface)}
.btn-del{background:var(--surface);border-color:var(--red-line)}
.card-lite{background:var(--surface-2);border-color:var(--line);border-radius:var(--radius);box-shadow:var(--e1)}
.btn-edit:hover{background:var(--surface-2)}
.btn-del:hover{background:var(--red-soft)}
.mono{font-family:var(--mono);font-size:12px}
.sub{color:var(--muted)}

/* ---------------------------------------------------------------- 12. DRAWER */
/* The pop-up is a side panel, not a floating card: it enters from the right
   edge, is full height, square, and keeps its own scrolling body with the
   actions pinned to a tinted footer band. styles.css renders the overlay with
   display:none/flex; this redefines it so the panel can animate in and out
   instead of snapping. */
.modal-overlay{
  display:flex;align-items:stretch;justify-content:flex-end;padding:0;
  background:var(--backdrop);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  opacity:0;visibility:hidden;
  transition:opacity var(--dur-2) var(--ease), visibility 0s linear var(--dur-2)}
.modal-overlay.show{display:flex;opacity:1;visibility:visible;
  transition:opacity var(--dur-2) var(--ease), visibility 0s}
.modal{
  width:min(680px,96vw);max-width:none;height:100%;max-height:none;margin:0;
  border-radius:0;border:0;
  background:var(--surface);box-shadow:var(--e4);
  display:flex;flex-direction:column;
  transform:translateX(100%);
  transition:transform var(--dur-3) var(--ease-out)}
.modal-overlay.show .modal{transform:none}
.modal.wide{width:min(980px,98vw)}
@media (max-width:700px){ .modal,.modal.wide{width:100%} }

.modal-head{background:var(--surface);border-bottom:1px solid var(--line);
  padding:17px 22px}
.modal-head h3{letter-spacing:-.015em;font-size:16px}
.modal-x{color:var(--muted);border-radius:var(--r-sm);
  transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease)}
.modal-x:hover{background:var(--surface-2);color:var(--ink)}
.modal-body{padding:22px;overflow-y:auto;flex:1}
.modal-foot{background:var(--surface-2);border-top:1px solid var(--line);
  padding:14px 22px;display:flex;gap:10px;align-items:center;justify-content:flex-end}

/* --------------------------------------------------------------- 13. TOASTS */
/* styles.css gives the toast z-index 50 and the drawer 60, so every message
   raised from inside a drawer — including the save errors the server sends
   back — rendered BEHIND it and was invisible. The operator saw a click that
   did nothing. Toasts must outrank anything they can be raised from.
   Errors also need room: "Insufficient stock: need 50 but only 3.274
   available at PRODUCTION" does not fit a one-line pill. */
/* position stays FIXED. An earlier pass set position:relative here to anchor
   the ::before accent bar and silently overrode styles.css's position:fixed —
   the toast dropped into normal flow at the end of <body>, so bottom/right no
   longer applied and it rendered off the bottom-left corner. A fixed element is
   already a containing block for its own pseudo-element. */
/* pointer-events:none is NOT optional. styles.css hides the toast with
   opacity:0 and never display:none, so the element sits in the bottom-right
   corner at all times. Raising its z-index above the drawer put an invisible
   460px box over the drawer's Close / Save buttons and swallowed every click on
   them. A toast is never interactive, so it should not take the pointer at all. */
.toast{position:fixed;z-index:120;pointer-events:none;
  border-radius:var(--r-lg);border:1px solid var(--line);
  background:var(--surface);color:var(--ink);box-shadow:var(--e3);
  overflow:hidden;padding-left:16px;
  max-width:min(460px,calc(100vw - 44px));white-space:normal;line-height:1.5}
.toast::before{content:"";position:absolute;inset:0 auto 0 0;width:3px;
  background:var(--amber-solid)}
.toast.ok::before{background:var(--green)}
.toast.err::before{background:var(--red)}
/* styles.css still paints .toast.ok / .toast.err with a solid green/red fill.
   Those selectors are (0,2,0) and beat this layer's plain .toast (0,1,0), so the
   fill won while the colour above set dark ink on top of it - black text on a
   saturated background, unreadable in light mode. Re-assert the surface at equal
   specificity; this layer loads after styles.css, so the cascade settles it and
   no !important is needed. The state stays legible through the left bar. */
.toast.ok,.toast.err{background:var(--surface);color:var(--ink)}
.toast.show{animation:cx-toast-in var(--dur-3) var(--ease-bump) both}
@keyframes cx-toast-in{from{opacity:0;transform:translateX(18px) scale(.96)}}

/* ---------------------------------------------------------- 14. AVATAR MENU */
.cx-menu{position:absolute;top:58px;right:22px;z-index:70;width:266px;overflow:hidden;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--e3);
  animation:cx-pop var(--dur-2) var(--ease-out) both}
.cx-menu.hidden{display:none}
.cx-menu-id{display:flex;align-items:center;gap:10px;padding:13px;
  border-bottom:1px solid var(--line-2)}
.cx-menu-av{width:34px;height:34px;flex:none;border-radius:var(--r-pill);
  background:var(--amber-solid);color:var(--on-brand);display:grid;place-items:center;
  font-size:12px;font-weight:700;
  box-shadow:0 1px 3px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18)}
.cx-menu-who{display:flex;flex-direction:column;min-width:0;line-height:1.4}
.cx-menu-nm{font-size:12.5px;font-weight:700;color:var(--ink)}
.cx-menu-em{font-family:var(--mono);font-size:10.5px;color:var(--muted);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cx-menu-rl{font-size:10.5px;color:var(--muted);text-transform:capitalize}
.cx-menu-prefs{display:flex;flex-direction:column;gap:9px;padding:11px 13px;
  border-bottom:1px solid var(--line-2)}
.cx-menu-row{display:flex;align-items:center;justify-content:space-between;gap:8px;
  font-size:11.5px;color:var(--ink-soft)}
.cx-seg{display:flex;padding:2px;background:var(--canvas);border:1px solid var(--line);
  border-radius:6px}
.cx-seg-o{font:inherit;font-size:11px;line-height:1.4;padding:2px 8px;border:0;
  border-radius:4px;background:transparent;color:var(--muted);cursor:pointer;
  transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease)}
.cx-seg-o:hover{color:var(--ink-soft)}
.cx-seg-o.on{background:var(--surface);color:var(--ink);font-weight:600;
  box-shadow:0 1px 1px rgba(20,26,33,.07)}
:root[data-theme="dark"] .cx-seg-o.on{box-shadow:none;border:1px solid var(--line);padding:1px 7px}
.cx-menu-foot{padding:7px}
.cx-menu-out{display:flex;align-items:center;gap:8px;width:100%;font:inherit;font-size:12px;
  color:var(--ink-soft);padding:7px;border:0;border-radius:5px;background:transparent;
  cursor:pointer;text-align:left;
  transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease)}
.cx-menu-out:hover{background:var(--hover);color:var(--ink)}
.cx-menu-out svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round}

/* -------------------------------------------------------------- 15. SKELETON */
.loading{color:var(--muted)}
.spinner{border-color:var(--line);border-top-color:var(--amber)}

/* Boot splash — covers the sign-in form while a saved session is restored, so
   a returning user never sees a prompt they do not need and cannot type into a
   form that is about to be replaced. */
.boot-splash{position:fixed;inset:0;z-index:200;display:flex;align-items:center;
  justify-content:center;background:var(--canvas);
  transition:opacity var(--dur-3) var(--ease), visibility 0s linear var(--dur-3)}
.boot-splash.gone{opacity:0;visibility:hidden;pointer-events:none}
.boot-card{display:flex;flex-direction:column;align-items:center;gap:16px;text-align:center;
  padding:30px 34px}
.boot-mark{width:54px;height:54px;object-fit:contain;border-radius:12px;
  box-shadow:0 2px 14px rgba(181,117,26,.30)}
.boot-spin{width:22px;height:22px;border:2px solid var(--line);border-top-color:var(--amber);
  border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.boot-msg{font-size:13px;color:var(--ink-soft);margin:0}
.boot-slow{display:flex;flex-direction:column;gap:10px;align-items:center;
  font-size:12.5px;color:var(--muted)}
.boot-slow.hidden{display:none}
.boot-slow p{margin:0}

/* -------------------------------------------- 16. DENSITY / MOTION OPT-OUT */
/* Compact drops row height for the operators who live in a list all day;
   cozy is the default for everyone else. */
:root[data-density="compact"]{font-size:12.5px}
:root[data-density="compact"] .tbl-wrap td{padding-top:5px;padding-bottom:5px}
:root[data-density="compact"] .tbl-wrap thead th{padding-top:6px;padding-bottom:6px}
:root[data-density="compact"] .card{border-radius:var(--radius)}
:root[data-density="compact"] .kpi{padding:10px 13px}
:root[data-density="compact"] .nav a,:root[data-density="compact"] .nav .nav-item{
  padding-top:6px;padding-bottom:6px}
:root[data-density="compact"] .content{padding:16px}

/* Honour the OS setting AND the in-app switch. Every animation above is
   decoration; none of it carries information that is lost when removed. */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;
    transition-duration:.01ms !important;scroll-behavior:auto !important}
}
:root[data-motion="off"] *,:root[data-motion="off"] *::before,:root[data-motion="off"] *::after{
  animation-duration:.01ms !important;animation-iteration-count:1 !important;
  transition-duration:.01ms !important}
:root[data-motion="off"] .kpi:hover{transform:none}

:focus-visible{outline:2px solid var(--amber);outline-offset:2px}

/* ----------------------------------------------------------------- 17. PRINT */
/* The app is a fixed-height shell: #app is 100vh with overflow hidden and
   .content is the scroller. A printer honours that literally, so the page box
   comes out one screen tall and everything below the fold is discarded. The
   first job is unwinding that, not styling. */
@media print{
  @page{size:A4 portrait;margin:12mm 10mm}
  html,body{height:auto !important;overflow:visible !important;background:#fff !important}
  #app{display:block !important;height:auto !important;overflow:visible !important}
  .shell{display:block !important}
  .main{display:block !important;overflow:visible !important}
  .content{overflow:visible !important;height:auto !important;padding:0 !important}
  .card,.tbl-wrap,.modal-body{overflow:visible !important;max-height:none !important}
  .sidebar,.topbar,.cx-util,.cx-menu,.act-bar,.pager,.row-act,.toast{display:none !important}
  .card{box-shadow:none !important;border:1px solid #ccc !important;break-inside:avoid}
  .tag{border:1px solid #999 !important;background:none !important;color:#000 !important}
}

/* ===================================================================
   Nov 2026 - action-in-card-header, collapsible page info, tab rows.
   Layered over styles.css by cascade order, never by !important.
   =================================================================== */

/* "Adds a row to the table below" button, living in the card header's right slot. */
.card-act{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.card-act .btn{white-space:nowrap}
@media(max-width:640px){
  .card-head{flex-wrap:wrap}
  .card-act{width:100%}
  .card-act .btn{width:100%;justify-content:center}
}

/* Page helper text, collapsed behind an info chip. Collapsed costs 0 vertical space
   because the chip rides on the tab row. */
.subtabs-row{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;
  flex-wrap:wrap;margin-bottom:18px;border-bottom:1px solid var(--line)}
.subtabs-row .subtabs{margin-bottom:0;border-bottom:none;flex:1 1 auto}
.info-wrap{position:relative;flex:0 0 auto;padding-bottom:6px}
.info-chip{appearance:none;background:transparent;border:1px solid var(--line);color:var(--muted);
  border-radius:999px;font-size:12px;font-weight:600;line-height:1;padding:5px 10px;cursor:pointer;
  transition:.12s}
.info-chip:hover{color:var(--ink);border-color:var(--ink-soft)}
.info-chip.on{color:var(--amber);border-color:var(--amber)}
.info-panel{display:none;position:absolute;right:0;top:calc(100% + 6px);z-index:40;
  width:min(620px,86vw);background:var(--card,#fff);border:1px solid var(--line);border-radius:10px;
  box-shadow:0 10px 30px rgba(0,0,0,.14);padding:14px 16px;font-size:12.5px;line-height:1.55;
  color:var(--ink-soft);text-align:left;font-weight:400}
.info-panel.open{display:block}
.info-panel b,.info-panel strong{color:var(--ink)}

/* Page info chip when a page has no tab bar - sits on its own minimal row, right-aligned. */
.info-row{display:flex;justify-content:flex-end;margin:-4px 0 10px}

/* Grouped / expandable batch view: stage groups that open to an item table. */
.grp{border:1px solid var(--line);border-radius:10px;margin-bottom:10px;overflow:hidden;
  background:var(--card,#fff)}
.grp-h{display:flex;align-items:center;gap:10px;padding:11px 14px;cursor:pointer;
  background:var(--chip,rgba(0,0,0,.02));transition:.12s}
.grp-h:hover{background:rgba(0,0,0,.045)}
.grp-h .caret{font-size:11px;color:var(--muted);width:12px;flex:0 0 auto;transition:transform .15s}
.grp.open>.grp-h .caret{transform:rotate(90deg)}
.grp-h .grp-t{font-weight:700;font-size:13px;flex:1 1 auto}
.grp-h .grp-m{font-size:11.5px;color:var(--muted);font-weight:500;display:flex;gap:10px;flex-wrap:wrap}
.grp-b{display:none;padding:0 2px 2px}
.grp.open>.grp-b{display:block}
.grp-b table.data{border:none}
.grp-lvl2{margin:6px 8px}

/* ---------- Mod 9: fused action buttons + folded page info ---------- */
/* The card header is the anchor for an absolutely-positioned info panel, and must
   not clip it: the add button and the info chip both live there now. */
.card{overflow:visible}
.card-head{position:relative}
.card-act .info-wrap{padding-bottom:0}
.card-act .info-panel{top:calc(100% + 10px)}
/* An act-bar that survives the fuse pass (no table under it) stays usable but quiet. */
.act-bar{margin-bottom:10px}

/* Mod 10's .grp-sub rules are gone with the expanding-row batch hub they styled;
   the batch is a detail page now (Mod 11 below). groupBlock itself is still used by
   Stock & re-order's batch-wise consumption view. */

/* ---------- Mod 11: record detail pages ---------- */
/* Matches the hub pattern in the Chemtex AiBLE apps so the two read alike. */
.dp-head{margin:0 0 12px}
.dp-crumb{font-size:10.5px;letter-spacing:.13em;text-transform:uppercase;
  color:var(--muted,#8a8a8a);font-weight:700;margin-bottom:5px}
.dp-title-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.dp-title{font-size:20px;font-weight:700;margin:0;letter-spacing:-.01em}
.dp-back{flex:0 0 auto}
.dp-sub{font-size:13px;color:var(--muted,#8a8a8a);margin-top:4px}
.dp-header{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
  gap:10px 24px;background:var(--surface,#fff);border:1px solid var(--line,#e6e6e6);
  border-radius:10px;padding:14px 16px;margin-bottom:12px}
.dp-header>div>span{display:block;font-size:10.5px;letter-spacing:.07em;
  text-transform:uppercase;color:var(--muted,#8a8a8a);font-weight:700;margin-bottom:3px}
.dp-header>div>strong{font-weight:600;font-size:13.5px}
.dp-tabs{display:flex;gap:4px;border-bottom:2px solid var(--line,#e6e6e6);
  margin-bottom:14px;flex-wrap:wrap;overflow-x:auto}
.dp-tabs::-webkit-scrollbar{display:none}
.dp-tab{background:none;border:none;padding:9px 15px;cursor:pointer;font-size:13.5px;
  font-weight:600;color:var(--muted,#8a8a8a);border-bottom:2px solid transparent;
  margin-bottom:-2px;flex:0 0 auto;white-space:nowrap;font-family:inherit}
.dp-tab:hover{color:var(--ink,#1a1a1a)}
.dp-tab.active{color:var(--accent,#b4632a);border-bottom-color:var(--accent,#b4632a)}
.dp-badge{display:inline-block;min-width:18px;padding:0 6px;border-radius:9px;
  background:var(--line-2,#eee);color:var(--muted,#8a8a8a);font-size:11px;
  line-height:18px;text-align:center;margin-left:5px}
.dp-tab.active .dp-badge{background:var(--accent,#b4632a);color:#fff}
/* a list row that opens a detail page */
.row-open{cursor:pointer;color:var(--accent,#b4632a);font-weight:600;
  background:none;border:none;padding:0;font-family:inherit;font-size:inherit;text-align:left}
.row-open:hover{text-decoration:underline}

/* ---------- Mod 11: home page index ---------- */
/* Deliberately NOT .home-grid — that class already belongs to the live KPI tiles
   above. These are the navigation cards. */
.mod-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(232px,1fr));
  gap:12px;margin:0 0 22px}
.mod-card{display:block;text-decoration:none;background:var(--surface,#fff);
  border:1px solid var(--line,#e6e6e6);border-radius:12px;padding:15px 16px;
  transition:border-color .15s,box-shadow .15s,transform .1s}
.mod-card:hover{border-color:var(--accent,#b4632a);
  box-shadow:0 4px 14px rgba(16,24,40,.08);transform:translateY(-1px)}
.mod-card .nav-ico{margin-bottom:10px}
.mod-card-t{font-weight:650;color:var(--ink,#1a1a1a);margin-bottom:3px;font-size:14px}
.mod-card-d{font-size:12.5px;color:var(--muted,#8a8a8a);line-height:1.45}
.mod-ext{font-size:11px;color:var(--muted,#8a8a8a)}

/* ---------- Mod 12: batch hub - row actions, header actions, filters ---------- */
/* Record-level buttons in a detail page's title row (history / edit / delete), pushed
   right so they sit opposite the back button and title. */
.dp-acts{margin-left:auto;display:flex;gap:6px;flex:0 0 auto}
@media (max-width:640px){.dp-acts{margin-left:0;width:100%}}

/* A whole row that opens its record. The action cell keeps its own cursor so the
   history / edit / delete buttons do not look like part of the row link. */
tr.row-link{cursor:pointer}
tr.row-link:hover{background:var(--hover,rgba(0,0,0,.025))}
tr.row-link .row-act{cursor:default}

/* A key/value grid used as a card body. wrapCard gives its body no padding - tables
   are meant to run edge to edge - so a grid dropped in there needs its own, or the
   text sits flush against the card border. */
.dp-kv{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
  gap:14px 24px;padding:16px 18px;margin:0;border:0;background:transparent}
.dp-kv>div>span{display:block;font-size:10.5px;letter-spacing:.07em;
  text-transform:uppercase;color:var(--muted,#8a8a8a);font-weight:700;margin-bottom:3px}
.dp-kv>div>strong{font-weight:600;font-size:13.5px;display:block;line-height:1.45;
  word-break:break-word}

/* The created / last-modified line under a record's detail grid. */
.dp-stamp{padding:0 18px 15px;margin-top:-4px;font-size:11.5px;line-height:1.6;
  color:var(--muted,#8a8a8a)}
.dp-stamp b{font-weight:600;color:var(--ink-soft,#555)}

/* A read-only value standing in for an input, when a form is opened already scoped
   to one record (the batch is fixed when filling from inside a batch). */
.locked-val{padding:8px 10px;border:1px dashed var(--line,#e6e6e6);border-radius:8px;
  background:var(--hover,rgba(0,0,0,.02));font-size:13px;font-weight:600}

/* Filter bar above a list: selects + dates + sort, wrapping on narrow screens. */
.flt-bar{display:flex;flex-wrap:wrap;gap:8px 10px;align-items:flex-end;
  padding:12px 18px;border-bottom:1px solid var(--line,#e6e6e6)}
.flt-bar>label{display:flex;flex-direction:column;gap:3px;font-size:10.5px;
  letter-spacing:.07em;text-transform:uppercase;color:var(--muted,#8a8a8a);font-weight:700}
.flt-bar select,.flt-bar input{font-family:inherit;font-size:13px;padding:6px 8px;
  border:1px solid var(--line,#e6e6e6);border-radius:7px;background:var(--surface,#fff);
  color:var(--ink,#1a1a1a)}
.flt-bar .flt-clear{align-self:flex-end}
.flt-count{margin-left:auto;align-self:flex-end;font-size:12px;
  color:var(--muted,#8a8a8a);font-weight:600}
@media (max-width:640px){.flt-bar{padding:12px 14px}.flt-count{margin-left:0}}

/* Delete in a detail-page header: red text on a ghost button. The solid .btn-danger
   fill shouts next to History and Edit, for the action least often wanted. */
.dp-acts .dp-del{color:#a32d2d}
.dp-acts .dp-del:hover{background:rgba(163,45,45,.08);border-color:rgba(163,45,45,.35)}

/* The back button owns its own line above the title. Sharing the title row with the
   title, the chips and the action buttons squeezed it out on narrow screens. */
.dp-backrow{margin-bottom:8px}
.dp-backrow .dp-back{padding-left:9px}

/* A locked field inside a form grid: the select is hidden and this replaces it. */
.fld>.locked-val{margin-top:0}

/* Report tables now page like the rest, so they need the same tools strip. */
.rpt-wrap>.tbl-tools{justify-content:flex-end}

/* Amber toast: the save went through but something needs the operator's attention
   (consumption recorded against stock that is not there). */
.toast.warn{background:var(--amber,#b5751a)}
.toast.warn::before{background:var(--amber,#b5751a)}

/* The "go negative anyway" confirmation inside the shortfall panel. */
.neg-ok{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12.5px;
  font-weight:600;cursor:pointer}
.neg-ok input{width:15px;height:15px;cursor:pointer}

/* A negative stock balance, wherever on-hand is shown. */
.neg-qty{color:#a32d2d;font-weight:700}
.tag-neg{background:rgba(163,45,45,.1);border-color:rgba(163,45,45,.35);color:#a32d2d}

/* ================= Mod 13: sidebar collapse + phone drawer ================= */
/* The collapse control sits in the sidebar header, pushed to its right edge. */
/* Tighter than the default padding: the toggle now shares this row, and at 236px
   "Caldera Vibe" wrapped to two lines once it did. */
.sidebar .brandmark{display:flex;align-items:center;gap:8px;padding:15px 11px}
.sidebar .brandmark>div{min-width:0;flex:1}
/* 236px, minus a 30px logo, a 30px toggle, two gaps and the padding, leaves ~120px
   for the name - enough for "Caldera Vibe" on one line only at this size. */
.sidebar .brand-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  font-size:12.5px;letter-spacing:-.02em}
.sidebar .brandmark .brand-logo{width:30px;height:30px;flex:0 0 auto}
/* 19 Nov 2026: the rail toggle lives in the topbar now, so it takes the topbar's
   palette rather than the sidebar's, and leads the row instead of trailing it. */
.cx-util{margin-right:14px;flex:0 0 auto}
.cx-util button{background:transparent;border:1px solid var(--line);
  color:#c8cdd4;width:30px;height:30px;border-radius:8px;cursor:pointer;padding:0;
  display:inline-flex;align-items:center;justify-content:center}
.cx-util button:hover{background:var(--surface-2);border-color:var(--line-3);color:var(--ink)}
.cx-util button.on{background:var(--amber-soft);border-color:var(--amber-line);color:var(--amber)}
.cx-util svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round}
/* Collapsed, the header is only the toggle - the logo would leave no room for it. */
:root[data-rail="on"] .sidebar .brandmark{padding-left:0;padding-right:0;justify-content:center}
:root[data-rail="on"] .sidebar .brandmark .brand-logo{display:none}
/* (the rail rule for .cx-util went with it when the toggle left the sidebar) */

/* Back button inside a detail header: tinted so it reads as "leave", not "act". */
.dp-acts .dp-back{color:var(--accent,#b4632a);border-color:rgba(180,99,42,.35);
  background:rgba(180,99,42,.06);font-weight:600}
.dp-acts .dp-back:hover{background:rgba(180,99,42,.12)}

/* The phone menu button. Hidden on desktop, where the sidebar is always present. */
.nav-toggle{display:none;background:transparent;border:1px solid var(--line,#e6e6e6);
  color:var(--ink,#1a1a1a);width:36px;height:36px;border-radius:9px;cursor:pointer;
  padding:0;align-items:center;justify-content:center;flex:0 0 auto;margin-right:10px}
.nav-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round}
.nav-scrim{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:58}

@media (max-width:860px){
  /* Rail is a desktop idea. On a phone the sidebar is a drawer, so the collapse
     toggle is hidden and data-rail is ignored entirely. */
  .cx-util{display:none}
  :root[data-rail="on"] .sidebar{width:min(82vw,290px);overflow:auto}
  :root[data-rail="on"] .sidebar .brand-name,
  :root[data-rail="on"] .nav-group,
  :root[data-rail="on"] .nav-item span.lbl,
  :root[data-rail="on"] .user-meta{display:block}
  :root[data-rail="on"] .nav-item span.lbl{display:inline}
  :root[data-rail="on"] .nav{padding:12px 10px}
  :root[data-rail="on"] .nav-item,:root[data-rail="on"] .nav a{justify-content:flex-start}
  :root[data-rail="on"] .brandmark,
  :root[data-rail="on"] .sidebar-foot,
  :root[data-rail="on"] .user-row{justify-content:flex-start;padding-left:18px;padding-right:18px}
  :root[data-rail="on"] .sidebar .brandmark .brand-logo{display:block}

  .nav-toggle{display:inline-flex}
  .topbar{gap:0}
  /* Off-canvas: full labels, slides over the content rather than squeezing it. */
  .sidebar{position:fixed;top:0;bottom:0;left:0;z-index:60;width:min(82vw,290px);
    transform:translateX(-102%);transition:transform var(--dur-3,.22s) var(--ease-out,ease);
    box-shadow:0 0 40px rgba(0,0,0,.35);overflow:auto}
  :root[data-nav="open"] .sidebar{transform:none}
  :root[data-nav="open"] .nav-scrim{display:block}
  .main{width:100%}
  /* The clock is the first thing to go - it is the least useful item on a phone. */
  .tb-clock{display:none}
  .topbar .tb-profile span{max-width:34vw;overflow:hidden;text-overflow:ellipsis;
    white-space:nowrap}
  .topbar h2{font-size:16px}
}
@media (max-width:520px){
  /* Only the avatar survives: the name is the first thing worth dropping, and
     Sign out already lives in the avatar menu (.cx-ready hides the bare button). */
  .topbar .tb-profile span{display:none}
}
/* No animation for people who asked for none. */
:root[data-motion="off"] .sidebar{transition:none}

/* As-on-date bar: one line, whatever the card width.
   The generic .flt-bar stacks a caption above each input and lets a bare button grow
   to fill the row, which made this five-control bar four lines and 160px tall. */
.ason-bar{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;
  padding:12px 18px;border-bottom:1px solid var(--line,#e6e6e6)}
.ason-bar>*{flex:0 0 auto}
.ason-bar .ab-l{font-size:10.5px;letter-spacing:.07em;text-transform:uppercase;
  color:var(--muted,#8a8a8a);font-weight:700;white-space:nowrap}
.ason-bar .ab-l+*{margin-right:6px}
.ason-bar input[type="date"],.ason-bar select{font-family:inherit;font-size:13px;
  padding:6px 8px;border:1px solid var(--line,#e6e6e6);border-radius:7px;
  background:var(--surface,#fff);color:var(--ink,#1a1a1a);height:32px}
.ason-bar input[type="date"]{width:150px}
.ason-bar select{width:160px}
/* .btn-primary carries width:100% for use inside forms - it has to be undone here
   or Show alone takes the whole row. */
.ason-bar .btn{height:32px;white-space:nowrap;width:auto;padding:0 14px;font-size:13px}
.ason-bar .ab-note{margin-left:auto;font-size:12px;font-weight:600;
  color:var(--muted,#8a8a8a);white-space:nowrap;text-align:right}
/* Only a genuinely narrow card gets to wrap. */
@media (max-width:760px){
  .ason-bar{flex-wrap:wrap;padding:12px 14px}
  .ason-bar .ab-note{margin-left:0;width:100%;text-align:left}
}

/* ------------------------------------------------- 15. HOME QUICK LINKS
   Two external destinations on Home: the reports portal and the published
   Zoho Analytics dashboard. Styled as cards rather than plain links so they
   read as destinations, and wrap to one per row on a phone. */
.home-ql{margin:18px 0 6px}
.ql-row{display:flex;gap:10px;flex-wrap:wrap;align-items:stretch}
.ql-btn{flex:1 1 240px;min-width:0;display:flex;align-items:center;gap:11px;
  padding:13px 15px;border:1px solid var(--line);border-radius:var(--r-lg);
  background:var(--surface);color:var(--ink);text-decoration:none;
  box-shadow:var(--e1);transition:border-color .15s,box-shadow .15s,transform .15s}
.ql-btn:hover{border-color:var(--amber-solid);box-shadow:var(--e2);transform:translateY(-1px)}
.ql-btn.ql-off{opacity:.62;cursor:default}
.ql-btn.ql-off:hover{border-color:var(--line);box-shadow:var(--e1);transform:none}
.ql-ico{flex:none;width:34px;height:34px;border-radius:var(--r-md);display:grid;place-items:center;
  background:var(--amber-soft);color:var(--amber-solid);font-size:15px}
.ql-t{display:flex;flex-direction:column;min-width:0;font-weight:700;font-size:13.5px;line-height:1.3}
.ql-t em{font-style:normal;font-weight:500;font-size:11.5px;color:var(--muted);margin-top:2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ql-edit{flex:none;align-self:center;padding:9px 13px;border:1px solid var(--line);
  border-radius:var(--r-md);background:var(--surface);color:var(--ink-soft);
  font-size:12.5px;font-weight:600;cursor:pointer}
.ql-edit:hover{border-color:var(--amber-solid);color:var(--ink)}
@media(max-width:620px){.ql-btn{flex:1 1 100%}}

/* ------------------------------------------------- 16. TARGET PLANNING GRID
   The sales head's planning workbook as a live screen. Dense on purpose: ~900
   rows of spreadsheet, so row height and font are tighter than a normal table
   and the header sticks while scrolling. */
.tg-bar{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.tg-bar .btn{flex:none;width:auto;white-space:nowrap}
.tg-sep{width:1px;height:22px;background:var(--line);flex:none;margin:0 2px}
.tg-sel{flex:none;max-width:190px;padding:7px 9px;border:1px solid var(--line);
  border-radius:var(--r-md);background:var(--surface);color:var(--ink);
  font-size:12.5px;font-family:inherit}
.tg-sel:focus{outline:none;border-color:var(--amber-solid);box-shadow:0 0 0 3px var(--amber-soft)}
.tg-q{flex:1 1 150px;min-width:120px;padding:7px 10px;border:1px solid var(--line);
  border-radius:var(--r-md);background:var(--surface);color:var(--ink);font-size:12.5px}
.tg-q:focus{outline:none;border-color:var(--amber-solid);box-shadow:0 0 0 3px var(--amber-soft)}
.tg-foot{flex:1 1 100%;font-size:12px;color:var(--ink-soft);margin-top:2px}
.tg-foot b{color:var(--ink)}
/* unit under each numeric header, so cases are never read as bottles */
table.tg-grid th em{display:block;font-style:normal;font-weight:500;font-size:9.5px;
  letter-spacing:.2px;text-transform:none;color:var(--muted);margin-top:1px}
.tg-scroll{max-height:68vh;overflow:auto;border:1px solid var(--line);border-radius:var(--r-md)}
table.tg-grid{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px}
table.tg-grid th{position:sticky;top:0;z-index:2;background:var(--surface-2,#f3f1ea);
  text-align:left;font-weight:700;font-size:11px;letter-spacing:.3px;text-transform:uppercase;
  color:var(--ink-soft);padding:9px 8px;border-bottom:1px solid var(--line);white-space:nowrap}
table.tg-grid td{padding:5px 8px;border-bottom:1px solid var(--line-2,#efece4);vertical-align:middle}
table.tg-grid tr:hover td{background:var(--amber-soft)}
table.tg-grid tr.dirty td{background:#fdf6e8}
table.tg-grid th.n,table.tg-grid td.n{text-align:right}
table.tg-grid th.s,table.tg-grid td.s{width:38px;text-align:right;color:var(--muted)}
table.tg-grid td.dim{color:var(--ink-soft);font-size:11.5px}
table.tg-grid td.mono{font-family:var(--mono,monospace);font-size:11.5px;white-space:nowrap}
table.tg-grid td.b{font-weight:700}
table.tg-grid td.pos{color:var(--green);font-weight:700}
table.tg-grid td.neg{color:var(--red);font-weight:700}
input.tg-in{width:62px;padding:5px 6px;border:1px solid var(--line);border-radius:6px;
  background:var(--surface);color:var(--ink);font-size:12.5px;text-align:right;font-weight:600}
input.tg-in:focus{outline:none;border-color:var(--amber-solid);box-shadow:0 0 0 3px var(--amber-soft)}
.warn-box{background:#fdf3e3;border:1px solid #e8d3a8;color:#5f4312;padding:10px 12px;
  border-radius:var(--r-md);font-size:12.5px;line-height:1.6;margin-bottom:12px}
.warn-box b.warn{color:var(--red)}
.warn-box .mono{font-family:var(--mono,monospace);font-size:11.5px}
@media(max-width:900px){.tg-scroll{max-height:60vh}input.tg-in{width:52px}}

/* ── 17. Inventory · clickable Negative balances KPI + merged stock bar ────────
   The KPI card is the filter control for the merged Stock-in-hand table, so it has
   to look pressable and show when it is engaged. Everything else in .kpi-grid stays
   inert, which is why these rules hang off .kpi-click rather than .kpi. */
.kpi.kpi-click{cursor:pointer;transition:transform .08s ease,box-shadow .12s ease}
.kpi.kpi-click:hover{transform:translateY(-1px);box-shadow:0 4px 14px rgba(0,0,0,.10)}
.kpi.kpi-click:active{transform:translateY(0)}
.kpi.kpi-click::after{content:'filter';position:absolute;top:8px;right:10px;
  font-size:9.5px;letter-spacing:.08em;text-transform:uppercase;opacity:.45}
.kpi.kpi-click{position:relative}
.kpi.kpi-on{outline:2px solid var(--red,#c0392b);outline-offset:-2px}
.kpi.kpi-on::after{content:'filtering';opacity:.85;font-weight:700}

/* the as-on bar gained an Item group select and a clear-filter chip */
.ason-bar #as_grp{width:170px}
.ason-bar #as_neg{background:var(--red,#c0392b);color:#fff;border-color:transparent}
.ason-bar #as_neg:hover{filter:brightness(1.08)}
@media(max-width:900px){.ason-bar #as_grp{width:100%}}

/* ── 18. Field visits · single-line filter + KPI toolbar ──────────────────────
   Five filters and three figures on one row. Same shape as .ason-bar, but the KPI
   chips sit in the right-hand slot so the numbers read as the result of the filters
   rather than as page furniture. */
.fv-bar{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;
  padding:10px 14px;border-bottom:1px solid var(--line);overflow-x:auto}
.fv-bar>*{flex:0 0 auto}
.fv-bar .ab-l{font-size:10.5px;letter-spacing:.07em;text-transform:uppercase;
  color:var(--ink-3);font-weight:700}
.fv-bar .ab-l+*{margin-right:6px}
.fv-bar select{font-family:inherit;font-size:13px;height:32px;padding:0 8px;
  border:1px solid var(--line);border-radius:var(--r-sm);background:var(--surface);color:var(--ink)}
.fv-bar #fv_month{width:130px}
.fv-bar #fv_src{width:130px}
.fv-bar #fv_by{width:160px}
.fv-bar #fv_stage{width:150px}
.fv-bar .btn{height:32px;white-space:nowrap;width:auto;padding:0 14px;font-size:13px}
/* 15 Nov 2026: Outlet is a search box, not a select. It leads the bar with the table's
   relocated row count beside it — the same arrangement as .out-search on Outlets. */
.fv-bar .fv-search{display:flex;align-items:center;gap:8px;flex:0 0 auto;margin-right:4px}
.fv-bar .fv-search .tbl-search{width:250px;height:32px;padding:0 10px;font-size:13px;margin:0}
.fv-bar .fv-search .tbl-count{font-size:12px;color:var(--muted);white-space:nowrap}
.fv-bar #fv_src+.ssel{width:140px}
.fv-bar #fv_by+.ssel{width:175px}
.fv-bar #fv_stage+.ssel{width:165px}
@media(max-width:1100px){
  .fv-bar{flex-wrap:wrap;overflow-x:visible}
}

/* 15 Nov 2026: the figures moved out of the toolbar and into the card header, so they
   share one line with the page's info chip and the fused "+ Add visit" button.
   .card-act is a flex row and the pieces arrive in whatever order layoutPass() fuses
   them, so the left-to-right reading order is set with `order` rather than by DOM
   position: figures, then the chip, then the action. */
.fv-card .card-head{gap:14px}
.fv-card .card-act{flex:1 1 auto;min-width:0;justify-content:flex-end;gap:10px}
.fv-card .card-act .fv-kpi{order:-1;margin-right:auto;display:flex;gap:7px;
  min-width:0;overflow-x:auto;scrollbar-width:thin}
.fv-card .card-act .info-wrap{order:1;flex:0 0 auto}
.fv-card .card-act .btn{order:2;flex:0 0 auto}
/* header chips are denser than the in-page ones: six of them share the row */
.fv-card .card-act .kpi-chip{white-space:nowrap;flex:0 0 auto;padding:5px 10px;border-left-width:3px}
.fv-card .card-act .kpi-chip .kc-l{font-size:9.5px;letter-spacing:.04em}
.fv-card .card-act .kpi-chip .kc-v{font-size:15px;margin-top:0}
/* shift timings are a clock reading, not a count - amber would imply a target */
.fv-card .card-act .kpi-chip.kc-time{border-left-color:var(--ink-3)}
@media(max-width:1100px){
  .fv-card .card-head{flex-wrap:wrap}
  .fv-card .card-act{width:100%;flex-wrap:wrap;justify-content:flex-start}
  .fv-card .card-act .fv-kpi{width:100%;margin-right:0;order:1}
  .fv-card .card-act .info-wrap{order:-1}
  .fv-card .card-act .btn{order:0;width:auto}
}

/* ── 19. Outlets · single-line filter + sort + search toolbar ─────────────────
   Six controls, Clear, and the table's own search box and row count relocated into
   the right-hand slot, so filters / sort / search read as one row. Same shape as
   .fv-bar; kept separate because the control widths differ. */
.out-bar{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;
  padding:10px 14px;border-bottom:1px solid var(--line);overflow-x:auto}
.out-bar>*{flex:0 0 auto}
.out-bar .ab-l{font-size:10.5px;letter-spacing:.07em;text-transform:uppercase;
  color:var(--ink-3);font-weight:700}
.out-bar .ab-l+*{margin-right:6px}
.out-bar select{font-family:inherit;font-size:13px;height:32px;padding:0 8px;
  border:1px solid var(--line);border-radius:var(--r-sm);background:var(--surface);color:var(--ink)}
.out-bar #o_fz{width:120px}
.out-bar #o_fc{width:110px}
.out-bar #o_ft{width:160px}
.out-bar #o_fs{width:140px}
.out-bar #o_fh{width:150px}
.out-bar #o_sort{width:170px}
.out-bar .btn{height:32px;white-space:nowrap;width:auto;padding:0 14px;font-size:13px}
/* the relocated search + count */
.out-bar .out-search{margin-left:auto;display:flex;align-items:center;gap:8px;flex:0 0 auto}
.out-bar .out-search .tbl-search{height:32px;width:200px;margin:0}
.out-bar .out-search .tbl-count{white-space:nowrap;font-size:12px;font-weight:600;color:var(--ink-3)}
@media(max-width:1250px){
  .out-bar{flex-wrap:wrap;overflow-x:visible}
  .out-bar .out-search{margin-left:0;width:100%;margin-top:6px}
  .out-bar .out-search .tbl-search{width:100%}
}

/* ── 20. Toolbar selects that makeSearchable() has taken over ─────────────────
   makeSearchable() hides any <select> with more than six options and inserts a
   .ssel widget as its next sibling. .ssel carries no width of its own - in a form
   grid the cell supplies it - so inside these nowrap flex toolbars it collapsed to
   nothing and the filter looked broken. Each one is given the width its select had,
   and the dropdown is pinned wider than the control so long outlet names still read.
   Targeted by adjacent sibling so the width always follows the right control. */
.out-bar .ssel,.fv-bar .ssel{flex:0 0 auto}
.out-bar .ssel-input,.fv-bar .ssel-input{height:32px;padding:0 9px;font-size:13px;
  border:1px solid var(--line);border-radius:var(--r-sm);background:var(--surface);color:var(--ink)}
.out-bar .ssel-list,.fv-bar .ssel-list{min-width:240px}

.out-bar #o_fh+.ssel{width:160px}
.out-bar #o_fs+.ssel{width:150px}
.out-bar #o_sort+.ssel{width:180px}
.out-bar #o_fc+.ssel{width:120px}

.fv-bar #fv_month+.ssel{width:140px}
.fv-bar #fv_by+.ssel{width:170px}
.fv-bar #fv_stage+.ssel{width:160px}
.fv-bar #fv_src+.ssel{width:140px}

/* search + count lead the Outlets bar now, so no auto margin pushing them right */
.out-bar .out-search{margin-left:0}
@media(max-width:1250px){
  .out-bar .out-search{width:auto;margin-top:0}
  .out-bar .ssel,.fv-bar .ssel{width:100%!important}
}

/* ===== 21 · Nov 2026: table grouping, full-width modal ===================== */
/* Group heading rows emitted by renderTable's cfg.group. Level 0 is the outer
   grouping (brand), level 1 the inner (process), so BOM reads brand > process. */
.tbl-group td{
  background:var(--surface-2);font-weight:700;font-size:11.5px;letter-spacing:.03em;
  text-transform:uppercase;color:var(--ink-soft);padding:7px 12px;
  border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.tbl-group-0 td{background:var(--ink-3,#e7ebf0);color:var(--ink)}
.tbl-group-1 td{font-size:11px;text-transform:none;letter-spacing:0;
  padding-left:26px;font-weight:600;background:var(--surface-2)}
.tbl-group-1 td::before{content:"\21B3";margin-right:7px;opacity:.5}

/* A dialog that needs room -- the sales order form carries a line grid, so at
   640px it was scrolling in two directions. */
.modal.modal-full{max-width:min(1360px,96vw);max-height:94vh;width:96vw}
.modal.modal-full .modal-body{padding:20px 24px}
@media(max-width:900px){.modal.modal-full{width:100%;max-height:96vh}}

/* ===== 22 · batch process sign-off ======================================== */
.proc-list{display:flex;flex-direction:column}
.proc-row{display:flex;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--line)}
.proc-row:last-child{border-bottom:none}
.proc-row.proc-done{background:var(--surface-2)}
.proc-seq{flex:0 0 22px;height:22px;border-radius:50%;background:var(--ink-3,#e7ebf0);
  display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:var(--ink)}
.proc-done .proc-seq{background:var(--green-soft,#e6f4ea)}
.proc-nm{flex:1 1 auto;font-weight:600;font-size:13px;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.proc-row .btn{flex:0 0 auto}

/* ===========================================================================
   18. OUTLET MASTER DATA (19 Nov 2026)
   Toolbar, view tabs and the frozen-first-column table. Scoped to .om-* so it
   cannot reach the other 26 views.
   =========================================================================== */

/* ---- inline line icons ---- */
.ico{width:1em;height:1em;flex:0 0 auto;vertical-align:-0.135em;display:inline-block}
.btn .ico,.om-tab .ico{width:15px;height:15px;margin-right:6px;vertical-align:-3px}
.om-clear .ico{width:13px;height:13px;margin-right:4px}
.ico-pin{width:15px;height:15px;color:var(--amber);margin-right:9px;margin-top:2px}
.ico-tack{width:13px;height:13px;color:var(--ink-4);margin-right:0}
.ico-grp{width:14px;height:14px;color:var(--amber);margin-right:6px;vertical-align:-2px}

/* ---- the card holds the whole page: toolbar, tabs and table ---- */
.om-card{padding:0;overflow:visible}
.om-bar{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;
  padding:14px 16px;border-bottom:1px solid var(--line-2)}
.om-f{display:flex;flex-direction:column;gap:5px;min-width:0}
.om-f>label,.om-chip>label{font-size:10.5px;font-weight:700;letter-spacing:.04em;
  text-transform:uppercase;color:var(--muted)}
.om-f select,.om-f input{height:36px}
.om-f-search{flex:1 1 230px;min-width:180px}
.om-f-add{margin-left:auto;justify-content:flex-end}

/* date range: the icon sits inside the field, as in the mockup */
.om-dates{display:flex;align-items:center;gap:8px}
.om-ic{position:relative;display:inline-flex;align-items:center}
.om-ic>.ico{position:absolute;left:10px;color:var(--muted);width:15px;height:15px;pointer-events:none}
.om-ic>input[type="date"]{padding-left:32px;min-width:148px}
.om-dash{color:var(--ink-4)}

/* search keeps renderTable's own input, restyled */
.om-search{position:relative;display:block}
.om-ic-s{position:absolute;left:11px;top:50%;transform:translateY(-50%);
  color:var(--muted);display:inline-flex;pointer-events:none}
.om-ic-s .ico{width:15px;height:15px}
.om-search .tbl-search{width:100%;height:36px;padding-left:34px;margin:0}
.om-search .tbl-count{display:none}

/* Filter button with its active-filter count */
.btn-chip{display:inline-flex;align-items:center;height:36px;gap:0;
  background:var(--surface);border:1px solid var(--line);color:var(--ink-soft);
  border-radius:var(--radius-sm,8px);padding:0 12px;font-weight:650;font-size:12.5px}
.btn-chip:hover{border-color:var(--line-3);color:var(--ink)}
.btn-chip.on{border-color:var(--amber);color:var(--amber)}
.om-badge{margin-left:7px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;
  background:var(--amber-solid,#b4791a);color:#fff;font-size:10.5px;font-weight:800;
  display:inline-flex;align-items:center;justify-content:center}
.om-add{height:36px;padding:0 16px;font-weight:700}

/* ---- second row: the filter chips ---- */
.om-bar-2{align-items:center;gap:10px;background:var(--surface-2)}
.om-bar-2.hide{display:none}
.om-chip{display:inline-flex;align-items:center;gap:7px;background:var(--surface);
  border:1px solid var(--line);border-radius:999px;padding:4px 6px 4px 13px;max-width:100%}
.om-chip>label{text-transform:none;letter-spacing:0;font-size:11.5px;
  font-weight:700;color:var(--ink-soft);white-space:nowrap}
.om-chip select{height:28px;border:none;background:transparent;padding:0 20px 0 2px;
  font-size:12.5px;font-weight:600;color:var(--ink);min-width:0;max-width:150px}
.om-chip select:focus{box-shadow:none}
.om-chip .ssel{min-width:0}
.om-clear{color:var(--amber);white-space:nowrap}
.om-count{margin-left:auto;font-size:12.5px;color:var(--ink-soft);white-space:nowrap}
.om-count .sub{color:var(--muted)}

/* ---- view tabs ---- */
.om-views{display:flex;align-items:center;gap:16px;padding:12px 16px;
  border-bottom:1px solid var(--line-2)}
.om-views-l{font-size:13px;font-weight:800;color:var(--ink)}
.om-tabs{display:flex;gap:8px;flex-wrap:wrap}
.om-tab{display:inline-flex;align-items:center;height:38px;padding:0 16px;
  border:1px solid var(--line);border-radius:10px;background:var(--surface);
  color:var(--ink-soft);font-size:13px;font-weight:650;cursor:pointer;
  transition:background .14s,border-color .14s,color .14s}
.om-tab:hover{border-color:var(--line-3);color:var(--ink)}
.om-tab.on{background:var(--amber-wash,#fdf6e8);border-color:var(--amber);color:var(--amber);font-weight:750}
.om-tab.on .ico{color:var(--amber)}

/* ---- table ---- */
.om-out{padding:0}
.om-out .tbl-wrap{border:none;border-radius:0}
.om-out .tbl-tools.tools-bare{display:none}
.om-out table.data th{background:var(--surface-2);font-size:11px}
.om-out table.data th:first-child{display:table-cell}
.om-out table.data td,.om-out table.data th{padding:12px 16px}

/* first column stays put while the rest scrolls sideways */
table.tbl-freeze th:first-child,
table.tbl-freeze td:first-child{position:sticky;left:0;z-index:2;background:var(--surface)}
table.tbl-freeze thead th:first-child{z-index:3;background:var(--surface-2)}
table.tbl-freeze tbody tr:hover td:first-child{background:var(--surface-2)}
/* the seam that tells you the column is frozen, only while scrolled */
table.tbl-freeze th:first-child::after,
table.tbl-freeze td:first-child::after{content:"";position:absolute;top:0;right:0;bottom:0;
  width:1px;background:var(--line)}
/* Size to content, not to a fixed width. The column was reserving 260px on every
   table whether its names needed it or not, and on a wide column set that is a
   quarter of the screen spent on one field.

   The NAME sets the width: it stays on one line, so the column is exactly as wide
   as it needs to be, with a cap and an ellipsis for the rare very long one. The
   SUB-LINE under it - an address, a code - wraps inside that width instead.

   REWRITTEN 24 Nov 2026, measured rather than eyeballed (tools/freezewalk.js).
   The previous rule failed both halves of its own intent:

     - the cap sat on the CELL (max-width:280px). A max-width on a td under
       table-layout:auto is advisory, so a long name did not get ellipsised - it
       overflowed. Worst case measured 245px of text lying across the Category
       column beside it, and because the cell is position:sticky it painted OVER
       that column rather than under it.
     - the column never actually sized to content either: 280px for a table of
       long names and 280px for a table of short ones.

   Both come from the same mistake - bounding the box instead of the text. The cap
   now sits on the NAME and SUB-LINE themselves, so the cell's max-content width
   cannot exceed it and width:1% is free to shrink below it. .om-name is a flex
   row, so it and its inner wrapper need min-width:0 or they refuse to shrink below
   their content and the bound never bites. */
:root{--freeze-max:300px}
table.tbl-freeze th:first-child,
table.tbl-freeze td:first-child{width:1%}
table.tbl-freeze th:first-child{white-space:nowrap}
table.tbl-freeze td:first-child{min-width:0}
table.tbl-freeze td:first-child .om-name{min-width:0;max-width:var(--freeze-max)}
table.tbl-freeze td:first-child .om-name > span{min-width:0;display:block}
table.tbl-freeze td:first-child .om-name > svg{flex:0 0 auto}
table.tbl-freeze td:first-child .nm{overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;display:block;max-width:var(--freeze-max)}
table.tbl-freeze td:first-child .sub{display:block;max-width:var(--freeze-max);
  white-space:normal;overflow-wrap:anywhere;overflow:hidden;text-overflow:clip}

.om-name{display:flex;align-items:flex-start;line-height:1.25}
.om-name .nm{display:block;font-weight:700;color:var(--ink);font-size:13px}
.om-name .sub{display:block;font-size:11.5px;color:var(--muted);margin-top:2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* inside the frozen column the sub-line wraps instead of being clipped */
/* inside the frozen column the sub-line wraps instead of being clipped - but it
   stays inside the column, which max-width:none and overflow:visible did not */
table.tbl-freeze td:first-child .om-name .sub{white-space:normal;overflow:hidden;
  text-overflow:clip;overflow-wrap:anywhere;max-width:var(--freeze-max)}
.om-dash-c{color:var(--ink-4)}
.om-grp{display:inline-flex;align-items:center;white-space:nowrap}
.om-map{color:var(--muted);font-size:11.5px;margin-left:4px;text-decoration:none}
.om-map:hover{color:var(--amber);text-decoration:underline}

/* classification pills */
.tag-tier{font-weight:750}
.tier-bronze{background:#f6ece2;color:#8a5a2b;border-color:#e8d5c0}
.tier-silver{background:#eef0f2;color:#5b6670;border-color:#dde1e5}
.tier-gold{background:#fbf2d8;color:#8a6d12;border-color:#f0e2b4}
.tier-platinum{background:#e8f2ef;color:#1f6b57;border-color:#cfe5de}

/* sales cells */
.om-items{display:flex;flex-direction:column;gap:2px}
.om-item{font-size:11.5px;color:var(--ink-soft);white-space:nowrap}
.om-item b{color:var(--ink);font-weight:650}
.om-share{display:inline-flex;align-items:center;gap:8px;justify-content:flex-end}
.om-share-b{width:54px;height:6px;border-radius:3px;background:var(--line-2);
  overflow:hidden;flex:0 0 auto}
.om-share-b i{display:block;height:100%;background:var(--amber-solid,#b4791a)}
.om-contact{font-size:12px}
.om-sep{color:var(--ink-4);margin:0 6px}

/* ---- row overflow menu ---- */
.row-act-menu{text-align:right;white-space:nowrap}
.row-dots{color:var(--muted);padding:4px 6px;border-radius:6px;line-height:0}
.row-dots .ico{width:17px;height:17px;margin:0}
.row-dots:hover{color:var(--ink);background:var(--surface-3)}
.row-menu{display:none;position:fixed;z-index:60;min-width:162px;padding:5px;
  background:var(--surface);border:1px solid var(--line);border-radius:10px;
  box-shadow:0 10px 28px rgba(20,26,33,.14)}
.row-act-menu.open .row-menu{display:block}
.row-menu-i{display:block;width:100%;text-align:left;padding:8px 11px;border:none;
  background:none;border-radius:7px;font-size:12.5px;font-weight:600;color:var(--ink);cursor:pointer}
.row-menu-i:hover{background:var(--surface-3)}

@media(max-width:900px){
  .om-bar{gap:10px;padding:12px}
  .om-f-add{margin-left:0;width:100%}
  .om-add{width:100%;justify-content:center}
  .om-views{flex-direction:column;align-items:flex-start;gap:8px}
  :root{--freeze-max:180px}
  .om-name .sub{max-width:160px}
  table.tbl-freeze td:first-child .om-name .sub{max-width:var(--freeze-max)}
}

/* --- 18b. Outlet Master corrections after the first render (19 Nov 2026) --- */

/* [hidden] sets display:none, but .om-badge's own display:inline-flex is more
   specific and won.  The badge rendered a literal "0" with no filters on. */
.om-badge[hidden]{display:none}

/* One row, as in the brief.  The selects were taking their natural width and
   pushing View and Add Outlet onto a second line. */
/* The content area is about 1150px at a 1440px window, so the controls are sized
   to total under that: everything stays on one row, as in the brief. */
.om-bar{gap:10px}
.om-f select{max-width:100%}
/* 124px clipped the year. The native picker button also eats ~22px, so it is faded
   out and our own calendar icon leads the field instead. */
/* 132px fitted a filled date but clipped the empty mm/dd/yyyy placeholder */
.om-f-period .om-ic>input[type="date"]{min-width:140px;width:140px;padding-left:28px;padding-right:2px}
.om-f-period .om-ic>.ico{left:9px;width:14px;height:14px}
.om-f-period input[type="date"]::-webkit-calendar-picker-indicator{opacity:0;width:14px;margin:0}
.om-dates{gap:6px}
/* Size the WRAPPER, not the select: makeSearchable() hides any select with more
   than six options behind a .ssel widget, so a width set on #om_sort never applied
   and Sort by rendered 242px wide, overflowing the row. */
.om-f-sort{width:150px}
.om-f-ord{width:92px}
.om-f-cols{width:120px}
.om-f-sort select,.om-f-ord select,.om-f-cols select,
.om-f-sort .ssel,.om-f-ord .ssel,.om-f-cols .ssel{width:100%;min-width:0;max-width:100%}
.btn-chip{padding:0 11px}
.om-add{padding:0 14px}
/* capped: with an uncapped flex-grow the search ate every spare pixel and pushed
   Add Outlet onto a second line even on a wide window */
.om-f-search{flex:1 1 150px;min-width:140px;max-width:214px}
.om-search .tbl-search{padding-left:34px}
.om-ic-s{left:12px}
/* below that the search drops to its own line rather than squeezing every field */
@media(max-width:1500px){
  .om-f-search{flex-basis:100%;order:9}
  .om-f-add{order:10}
}

/* ---- 19. SIDEBAR ICONS (19 Nov 2026) ----
   The working modules carry a colour-filled badge; the Masters group carries a bare
   outline icon. The colour separates pages people live in from reference lists they
   set up once, so it is not spent where it would carry no meaning. */
.nav-ico{width:26px;height:26px;border-radius:7px;flex:0 0 auto}
.nav-ico .ico{width:15px;height:15px;stroke-width:1.7}
/* badge icons sit on a colour, so they draw in white */
.nav-ico:not(.ic-none) .ico{color:#fff}

/* masters: no badge, no colour */
.nav-ico.ic-none{background:none;box-shadow:none;width:26px}
/* the sidebar's own tokens, so these follow dark mode instead of assuming white */
.nav-ico.ic-none .ico{width:17px;height:17px;color:var(--sidebar-ink-2);stroke-width:1.5}
.nav-item:hover .nav-ico.ic-none .ico{color:var(--sidebar-ink)}
.nav-item.active .nav-ico.ic-none{box-shadow:none}
.nav-item.active .nav-ico.ic-none .ico{color:var(--amber)}

/* the active badge ring reads better as a soft halo than a hard 2px stroke */
.nav-item.active .nav-ico:not(.ic-none){box-shadow:0 0 0 3px rgba(255,255,255,.16)}

/* ---- 20. pageBar additions (19 Nov 2026) ----
   Figures strip between the toolbar and the table, and the search slot when a page
   supplies its own input rather than lifting renderTable's. */
.om-kpis{display:flex;gap:8px;flex-wrap:wrap;padding:12px 16px;
  border-bottom:1px solid var(--line-2)}
.om-kpis:empty{display:none}
.fv-qwrap{display:block}
.fv-qwrap .tbl-search{width:100%;height:36px;padding-left:34px;margin:0}
.om-name .nm.mono{font-family:var(--mono);font-size:12.5px}

/* ---- 21. FLAT CONTENT TAGS (19 Nov 2026) ----
   A value highlighted inside a table column is now just its colour on its own tint:
   no pill shape, no outline ring. .tag carried border-radius:var(--r-pill) and a
   1px border, which made every status, stage and classification read as a button
   you could press. Colour alone carries the same meaning with far less furniture.

   Scope is content tags only. The filter chips, the Filter count badge and the KPI
   chips keep their shapes: those are controls and counters, not column values.
   Rolling this back is deleting this block. */
.tag{border:0;border-radius:3px;padding:2px 7px}
/* the per-colour rules only set border-COLOR, and a zero width leaves nothing to
   paint, so background and text colour come through untouched */

/* print still needs an outline: the tints do not survive a mono printer */
@media print{
  .tag{border:1px solid #999 !important;border-radius:3px}
}

/* views band sitting above the controls (cfg.viewsTop) */
.om-card>.om-views:first-child{border-bottom:1px solid var(--line-2)}

/* home tiles and module cards draw the same line icons as the sidebar */
.ht-ico .ico{width:18px;height:18px}
.mod-card .nav-ico{width:28px;height:28px}
.mod-card .nav-ico .ico{width:16px;height:16px}

/* the page info chip sits beside the primary action, so that slot lays out in a row */
.om-f-add{flex-direction:row;align-items:center;gap:10px}
.om-f-add .info-chip{flex:0 0 auto}

/* the chip in a tabs band sits at the far end of the row */
.om-views>.info-chip{margin-left:auto}

/* The topbar is justify-content:space-between and had exactly two children, so the
   title sat left by construction. Moving the rail toggle in made three, and the
   title became the middle one and centred itself. An auto margin on the right-hand
   group pins the slack there instead, so the title stays hard left whatever else
   gets added to the row (the phone hamburger makes four). */
.topbar{justify-content:flex-start}
.topbar>.tb-right{margin-left:auto}

/* ---- 22. NEW PROJECTS lead cards (19 Nov 2026) ----
   A lead is prose, not a row: the opportunity and the next step are sentences the
   rep has to read before calling, so the module is a card list and not a table.
   Two columns — what the lead IS on the left, what to DO about it on the right. */
.lp-prio{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 14px}
.lp-pchip{border:1px solid var(--line);background:var(--surface-2);color:var(--ink-soft);
  border-radius:var(--r-pill);padding:5px 12px;font-size:12.5px;font-weight:600;cursor:pointer;
  display:inline-flex;align-items:center;gap:6px}
.lp-pchip:hover{border-color:var(--ink-soft);color:var(--ink)}
.lp-pchip.on{background:var(--ink);border-color:var(--ink);color:#fff}
.lp-pn{font-variant-numeric:tabular-nums;opacity:.72;font-weight:700}

.lp-card{padding:0;margin-bottom:12px;overflow:hidden}
.lp-head{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;
  padding:13px 16px;border-bottom:1px solid var(--line);background:var(--surface-2)}
.lp-ttl{font-size:16px;font-weight:700;line-height:1.3;min-width:0}
.lp-badges{display:flex;gap:7px;align-items:center;flex:0 0 auto;flex-wrap:wrap}
.lp-score{font-size:13px;font-weight:750;font-variant-numeric:tabular-nums;color:var(--ink-soft)}
.lp-score small{font-weight:400;opacity:.65}

.lp-body{display:flex;gap:0;flex-wrap:wrap;align-items:stretch}
.lp-main{flex:1 1 400px;min-width:0;padding:12px 16px;display:flex;flex-direction:column}
.lp-rec{flex:1 1 300px;min-width:0;padding:12px 16px;background:var(--amber-soft);
  border-left:1px solid var(--line)}
.lp-rec-h{font-size:.66rem;letter-spacing:.09em;text-transform:uppercase;
  color:var(--amber);font-weight:700;margin-bottom:8px}

/* label-above-value, the shape the rest of the app uses for read-only detail */
.lp-note{margin-bottom:9px;font-size:13px;line-height:1.45;word-break:break-word}
.lp-note>span{display:block;font-size:.64rem;letter-spacing:.07em;text-transform:uppercase;
  color:var(--ink-soft);font-weight:700;margin-bottom:2px}
.lp-note ul{margin:2px 0 0;padding-left:17px}
.lp-note li{margin:1px 0}
.lp-none{color:var(--ink-soft);font-style:italic}

.lp-reaches{display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:4px}
.lp-reach{display:inline-flex;align-items:center;gap:5px;font-size:12.5px}
.lp-reach .ico{width:13px;height:13px;flex:0 0 auto;opacity:.65}

.lp-det{margin:2px 0 8px;font-size:12.5px}
.lp-det>summary{cursor:pointer;color:var(--ink-soft)}
.lp-det>summary:hover{color:var(--ink)}
.lp-pre{white-space:pre-wrap;margin-top:6px;color:var(--ink-soft);line-height:1.5;
  max-height:260px;overflow:auto}
.lp-who{margin:2px 0 6px}

/* pushed to the bottom of the left column so the row sits on one line across cards */
.lp-acts{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:auto 0 0;padding-top:10px}
.lp-sel{flex:0 1 230px;min-width:150px}
/* the select is the only thing allowed to give ground. .btn-primary carries
   width:100% from the login button, which in a flex row collapsed Assign to a
   28px stub reading "ssig" — hence the explicit width and nowrap here. */
.lp-acts .btn{flex:0 0 auto;width:auto;white-space:nowrap}
.lp-foot{padding:7px 16px;border-top:1px solid var(--line);background:var(--surface-2);
  font-variant-numeric:tabular-nums}
.lp-pager{display:flex;gap:12px;align-items:center;justify-content:center;
  flex-wrap:wrap;margin:16px 0 8px}

@media(max-width:860px){
  .lp-rec{border-left:0;border-top:1px solid var(--line)}
}

/* ---- 23. QUANTITY EQUATION BLOCK (20 Nov 2026) ----
   A bottling run is cases x pack + a loose tail. Three separate form fields made
   that read as three unrelated numbers, and the loose box in particular looked
   like an alternative to the cases box rather than an addition to it. So the
   three sit on one line, in the order the arithmetic happens, with the result
   on the end. Beer shows a fixed "24 per case" instead of a one-option select. */
.qty-blk{grid-column:1/-1}
.qb{display:flex;align-items:center;gap:9px;flex-wrap:wrap;
  background:var(--surface-2);border:1px solid var(--line);
  border-radius:var(--r-sm);padding:9px 12px}
.qb-part{display:inline-flex;align-items:center;gap:7px;flex:0 0 auto}
.qb-part[hidden]{display:none}
.qb-part input{width:92px}
.qb-part select{min-width:76px}
.qb-part em{font-style:normal;font-size:12.5px;color:var(--ink-soft);white-space:nowrap}
/* the fixed pack reads as a value, not a control */
.qb-fixed{font-weight:650;color:var(--ink)}
.qb-op{color:var(--ink-soft);font-size:15px;font-weight:600;flex:0 0 auto}
.qb-op[hidden]{display:none}
.qb-eq{margin-left:2px}
.qb-out{font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink);
  margin-left:auto;white-space:nowrap}
@media(max-width:640px){
  .qb{gap:7px}
  .qb-out{margin-left:0;flex-basis:100%}
}

/* ---- 24. FIFO LEDGER toolbar (20 Nov 2026) ---- */
.fifo-bar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 12px}
.fifo-bar .om-search{position:relative;display:inline-flex;align-items:center}
.fifo-bar .tbl-search{width:100%;height:36px;padding-left:34px;margin:0}
.fifo-bar .sub{margin-left:auto;font-variant-numeric:tabular-nums}

/* ---- 25. RETURNABLE GLASS row actions (23 Nov 2026) ----
   Worded buttons in the cell were tried first and measured: three of them pushed
   themselves past the right-hand edge of a nine-column grid, which defeats the
   point of putting the action beside the figure. So they fold behind the same
   "..." as every other table, and this only aligns the trigger. */
.rt-menu{display:inline-block;text-align:right}
.rt-menu .row-dots{margin:0}

/* ---- 26. SALES ORDERS tab strip (23 Nov 2026) ----
   Returnable bottles was a page of its own until it was merged in here. The strip
   is the same .om-views/.om-tabs markup pageBar emits, in a card of its own, so the
   Orders tab can keep its KPI row and the Returnable bottles tab can bring its own
   pageBar underneath without two toolbars fighting for the same band. */
.so-tabs{padding:0;margin-bottom:14px}
.so-tabs .om-views{border-bottom:0}
.so-tab-body{display:block}
.so-tab-body > .om-card:first-child{margin-top:0}

/* ---- 27. TP REVIEW (23 Nov 2026) ----
   Bulk confirm is the point of the page: Gaurav has 800+ already-correct passes
   and must not click them one at a time. The select-all and the count sit in the
   action bar so the button never fires on an empty selection without saying so. */
.tp-bulk{align-items:center;gap:12px;flex-wrap:wrap}
.tp-bulk .tp-all{display:inline-flex;align-items:center;gap:6px;font-weight:650;
  font-size:13px;white-space:nowrap;cursor:pointer}
.tp-bulk .tp-all input{width:16px;height:16px;cursor:pointer}
.tp-bulk .sub{margin-right:auto}
.note-box.note-warn{border-color:var(--amber);background:var(--amber-soft)}

/* ---- 28. NEW PROJECTS recommendation + activity (24 Nov 2026) ----
   A contact is usually one short line - "called, call back Tuesday" - so the row
   is a single flex line that wraps, with the date fixed-width on the left so the
   dates line up down the card.

   The section folds like Project notes & evidence, but highlighted: a folded
   section is easy to skip past while eyeballing a stack of cards, and this is the
   part a rep is meant to read first. It is shut by default and the summary
   carries the count and the last contact, so folding it costs nothing at a
   glance. */
.lp-tl{margin:6px 0 2px;display:flex;flex-direction:column;gap:4px;
  max-height:230px;overflow:auto}
.lp-tl-r{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;font-size:12px}
/* 72px wrapped "22 Nov 2026" onto two lines at this weight - measured, not
   guessed, after the first render of the open list showed one row taller than
   the rest for no reason a reader could see. */
.lp-tl-d{flex:0 0 84px;color:var(--muted);font-weight:650;font-size:11.5px;
  white-space:nowrap}
/* 180px of flex-basis was fine in the wide left column and pushed the stage tag
   onto a line of its own once this moved into the narrower right panel, where it
   read as a stray. 110px lets the row pack and still wraps when it must. */
.lp-tl-t{color:var(--ink-soft);overflow-wrap:anywhere;flex:1 1 110px;min-width:0}

/* Both sections in the right panel fold (24 Nov 2026): the recommendation is what
   matters while triaging, the activity once the lead is being worked, and which of
   the two you want open changes through a lead's life.

   The panel is already amber, so the activity block is marked out by a solid card
   on top of it rather than by more tint - a tint on a tint reads as nothing. */
.lp-rec-det{margin:0 0 10px}
.lp-rec-det>summary{font-size:.66rem;letter-spacing:.09em;text-transform:uppercase;
  color:var(--amber-ink,var(--ink));font-weight:800;margin-bottom:6px}
.lp-act-det{border-left:3px solid var(--amber);background:var(--surface);
  border-radius:0 8px 8px 0;padding:7px 11px;margin:0;
  box-shadow:0 1px 3px rgba(0,0,0,.06)}
.lp-act-det>summary{display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  color:var(--ink);font-weight:650}
.lp-act-det>summary::marker{color:var(--amber)}
.lp-act-n{background:var(--amber);color:#fff;border-radius:999px;padding:0 7px;
  font-size:11px;font-weight:700;line-height:17px;min-width:19px;text-align:center}
.lp-act-last{color:var(--ink-soft);font-weight:600;font-size:11.5px}
.lp-act-det[open]>summary{margin-bottom:4px}

/* ===== 29. single-tab pageBar (24 Nov 2026) =========================
   A role that holds only one of a page's two tab modules gets one tab. A
   "Tabs" label over a single button is a control that does nothing, so the
   band is hidden and the card is left as a plain container. The tab still
   exists in the DOM — state.view must stay readable. ==================== */
.om-card.one-tab > .om-views{display:none}

/* ===== 30. Sales order: clickable rows, page actions, slimmer item table ======
   24 Nov 2026. The order page repeats every action from the list row, the list row
   itself opens the order, and the view-mode item table is five columns instead of
   eight — reference detail sits under the number it belongs to. ================ */
tr.row-open{cursor:pointer}
tr.row-open:hover{background:var(--row-hover,rgba(31,95,139,.055))}

/* the action cluster in the page header, pushed right of the title */
.act-bar.so-back{align-items:flex-start}
.so-page-acts{margin-left:auto;display:flex;flex-wrap:wrap;gap:6px;
  justify-content:flex-end;align-items:center;padding-left:12px}
.so-page-acts .btn{white-space:nowrap}

.so-items-head{display:flex;align-items:baseline;gap:8px;margin:16px 0 6px}
.so-items-head label{font-weight:700;font-size:12.5px;letter-spacing:.02em}
.so-items-n{color:var(--ink-soft);font-size:11.5px;font-weight:600}

/* the product cell takes the slack; the four numeric columns size to content so the
   sub-lines under them never wrap mid-number */
table.tbl-so-items{table-layout:auto;width:100%}
table.tbl-so-items th,table.tbl-so-items td{vertical-align:top}
table.tbl-so-items td.so-ln-p,table.tbl-so-items th:first-child{width:40%;min-width:200px}
table.tbl-so-items td.so-ln-p .nm{display:block;font-weight:600}
table.tbl-so-items td.so-ln-p .sub{display:block;white-space:normal;overflow-wrap:anywhere}
/* width:1% bunched all four numeric columns hard against the right edge with the
   Product cell eating every spare pixel (MIS, 24 Nov 2026). Each now claims a share
   and carries real gutters, so they read as four distinct columns. */
table.tbl-so-items th.num,table.tbl-so-items td.num{
  white-space:nowrap;width:15%;min-width:104px;padding-left:22px}
table.tbl-so-items th:last-child,table.tbl-so-items td:last-child{padding-right:4px}
table.tbl-so-items td.num .sub{display:block;white-space:nowrap;font-weight:500}
table.tbl-so-items tr.so-ln-foc td.num:last-child{color:var(--ink-soft)}

/* ===== 31. Sales order view page: structured cards (24/25 Nov 2026) ==========
   The view page was one flat form-grid of ten disabled inputs — it read as a form
   you could not type in. Now titled read-only cards of label/value rows, grouped
   as MIS asked: Customer+Contact in one, Order date/Tax/Place of supply/Expected
   delivery in another, then the two addresses. =============================== */
.so-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));
  gap:12px;margin:14px 0}
.so-card{border:1px solid var(--line,rgba(0,0,0,.1));border-radius:10px;
  background:var(--surface-2,rgba(0,0,0,.015));overflow:hidden}
.so-card-h{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--ink-soft);padding:9px 14px;border-bottom:1px solid var(--line,rgba(0,0,0,.08));
  background:var(--surface-3,rgba(0,0,0,.02))}
.so-card-b{padding:4px 14px 10px}

.so-rv{display:flex;gap:12px;align-items:baseline;padding:7px 0;
  border-bottom:1px dashed var(--line,rgba(0,0,0,.07))}
.so-rv:last-child{border-bottom:0}
.so-rv .k{flex:0 0 42%;max-width:150px;color:var(--ink-soft);font-size:12px;font-weight:600}
.so-rv .v{flex:1 1 auto;min-width:0;font-weight:600;font-size:13px;
  overflow-wrap:anywhere}
.so-rv .sub-i{color:var(--ink-soft);font-weight:500;font-size:11.5px}
.so-addr{padding:8px 0 4px;font-size:13px;line-height:1.5;overflow-wrap:anywhere}

/* totals sit right, as a block, not stretched across the page */
.so-totals{margin-left:auto;max-width:360px}

/* ===== 32. Order form uses the same cards as the order page (25 Nov 2026) =====
   The form's label/value rows carry controls instead of text, so creating, editing
   and viewing an order all read the same way. ================================= */
.so-rv-c .v>input,.so-rv-c .v>select,.so-rv-c .v>textarea{width:100%;margin:0}
.so-rv-c .v .so-party-pick{display:flex;gap:6px;align-items:center}
.so-rv-c .v .so-party-pick>select{flex:1 1 auto;min-width:0}
.so-rv-c .v .so-party-pick>button{flex:0 0 auto;white-space:nowrap}
/* a control row needs a touch more height than a text row */
.so-rv-c{padding:6px 0}
.so-rv .req{color:var(--red,#a32d2d)}
/* the searchable-select widget replaces the <select>; it must fill the slot too */
.so-rv-c .v .ssel{width:100%}
