@charset "UTF-8";
/* Mathurata Distributors — design system
   Soft grey canvas, white rounded cards, black pills, one orange accent, hatched bars and tick meters. */

:root {
  --bg: #E5E5E1;
  --canvas: #F3F3F0;
  --surface: #FFFFFF;
  --surface-2: #F5F5F2;
  --surface-3: #ECECE8;
  --line: #E8E8E4;
  --line-2: #D7D7D2;
  --ink: #151515;
  --ink-2: #3E3E3B;
  --muted: #696964;
  --faint: #9B9B95;
  --primary: #151515;
  --on-primary: #FFFFFF;
  --primary-hover: #2E2E2E;
  --btn-light: #F0F0EC;
  --orange: #EE5A24;
  --orange-strong: #CF4510;
  --orange-ink: #C2410C;
  --orange-soft: #FDEDE5;
  --orange-tint: #F7C3AB;
  --avatar-bg: #FDEDE5;
  --green: #16A34A;
  --green-ink: #15803D;
  --green-soft: #E2F5E9;
  --red: #DC2626;
  --red-ink: #B91C1C;
  --red-soft: #FDE7E7;
  --amber: #CA8A04;
  --amber-ink: #9A5B05;
  --amber-soft: #FEF3D3;
  --tick-off: #E3E3DE;
  --bar-dark: #1A1A1A;
  --bar-soft: #D9D9D3;
  --ring: rgba(238, 90, 36, .28);
  --scrim: rgba(18, 18, 18, .42);
  --shadow-lg: 0 28px 70px -18px rgba(20, 20, 20, .28), 0 10px 24px -10px rgba(20, 20, 20, .14);
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, .06);
  --r-card: 24px;
  --r-inner: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

/* ---------- brand themes: only the accent follows the brand (about a fifth of the logo's colours) ---------- */
[data-brand="munchee"] { --orange: #D7191F; --orange-strong: #B11117; --orange-ink: #B11117; --orange-soft: #FDECEC; --orange-tint: #F4B5B7; --ring: rgba(215, 25, 31, .26); --brand-hi: #FFD200; --feat-a: #E0353A; --feat-b: #C8141A; --feat-c: #A50E14; --feat-glow: #F0A23B; }
[data-brand="ritzbury"] { --orange: #1E4FCE; --orange-strong: #173EA6; --orange-ink: #1B44B5; --orange-soft: #E8EEFC; --orange-tint: #B3C5F2; --ring: rgba(30, 79, 206, .26); --brand-hi: #6E93F5; --feat-a: #3A68E4; --feat-b: #1E4FCE; --feat-c: #12379A; --feat-glow: #6C8FF0; }

[data-theme="dark"] {
  --bg: #090909;
  --canvas: #131313;
  --surface: #1B1B1B;
  --surface-2: #232323;
  --surface-3: #2B2B2B;
  --line: #2A2A2A;
  --line-2: #3B3B3B;
  --ink: #F2F2EF;
  --ink-2: #CDCDC8;
  --muted: #9D9D97;
  --faint: #6F6F6A;
  --primary: #F2F2EF;
  --on-primary: #141414;
  --primary-hover: #FFFFFF;
  --btn-light: #2A2A2A;
  --orange: #F2692F;
  --orange-ink: #FF9B6E;
  --orange-soft: rgba(242, 105, 47, .14);
  --orange-tint: #7C3C20;
  --avatar-bg: #3A2519;
  --green-ink: #5ED38C;
  --green-soft: rgba(46, 180, 100, .16);
  --red-ink: #FF8B82;
  --red-soft: rgba(239, 68, 68, .16);
  --amber-ink: #F2C14E;
  --amber-soft: rgba(234, 179, 8, .15);
  --tick-off: #343434;
  --bar-dark: #ECECE8;
  --bar-soft: #3D3D3D;
  --ring: rgba(242, 105, 47, .38);
  --scrim: rgba(0, 0, 0, .6);
  --shadow-lg: 0 28px 70px -18px rgba(0, 0, 0, .7), 0 10px 24px -10px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
[data-theme="dark"][data-brand="munchee"] { --orange: #EE3F45; --orange-ink: #FF8A8D; --orange-soft: rgba(238, 63, 69, .15); --orange-tint: #6B1E21; --ring: rgba(238, 63, 69, .38); }
[data-theme="dark"][data-brand="ritzbury"] { --orange: #4C7BF2; --orange-ink: #9DB7FF; --orange-soft: rgba(76, 123, 242, .16); --orange-tint: #1F3570; --ring: rgba(76, 123, 242, .4); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
html.locked { overflow: hidden; }
body {
  margin: 0; padding: 14px;
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .4; }
svg { flex: none; }
.ic { display: block; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
kbd {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px;
  font: 600 11.5px/1 var(--font); color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 300; background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: 999px; }
.skip:focus { top: 16px; }
.muted { color: var(--muted); }
.block { display: block; }
.nowrap { white-space: nowrap; }
.warn-t { color: var(--amber-ink); font-weight: 500; }
.loss-t { color: var(--red-ink); }
.good-t { color: var(--green-ink); font-weight: 500; }
/* stock history filters, report period */
.hist-bulk { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: -4px 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; position: sticky; top: 64px; z-index: 3; background: var(--surface); color: var(--muted); }
.hist-bulk.on { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-2); }
.hist-bulk .hb-all { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500; }
.hist-bulk .hb-n { flex: 1; min-width: 140px; }
.hist-bulk .hb-n b { font-weight: 600; color: var(--ink); }
td.pick, th.pick { width: 36px; padding-right: 0 !important; }
td.pick { cursor: pointer; }
td.pick input, .hist-bulk input { width: 17px; height: 17px; accent-color: var(--ink); cursor: pointer; vertical-align: middle; }
tr.is-picked > td { background: var(--surface-2); }
.mdl-list { max-height: 240px; overflow: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 10px; }
.mdl-row { display: grid; grid-template-columns: 150px 100px 1fr; gap: 8px; padding: 8px 12px; font-size: 13px; border-top: 1px solid var(--line); }
.mdl-row:first-child { border-top: 0; }
.mdl-to { color: var(--ink-2); }
.mdl-to.bad { color: var(--red-ink); }
.hist-ctl { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.hist-ctl label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.hist-ctl .in { height: 40px; min-width: 150px; }
.hist-ctl .dp { min-width: 150px; }   /* .dp is a size container: without this the label shrinks and the date face spills out instead of wrapping */
.in.caps { text-transform: uppercase; }
/* vehicle form: a route for each day of the week */
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.pg-d { display: flex; align-items: center; gap: 8px; }
.pg-d > span { flex: none; width: 34px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pg-d .in { flex: 1; min-width: 0; height: 40px; }
@media (max-width: 480px) { .plan-grid { grid-template-columns: minmax(0, 1fr); } }
/* Morning load: more routes for one trip */
.xroutes { display: grid; gap: 8px; margin-top: -8px; }
.xroutes:empty { display: none; }
.xroute { display: flex; gap: 8px; align-items: center; }
.xroute .sg { flex: 1; }
.add-route { align-self: flex-start; margin-top: -6px; }
/* date picker (ui.js U.datePick): the real date box sits invisible under a face; a calendar opens below it */
.dp { position: relative; container-type: inline-size; }
@container (max-width: 250px) { .dp-face .dp-today { display: none; } }   /* a narrow box keeps the whole date */
.dp > input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.dp-face { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; white-space: nowrap; }
.dp-face > svg { flex: none; color: var(--muted); }
.dp-face > span { overflow: hidden; text-overflow: ellipsis; }
.dp-face.is-empty > span { color: var(--faint); }
.dp-today { margin-left: auto; padding: 2px 9px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-ink); font-size: 11.5px; font-style: normal; font-weight: 600; }
.dp.is-open .dp-face { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.dp-pop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: 312px; padding: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-lg); transform-origin: top left; animation: sg-in .16s ease-out; }
.dp-pop.up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom left; }
.dp-pop.right { left: auto; right: 0; }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.dp-title { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 11px; font-size: 14.5px; font-weight: 600; }
.dp-title:hover { background: var(--surface-2); }
.dp-title svg { color: var(--muted); }
.dp-nav { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--ink-2); }
.dp-nav:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.dp-nav:disabled { opacity: .3; cursor: default; }
.dp-dow, .dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dp-dow span { padding: 6px 0; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.dp-day { height: 38px; border-radius: 12px; font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink); transition: background .12s; }
.dp-day:hover:not(:disabled):not(.sel) { background: var(--surface-2); }
.dp-day.out { color: var(--faint); }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--orange); font-weight: 600; }
.dp-day.sel { background: var(--orange); color: #fff; font-weight: 600; box-shadow: none; }
.dp-day:disabled { color: var(--faint); opacity: .4; cursor: not-allowed; }
.dp-day:focus-visible, .dp-month:focus-visible, .dp-nav:focus-visible, .dp-title:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.dp-months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px 0 2px; }
.dp-month { height: 46px; border-radius: 12px; font-size: 14px; }
.dp-month:hover:not(:disabled):not(.sel) { background: var(--surface-2); }
.dp-month.sel { background: var(--orange); color: #fff; font-weight: 600; }
.dp-month:disabled { color: var(--faint); opacity: .4; cursor: not-allowed; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .dp-pop { position: absolute; left: 0; right: 0; width: auto; min-width: 280px; }
  .dp-pop.right { left: auto; }
  .dp-day { height: 42px; font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) { .dp-pop { animation: none; } }
/* route boxes: a styled suggestion list (forms.js suggestBox) */
.sg { position: relative; flex: 1; min-width: 0; }
.sg > .in { width: 100%; padding-right: 46px; }
.sg-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--muted); transition: background .15s, color .15s; }
.sg-btn:hover { background: var(--surface-2); color: var(--ink); }
.sg-btn svg { transition: transform .2s ease; }
.sg.is-open .sg-btn svg { transform: rotate(180deg); }
.sg.is-open > .in { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.sg-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); max-height: 312px; overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); transform-origin: top center; animation: sg-in .16s ease-out; }
.sg-list[hidden] { display: none; }
@keyframes sg-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.sg-g { padding: 10px 10px 5px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sg-g:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.sg-o { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.sg-o.is-active { background: var(--surface-2); }
.sg-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.sg-o.is-active .sg-ic { background: var(--surface); }
.sg-o.is-sel .sg-ic { background: var(--orange-soft); color: var(--orange-ink); }
.sg-t { flex: 1; min-width: 0; }
.sg-t b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-t b mark { background: none; color: var(--orange-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.sg-t small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-ok { flex: none; color: var(--orange-ink); }
.sg-new { display: flex; align-items: center; gap: 8px; padding: 10px; font-size: 13px; color: var(--muted); }
.pg-d .sg-list { min-width: 250px; }
.plan-grid .pg-d:nth-child(even) .sg-list { left: auto; }
@media (max-width: 480px) { .plan-grid .pg-d:nth-child(even) .sg-list { left: 0; } }
@media (prefers-reduced-motion: reduce) { .sg-list { animation: none; } .sg-btn svg { transition: none; } }
.vb-rt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Vehicles: weekly routes, today's column marked */
.routes-t th.is-today, .routes-t td.is-today { background: color-mix(in srgb, var(--orange-soft) 75%, transparent); }
.routes-t th.is-today { color: var(--orange-ink); }
.routes-t td { white-space: nowrap; }
.hist-ctl .find-n { align-self: flex-end; line-height: 40px; font-size: 13px; }
/* Stock > Products: the company's product list, added in one go */
.cat-add { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); }
.cat-add > svg { flex: none; color: var(--ink-2); }
.cat-add > div { flex: 1; min-width: 0; }
.cat-add b { display: block; font-size: 15px; }
.cat-add > div > span { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); }
@media (max-width: 640px) { .cat-add { flex-wrap: wrap; } .cat-add .btn { width: 100%; justify-content: center; } }
.dmg-top { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.dmg-top p { max-width: 70ch; margin: 0; font-size: 13.5px; }
.rp-seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface); border-radius: 999px; }
.rp-seg button { height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.rp-seg button.is-on { background: var(--primary); color: var(--on-primary); }
.rp-range { display: inline-flex; align-items: center; gap: 8px; }
.rp-range { flex: none; }
.rp-range .dp { flex: none; width: 200px; }   /* .dp is a size container: it needs its own width, or it shrinks to 0 and the dates spill */
.rp-range .dp-face { width: 100%; height: 44px; gap: 8px; }   /* as tall as Print */
.rp-range .dp-face .dp-today { display: none; }
@media (max-width: 640px) { .rp-range { flex: 1 1 100%; gap: 6px; } .rp-range .dp { flex: 1 1 0; width: auto; min-width: 0; } .rp-range .dp-face { padding: 0 9px; gap: 6px; font-size: 12.5px; } .rp-range .dp-face > svg { display: none; } }
.rp-range > span { color: var(--muted); font-size: 13px; }
.rp-date { height: 38px; width: auto; padding: 0 10px; }
.rp-step .rp-date { border: 0; background: transparent; }
.rp-step .dp { flex: none; width: 220px; }   /* .dp is a size container: it needs its own width, or it shrinks to 0 and only the icon shows */
.rp-step .dp-face { width: 100%; height: 36px; }   /* 36 + 4 + 4 = 44, as tall as Print and Day/Month/Year */
.rp-step .icon-btn.sm { height: 36px; width: 36px; }
.cur { font-size: .58em; font-weight: 500; margin-right: .16em; opacity: .72; letter-spacing: 0; }
.num, .tab-n { font-variant-numeric: tabular-nums; }

/* ---------- app frame ---------- */
.app {
  width: 100%; margin: 0; min-height: calc(100dvh - 28px);
  background: var(--canvas); border-radius: 32px;
  padding: 18px 26px 36px 18px;
  display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "top top" "rail main";
  column-gap: 26px; row-gap: 26px;
}
main { grid-area: main; min-width: 0; outline: none; }
main:focus, main:focus-visible { outline: none; }

/* header */
.top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
/* the full logo sits on its own navy, in both themes */
.brand {
  position: relative; display: inline-flex; align-items: center; height: 50px; padding: 0 14px;
  background: #0E102F; border-radius: 999px; flex: none;
}
.brand picture { display: block; }
.brand-logo { display: block; width: auto; height: min(40px, 2.6vw); }
/* brand switcher */
.bsw { display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 14px 0 8px; background: var(--surface); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink); flex: none; margin-right: auto; }
.bsw:hover { background: var(--surface-2); }
.bsw-logo { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.bsw-logo img { width: 100%; height: 100%; object-fit: cover; }
.bsw .ic { color: var(--muted); }
[data-brand] .bsw { box-shadow: inset 0 0 0 2px var(--brand-hi); }
.q-brand { padding: 9px 14px 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--orange-ink); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.view-note { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 14px; border-radius: 14px; background: var(--orange-soft); color: var(--ink-2); font-size: 13.5px; }
.view-note b { color: var(--orange-ink); }
.tax-sales { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.tax-sales b { color: var(--ink); }
.brand-tag {
  position: absolute; right: -4px; bottom: -7px; padding: 2px 8px; border-radius: 999px;
  background: var(--amber-soft); color: var(--amber-ink); box-shadow: 0 0 0 2px var(--canvas);
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; line-height: 1.4;
}
.nav { display: flex; gap: 2px; padding: 5px; background: var(--surface); border-radius: 999px; min-width: 0; }
.nav a {
  display: inline-flex; align-items: center; height: 40px; padding: 0 17px; border-radius: 999px;
  font-size: 14.5px; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.tools { display: flex; align-items: center; gap: 12px; }
.tool-group { display: flex; gap: 2px; padding: 5px; background: var(--surface); border-radius: 999px; }
.user { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px 0 6px; background: var(--surface); border-radius: 999px; min-width: 0; }
.user-t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-t b { font-size: 14px; font-weight: 600; }
.user-t small { font-size: 12px; color: var(--muted); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--avatar-bg); color: var(--orange-ink); font-weight: 600; font-size: 13.5px;
}

.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; color: var(--ink-2); transition: background .15s, color .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.is-dark { background: var(--primary); color: var(--on-primary); }
.icon-btn[aria-pressed="true"], .icon-btn[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.badge-dot {
  position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

/* side rail */
.rail {
  grid-area: rail; position: sticky; top: 18px; align-self: start;
  z-index: 20;   /* sticky makes its own layer; keep it (and its tooltips) above the page cards */
  height: calc(100dvh - 150px); min-height: 460px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.rail-group { display: flex; flex-direction: column; gap: 6px; padding: 7px; background: var(--surface); border-radius: 999px; }
.rail-group .icon-btn { width: 44px; height: 44px; }
.rail-end { margin-top: auto; }
.rail [data-tip]::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%; transform: translate(-4px, -50%);
  background: var(--ink); color: var(--canvas); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  padding: 6px 10px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30;
}
.rail [data-tip]:hover::after, .rail [data-tip]:focus-visible::after { opacity: 1; transform: translate(0, -50%); }

/* ---------- page head ---------- */
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 22px; }
.ph-l { min-width: 0; flex: 1 1 380px; }
.ph h1 { font-size: clamp(28px, 2.5vw, 38px); font-weight: 500; letter-spacing: -.028em; line-height: 1.12; }
.ph-sub { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 70ch; }
.ph-r { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ph .btn-light, .ph-r .btn-light { background: var(--surface); }
.back { flex-basis: 100%; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: -8px; width: max-content; }
.back:hover { color: var(--ink); }
.reg-chip { display: inline-block; vertical-align: middle; font-size: 14px; font-weight: 500; letter-spacing: .03em; background: var(--surface); padding: 5px 12px; border-radius: 999px; margin-left: 6px; position: relative; top: -4px; }

.mswitch, .dswitch { display: inline-flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border-radius: 999px; }
.mswitch-l, .dswitch-l { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 14px; font-weight: 500; white-space: nowrap; min-width: 150px; justify-content: center; }
.dswitch-l { position: relative; cursor: pointer; border-radius: 999px; height: 34px; }
.dswitch-l:hover { background: var(--surface-2); }
.dswitch-l input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent; font-size: 14.5px; font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; gap: 6px; }
.btn-block { width: 100%; }
.btn-dark { background: var(--primary); color: var(--on-primary); }
.btn-dark:hover { background: var(--primary-hover); }
.btn-light { background: var(--btn-light); color: var(--ink); }
.btn-light:hover { background: var(--surface-3); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-orange { background: var(--orange-strong); color: #fff; font-weight: 600; }
.btn-orange:hover { background: #B83C0C; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-ink); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* quick-add toolbar (black pill) */
.actionbar {
  display: flex; gap: 4px; padding: 5px; margin-bottom: 22px; width: max-content; max-width: 100%;
  background: #121212; border-radius: 999px; overflow-x: auto; scrollbar-width: none;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .55);
}
[data-theme="dark"] .actionbar { background: #000; box-shadow: inset 0 0 0 1px #2C2C2C; }
.actionbar::-webkit-scrollbar { display: none; }
.ab-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  color: #F4F4F1; font-size: 14px; font-weight: 500; border: 1px solid rgba(255, 255, 255, .14); transition: background .15s, transform .1s;
}
.ab-btn:hover { background: rgba(255, 255, 255, .1); }
.ab-btn:active { transform: scale(.96); }
.ab-btn.is-main { background: #fff; color: #121212; border-color: #fff; }
.ab-btn.ab-more { width: 40px; padding: 0; justify-content: center; }
.ab-btn:focus-visible { outline-color: #FFB089; }
.ab-row { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; max-width: 100%; }
.ab-row > .actionbar { margin-bottom: 0; min-width: 0; }
.ab-quick { flex: none; display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 24px; border-radius: 999px;
  background: #fff; color: #121212; font-size: 15px; font-weight: 600; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .55); transition: transform .1s, box-shadow .15s; }
.ab-quick:hover { box-shadow: 0 0 0 4px rgba(255, 255, 255, .14), 0 10px 24px -14px rgba(0, 0, 0, .55); }
.ab-quick:active { transform: scale(.97); }
[data-theme="light"] .ab-quick, :root:not([data-theme="dark"]) .ab-quick { box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 24px -14px rgba(0, 0, 0, .35); }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--r-card); padding: 22px; min-width: 0; }
.page > .card, .page > .two, .page > .vgrid { margin-top: 16px; }
.page > .strip + .card, .page > .kpis + .two { margin-top: 0; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.card-t { font-size: 19px; font-weight: 500; letter-spacing: -.012em; line-height: 1.3; }
.card-sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.card-hr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inset { background: var(--surface-2); border-radius: var(--r-inner); padding: 14px; }
.pill-note { font-size: 12.5px; font-weight: 500; color: var(--ink-2); background: var(--surface-2); padding: 5px 11px; border-radius: 999px; }
.sub-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; margin: 22px 0 4px; }
.sub-h span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.more-row { display: flex; justify-content: center; padding-top: 14px; }
.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; margin-bottom: 18px;
  background: var(--orange-soft); border: 1px solid var(--orange-tint); border-radius: 18px; color: var(--ink);
}
.banner > .ic { color: var(--orange-ink); }
.banner p { flex: 1; font-size: 14px; }
.banner .btn-light { background: var(--surface); }

/* status chips & badges */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.st i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.st-out { background: var(--orange-soft); color: var(--orange-ink); }
.st-out i { background: var(--orange); animation: pulse 2s ease-in-out infinite; }
.st-ok { background: var(--green-soft); color: var(--green-ink); }
.st-ok i { background: var(--green); }
.st-warn { background: var(--amber-soft); color: var(--amber-ink); }
.st-warn i { background: var(--amber); }
.st-bad { background: var(--red-soft); color: var(--red-ink); }
.st-bad i { background: var(--red); }
.st-dep { background: #E7EEFC; color: #1D4ED8; }                 /* deposited, waiting to be verified: the same blue in both brands */
.st-dep i { background: #2563EB; }
[data-theme="dark"] .st-dep { background: rgba(59, 130, 246, .18); color: #9DBBF7; }
.slip-link { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(238, 90, 36, .45); } 50% { box-shadow: 0 0 0 4px rgba(238, 90, 36, 0); } }
.badge { display: inline-flex; align-items: center; gap: 2px; padding: 3px 8px 3px 6px; border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge.good { background: var(--green-soft); color: var(--green-ink); }
.badge.bad { background: var(--red-soft); color: var(--red-ink); }
.badge.flat { background: var(--surface-3); color: var(--ink-2); padding-left: 8px; }

/* tick meter */
/* meters (U.ticks): one thin line, the filled part in the brand colour */
.ticks { --on: var(--orange); position: relative; display: block; height: 6px; background: var(--tick-off); border-radius: 999px; overflow: hidden; }
.ticks::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); background: var(--on); border-radius: inherit; }
.ticks.bad { --on: var(--red); }

/* ---------- overview grid ---------- */
.ov {
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.2fr);
  grid-template-areas: "stock kpis chart" "budget fleet fleet" "attn act act" "aging aging aging";
}
/* credit aging (dashboard) */
.agec { min-width: 0; }
.age-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.age-fig { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); min-width: 0; }
.age-fig span { font-size: 12.5px; color: var(--muted); }
.age-fig b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.age-fig small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.age-fig.is-bad b { color: var(--red-ink); } .age-fig.is-warn b { color: var(--amber-ink); } .age-fig.is-good b { color: var(--green-ink); }
.age-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-3); margin-bottom: 8px; }
.age-bar span { height: 100%; }
.age-legend { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); }
.age-legend li { display: inline-flex; align-items: center; gap: 6px; }
.age-legend i { width: 10px; height: 10px; border-radius: 3px; }
.age-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.age-b0 { background: #34C38F; } .age-b1 { background: #9BD45B; } .age-b2 { background: #F2B53C; } .age-b3 { background: #F07B3F; } .age-b4 { background: #E5484D; }
.age-ctl { margin-bottom: 10px; }
.age-tbl tbody tr[data-act] { cursor: pointer; }
.age-tbl tr.is-late td { background: color-mix(in srgb, var(--red-soft) 45%, transparent); }
.age-d { display: inline-flex; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.age-d.late { background: var(--red-soft); color: var(--red-ink); }
.age-d.soon { background: var(--amber-soft); color: var(--amber-ink); }
.age-d.done { background: transparent; color: var(--muted); font-weight: 500; }
.stockc { display: flex; flex-direction: column; }
.chartc { display: flex; flex-direction: column; }
.chartc .chart-box { flex: 1; display: flex; flex-direction: column; }
.chartc .bchart { flex: 1; height: auto; min-height: 236px; }
.ov-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.rank li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "ic n v" "ic t t"; column-gap: 10px; row-gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.rank li:last-child { border-bottom: 0; }
.rank .cl-ic { grid-area: ic; align-self: start; }
.rank a { grid-area: n; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rank a small { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 4px; }
.rank b { grid-area: v; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rank .ticks { grid-area: t; }
.stockc .card-h { margin-bottom: 6px; }
.big { font-size: clamp(28px, 2.4vw, 36px); font-weight: 500; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.muted-row { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin: 6px 0 18px; }
.stockc .btn-row { margin-bottom: 16px; }
.wallets { margin-top: auto; padding: 12px; }
.wl-h { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin: 0 2px 10px; }
.wl-h b { color: var(--ink); font-weight: 500; }
.wl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@container (min-width: 760px) { .wl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wl { display: flex; flex-direction: column; gap: 1px; padding: 10px 11px; background: var(--surface); border-radius: 14px; min-width: 0; transition: transform .15s; }
.wl:hover { transform: translateY(-1px); }
.wl-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; min-width: 0; }
.wl-top b { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-ic { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.wl-v { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.wl em.good { color: var(--green-ink); }
.wl em.warn { color: var(--amber-ink); }
.wl em.bad { color: var(--red-ink); }
.wallets { container-type: inline-size; }
@container (max-width: 520px) {
  .wl-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .wl { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 0; padding: 9px 12px; }
  .wl-top { margin: 0; }
  .wl-v { grid-column: 2; grid-row: 1; text-align: right; }
  .wl small { grid-column: 1; padding-left: 30px; }
  .wl em { grid-column: 2; grid-row: 2; margin: 0; text-align: right; }
}

/* KPI block (white tray holding grey cards, one orange) */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; background: var(--surface); border-radius: var(--r-card); min-width: 0; }
.kpis.five { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
.kpi { container-type: inline-size; background: var(--surface-2); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; min-width: 0; min-height: 156px; }
.kpi-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-l { font-size: 15px; color: var(--ink-2); }
.kpi-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.kpi-v {
  margin: auto 0 12px; padding-top: 16px; font-weight: 500; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap;
  font-size: min(34px, calc(100cqi / (var(--len, 9) * .6 + 1.25)));
}
.kpi-d { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.kpi.is-feature {
  background: radial-gradient(120% 90% at 100% 0%, var(--feat-glow, #F47A40) 0%, transparent 55%), linear-gradient(225deg, var(--feat-a, #E5541A) 0%, var(--feat-b, #CF4510) 45%, var(--feat-c, #BD3D0B) 100%);
  color: #fff;
}
.kpi.is-feature .kpi-l, .kpi.is-feature .kpi-d { color: rgba(255, 255, 255, .92); }
.kpi.is-feature .kpi-ic { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .26); color: #fff; }
.kpi.is-feature .badge { background: rgba(255, 255, 255, .2); color: #fff; }
.kpi.is-loss .kpi-v { color: var(--red-ink); }

/* figure strip (big numbers with units) */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; margin-bottom: 16px; }
.fig { container-type: inline-size; background: var(--surface); border-radius: 22px; padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; min-height: 120px; min-width: 0; }
.fig-l { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.fig-v { margin-top: auto; font-weight: 500; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: min(32px, calc(100cqi / (var(--len, 8) * .6 + 1.4))); }
.fig-v small { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 5px; }
.fig-n { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- charts ---------- */
.chart-box { padding: 14px 14px 10px; }
.chart-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-top b { font-size: 14px; font-weight: 500; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sw.a { background: var(--bar-dark); }
.sw.b { background: var(--orange-tint) repeating-linear-gradient(-45deg, var(--orange) 0 2.5px, transparent 2.5px 5px); }
.bchart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; height: 236px; }
.bc-y { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 24px; font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; line-height: 1; transform: translateY(-5px); }
.bc-plot { position: relative; min-width: 0; }
.bc-grid { position: absolute; inset: 0 0 24px 0; display: flex; flex-direction: column; justify-content: space-between; }
.bc-grid i { border-top: 1px dashed var(--line-2); }
.bc-grid i:last-child { border-top-style: solid; }
.bc-cols { position: absolute; inset: 0; display: flex; }
.bc-col { flex: 1; min-width: 0; position: relative; display: block; border-radius: 10px; outline-offset: -2px; }
.bc-in { position: absolute; inset: 0 0 24px 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.bc-col:disabled { opacity: 1; cursor: default; }
.bc-bar { position: relative; width: min(30px, 62%); display: flex; flex-direction: column; gap: 3px; min-height: 0; transition: height .4s var(--ease); }
.bs { flex-basis: 0; min-height: 3px; border-radius: 7px; }
.bs-a { background: var(--bar-dark); }
.bs-b { background: var(--orange-tint) repeating-linear-gradient(-45deg, var(--orange) 0 3px, transparent 3px 6.5px); }
.is-loss .bs-a { box-shadow: inset 0 3px 0 var(--red); }
.bc-x { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; padding: 1px 7px; border-radius: 999px; line-height: 18px; }
.bc-col.is-current .bc-x { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.bc-col:hover .bc-bar { filter: brightness(1.06); }
.bc-tip {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); z-index: 5;
  display: grid; gap: 4px; min-width: 180px; padding: 10px 12px; border-radius: 12px;
  background: var(--ink); color: var(--canvas); font-size: 12.5px; text-align: left; box-shadow: var(--shadow-lg);
  display: none; pointer-events: none;
}
.bc-tip span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.bc-tip i { font-style: normal; font-weight: 600; margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }
.bc-tip .sw.a { background: var(--canvas); }
.bc-col:first-child .bc-tip, .bc-col:nth-child(2) .bc-tip { left: 0; transform: none; }
.bc-col:last-child .bc-tip, .bc-col:nth-last-child(2) .bc-tip { left: auto; right: 0; transform: none; }
.bc-col:hover .bc-tip, .bc-col:focus-visible .bc-tip { display: grid; }
.bchart.days { height: 200px; }
.bchart-empty { flex: 1; display: grid; place-items: center; min-height: 200px; }
@media (pointer: coarse) { .kbd-tip { display: none; } }
.days .bc-bar { width: min(16px, 70%); }
.days .bs-a { background: var(--bar-soft); }
.days .is-current .bs-a { background: var(--orange); }
.days .bc-col:hover .bs-a { background: var(--bar-dark); }
.days .bc-x { font-size: 11px; padding: 1px 5px; }

/* ---------- fleet board ---------- */
.fleetc { container-type: inline-size; }
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
@container (min-width: 780px) { .fleet { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 1500px) { .fleet { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.vcard { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); min-width: 0; transition: border-color .2s, box-shadow .2s; }
.vc-foot:has(.vc-link) { flex-direction: column; align-items: stretch; gap: 4px; }
.vc-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 0; padding: 6px; font-size: 13px; font-weight: 500; color: var(--muted); border-radius: 10px; }
.vc-link:hover { color: var(--ink); background: var(--surface-2); }
.vcard.is-carried { border-style: dashed; }
.vcard.is-out { border-color: color-mix(in srgb, var(--orange) 40%, var(--line)); box-shadow: 0 0 0 3px var(--orange-soft); }
.vc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.vc-ic { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--ink); flex: none; }
.vc-ic.lg { width: 46px; height: 46px; }
.is-out .vc-ic { background: var(--orange-soft); color: var(--orange-ink); }
.vc-name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; width: max-content; max-width: 100%; }
.vc-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.vc-reg { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; margin-top: -6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-rows { padding: 8px 10px; margin: 4px 0 6px; }
.vc-rows div, .props div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vc-rows div { padding: 4px 0; font-size: 13px; }
.vc-rows dt, .props dt { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); white-space: nowrap; }
.vc-rows dd, .props dd { font-weight: 500; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-mini { display: none; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.vc-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; min-height: 40px; }
.vc-foot .btn { height: 40px; }
.vc-sale { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.vc-sale span { font-size: 12px; color: var(--muted); }
.vc-sale b { font-size: 15.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* category lists */
.cat-list li { display: grid; gap: 7px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cat-list li:last-child { border-bottom: 0; }
.cat-list a, .cat-list button, .cl-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border-radius: 10px; }
.cat-list button { padding: 2px; margin: -2px; width: calc(100% + 4px); }
.cat-list a:hover .cl-l, .cat-list button:hover .cl-l { text-decoration: underline; text-underline-offset: 3px; }
.cat-list li.is-on button { background: var(--orange-soft); }
.cl-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--ink-2); }
.cl-l { flex: 1; font-size: 14px; min-width: 0; }
.cat-list b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cat-list .ticks { align-self: center; }
.cl-rest { display: flex !important; justify-content: space-between; font-size: 13.5px; color: var(--muted); }

/* alerts */
.alerts { display: grid; gap: 8px; }
.al { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.al > div { flex: 1; min-width: 0; }
.al b { display: block; font-size: 14px; font-weight: 600; }
.al small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.al-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--ink-2); }
.lv-high .al-ic { background: var(--red-soft); color: var(--red-ink); }
.lv-mid .al-ic { background: var(--amber-soft); color: var(--amber-ink); }
.al .btn-light { background: var(--surface); }

/* ---------- tables ---------- */
.tbl-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { background: var(--surface-2); text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 12px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tbody tr[data-open] { cursor: pointer; transition: background .12s; }
.tbl tbody tr[data-open]:hover { background: var(--surface-2); }
.tbl tbody tr[data-open]:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.tbl tr.is-off td { opacity: .55; }
.tbl .ref { color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .act { width: 48px; text-align: right; padding: 6px 8px; }
.tbl small { font-size: 12.5px; }
.tbl.compact td, .tbl.compact th { padding: 9px 12px; }
.act-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.act-cell > div { min-width: 0; }
.act-cell b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.act-cell small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34ch; }
.when { white-space: nowrap; line-height: 1.3; }
.when small { display: block; color: var(--muted); font-size: 12px; }
.act-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.act-ic.trip { background: var(--orange-soft); color: var(--orange-ink); }
.act-ic.stock { background: var(--green-soft); color: var(--green-ink); }
.empty-row td { padding: 0 !important; }
.empty-row:hover { background: none !important; }
td.lvl { min-width: 150px; }
.lvl-n { display: block; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
td.lvl .ticks { max-width: 220px; margin-top: 4px; }
.tel { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.show-sm { display: none; }

/* statement */
.stmt td, .stmt th { padding: 10px 14px; }
.stmt tbody tr:hover { background: none; }
.stmt .grp td { font-weight: 600; padding-top: 18px; color: var(--ink); border-bottom: 0; }
.stmt .ind { padding-left: 14px; color: var(--ink-2); }
.stmt .strong td { font-weight: 600; }
.stmt .sub td { font-weight: 600; background: var(--surface-2); }
.stmt .total td { font-weight: 600; border-top: 2px solid var(--ink); }
.stmt .total.big td { font-size: 17px; }
.stmt .loss td:nth-child(2) { color: var(--red-ink); }
.tbl:not(.stmt) tr.strong td { font-weight: 600; }

/* search, selects, chips used on pages */
.search-in { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); width: 220px; color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search-in:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.search-in input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 14px; color: var(--ink); }
.search-in.big { height: 52px; border-radius: 16px; width: 100%; }
.search-in.big input { font-size: 16px; }
.in-select { position: relative; display: block; }
.in-select > .ic { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.in-select select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.in-select.sm select { height: 40px; padding: 0 38px 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 14px; outline: none; }
.in-select.sm select:focus-visible { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: background .15s; }
.fchip:hover { background: var(--surface-3); }
.fchip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }

/* underline tabs */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin: -6px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; padding: 8px 0 14px; font-size: 17px; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px; }

/* layout helpers */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.two.side { grid-template-columns: minmax(0, .82fr) minmax(0, 1.6fr); }
.two.side.rev { grid-template-columns: minmax(0, 1.6fr) minmax(0, .82fr); }
.two > .card { margin: 0; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.props div { padding: 7px 0; font-size: 14px; }
.props > div > span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); white-space: nowrap; }
.props > div > b { font-weight: 500; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.props.roomy div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.props.roomy div:last-child { border-bottom: 0; }
.props.roomy { padding-top: 4px; padding-bottom: 4px; }

/* vehicles */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.vbig { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border-radius: var(--r-card); min-width: 0; }
.vb-h { display: flex; align-items: center; gap: 12px; }
.vb-t { flex: 1; min-width: 0; }
.vb-t h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.vb-t a:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.vb-t p { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.vbig .props { padding: 8px 14px; }
.svc { display: grid; gap: 8px; }
.svc-l { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.svc-l span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.svc-l b { font-weight: 600; font-variant-numeric: tabular-nums; }
.svc.due .svc-l span { color: var(--red-ink); font-weight: 500; }
.svc-card .svc { margin-bottom: 14px; }
.svc-card .props { margin-bottom: 14px; }
.vb-close { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.vb-close .btn { flex: 1; justify-content: center; }
.vb-close + .vb-f { margin-top: 0; }
.vb-f { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.vb-f .vb-go { margin-left: auto; background: var(--btn-light); }
.vb-f .vb-go:hover { background: var(--primary); color: var(--on-primary); }

/* settings */
.data-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.data-box { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.data-box > b { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.data-box p { color: var(--muted); font-size: 13.5px; flex: 1; }
.data-box .btn { align-self: flex-start; }
.data-box .btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.data-box.danger > b { color: var(--red-ink); }
.data-box .btn-light { background: var(--surface); }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* empty states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 16px; color: var(--muted); }
.empty > .ic { width: 50px; height: 50px; padding: 14px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); box-sizing: border-box; margin-bottom: 4px; }
.empty b { color: var(--ink); font-size: 15px; font-weight: 600; }
.empty p { font-size: 13.5px; max-width: 38ch; }
.empty .btn { margin-top: 8px; }

/* ---------- sheet (forms) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .22s ease; }
.sheet {
  position: relative; width: min(680px, calc(100vw - 24px)); margin: 12px; max-height: calc(100dvh - 24px);
  display: flex; flex-direction: column; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-lg);
  transform: translateX(28px); opacity: 0; transition: transform .3s var(--ease), opacity .22s ease;
}
.sheet.wide { width: min(820px, calc(100vw - 24px)); }
.sheet-wrap.open .scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; opacity: 1; }
.sheet-wrap.closing .sheet { transform: translateX(18px); opacity: 0; transition-duration: .18s; transition-timing-function: ease-in; }
.sh-h { display: flex; align-items: center; gap: 14px; padding: 18px 18px 16px 22px; border-bottom: 1px solid var(--line); }
.sh-ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); flex: none; }
.sh-ico.orange { background: var(--orange-soft); color: var(--orange-ink); }
.sh-ico.green { background: var(--green-soft); color: var(--green-ink); }
.sh-ico.red { background: var(--red-soft); color: var(--red-ink); }
.sh-tt { flex: 1; min-width: 0; }
.sh-tt h2 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.sh-tt p { font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.sh-b { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;   /* min-height 0: a long form scrolls, the footer stays */
   padding: 20px 22px 26px; display: flex; flex-direction: column; gap: 18px; }
.sh-b > * { flex-shrink: 0; }   /* the body scrolls; a long biscuit list (overflow hidden) must never be squeezed to nothing */
.sh-f { display: flex; align-items: center; gap: 12px; padding: 14px 18px 14px 22px; border-top: 1px solid var(--line); }
.f-sum { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.f-sum b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.f-sum span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.f-btns { display: flex; gap: 8px; margin-left: auto; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field[hidden] { display: none; }
.field label, .lbl, .f-set legend { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.req { color: var(--orange-ink); }
.opt { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 2px; }
.hint { font-size: 12.5px; color: var(--muted); }
.err { font-size: 12.5px; font-weight: 500; color: var(--red-ink); }
.err:empty { display: none; }
.in {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--surface); color: var(--ink); font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.in:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line-2)); }
.in:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.in[aria-invalid="true"] { border-color: var(--red); }
.in::placeholder { color: var(--faint); }
input[type="date"].in, input[type="month"].in { padding-right: 10px; }
.in-select .in { padding-right: 40px; }
.in-money { position: relative; }
.in-money > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; font-weight: 500; pointer-events: none; }
.in-money .in { padding-left: 44px; font-variant-numeric: tabular-nums; }
.in-money.big .in { height: 58px; font-size: 23px; font-weight: 600; letter-spacing: -.01em; padding-left: 50px; }
.in-money.big > span { font-size: 17px; left: 16px; }
.in-money.sm .in, .in-money.sm .cin { height: 40px; font-size: 15px; padding-left: 38px; border-radius: 12px; width: 128px; }
.in-money.sm > span { left: 12px; font-size: 13px; }
.cin { border: 1px solid var(--line-2); background: var(--surface); outline: none; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; padding-right: 10px; }
.cin:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.f-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.f-row.pcode-row { grid-template-columns: 150px minmax(0, 1fr); }
.pcode-show { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.pcode-show:empty { display: none; }
.pcode-show b { color: var(--ink); font-weight: 600; }
.f-set { border: 0; padding: 0; margin: 0; min-width: 0; }
.f-set legend { padding: 0; margin-bottom: 8px; }
.f-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.f-sec-h h3 { font-size: 15.5px; font-weight: 600; }
.f-tools { display: flex; gap: 6px; }
.f-tip { margin-top: -12px; }
.f-sec-h:has(.f-tools) + .f-tip { margin-top: 0; }   /* a button beside the heading: keep the hint clear of it */
.f-tip { line-height: 1.55; }
/* a heading inside a section block (no gap between its parts): room between the heading, its hint and what follows */
:not(.sh-b) > .f-sec-h + .f-tip { margin: 10px 0 6px; }

/* vehicle picker & chips */
.vpick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.vp { position: relative; min-width: 0; }
.vp input, .cp input, .seg input, .chk input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.vp-in {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 6px 9px; text-align: center;
  border: 1px solid var(--line-2); border-radius: 15px; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.vp-in:hover { border-color: var(--ink-2); }
.vp-in:active { transform: scale(.97); }
.vp-in .ic { margin-bottom: 3px; }
.vp-in b { font-size: 13.5px; font-weight: 600; }
.vp-in small { font-size: 11px; color: var(--muted); width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-in em { position: absolute; top: 6px; right: 6px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--orange-ink); background: var(--orange-soft); padding: 1px 6px; border-radius: 6px; }
.vp input:checked + .vp-in { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.vp input:checked + .vp-in small { color: color-mix(in srgb, var(--on-primary) 70%, transparent); }
.vp input:focus-visible + .vp-in, .cp input:focus-visible + span, .seg input:focus-visible + span, .chk input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cp span { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px 0 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.cp span:hover { border-color: var(--ink-2); }
.cp input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.seg { display: inline-flex; align-self: flex-start; gap: 2px; padding: 4px; background: var(--surface-2); border-radius: 999px; flex-wrap: wrap; }
.seg span { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px; font-size: 14px; cursor: pointer; color: var(--ink-2); transition: background .15s; }
.seg input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

/* quantity lists */
.qlist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.qrow { display: flex; flex-shrink: 0; align-items: center; gap: 12px; padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--line); min-height: 64px; transition: background .15s; }
.qrow:last-child { border-bottom: 0; }
.qrow[hidden] { display: none; }
/* one biscuit at several cost prices: a row for each price batch */
.q-grp { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.q-grp:last-child { border-bottom: 0; }
.q-grp[hidden] { display: none; }
.q-grp-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 14px 4px; }
.q-grp-h b { font-size: 14.5px; font-weight: 600; }
.q-grp-h small { font-size: 12.5px; color: var(--muted); }
.q-grp .qrow { border-bottom: 0; min-height: 56px; padding-left: 28px; }
.q-grp .qrow .q-name b { font-size: 13.5px; }
.qrow.is-bad .q-warn { color: var(--red-ink); }
.q-price { font-style: normal; font-weight: 600; color: var(--ink); }
.pbs { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pbs > span { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.pbs b { font-weight: 600; }
.pbs small { color: var(--muted); }
/* Reports › Bills */
.bill-tbl tbody tr[data-act] { cursor: pointer; }
.bill-tbl tr.is-cx td { color: var(--muted); }
.billv { display: flex; flex-direction: column; gap: 12px; }
.billv-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.billv-top b { font-size: 16px; }
.billv .btn-row-inline { margin-top: 4px; }
/* a cheque's history */
.chq-hist { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.chq-hist p { margin: 0; }
.chq-hist li { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; }
.chq-hist li > span { flex: none; min-width: 64px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* search above a long biscuit list (forms.js qfind); stays in view while the list scrolls */
.qfind { position: sticky; top: -20px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -8px 0 -10px; padding: 8px 0 10px; background: var(--surface); }
.qfind .search-in { flex: 1 1 220px; width: auto; }
.qf-chk { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.qf-chk input { width: 17px; height: 17px; accent-color: var(--primary); }
.qf-n { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qf-n:empty { display: none; }
/* a load with nothing in the store (forms.js qfind) */
.qf-empty { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px dashed var(--line-2); border-radius: 18px; background: var(--surface-2); }
.qf-empty[hidden] { display: none; }
.qf-e-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--orange-soft); color: var(--orange-ink); }
.qf-empty b { display: block; font-size: 15px; }
.qf-empty p { margin: 3px 0 10px; font-size: 13.5px; color: var(--ink-2); }
.qrow.has-q { background: color-mix(in srgb, var(--orange-soft) 70%, transparent); }
.q-name { flex: 1; min-width: 0; }
.q-name b { display: block; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }   /* the whole name shows: long names wrap */
.q-name small { display: block; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-warn { display: block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--orange-ink); }
.q-warn:empty { display: none; }
.qin { width: 54px; height: 100%; border: 0; outline: none; background: transparent; text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.qin::placeholder { color: var(--faint); font-weight: 400; }
.q-sold { width: 72px; text-align: right; line-height: 1.15; flex: none; }
.q-sold b { display: block; font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-sold small { font-size: 11px; color: var(--muted); }
/* Case / Box / Unit boxes (forms.js qty3): any mix, saved as single units */
.q3 { display: flex; gap: 6px; flex: none; }
.q3-f { display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 104px; }
.q3-f > span { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: center; line-height: 1; }
.q3-f > span small { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2); white-space: nowrap; }
.q3-in { display: flex; align-items: stretch; height: 40px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); overflow: hidden; }   /* ‹ one less · box · one more › */
.q3-in:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.q3-f .qin { flex: 1; min-width: 0; width: auto; height: auto; border: 0; border-radius: 0; background: transparent; font-size: 16px; padding: 0; }
.q3-f .qin:focus { box-shadow: none; }
.q3-in button { flex: none; width: 30px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.q3-in button:hover { background: var(--line-2); color: var(--ink); }
.q3-in button:active { transform: scale(.9); }

.q3-f.is-none { visibility: hidden; }
.qrow.is-bad .q3-in { border-color: var(--red); }
.q-pair { display: grid; grid-template-columns: auto auto; align-items: end; gap: 6px 10px; flex: none; }
.q-pl { font-size: 12px; font-weight: 600; color: var(--muted); padding-bottom: 12px; }
/* evening check: sold on bills + came back, side by side, with the row's verdict */
.rrow { flex-wrap: wrap; row-gap: 8px; }
.rrow .q-name { flex: 1 1 100%; }
.r-cols { display: flex; align-items: flex-end; gap: 14px; flex: 1 1 100%; flex-wrap: wrap; }
.r-col { display: flex; flex-direction: column; gap: 5px; }
.r-h { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.r-st { flex: 1; min-width: 110px; margin: 0; padding-bottom: 11px; text-align: right; font-size: 13px; font-weight: 600; color: var(--muted); }
.r-st.is-ok { color: var(--green-ink); }
.r-st.is-short, .r-st.is-bad { color: var(--red-ink); }
.r-st.is-wait { color: var(--amber-ink); }
.ret-opts { display: flex; gap: 12px 28px; flex-wrap: wrap; margin: 12px 0 16px; }
.ret-area > .f-sec-h { margin-top: 26px; }
.chk-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.chk-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.dmg-sec .sub-h { margin-top: 18px; }
.dmg-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.dmg-h .sub-h { display: block; flex: 1 1 260px; margin-bottom: 0; }
.dmg-h .sub-h b { display: block; font-weight: inherit; }
.dmg-h .sub-h span { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; }
.dmg-h .btn { margin-bottom: 2px; }
/* staff: money columns and admin-only buttons are hidden (the office computer never sends staff those figures) */
html.is-staff .msec, .no-perm { display: none !important; }
.chip-admin.is-staff { background: var(--surface-2); color: var(--ink-2); }
/* sign in: who is it */
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 18px; width: 100%; }
.who { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px 14px; border-radius: 20px; background: var(--surface-2); transition: background .15s, transform .1s; }
.who:hover, .who:focus-visible { background: var(--surface-3); }
.who:active { transform: scale(.98); }
.who b { font-size: 14.5px; font-weight: 600; }
.who small { font-size: 12.5px; color: var(--muted); }
/* People in Settings */
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.people li + li { border-top: 1px solid var(--line); }
.person { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 8px; text-align: left; border-radius: 14px; }
.person:hover { background: var(--surface-2); }
.person-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-t b { font-weight: 600; }
.person-t small, .person-s small { color: var(--muted); font-size: 12.5px; }
.person-s { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.people li.is-off .person-t b { color: var(--muted); }
.jobs-pick { display: flex; flex-direction: column; gap: 8px; }
.chk-row.job { align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.chk-row.job span { display: flex; flex-direction: column; }
.chk-row.job small { color: var(--muted); font-size: 12.5px; }
.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.jobs li { display: flex; gap: 10px; align-items: flex-start; }
.jobs li span { display: flex; flex-direction: column; }
.jobs li small { color: var(--muted); font-size: 12.5px; }
.jobs li .ic { color: var(--green-ink); flex: none; margin-top: 2px; }
.jobs li.off { opacity: .55; }
.jobs li.off .ic { color: var(--muted); }
.watch { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.watch li + li { border-top: 1px solid var(--line); }
.watch button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 4px; text-align: left; flex-wrap: wrap; }
.watch small { color: var(--muted); margin-left: auto; }
@media (max-width: 640px) { .person-s small { display: none; } }

/* bills on Close day: number, shop, total, how it was paid */
.bsec, .psec { display: flex; flex-direction: column; gap: 8px; }
.bl-head, .brow { display: grid; grid-template-columns: 92px minmax(0, 1fr) 132px 108px 36px; gap: 8px; }
.bl-head { grid-template-areas: "no shop total how del"; padding: 0 10px; font-size: 12px; color: var(--muted); }
.blist, .plist { display: flex; flex-direction: column; gap: 8px; }
.brow { grid-template-areas: "no shop total how del" "more more more more more" "rets rets rets rets rets" "msg msg msg msg msg"; row-gap: 0; align-items: start; padding: 10px; border-radius: 16px; background: var(--surface-2); }
.brow .in, .prow .in { height: 42px; min-width: 0; width: 100%; background: var(--surface); }
.brow .b-rets { grid-area: rets; }
.brow .b-no { grid-area: no; } .brow .b-shop { grid-area: shop; } .brow .b-total { grid-area: total; } .brow .b-how { grid-area: how; } .brow [data-bill-del] { grid-area: del; margin-top: 3px; }
.b-more { grid-area: more; display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; }
.b-more[hidden], .b-f[hidden] { display: none; }
.b-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); flex: 1 1 140px; min-width: 0; }
.b-cr b { height: 42px; display: flex; align-items: center; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.b-msg { grid-area: msg; margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.b-msg:empty { display: none; }
.b-msg.bad { color: var(--red-ink); } .b-msg.warn { color: var(--amber-ink); }
.bl-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 46px; border: 1.5px dashed var(--line-2); border-radius: 16px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.bl-add:hover { background: var(--surface-2); border-color: var(--faint); color: var(--ink); }
.bl-add:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.bl-sum { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; padding: 2px; }
.bl-sum:empty { display: none; }
/* Close day: bill cards (forms.js billCards) — type the number, fill the card, it folds into a summary */
.bcards { gap: 10px; }
.bcd-bar { display: flex; gap: 10px; align-items: stretch; }
.bcd-new { flex: 1; max-width: 320px; display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 6px 0 16px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.bcd-new:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.bcd-new > span { font-size: 17px; font-weight: 600; color: var(--faint); }
.bcd-new .in { flex: 1; min-width: 0; height: 100%; border: 0; padding: 0 4px; background: transparent; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bcd-new .in:focus { box-shadow: none; }
.bcd-bar .btn { height: 48px; }
.bcd-found { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line)); border-radius: 18px; background: var(--orange-soft); }
.bcd-fh { display: flex; gap: 12px; align-items: flex-start; }
.bcd-fic { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); color: var(--orange-ink); }
.bcd-fh b { display: block; font-size: 15px; }
.bcd-fh span { font-size: 13px; color: var(--ink-2); }
.bcd-saved { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface); }
.bcd-where { font-size: 12.5px; color: var(--muted); }
.bcd-found .btn-row-inline { margin-top: 0; }
.bcd-cards { display: flex; flex-direction: column; gap: 10px; }
.bcd-cards:empty { display: none; }
.bcd { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.bcd.is-open { border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); box-shadow: 0 0 0 3px var(--orange-soft); }
.bcd-sum { display: flex; flex-direction: column; gap: 9px; width: 100%; padding: 14px 16px; border: 0; border-radius: 18px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.bcd-sum:hover { background: var(--surface-2); }
.bcd-sum:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.bcd.is-open .bcd-sum, .bcd:not(.is-open) .bcd-ed { display: none; }
.bcd-top { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.bcd-sno { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bcd-sshop { flex: 1 1 120px; min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcd-samt { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bcd-sedit { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.bcd-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bcd-facts > span { display: inline-flex; gap: 6px; align-items: baseline; }
.bcd-facts i { white-space: nowrap; font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bcd-prods { display: flex; flex-wrap: wrap; gap: 6px; }
.bcd-prods > span { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bcd-prods b { font-weight: 600; color: var(--ink); }
.bcd-ed { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.bcd-h { display: grid; grid-template-columns: 112px minmax(0, 1fr) 272px 36px; gap: 10px; align-items: end; }
.bcd-del { margin-bottom: 3px; }
.bcd .in { height: 42px; min-width: 0; }
.bcd-sub { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bcd-items { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.bcd-list { display: flex; flex-direction: column; gap: 6px; }
.bcd-list:empty { display: none; }
.bcd-it, .bcd-xr { display: flex; align-items: flex-end; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--surface); }
.bcd-it .q-name, .bcd-xr .q-name { align-self: center; }
.bcd-xr [data-it-del] { margin-bottom: 4px; }
.bcd-xopts { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 0 2px; }
.bcd-xs { background: color-mix(in srgb, var(--amber-soft) 55%, var(--surface-2)); }
.bcd-rt { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; grid-template-areas: "n v del" "m m m" "k k k"; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface); }
.bcd-rt .q-name { grid-area: n; align-self: center; min-width: 0; }
.bcd-rt .bcd-v { grid-area: v; } .bcd-rt .rkinds { grid-area: k; } .bcd-rt [data-it-del] { grid-area: del; }
.bcd-rt .q-name b { white-space: normal; }
.bcd-rt .rt-cond { align-self: center; padding: 3px; }
.bcd-rt .rt-cond span { height: 32px; padding: 0 12px; font-size: 13px; }
.bcd-rt .bcd-v { min-width: 0; color: var(--red-ink); }
.bcd-rt [data-it-del] { margin-bottom: 4px; }
.bcd-v { white-space: nowrap; }
.bcd-xopts .chk-row small { display: block; font-size: 12px; color: var(--muted); }
.bcd-xbox { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; align-items: start; }
.bcd-xbox .bcd-xr { flex-wrap: wrap; row-gap: 6px; }
.bcd-xbox .bcd-xr .q-name { flex: 1 1 100%; }
.bcd-xbox .bcd-xr .q3 { flex: 1; }
.bcd-subrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bcd-parts { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; align-items: start; }
.bcd-parts[hidden] { display: none; }
.bcd-parts .b-cr b { height: 42px; }
.bcd .b-more { row-gap: 14px; }
.bcd .b-more > .b-f { flex: 1 1 190px; }                       /* cheque no., date and bank on one row */
.bcd .b-more > .b-f[data-for="credit"] { flex: 0 1 calc(33.33% - 8px); min-width: 190px; }
.bcd-prods em { align-self: center; font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.bcd-v { min-width: 104px; padding-bottom: 10px; text-align: right; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.bcd-it [data-it-del] { margin-bottom: 4px; }
.bcd-find { position: relative; }
.bcd-fi { position: absolute; left: 14px; top: 13px; color: var(--muted); pointer-events: none; }
.bcd-find .in { padding-left: 40px; }
.bcd-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; align-items: end; }   /* 4 figures, or 5 with returns */
.bcd-m { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.bcd-m b { height: 42px; display: flex; align-items: center; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.bcd-amt { text-align: right; }
.bcd-amt b { justify-content: flex-end; font-size: 20px; font-weight: 700; }
.bcd-pay { display: flex; gap: 10px 16px; align-items: flex-end; flex-wrap: wrap; }
.bcd-how { display: flex; flex-direction: column; gap: 6px; }
.bcd .b-more, .bcd .b-msg { margin: 0; }
.bcd-foot { display: flex; justify-content: flex-end; }
/* a product the bills sell more of than the load */
.q-name .bcd-ow { color: var(--red-ink); font-weight: 600; white-space: normal; }
.q-name .bcd-ow:empty { display: none; }
.bcd-it.is-over { background: color-mix(in srgb, var(--red-soft) 70%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 50%, transparent); }
.bcd-it.is-over .bcd-v { color: var(--red-ink); }
.bcd-over { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--red-soft); color: var(--red-ink); font-size: 13px; line-height: 1.45; }
.bcd-over[hidden] { display: none; }
.bcd-over .ic { flex: none; margin-top: 1px; }
.bcd.is-over:not(.is-open) { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.bcd-sover { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--red-soft); color: var(--red-ink); font-size: 12px; font-weight: 600; }
/* the cheques on a bill: one, or several that add up */
.bcd .b-more > .bcd-chqs, .brow .b-more > .bcd-chqs { flex: 1 1 100%; display: flex; flex-direction: column; gap: 10px; }
.brow.cq-multi .bcd-cq { background: var(--surface); }
.brow .b-cr b { display: flex; align-items: center; height: 42px; font-size: 16px; font-variant-numeric: tabular-nums; }
.bcd-chqs[hidden] { display: none; }
.bcd-cqlist { display: flex; flex-direction: column; gap: 8px; }
.bcd-cq { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.bcd-cq > .b-f { flex: 1 1 170px; }
.bcd-cq > .cq-amt { flex: 0 1 170px; }
.bcd-cq [data-cq-del] { margin-bottom: 3px; }
.bcd-cqn { flex: 1 1 100%; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bcd-cqn:empty { display: none; }
.cq-multi .bcd-cq { position: relative; padding: 10px 12px 12px; border-radius: 14px; background: var(--surface-2); }
.cq-multi .bcd-cq [data-cq-del] { position: absolute; top: 4px; right: 4px; margin: 0; }
.bcd-cqbar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.bcd-cqsum { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bcd-cqsum:empty { display: none; }
.bcd-cqsum.good { color: var(--green-ink); } .bcd-cqsum.warn { color: var(--amber-ink); } .bcd-cqsum.bad { color: var(--red-ink); }
.bcd [data-b="cheque"][readonly] { background: var(--surface-2); color: var(--ink-2); cursor: default; }
.bcd-cqsep { margin: 0 8px; color: var(--faint); }
/* cheque numbers: 6 digits */
.chq-msg { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chq-msg:empty { display: none; }
.chq-msg.bad { color: var(--red-ink); font-weight: 600; }
.in.is-bad { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }
/* a cancelled bill: its number stays in the bill book */
.bcd-cxrow { display: flex; flex-direction: column; gap: 10px; padding: 0 2px; }
.bcd-cx { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.bcd-cx[hidden] { display: none; }
.bcd-cx .hint { margin: 0; }
.bcd.is-cx .bcd-items, .bcd.is-cx .bcd-xopts, .bcd.is-cx .bcd-xbox, .bcd.is-cx .bcd-money, .bcd.is-cx .bcd-pay, .bcd.is-cx .b-more { display: none !important; }
.bcd.is-cx:not(.is-open) { background: var(--surface-2); border-style: dashed; }
.bcd-scx { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.bcd-cxn { color: var(--muted); }
.bcd-gap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; }
.bcd-gap[hidden] { display: none; }
.bcd-gap > .ic { flex: none; }
.bcd-gap > div { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.bcd-gap b { color: var(--ink); font-size: 14px; }
.bcd-gap span { color: var(--ink-2); }
/* the agency profit (Settings) */
.pf { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pf b { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf span { color: var(--muted); font-size: 13.5px; }
.pf-list { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.in-pct { position: relative; max-width: 160px; }
.in-pct .in { padding-right: 34px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.in-pct > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.pf-hist { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pf-hist ul { color: var(--ink-2); }
/* the vehicle allowance */
.alw-list { display: flex; flex-direction: column; gap: 8px; }
.alw-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.alw-row .chk-row { flex: 1 1 220px; }
.alw-row .chk-row small { display: block; font-size: 12.5px; color: var(--muted); }
.alw-row .alw-amt { flex: 0 1 180px; }
.alw-row:not(.is-on) .alw-amt { opacity: .45; }
.alw-hist { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); padding-top: 4px; }
.alw-hist b { display: inline-block; min-width: 76px; margin-right: 8px; color: var(--ink); }
.alw-tot { margin: 10px 2px 0; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.warn-t { color: var(--amber-ink); font-style: normal; }
/* sold, from the bills: shown, not typed */
.r-sv { display: flex; align-items: center; justify-content: center; min-width: 96px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface-3); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.r-sv.is-bad { background: var(--red-soft); color: var(--red-ink); }
.q-pair .r-sv { justify-self: start; }
@media (max-width: 640px) {
  .bcd-new { max-width: none; }
  .bcd-h { grid-template-columns: minmax(0, 1fr) 36px; grid-template-areas: "no del" "shop shop" "date date"; }
  .bcd-no { grid-area: no; } .bcd-shop { grid-area: shop; } .bcd-date { grid-area: date; } .bcd-del { grid-area: del; }
  .bcd-it, .bcd-xr { flex-wrap: wrap; }
  .bcd-it .q-name, .bcd-xr .q-name { flex: 1 1 100%; }
  .bcd-parts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bcd-it .bcd-v { white-space: normal; text-align: right; }
  .bcd-rt { grid-template-columns: minmax(0, 1fr) auto 36px; grid-template-areas: "n v del" "m m m" "k k k"; }
  .bcd-v { flex: 1; min-width: 0; }
  .bcd-money { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bcd-ed { padding: 12px; }
  .bcd-items { padding: 10px; }
  .bcd .b-more .b-f { flex-basis: 100%; }
  .bcd-sedit span { display: none; }
}

.prow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 130px 104px 36px; grid-template-areas: "shop bill amt how del" "more more more more more"; gap: 0 8px; align-items: start; padding: 10px; border-radius: 16px; background: var(--surface-2); }
.prow [data-p="shop"] { grid-area: shop; } .prow [data-p="bill"] { grid-area: bill; } .prow .p-amt { grid-area: amt; } .prow [data-p="how"] { grid-area: how; } .prow [data-pay-del] { grid-area: del; margin-top: 3px; }
.prow .b-more { grid-area: more; }
.handin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.handin > div { display: flex; flex-direction: column; gap: 2px; }
.handin span { font-size: 12.5px; color: var(--muted); } .handin b { font-size: 17px; font-variant-numeric: tabular-nums; } .handin small { font-size: 12px; color: var(--muted); }
/* new shops to visit (Morning load) */
.rs-new { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.b-msg.good { color: var(--green-ink); }

/* one brand per screen */
.bsw.is-single { cursor: default; }
.bsw.is-single .ic { display: none; }
.brand-line { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }
.brand-line img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.plain-people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.plain-people li { display: flex; flex-direction: column; }
.plain-people small { font-size: 12px; color: var(--muted); }

/* paying the companies (dashboard) */
.compc { display: flex; flex-direction: column; gap: 14px; }
.cp-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cp-fig { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); min-width: 0; }
.cp-fig span { font-size: 12.5px; color: var(--muted); }
.cp-fig b { font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-fig small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-fig.bad b { color: var(--red-ink); } .cp-fig.warn b { color: var(--amber-ink); } .cp-fig.good b { color: var(--green-ink); }
.cp-cos { display: flex; flex-direction: column; gap: 10px; }
.cp-co { border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cp-co-h { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cp-co-h img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.cp-co-h > div { display: flex; flex-direction: column; min-width: 0; }
.cp-co-h small, .cp-co-v small { font-size: 12px; color: var(--muted); }
.cp-co-v { margin-left: auto; text-align: right; }
.cp-co-v b { font-variant-numeric: tabular-nums; }
.cp-co .duel button { padding: 8px 2px; }
.duel-d.soon { background: var(--amber-soft); color: var(--amber-ink); }
.cp-more, .cp-none { margin: 4px 2px 0; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
/* paying a company (form) */
.pay-list { display: flex; flex-direction: column; gap: 6px; }
.pay-inv { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.pay-inv span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pay-inv small { font-size: 12.5px; color: var(--muted); }
.pay-inv.is-late small { color: var(--red-ink); }
.pay-amt { font-variant-numeric: tabular-nums; }
.pay-box { display: flex; flex-direction: column; gap: 14px; }
.pay-box[hidden] { display: none; }
/* settings: companies */
.co-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.co-day { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.co-day img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.co-day-in { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.co-day-in .in { width: 84px; height: 42px; text-align: center; }

/* credit to collect (dashboard) */
.duel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.duel li + li { border-top: 1px solid var(--line); }
.duel button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 4px; text-align: left; border-radius: 12px; }
.duel button:hover { background: var(--surface-2); }
.duel-d { flex: none; min-width: 66px; padding: 4px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 600; text-align: center; color: var(--ink-2); }
.duel-d.late { background: var(--red-soft); color: var(--red-ink); }
.duel-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.duel-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .duel-t small { font-size: 12.5px; color: var(--muted); }
.duel-a { font-variant-numeric: tabular-nums; }
.chq-acts { display: flex; gap: 6px; justify-content: flex-end; }
.chq-td { white-space: nowrap; text-align: right; width: 1%; }
@media (max-width: 640px) { .chq-acts { flex-direction: column; align-items: flex-end; } }
.linkish { color: var(--ink); font-weight: 600; text-align: left; }
.linkish:hover { text-decoration: underline; }
.bcd-bank { display: contents; }
.vp-in .vp-stock { color: var(--ink-2); font-weight: 500; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }   /* each lorry's own stock under its name */
/* QUICK BILL: the day's Quick Bills, and one Quick Bill in three steps */
.qb-none { margin: 4px 0 14px; }
.qb-batches { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: 16px; }
.qb-b { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 10px 10px 10px 14px; font-size: 14px; }
.qb-b + .qb-b { border-top: 1px solid var(--line); }
.qb-b.is-open { background: color-mix(in srgb, var(--orange, #f59e0b) 8%, transparent); }
.qb-b > span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-b .qb-when { font-size: 12.5px; }
.qb-ed-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.qb-ed-h b { font-size: 16px; }
.qb-ed-h .linkish { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.qb-ed-h small { color: var(--muted); }
.qb-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; counter-reset: qb; }
.qb-steps button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--ink); cursor: pointer; }
.qb-steps button.is-on { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.qb-sn { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--line); }
.qb-steps button.is-on .qb-sn { background: var(--ink); color: var(--surface); }
.qb-sl { display: grid; min-width: 0; }
.qb-sl b { font-size: 13.5px; }
.qb-sl small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-cmp { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); }
.qb-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.qb-nav [data-qb-next] { margin-left: auto; }
.qb-ed-x { margin: 14px 0 0; font-size: 13px; }
@media (max-width: 640px) {
  .qb-b { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 4px; }
  .qb-steps { grid-template-columns: 1fr; }
}
.qb-wait { display: grid; gap: 8px; margin: 4px 0 12px; }   /* Quick bill: lorries whose remaining stock waits in the store */
.qb-wh { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.qb-wrow { display: flex; align-items: center; gap: 12px; }
.qb-wt { flex: 1; min-width: 0; display: grid; }
.qb-wt small { color: var(--muted); font-size: 12.5px; }
.src-pick { display: grid; gap: 10px; }   /* Morning load: where today's stock comes from */
.src-opt { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); color: var(--ink); cursor: pointer; }
.src-opt:hover, .src-opt:focus-visible { border-color: var(--ink); }
.src-ic { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--line); }
.src-t { display: grid; gap: 4px; }
.src-t b { font-size: 15px; }
.src-t small { font-size: 13px; color: var(--muted); line-height: 1.45; }
.src-t em { font-style: normal; font-size: 12.5px; color: var(--red-ink); }   /* a bill paid online / by deposit: its boxes sit with the other payment boxes */
.qrow.on-inv { background: var(--surface-2, rgba(127,127,127,.06)); }   /* on the invoice being edited */
.qrow.on-inv [data-line-rm] { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.qrow.was-rm .q-name b { text-decoration: line-through; color: var(--muted); }
.f-sum .tot-act { display: flex; gap: 10px; margin-top: 2px; font-size: 12.5px; }   /* the invoice total: change it, or clear the amounts */
.dlg-b { display: grid; gap: 12px; }
.dlg-b .dlg-btns { margin-top: 4px; }
.list-sum { margin: 0 0 8px; font-size: 13.5px; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
@media (max-width: 640px) {
  .bl-head { display: none; }
  .brow { grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr) 36px; grid-template-areas: "no shop shop del" "total total how how" "more more more more" "rets rets rets rets" "msg msg msg msg"; row-gap: 8px; }
  .brow .b-more, .brow .b-msg { margin-top: 0; }
  .prow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; grid-template-areas: "shop shop del" "bill bill bill" "amt how how" "more more more"; row-gap: 8px; }
  .handin { grid-template-columns: minmax(0, 1fr); }
}

/* shop rows on Close day */
.ssec { display: flex; flex-direction: column; gap: 8px; }
.shrows { display: flex; flex-direction: column; gap: 8px; }
.shrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, .8fr) minmax(0, 1fr) 36px; gap: 8px; align-items: start; }
.shrow[data-kind="pay"] { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 36px; }
.shrow-shop { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shrow .in { height: 42px; min-width: 0; width: 100%; }
.shrow .in-money .in { padding-left: 40px; }
.shrow .icon-btn { margin-top: 3px; }
.shrow-why { grid-column: 1 / -2; }   /* a cancelled bill's reason gets its own line */
.shrow[data-kind="cancel"] [data-shrow-del] { grid-area: 1 / 4; }
.route-shops { border-radius: 16px; padding: 12px 14px; background: var(--surface-2); font-size: 13.5px; }
.route-shops.has-blocked { background: var(--red-soft); }
.rs-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.route-shops ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.route-shops li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.route-shops li span:last-child { color: var(--muted); }
tr.is-alert td:first-child b { color: var(--red-ink); }
.shopv { display: flex; flex-direction: column; gap: 16px; }
.shopv-top { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; }
.shopv-top p { margin: 0 0 6px; }
.shopv-bal { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.shopv-bal small { font-size: 14px; color: var(--muted); font-weight: 400; }
@media (max-width: 640px) {
  .shrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .shrow[data-kind="pay"] { grid-template-columns: minmax(0, 1fr) 36px; }
  .shrow-shop { grid-column: 1 / -1; }
  .shrow[data-kind="cancel"] [data-shrow-del] { grid-area: 2 / 3; }
}
.q-diff { font-style: normal; font-weight: 600; }
.q-diff.pos { color: var(--green-ink); }
.q-diff.neg { color: var(--red-ink); }
.q-cost { color: var(--muted); }
.cost-in { width: 74px; height: 24px; border: 1px dashed var(--line-2); border-radius: 7px; background: transparent; font-size: 12.5px; text-align: right; padding: 0 5px; color: var(--ink-2); outline: none; font-variant-numeric: tabular-nums; }
.cost-in:focus { border-style: solid; border-color: var(--ink); }

/* salary list */
.slist { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.srow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); min-height: 60px; transition: opacity .15s, background .15s; }
.srow:last-child { border-bottom: 0; }
.srow.off { opacity: .5; }
.srow.is-paid { background: var(--surface-2); }
.srow.is-paid .chk { visibility: hidden; }
.chk { position: relative; display: inline-grid; cursor: pointer; }
.chk span { width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; background: var(--surface); transition: background .15s, border-color .15s; }
.chk input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.s-name { flex: 1; min-width: 0; }
.s-name b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-name small { font-size: 12.5px; color: var(--muted); }
.s-paid { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ---------- dialogs ---------- */
.dialog-wrap { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; }
.dialog-wrap.open .scrim { opacity: 1; }
.dialog {
  position: relative; width: min(430px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--surface); border-radius: 26px; padding: 24px; box-shadow: var(--shadow-lg);
  transform: scale(.96) translateY(6px); opacity: 0; transition: transform .22s var(--ease), opacity .18s ease;
}
.dialog-wrap.open .dialog { transform: none; opacity: 1; }
.dialog.wide { width: min(680px, 100%); }
.dialog.palette { width: min(620px, 100%); align-self: start; margin-top: 10vh; padding: 16px; }
.dlg-ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-2); }
.dlg-ico.danger { background: var(--red-soft); color: var(--red-ink); }
.dialog h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 14px 0 6px; }
.dialog > p { color: var(--muted); font-size: 14.5px; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dlg-head h2 { margin: 0; }
.palette .dlg-head { display: none; }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid transparent; text-align: left; transition: background .15s, border-color .15s, transform .1s; min-width: 0; }
.quick:hover { background: var(--surface); border-color: var(--line-2); }
.quick:active { transform: scale(.98); }
.quick b { font-size: 14.5px; font-weight: 600; margin-top: 8px; }
.quick small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.quick kbd { position: absolute; top: 12px; right: 12px; }
.quick-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); color: var(--ink); flex: none; transition: background .15s, color .15s; }
.quick:hover .quick-ic { background: var(--orange); color: #fff; }
.howto li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.howto li:last-child { border-bottom: 0; }
.howto b { font-size: 14.5px; font-weight: 600; }
.howto p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.howto .quick-ic { background: var(--surface-2); }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-bottom: 16px; }
.keys li { display: flex; align-items: center; gap: 10px; font-size: 14px; }

/* palette */
.pal-list { max-height: 52vh; overflow-y: auto; margin-top: 10px; }
.pal-list li[role="option"] { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-areas: "ic b" "ic s"; column-gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.pal-list li[aria-selected="true"] { background: var(--surface-2); }
.pal-list b { grid-area: b; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-list small { grid-area: s; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-ic { grid-area: ic; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; align-self: center; }
li[aria-selected="true"] .pal-ic { background: var(--surface); }
.pal-g { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 10px 4px; }
.pal-none { padding: 24px 10px; text-align: center; color: var(--muted); }

/* popover menu & alerts */
.menu { position: fixed; z-index: 150; min-width: 210px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 14px; text-align: left; color: var(--ink); }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu button.danger { color: var(--red-ink); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.pop { position: fixed; z-index: 140; max-height: min(70vh, 640px); overflow-y: auto; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); }
.pop-h { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 12px; font-size: 15px; }
.pop-h span { font-size: 13px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
/* a message card: the dashboard's own surface as frosted glass, a soft tinted icon, a hairline that runs down while it shows */
.toast {
  --t-ac: var(--green); --t-ink: var(--green-ink); --t-soft: var(--green-soft);
  position: relative; overflow: hidden; pointer-events: auto; touch-action: pan-y; user-select: none;
  display: flex; align-items: flex-start; gap: 12px; width: 400px; max-width: 100%;
  padding: 12px 10px 12px 12px; border-radius: 18px;
  background: rgba(255, 255, 255, .86); color: var(--ink);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(20, 20, 20, .08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 18px 44px -16px rgba(20, 20, 20, .28), 0 4px 12px -6px rgba(20, 20, 20, .12);
  font-size: 13.5px; line-height: 1.45; letter-spacing: -.003em;
  transform: translateY(14px) scale(.96); opacity: 0; filter: blur(4px);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1), opacity .24s ease, filter .3s ease;
}
[data-theme="dark"] .toast {
  background: rgba(32, 32, 32, .82); color: var(--ink);
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 22px 50px -16px rgba(0, 0, 0, .75), 0 6px 16px -8px rgba(0, 0, 0, .6);
}
.toast.is-in { transform: none; opacity: 1; filter: none; }
.toast.is-out { transform: translateY(10px) scale(.97); opacity: 0; transition: transform .24s cubic-bezier(.4, 0, 1, 1), opacity .2s ease; }
.toast.error { --t-ac: var(--red); --t-ink: var(--red-ink); --t-soft: var(--red-soft); }
.toast.info { --t-ac: var(--muted); --t-ink: var(--ink-2); --t-soft: var(--surface-3); }
.toast-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--t-soft); color: var(--t-ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--t-ac) 18%, transparent) inset; }
.toast-m { flex: 1; min-width: 0; padding: 5px 2px 0 0; overflow-wrap: anywhere; }
.toast-undo { align-self: center; font-weight: 600; font-size: 13px; color: var(--orange-ink); padding: 6px 12px; border-radius: 10px; background: var(--orange-soft); flex: none; transition: transform .1s ease, background .15s ease; }
.toast-undo:hover { background: color-mix(in srgb, var(--orange) 22%, transparent); }
.toast-x { width: 28px; height: 28px; margin-top: 1px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); flex: none; transition: transform .1s ease, background .15s ease, color .15s ease; }
.toast-x:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.toast-x:active, .toast-undo:active { transform: scale(.92); }
.toast-t { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--t-ac); opacity: .55; transform-origin: left; transform: scaleX(0); pointer-events: none; }
.toast.is-in .toast-t { animation: toast-life var(--life, 4200ms) linear forwards; }
.toast.is-held .toast-t { animation-play-state: paused; }
@keyframes toast-life { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.is-out { transform: none; filter: none; transition: opacity .2s ease; }
}
@media (prefers-reduced-transparency: reduce) {
  .toast { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  [data-theme="dark"] .toast { background: var(--surface-2); }
}

/* mobile tab bar */
.tabbar { display: none; }

/* motion helpers */
.page.is-entering { animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.flash { animation: flash 1.4s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--orange); } 30% { box-shadow: 0 0 0 4px var(--ring); } 100% { box-shadow: 0 0 0 0 transparent; } }

.print-head { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1480px) {
  .ov { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-areas: "stock kpis" "budget chart" "fleet fleet" "attn act" "aging aging"; }
}
@media (max-width: 1560px) {
  .top { flex-wrap: wrap; }
  .brand-logo { height: 40px; }
  .nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav a { flex: 1 0 auto; justify-content: center; }
  .rail { height: calc(100dvh - 210px); }
}
@media (max-width: 1180px) {
  .two, .two.side, .two.side.rev { grid-template-columns: minmax(0, 1fr); }
  .ov { grid-template-areas: "stock kpis" "chart chart" "fleet fleet" "budget attn" "act act" "aging aging"; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  body { padding: 0; }
  .app { border-radius: 0; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; padding: 14px 16px calc(110px + env(safe-area-inset-bottom)); row-gap: 18px; }
  .rail, .nav, .user { display: none; }
  .top { flex-wrap: nowrap; gap: 10px; }
  .brand { height: 46px; padding: 0 12px; }
  .brand-logo { height: 36px; }
  .bsw { height: 46px; padding: 0 10px 0 6px; }
  .bsw-t { display: none; }
  .tool-group [data-act="help"] { display: none; }
  .ov { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stock" "kpis" "fleet" "attn" "aging" "chart" "budget" "act"; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; z-index: 90; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    height: 66px; padding: 0 6px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  }
  .tabbar a, .tabbar > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%; font-size: 11px; font-weight: 500; color: var(--muted); }
  .tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
  .tabbar a[aria-current="page"] .ic { color: var(--orange); }
  .tabbar .tb-add { justify-self: center; width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .5); }
  .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
  html:has(.sheet-wrap.open) .toasts { top: calc(12px + env(safe-area-inset-top)); bottom: auto; }   /* never over a form's Save button */
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .act-cell b { max-width: 22ch; }
  .act-cell small { max-width: 26ch; }
  .card-hr .search-in { width: 100%; flex: 1 1 160px; }
  .card { padding: 18px; }
}
@media (max-width: 640px) {
  .sheet-wrap { align-items: flex-end; }
  .sheet, .sheet.wide { width: 100%; margin: 0; border-radius: 26px 26px 0 0; max-height: 94dvh; transform: translateY(40px); }
  .sheet-wrap.closing .sheet { transform: translateY(30px); }
  .sh-b { padding: 18px 16px 22px; }
  .sh-h { padding: 16px 12px 14px 16px; }
  .sh-f { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) 16px; flex-wrap: wrap; }
  .f-sum { flex: 1 1 100%; flex-direction: row; justify-content: space-between; gap: 10px; }
  .f-btns { width: 100%; }
  .f-btns .btn { flex: 1; }
  .ph h1 { font-size: 27px; }
  .ph-r { width: 100%; }
  .ph-r .mswitch, .ph-r .dswitch { flex: 1 1 100%; justify-content: space-between; }
  .ph-r .rp-step .dp { flex: 1 1 0; width: auto; min-width: 0; }
  .ph-r > .btn { flex: 1 1 auto; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick kbd { display: none; }
  .kpi { min-height: 132px; padding: 14px; }
  .fleet { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .vcard { padding: 12px; gap: 4px; }
  .vc-rows { display: none; }
  .vc-mini { display: block; margin: 2px 0 8px; }
  .vc-ic { width: 34px; height: 34px; }
  .vc-name { font-size: 16px; }
  .vc-foot .btn { height: 42px; padding: 0 10px; }
  .vc-sale b { font-size: 14.5px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fig { min-height: 104px; padding: 14px; }
  .actionbar { margin-left: -16px; margin-right: -16px; max-width: none; width: auto; border-radius: 0; padding: 6px 16px; }
  .ab-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .ab-quick { justify-content: center; }
  .keys { grid-template-columns: minmax(0, 1fr); }
  .dialog.palette { margin-top: 4vh; }
  .vpick { gap: 6px; }
  .vp-in { padding: 9px 4px 8px; }
  .keys, .tabs { gap: 20px; }
  .tab { font-size: 15.5px; }
}
@media (max-width: 640px) {
  .brand { padding: 0 4px; }
  .brand-logo { width: 38px; height: 38px; }   /* the mark alone (see <picture> in index.html) */
}
@media (max-width: 480px) {
  .tbl td, .tbl th { padding: 10px 8px; }
  .tbl td:first-child, .tbl th:first-child { padding-left: 12px; }
  .tbl .act { width: 40px; padding: 4px; }
  .act-cell { gap: 8px; }
  .act-ic { width: 30px; height: 30px; border-radius: 10px; }
  .act-cell b { max-width: 16ch; }
  .act-cell small { max-width: 18ch; }
  td.lvl { min-width: 110px; }
}
@media (max-width: 420px) {
  .f-row { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 8px; }
  .kpi-d span:last-child { display: none; }
  .q-name small { font-size: 12px; }
  .qrow { gap: 8px; padding-left: 12px; flex-wrap: wrap; }
  .qrow .q-name { flex-basis: 100%; }
  .qrow .q3 { margin-left: auto; }
  .q3-f { width: 96px; }
}

/* ---------- admin profile ---------- */
.user { text-align: left; color: var(--ink); transition: background .15s; }
.user:hover { background: var(--surface-2); }
.me-btn { display: none; padding: 0; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; }
.avatar.xxl { width: 112px; height: 112px; font-size: 38px; letter-spacing: -.02em; }
.chip-admin { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip-admin.sm { height: 22px; font-size: 11.5px; padding: 0 8px 0 6px; margin-top: 6px; }

.user-pop { padding: 10px; }
.up-h { display: flex; align-items: center; gap: 12px; padding: 8px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.up-h > div { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.up-h b { font-size: 15.5px; font-weight: 600; }
.up-h small { font-size: 12.5px; color: var(--muted); max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 12px; text-align: left; color: var(--ink); }
.up-list button:hover, .up-list button:focus-visible { background: var(--surface-2); outline: none; }
.up-list button > .ic { color: var(--ink-2); }
.up-list span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.up-list b { font-size: 14px; font-weight: 500; }
.up-list small { font-size: 12px; color: var(--muted); }
.up-list button.warn small { color: var(--amber-ink); font-weight: 500; }
.up-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

.prof { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.prof .stack > .strip { margin: 0; }
.prof .two > .card { margin: 0; }
.profc { padding: 0; overflow: hidden; position: sticky; top: 18px; }
.profc-cover {
  position: relative; height: 128px;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 9px),
    radial-gradient(90% 140% at 100% 0%, #F47A40 0%, rgba(244, 122, 64, 0) 60%),
    linear-gradient(225deg, #E5541A 0%, #CF4510 45%, #9F350A 100%);
}
.profc-tag { position: absolute; right: 14px; top: 14px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 9px; border-radius: 999px; background: rgba(255, 255, 255, .18); color: #fff; font-size: 12.5px; font-weight: 600; }
.profc-body { padding: 0 22px 22px; display: flex; flex-direction: column; }
.profc-av { position: relative; width: max-content; margin-top: -58px; margin-bottom: 14px; }
.profc-av .avatar { box-shadow: 0 0 0 5px var(--surface); }
.profc-cam { position: absolute; right: -2px; bottom: 4px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 3px var(--surface); transition: transform .1s; }
.profc-cam:active { transform: scale(.94); }
.profc-name { font-size: 25px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.profc-role { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; font-size: 13.5px; color: var(--muted); }
.profc .props { margin-bottom: 16px; }
.profc .props dd a { color: var(--ink); }
.profc-rm { align-self: center; margin-top: 8px; }

.sec-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); margin-bottom: 14px; }
.sec-row > div { flex: 1; min-width: 0; }
.sec-row b { display: block; font-size: 14.5px; font-weight: 600; }
.sec-row small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.sec-row .btn-light { background: var(--surface); }
.sec-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); flex: none; }
.sec-ic.on { background: var(--green-soft); color: var(--green-ink); }
.sec-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; }
.card .field + .sec-btns { margin-top: 14px; }
.card > .field { margin-bottom: 16px; }
.sec-note { display: flex; gap: 8px; align-items: flex-start; }
.sec-note .ic { flex: none; margin-top: 2px; }

.ph-row { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 18px; background: var(--surface-2); }
.ph-row b { font-size: 14.5px; font-weight: 600; }
.ph-prev { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; background: var(--avatar-bg); color: var(--orange-ink); font-size: 26px; font-weight: 600; }
.ph-prev img { width: 100%; height: 100%; object-fit: cover; }
.btn-row-inline { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.btn-row-inline .btn-light { background: var(--surface); }
.btn-row-inline [hidden] { display: none; }
.in-pass { position: relative; }
.in-pass .in { padding-right: 52px; }
.in-pass .in[type=password] { letter-spacing: .12em; }
.pass-eye { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); }
.pass-eye:active { transform: translateY(-50%) scale(.94); }
.more-me { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 12px; border-radius: 18px; background: var(--surface-2); }
.more-me > span:not(.avatar) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.more-me .avatar { flex: none; }   /* the picture stays a circle (it is a span too) */
.more-me b { font-size: 15px; font-weight: 600; }
.more-me small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* lock screen */
html.is-locked { overflow: hidden; scrollbar-gutter: auto; }
html.is-locked .app, html.is-locked .tabbar, html.is-locked #layer, html.is-locked .toasts { visibility: hidden; }
.lock {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px; overflow-y: auto;
  background:
    radial-gradient(60% 50% at 85% 0%, rgba(238, 90, 36, .22), transparent 70%),
    radial-gradient(50% 45% at 0% 100%, rgba(238, 90, 36, .12), transparent 70%),
    var(--bg);
  opacity: 0; transition: opacity .22s ease;
}
.lock.is-in { opacity: 1; }
.lock.is-leaving { opacity: 0; transition-duration: .18s; }
.lock-card {
  width: min(400px, 100%); padding: 28px 26px 22px; border-radius: 32px; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: var(--shadow-lg);
  transform: translateY(8px); transition: transform .3s var(--ease);
}
.lock.is-in .lock-card { transform: none; }
.lock-brand { display: inline-flex; margin-bottom: 22px; padding: 10px 16px; border-radius: 16px; background: #0E102F; max-width: 100%; }
.lock-logo { display: block; max-width: 100%; height: auto; }
.lock .avatar.xl { box-shadow: 0 0 0 5px var(--surface-2); }
.lock h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 16px; }
.lock-sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.lock-form { width: 100%; display: flex; flex-direction: column; align-items: center; position: relative; }
.lock-input { position: absolute; top: 18px; left: 50%; width: 1px; height: 1px; opacity: 0; transform: translateX(-50%); }
.pin-dots { display: flex; gap: 14px; margin: 22px 0 6px; padding: 12px 18px; border-radius: 999px; cursor: text; }
.lock-form:focus-within .pin-dots { box-shadow: 0 0 0 2px var(--orange); }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); transition: background .12s, border-color .12s, transform .12s; }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); transform: scale(1.08); }
.pin-dots.shake, .lock-card.shake { animation: shake .4s ease; }
/* sign in with a username and password (profile.js) */
.login-form { width: 100%; display: grid; gap: 12px; margin-top: 18px; text-align: left; }
.login-form .btn-block { height: 50px; margin-top: 2px; }
.login-form .lock-err { margin: 0; min-height: 18px; }
.lock-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; text-align: left; }
.lock-note svg { flex: none; margin-top: 1px; }
.person-t .uname { font-weight: 600; color: var(--ink-2); }
.lock-card .avatar[hidden] { display: none; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.lock-err { min-height: 20px; font-size: 13px; font-weight: 500; color: var(--red-ink); margin-bottom: 8px; }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px 18px; justify-content: center; }
.key { width: 72px; height: 72px; border-radius: 50%; background: var(--surface-2); font-size: 24px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; display: grid; place-items: center; transition: background .12s, transform .08s; }
.key:hover { background: var(--surface-3); }
.key:active { transform: scale(.93); background: var(--primary); color: var(--on-primary); }
.key-del { background: transparent; }
.lock-forgot { margin-top: 18px; font-size: 13.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 8px; }
.lock-forgot:hover { color: var(--ink); }
.lock-help { margin-top: 8px; padding: 14px; border-radius: 18px; background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); text-align: left; display: grid; gap: 8px; }
.lock-help[hidden] { display: none; }
.lock-help .file-btn { justify-self: start; background: var(--surface); }

@media (max-width: 1100px) {
  .prof { grid-template-columns: minmax(0, 1fr); }
  .profc { position: static; }
}
@media (max-width: 900px) {
  .me-btn { display: inline-grid; }
}
@media (max-width: 480px) {
  .keypad { grid-template-columns: repeat(3, 64px); gap: 10px 16px; }
  .key { width: 64px; height: 64px; }
  .lock-card { padding: 24px 18px 16px; }
}

/* ---------- saving indicator ---------- */
.sync { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.sync[hidden] { display: none; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.sync.is-ok i { background: var(--green); }
.sync.is-busy i { background: var(--orange); animation: pulse 1.2s ease-in-out infinite; }
.sync.is-warn { background: var(--amber-soft); color: var(--amber-ink); }
.sync.is-warn i { background: var(--amber); }
.sync.is-bad { background: var(--red-soft); color: var(--red-ink); }
.sync.is-bad i { background: var(--red); }
.sync:hover { filter: brightness(.97); }

/* ---------- warnings before saving ---------- */
.warn-list { margin: 4px 0 0; padding-left: 18px; list-style: disc; display: grid; gap: 8px; color: var(--ink-2); font-size: 14px; line-height: 1.45; text-align: left; }
.cash-total { margin-top: -8px; font-weight: 500; color: var(--ink-2); }
.cash-total:empty { display: none; }

/* ---------- getting started ---------- */
.getting { margin-bottom: 18px; border: 1px solid var(--orange-tint); }
.getting .card-h { align-items: center; }
.getting .card-h > .ticks { width: 180px; flex: none; }
.steps { display: grid; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.steps li.is-done { opacity: .7; }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); font-size: 13px; font-weight: 600; }
.is-done .step-n { background: var(--green-soft); color: var(--green-ink); }
.step-t { flex: 1; font-size: 14px; font-weight: 500; }
.steps .btn-light { background: var(--surface); }

/* ---------- settings: data, backups, phones ---------- */
.path, .big-link { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; color: var(--ink-2); background: var(--surface); padding: 8px 10px; border-radius: 10px; word-break: break-all; }
.big-link { font-size: 17px; font-weight: 600; color: var(--ink); text-align: center; padding: 12px; }
.folders { display: grid; gap: 6px; }
.folders li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--ink-2); word-break: break-all; }
.folders li .ic { color: var(--green-ink); margin-top: 2px; flex: none; }
.folders li.bad .ic, .folders li.bad { color: var(--red-ink); }
.folders em { font-style: normal; color: var(--muted); }
.bk-list { display: grid; gap: 4px; margin-top: 4px; }
.bk-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.bk-list span { display: inline-flex; align-items: center; gap: 6px; }
.bk-list small { color: var(--muted); }
.switch-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; margin-top: 4px; border-radius: 14px; background: var(--surface); text-align: left; }
.switch-row span { flex: 1; display: flex; flex-direction: column; }
.switch-row b { font-size: 14px; font-weight: 600; }
.switch-row small { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s var(--ease); }
[aria-checked="true"] .switch { background: var(--green); }
[aria-checked="true"] .switch::after { transform: translateX(18px); }

/* ---------- history, change log, deleted ---------- */
.hist { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; }
.hist li { padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 14px; display: grid; gap: 2px; }
.hist li:last-child { border-bottom: 0; }
.hist small { color: var(--muted); font-size: 12.5px; }
.hist-v { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 6px 8px; margin-top: 4px; }
.hist-v.was { text-decoration: line-through; text-decoration-color: var(--faint); }
.del-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.del-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.del-list li > div { flex: 1; min-width: 0; }
.del-list b { display: block; font-size: 14px; }
.del-list small { display: block; font-size: 12.5px; color: var(--muted); }
.del-list .btn-light { background: var(--surface); }

/* ---------- signed-in devices ---------- */
.devices { display: grid; gap: 8px; }
.devices li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.devices li > div { flex: 1; min-width: 0; }
.devices b { display: block; font-size: 13.5px; font-weight: 600; word-break: break-word; }
.devices small { display: block; font-size: 12px; color: var(--muted); }
.chip-me { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); font-size: 11px; font-weight: 600; vertical-align: 1px; }

/* ---------- set-up, sign-in and offline screens ---------- */
.setup-form { width: 100%; display: grid; gap: 14px; margin-top: 20px; text-align: left; }
.setup-form .btn-block { height: 50px; margin-top: 4px; }
.practice-tag { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: var(--amber-soft); color: var(--amber-ink); font-size: 12.5px; font-weight: 600; }
.lock-ic { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber-ink); margin-bottom: 6px; }
.lock-list { margin: 16px 0 18px; padding-left: 18px; list-style: disc; display: grid; gap: 8px; text-align: left; font-size: 14px; color: var(--ink-2); }
.lock-card .btn-block { height: 48px; }
.noscript { padding: 24px; font-family: sans-serif; }

@media (max-width: 900px) {
  .sync { height: 36px; padding: 0 10px; }
  .sync span { display: none; }
  .sync.is-warn span, .sync.is-bad span { display: inline; }
  .getting .card-h > .ticks { width: 100%; }
}
@media (max-width: 640px) {
  /* a long sync message ("Offline · 2 waiting") shortens instead of pushing the header past the screen */
  .top { gap: 8px; }
  .tools { gap: 8px; min-width: 0; flex: 0 1 auto; }
  .sync { min-width: 0; flex: 0 1 auto; overflow: hidden; }
  .sync span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- print (reports) ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; padding: 0; color: #000; font-size: 11pt; }
  .app { display: block; background: #fff; padding: 0; border-radius: 0; min-height: 0; }
  .top, .rail, .tabbar, .toasts, #layer, .actionbar, .ph-r, .banner, .tbl .act, .more-row, .skip { display: none !important; }
  .page { animation: none; }
  .ph { margin-bottom: 8px; }
  .ph h1 { font-size: 20pt; }
  .print-head { display: flex; flex-direction: column; margin-bottom: 12px; font-size: 10pt; color: #444; }
  .print-head b { font-size: 13pt; color: #000; }
  .print-head img { align-self: flex-start; margin-bottom: 8px; padding: 6px 10px; background: #0E102F; border-radius: 8px; box-sizing: content-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card, .kpi, .fig { background: #fff !important; border: 1px solid #ddd; break-inside: avoid; box-shadow: none; }
  .two { grid-template-columns: 1fr !important; }
  .tbl-wrap { overflow: visible; border-color: #ddd; }
  .tbl th { background: #f3f3f3 !important; }
  .hide-sm { display: table-cell !important; }
  .inset { background: #f7f7f7 !important; }
}

.data-box .path, .data-box .big-link { flex: none; }

/* anything marked hidden stays hidden, whatever display its own rule gives it (the cancelled-bills section showed when unticked) */
/* a lorry's helpers (vehicle form) and the crew under the driver (Morning load) */
.hchips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 210px; overflow-y: auto; padding: 2px; }
.hchip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.hchip span { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13.5px; cursor: pointer; background: var(--surface); }
.hchip span small { font-size: 11.5px; color: var(--muted); }
.hchip input:checked + span { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.hchip input:checked + span small { color: inherit; opacity: .75; }
.hchip input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.crew-line { display: flex; gap: 8px; align-items: flex-start; margin: -6px 0 4px; font-size: 13px; color: var(--ink-2); }
.crew-line:empty { display: none; }
.crew-line svg { flex: none; margin-top: 1px; color: var(--muted); }
.crew-line b { font-weight: 600; }
/* cheque deposit (forms.js F.deposit) */
.dq-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.dq { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.dq:hover { border-color: var(--line-2); }
.dq.is-on { border-color: color-mix(in srgb, var(--orange) 50%, var(--line)); background: color-mix(in srgb, var(--orange-soft) 60%, var(--surface)); }
.dq.is-later { opacity: .6; }
.dq input { width: 18px; height: 18px; accent-color: var(--primary); }
.dq-main { min-width: 0; }
.dq-main b { display: block; font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dq-main small { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dq-date { font-size: 13px; color: var(--ink-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dq-date small { display: block; font-size: 11.5px; color: var(--amber-ink); }
.dq-date small:empty { display: none; }
.dq-amt { min-width: 110px; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }
.dq-find { width: 100%; margin-bottom: 8px; }
.dq-tot { align-items: end; margin-top: 6px; }
.dq-sum { display: flex; flex-direction: column; gap: 2px; padding: 0 0 12px; font-size: 13.5px; }
.dq-sum b { font-size: 16px; font-variant-numeric: tabular-nums; }
.dq-ver { margin: 4px 0 8px; }
.slip { display: flex; flex-direction: column; gap: 8px; }
.slip-prev { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 16px; background: var(--surface-2); }
.slip-prev.has { border-style: solid; }
.slip-prev img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; display: block; background: var(--surface); }
.slip-prev small { font-size: 12.5px; color: var(--muted); }
.slip-thumb { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; }
.slip-none, .slip-pdf { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.slip-pdf b { color: var(--ink); font-weight: 600; }
.slip .btn-row-inline { margin-top: 0; }
.slip-view { display: grid; place-items: center; max-height: 70vh; overflow: auto; border-radius: 14px; background: var(--surface-2); }
.slip-view img { max-width: 100%; height: auto; display: block; }
.slip-view.sm { max-height: 280px; margin-top: 10px; }
.slip-view-acts { justify-content: flex-end; }
.hist-act { margin-left: auto; }
.chq-dep { white-space: nowrap; }
/* Reports › Cheque deposits */
.rep-tabs { margin-bottom: 16px; }
.dep-ctl { flex-wrap: wrap; }
.dep-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dep-checks li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.dep-checks li > div { flex: 1; min-width: 0; }
.dep-checks b { display: block; font-size: 14px; font-weight: 600; }
.dep-checks small { display: block; font-size: 12.5px; color: var(--muted); }
.dep-checks .al-ic { color: var(--amber-ink); }
@media (max-width: 640px) {
  .dep-ctl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .dep-ctl label { min-width: 0; }
  .dep-ctl label .in { width: 100%; }
  .dep-ctl label:last-child { grid-column: 1 / -1; }
  .dq { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .dq-date { grid-column: 2; text-align: left; }
  .dq-amt { grid-column: 3; grid-row: 1 / span 2; min-width: 0; }
}
[hidden] { display: none !important; }
.danger-t { color: var(--red-ink) !important; }
.stk-field .hint em { font-style: normal; }
.bsec.fast .bl-head, .brow.fast { grid-template-columns: 112px 150px 112px minmax(0, 1fr) 36px; }
.brow.fast { grid-template-areas: "no total how shop del" "more more more more more" "rets rets rets rets rets" "msg msg msg msg msg"; }
.b-rets { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.b-rets.has-rets { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.rret-list { display: flex; flex-direction: column; gap: 8px; }
.rret-list:empty { display: none; }
.rret { display: grid; grid-template-columns: minmax(0, 1fr) auto 34px; grid-template-areas: "p v del" "m m m" "k k k"; gap: 10px 12px; align-items: center; padding: 10px 10px 12px 12px; border-radius: 14px; background: var(--surface); }
.rret > .sg, .rret > [data-r="p"] { grid-area: p; min-width: 0; }
.rret > [data-rret-del] { grid-area: del; }
.rret > .rkinds { grid-area: k; }
.rret > .rmeta, .bcd-rt > .rmeta { grid-area: m; }
.rmeta { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.rmeta .b-f { flex: 1 1 200px; }
.rmeta select.in { height: 42px; }
/* Fresh / Expired / Damaged side by side, each with its own boxes */
.rkinds { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.rk { display: flex; flex-direction: column; gap: 6px; }
.rk-h { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.rk-h::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.rk-good .rk-h { color: var(--green-ink); } .rk-exp .rk-h { color: var(--amber-ink); } .rk-dmg .rk-h { color: var(--red-ink); }
.rk .q3 { margin: 0; }
.rk .q3-f.is-none { display: none; }        /* no empty case / box slots: the boxes start at the left */
.rret-v { grid-area: v; text-align: right; font-variant-numeric: tabular-nums; color: var(--red-ink); font-size: 14px; font-weight: 600; }
.rret-bar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.rret-bar .btn { margin-left: -8px; }
.rret-bar .btn.b-save { margin-left: auto; }
.rret-sum { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rret-sum:empty { display: none; }
.qb-match { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qb-match > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.qb-match span { font-size: 12px; color: var(--muted); }
.qb-match b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qb-match small { font-size: 12px; color: var(--muted); }
.qb-match .is-bad { background: color-mix(in srgb, var(--red-ink) 14%, var(--surface-2)); }
.qb-match .is-bad b, .qb-match .is-bad span { color: var(--red-ink); }
.qb-match .is-ok b { color: var(--green-ink); }
@media (max-width: 640px) {   /* after the fast-row rules above, so the phone layout wins */
  .brow.fast { grid-template-columns: 104px minmax(0, 1fr) 36px; grid-template-areas: "no total del" "how shop shop" "more more more" "rets rets rets" "msg msg msg"; }
  .rret { grid-template-areas: "p p del" "v v v" "m m m" "k k k"; } .rret-v { text-align: left; }
  .rkinds { gap: 10px 14px; }
  .qb-match { grid-template-columns: minmax(0, 1fr); }
  .qb-match > div { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
  .qb-match b { margin-left: auto; }
  .qb-match small { flex-basis: 100%; }
  .f-btns:has([data-close-day]:not([hidden])) { flex-wrap: wrap; }
  .f-btns [data-close-day] { flex: 1 1 100%; order: 3; }
}
.qb-left { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.qb-left-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; }
.qb-left-foot[hidden] { display: none; }
.qb-left-sum { font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.qb-h { margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.qb-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.qb-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 6px 6px 6px 12px; font-size: 14px; }
.qb-list li + li { border-top: 1px solid var(--line); }
.qb-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.qb-list .num { font-variant-numeric: tabular-nums; }
.qb-credit { height: 42px; display: flex; align-items: center; margin: 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* a quick bill as a card (Quick bill, its Close day, Edit trip): the Close day bill card without the dealer and products */
.brow.qc { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.brow.qc .in { background: var(--surface); }
.brow.qc .b-more, .brow.qc .b-msg { margin: 0; }
.brow.qc .b-more { row-gap: 14px; }
.brow.qc .b-more > .b-f { flex: 1 1 190px; }
.brow.qc .b-more > .b-f[data-for="credit"] { flex: 0 1 calc(33.33% - 8px); min-width: 190px; }
.qc-h { display: grid; grid-template-columns: 130px 190px minmax(0, 1fr) auto; gap: 10px; align-items: end; }   /* bill no., date, dealer, remove */
.qc-h .qc-del, .qc-h .qc-lock { grid-area: auto; grid-column: 4; justify-self: end; margin: 0 0 3px; }
.qc-h .qc-dealer { min-width: 0; }
.qc-h .qc-dealer > span { text-align: left; }
.qc-lock { display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); }
.qc-body { display: flex; flex-direction: column; gap: 14px; }
.qc-body[hidden] { display: none; }
.qc-dealer { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--ink-2); }
.qc-rets { padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--amber-soft) 55%, var(--surface-2)); }
.qc-rets[hidden] { display: none; }
.qc-rets .b-rets, .qc-rets .b-rets.has-rets { margin: 0; padding: 0; border: 0; }
.brow.qc.is-cx { border-style: dashed; }
.brow.qc.is-locked { background: var(--surface-2); gap: 10px; }
.brow.qc.is-locked .in { background: transparent; }
.brow.qc .bcd-cx .bcd-facts { padding: 2px 0; }
.bcx-saved { display: flex; flex-direction: column; gap: 8px; }
.bcx-saved .qb-h, .qb-h:has(.ic) { display: flex; align-items: center; gap: 6px; }
.bcx-saved .qb-h { margin: 8px 0 0; }
.bcd.is-locked:not(.is-open) { opacity: .92; }
.qb-cx li { color: var(--muted); }
.qb-cx s { color: var(--muted); }
.qb-lk { display: grid; place-items: center; width: 30px; color: var(--faint); }
/* Cancel a bill */
.cxb-hits { display: flex; flex-direction: column; gap: 8px; }
.cxb-hits:empty { display: none; }
.cxb-was { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.cxb-was .ic { flex: none; margin-top: 2px; color: var(--muted); }
.cxb-was small, .cxb-o small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.cxb-opts { display: flex; flex-direction: column; gap: 6px; }
.cxb-o { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 14px; }
.cxb-o:has(input:checked) { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.cxb-o input { flex: none; margin-top: 3px; accent-color: var(--red); }
.cxb-o.is-off { opacity: .6; cursor: not-allowed; }
.cxb-o .loss-t { color: var(--red-ink); }
.cxb-lorry { display: flex; flex-direction: column; gap: 6px; }
.cxb-lorry[hidden] { display: none; }
.cxb-stamp { display: flex; gap: 8px; align-items: flex-start; }
.cxb-stamp .ic { flex: none; margin-top: 2px; }
.cxv-h { margin: 14px 0 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) {
  .brow.qc { padding: 12px; }
  .qc-h { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .qc-h .qc-del, .qc-h .qc-lock { grid-column: 3; grid-row: 1; }
  .qc-h .qc-dealer { grid-column: 1 / -1; }
  .brow.qc .b-more > .b-f, .brow.qc .b-more > .b-f[data-for="credit"] { flex-basis: 100%; min-width: 0; }
}

/* quick bills: products added later and their status */
.st-ver { background: color-mix(in srgb, var(--green-ink) 14%, var(--surface)); color: var(--green-ink); }
.st-ver i { background: var(--green-ink); }
.qb-list.qb-bills li { grid-template-columns: auto minmax(0, 1fr) auto auto auto auto auto auto; }   /* no., dealer, paid by, amount, status, Products, Edit, remove */
.qb-edit-h { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--orange-ink, var(--ink)); }
.qb-st { display: flex; }
.qbp-match { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qbp-match > div { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.qbp-match span { font-size: 12px; color: var(--muted); }
.qbp-match b { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.qbp-match small { font-size: 12px; color: var(--muted); }
.qbp-match .is-ok { background: color-mix(in srgb, var(--green-ink) 10%, var(--surface-2)); }
.qbp-match .is-ok b { color: var(--green-ink); }
.qbp-match .is-bad { background: color-mix(in srgb, var(--amber-ink) 12%, var(--surface-2)); }
.qbp-match .is-bad b { color: var(--amber-ink); }
.qbp-find { position: relative; }
.qbp-list { display: flex; flex-direction: column; gap: 8px; }
.qbp-list:empty { display: none; }
.qbp-row { display: flex; align-items: flex-end; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); flex-wrap: wrap; }
.qbp-row .q-name { flex: 1 1 220px; align-self: center; min-width: 0; }
.qbp-row .qbp-pr { flex: 0 1 150px; }
.qbp-row .bcd-v { min-width: 96px; }
.qbp-row [data-qbp-del] { margin-bottom: 4px; }
.qbp-row.is-over { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 50%, transparent); }
.qbp-warn { display: block; color: var(--red-ink); }
.qbp-warn:empty { display: none; }
.qbp-vbox { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 16px; }
.qbp-vbox .hint { margin: 4px 0 0; }
.qbp-vbox .btn { align-self: flex-start; }
.qbp-vok { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--green-ink) 10%, var(--surface-2)); color: var(--green-ink); font-size: 14px; }
.qbp-vok span { flex: 1; color: var(--ink); }
.qbc-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.qbc-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.qbc-chip b { font-size: 18px; font-variant-numeric: tabular-nums; }
.qbc-chip span { font-size: 11.5px; line-height: 1.25; color: var(--muted); }
.qbc-chip[aria-selected="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ring); }
.qbc-chip.is-mismatch b { color: var(--amber-ink); }
.qbc-chip.is-verified b, .qbc-chip.is-matched b { color: var(--green-ink); }
.qbc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.qbc-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: var(--surface-2); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.qbc-list button:hover { background: var(--surface-3); }
.qbc-no { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qbc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qbc-t b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qbc-t small, .qbc-v small { font-size: 12px; color: var(--muted); }
.qbc-v { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.qbc-v .warn-t { color: var(--amber-ink); } .qbc-v .good-t { color: var(--green-ink); }
@media (max-width: 640px) {
  .qb-list.qb-bills li { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 6px; }
  .qbp-match { grid-template-columns: minmax(0, 1fr); }
  .qbp-match > div { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
  .qbp-match b { margin-left: auto; }
  .qbc-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* company invoices: the claim and the net invoice */
.claim-box { display: flex; flex-direction: column; gap: 8px; }
.inv-in .hint .linkish { font-size: inherit; }
.cl-top { align-items: flex-end; }
.inv-sum .is-row .is-l { flex: 1; }
/* Stock in: invoice amount and claim, read like an invoice */
.inv-sum { display: flex; flex-direction: column; gap: 0; padding: 4px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); }
.inv-sum .is-h { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 10px; }
.inv-sum .is-h b { font-size: 15px; }
.inv-sum .is-h small { font-size: 12.5px; color: var(--muted); }
.inv-sum .is-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.inv-sum .is-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.inv-sum .is-l b { font-weight: 600; color: var(--ink); }
.inv-sum .is-l small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.inv-sum .is-v { flex: none; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.inv-sum .is-box { flex: 0 0 200px; }
.inv-sum .is-box .in { text-align: right; font-variant-numeric: tabular-nums; }
.inv-sum .is-box .in:disabled { opacity: .55; }
.inv-sum .is-total { border-top: 2px solid var(--ink); padding: 14px 0; }
.inv-sum .is-total .is-l b { font-size: 15px; }
.inv-sum .is-total .is-v { font-size: 22px; }
.inv-sum .err { margin: 0; }
.inv-sum .err:empty { display: none; }
.is-check { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 12px; padding: 9px 12px; border-radius: 12px; background: var(--surface); font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.is-check:empty { display: none; }
.is-check .ic { flex: none; margin-top: 2px; }
.is-check.is-ok { background: color-mix(in srgb, var(--green-ink) 12%, var(--surface)); color: var(--green-ink); }
.is-check.is-bad { background: color-mix(in srgb, var(--amber-ink) 14%, var(--surface)); color: var(--amber-ink); }
.is-check.is-err { background: color-mix(in srgb, var(--red-ink) 12%, var(--surface)); color: var(--red-ink); }
@media (max-width: 640px) {
  .inv-sum .is-row.is-in { flex-direction: column; align-items: stretch; gap: 8px; }
  .inv-sum .is-box { flex-basis: auto; }
}
.inv-match { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); align-self: start; }
.inv-match span { font-size: 12.5px; color: var(--muted); }
.inv-match b { justify-self: end; font-variant-numeric: tabular-nums; }
.inv-match em { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-style: normal; font-size: 12.5px; color: var(--muted); }
.inv-match.is-ok { background: color-mix(in srgb, var(--green-ink) 10%, var(--surface-2)); }
.inv-match.is-ok em { color: var(--green-ink); font-weight: 600; }
.inv-match.is-bad { background: color-mix(in srgb, var(--amber-ink) 12%, var(--surface-2)); }
.inv-match.is-bad em { color: var(--amber-ink); font-weight: 600; }
.claim-net { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); align-self: start; }
.claim-net span { font-size: 12.5px; color: var(--muted); }
.claim-net b { justify-self: end; font-variant-numeric: tabular-nums; }
.claim-net .claim-netv { font-size: 18px; }
.claim-net small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.claim-net small.loss-t { color: var(--red-ink); }
.cl-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cl-figs > div { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.cl-figs span { font-size: 12px; color: var(--muted); }
.cl-figs b { font-size: 16px; font-variant-numeric: tabular-nums; }
.cl-figs .is-ok b { color: var(--green-ink); } .cl-figs .is-warn b { color: var(--amber-ink); } .cl-figs .is-bad b { color: var(--red-ink); }
.clc .hint { margin: 8px 0 0; }
.cl-strip .strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.claim-done { display: flex; align-items: center; gap: 6px; color: var(--green-ink); }
.qbp-row .q-name { flex-basis: 180px; }
.qbp-row .q-name b { white-space: normal; overflow: visible; }
.qbp-row .qbp-pr { flex-basis: 130px; }
.qbp-row .bcd-v { min-width: 84px; }

/* Edit trip (a closed day): each biscuit is a tall block of Loaded / Sold / Back / Replaced — a clear line between
   biscuits, the name at the top of its block, and every other biscuit on a slightly different shade */
.qlist.load .qrow.full { align-items: flex-start; padding: 18px 12px 18px 16px; border-bottom: 2px solid var(--line-2); }
.qlist.load .qrow.full:last-child { border-bottom: 0; }
.qlist.load .qrow.full .q-name { padding-top: 8px; }
.qlist.load .qrow.full .q-name b { font-size: 15px; }
.qlist.load .qrow.full:nth-child(even) { background: var(--surface-2); }
.qlist.load .qrow.full.has-q { box-shadow: inset 4px 0 0 var(--orange); }

/* RD allowance */
.rd-day:empty { display: none; }
.rd-day .is-check { margin: 0 0 8px; }
.rd-bills { list-style: none; margin: 0 0 12px; padding: 4px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.rd-bills li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rd-bills li:last-child { border-bottom: 0; }
.rd-bills li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-adj { display: flex; margin: 0 0 14px; }
.rd-by { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.rd-by li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 2px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rd-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 4px; }
@media (max-width: 640px) { .rd-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rd-h { margin: 16px 2px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rd-note { max-width: 260px; color: var(--muted); font-size: 12.5px; }
.rd-sep { margin: 12px 0; }
.rd-set { display: inline-flex; align-items: center; gap: 5px; color: var(--orange-ink); }
.f-btns .btn-remove { margin-right: auto; color: var(--red-ink); }
.f-btns .btn-remove .ic { color: var(--red-ink); }

/* unsold products kept on the lorry */
.keep .seg { margin-bottom: 12px; }
.keep-more { margin-top: 4px; }
.keep-list .krow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.keep-list .krow[hidden] { display: none !important; }
.keep-list .k-auto { font-size: 13px; font-weight: 600; color: var(--green-ink); }
.keep-list .k-pick { display: flex; align-items: center; gap: 10px; }
.keep-list .k-pick .r-h { font-size: 12px; color: var(--muted); }
.keep-carried { margin: 4px 0 10px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--green-ink) 9%, var(--surface)); }
.keep-carried .kc-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 6px; color: var(--green-ink); }
.keep-carried .kc-h small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.keep-carried ul { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.keep-carried li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); }

/* month-end stock report */
.sr-locs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 4px 0 14px; }
.sr-at { margin: 0; align-self: end; padding-bottom: 10px; }
.sr-sub td { border-top: 2px solid var(--line-2); }
@media print { .sr-locs, .dep-ctl { display: none !important; } }
.qb-lacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }   /* Quick bill: the chosen lorry's stock — correct it or add to it */
.stk-split { list-style: none; margin: 10px 0 12px; padding: 0; display: grid; gap: 2px; }   /* Overview stock: the store, then each lorry */
.stk-split li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.stk-split li span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.stk-split li small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-split li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stk-split li:first-child { grid-template-columns: auto minmax(0, 1fr) auto; }
.qb-left { font-weight: 600; color: var(--ink-2); }   /* Quick Bill products: what is left on the lorry now */
.qb-after { color: var(--muted); font-size: 12px; }
.qb-amt { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.qf-sum { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-left: auto; font-size: 14px; font-weight: 600; color: var(--ink); }
.qf-sum .num { font-variant-numeric: tabular-nums; }
.qf-sum small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.qf-sum small.good-t { color: var(--green-ink); }
.qf-sum small.loss-t { color: var(--red-ink); }

/* ---- audit (UI): amounts and counts are never cut off with "…" — they wrap */
.vc-rows dd, .props dd, .props > div > b, .wl-top b, .wl-v, .wl small, .cp-fig b, .cp-fig small, .stk-split li small, .age-fig small, .qb-sl small { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.fig-n { white-space: normal; overflow: visible; text-overflow: clip; }
/* the small "Rs" stays readable on big figures */
.cur { font-size: max(11px, .58em); opacity: .8; }
/* a date box keeps its whole date */
.dp { min-width: 150px; }
/* tabs that scroll sideways show there are more (a fade at the edge) */
.tabs.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
/* a form open on a computer: messages sit to the left, over the page, not over the form */
@media (min-width: 641px) { html:has(.sheet-wrap.open) .toasts { left: 24px; transform: none; align-items: flex-start; max-width: 420px; } }
/* bigger targets on a phone */
@media (max-width: 640px) {
  .q3-in button { min-width: 36px; }
  .linkish { padding-top: 8px; padding-bottom: 8px; }
}

.loading-note { display: flex; align-items: center; gap: 8px; padding: 40px 0; justify-content: center; }

/* Reports › RD sales */
.rds-tbl td, .rds-tbl th { white-space: nowrap; }
.rds-tbl td:first-child { white-space: normal; min-width: 180px; }
.rds-tbl .tot-row td { border-top: 2px solid var(--line); }

.rds-ctl .dp { min-width: 205px; }
.rds-ctl .dp-face .dp-today { display: none; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
.th-sort:hover, .th-sort.is-on { color: var(--ink); }
.th-ar { font-size: 10px; opacity: .55; }
.th-sort.is-on .th-ar { opacity: 1; }
th.num .th-sort { justify-content: flex-end; width: 100%; }
@media print { .th-ar { display: none; } }

/* Reports: groups, then the group's reports */
.rep-nav { display: flex; flex-direction: column; gap: 12px; margin: -6px 0 18px; }
.rep-nav .rep-tabs { margin: 0; }
.rep-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.rep-cat { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; border: 1px solid var(--line); cursor: pointer; transition: background .15s, color .15s; }
.rep-cat:hover { color: var(--ink); }
.rep-cat small { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.rep-cat.is-on { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.rep-cat.is-on small { background: rgba(255, 255, 255, .18); color: inherit; }
@media (min-width: 641px) and (max-width: 1400px) { .rep-cats { gap: 6px; } .rep-cat { gap: 6px; padding: 0 11px 0 10px; font-size: 13.5px; } }
@media (max-width: 640px) { .rep-cat { flex: 1 1 calc(33.3% - 8px); justify-content: center; padding: 0 8px; font-size: 13px; white-space: nowrap; } .rep-cat small, .rep-cat .ic { display: none; } }
@media print { .rep-nav { display: none; } }

/* RD Sales › lorries out now */
.rde-out { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.rde-l b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-tbl th, .ds-tbl td.num, .ds-tbl td.nowrap { white-space: nowrap; }
.ds-tbl td:nth-child(4) { min-width: 140px; }
@media (max-width: 640px) { .rde-out { grid-template-columns: 1fr; } }
.rde-l { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rde-l > div { flex: 1; min-width: 0; }
.rde-l b { display: block; font-weight: 600; }
.rde-l small { color: var(--muted); font-size: 12.5px; }
.rde-ic { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 10px; background: var(--surface-2); }
@media (max-width: 640px) {
  .rds-ctl > label { flex: 1 1 100%; min-width: 0; }
  .rds-ctl .dp { min-width: 0; width: 100%; }
}
@media (max-width: 640px) { .dep-ctl.rds-ctl { grid-template-columns: minmax(0, 1fr); } }

.slu-tbl td.num, .slu-tbl th.num { white-space: nowrap; }

.qb-units { font-weight: 500; color: var(--muted); white-space: nowrap; }

/* the bank fields (Date paid in, bank, reference — and in Partial, which way it came in): three on a row, or two by two */
.bcd .b-more > .bcd-bank > .b-f, .brow.qc .b-more > .bcd-bank > .b-f { flex: 1 1 190px; min-width: 0; }
.bcd .b-more > .bcd-bank:has(> [data-for="part"]:not([hidden])) > .b-f, .brow.qc .b-more > .bcd-bank:has(> [data-for="part"]:not([hidden])) > .b-f { flex: 1 1 calc(50% - 6px); }
@media (max-width: 640px) { .bcd .b-more > .bcd-bank > .b-f, .brow.qc .b-more > .bcd-bank > .b-f { flex-basis: 100% !important; } }

.chq-msg.warn { color: var(--amber-ink); font-weight: 500; }
.in.is-warn { border-color: var(--amber); }

/* a warning under the cheque number keeps the cheque date and bank in line (tops aligned) */
.bcd-cq { align-items: flex-start; }
.bcd-cq > [data-cq-del] { align-self: flex-start; margin-top: var(--cq-del-top, 30px); }

.f-sum .f-net { font-size: inherit; color: var(--ink); font-weight: 600; }

/* Quick Bill products: the case / unit boxes stay where they are when the "= Rs … · after this Quick Bill … left" line appears */
.qb-plist .qrow { align-items: flex-start; }
.qb-plist .qrow > .q3 { align-self: flex-start; }
/* on a phone the boxes sit under the name: the "= Rs … · after this Quick Bill" line and a warning go under the boxes, so the boxes never move */
@media (max-width: 420px) {
  .qb-plist .qrow .q-name { display: contents; }
  .qb-plist .qrow .q-name > * { flex: 1 1 100%; min-width: 0; }
  .qb-plist .qrow > .q3 { order: 1; }
  .qb-plist .qrow .q-name > .qb-after, .qb-plist .qrow .q-name > .q-warn { order: 2; margin-top: -2px; }
  .qb-plist .qrow .q-name > .qb-after:empty, .qb-plist .qrow .q-name > .q-warn:empty { display: none; }
}
/* on a phone the products total keeps two set lines (total · typed, then against the RD), so the list under it never jumps */
@media (max-width: 640px) {
  .qf-sum { flex: 1 1 100%; margin-left: 0; min-height: 40px; align-content: flex-start; }
  .qf-sum small.good-t, .qf-sum small.loss-t { flex: 1 1 100%; }
}

/* on a phone or tablet the Quick Bill sheet keeps its full height: a growing row does not lift the whole sheet */
@media (max-width: 640px) { .sheet:has([data-qed]) { height: 94dvh; } }
/* Shops › Credit due: old bills (from before the dashboard) */
.ob-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13.5px; }
.ob-drop { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ob-drop textarea { min-height: 120px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.ob-sum { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 10px; font-size: 13.5px; color: var(--ink-2); }
.ob-sum b { color: var(--ink); font-weight: 600; }
.ob-map { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 4px; }
.ob-map label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.ob-tbl td.ob-bad { color: var(--red-ink); }
@media (max-width: 640px) { .ob-drop { grid-template-columns: 1fr; } }
/* Quick Bill step 5: the cash collectors sheet — one line per bill on a wide screen, labelled boxes that wrap on smaller ones.
   No scrolling box around it, so the date calendar always opens in full. */
.cc-grid { --cc-cols: minmax(118px, 1.4fr) 152px minmax(78px, .7fr) repeat(3, minmax(104px, 1fr)) minmax(92px, .8fr) 152px 44px 36px; margin-top: 12px; }   /* one line per bill down to a 1280 px screen */
/* the title, Add a row and the column headings stay at the top of the Quick Bill while the rows scroll */
.cc-stick { position: sticky; top: -20px; z-index: 6; margin: 0 -4px; padding: 14px 4px 0; background: var(--surface); box-shadow: 0 10px 12px -12px rgba(0, 0, 0, .35); }
.cc-stick .f-sec-h { margin-bottom: 10px; }
.cc-head, .cc-row { display: grid; grid-template-columns: var(--cc-cols); gap: 10px; align-items: center; }
.cc-head { padding: 0 17px 10px; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }   /* 17 = the row's padding + its border: each heading sits over its box */
.cc-head span { text-align: center; }
.cc-head .num { text-align: center; }
.cc-list { display: flex; flex-direction: column; gap: 10px; }
.cc-row { padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.cc-c { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cc-l { display: none; font-size: 12px; font-weight: 500; color: var(--muted); }
.cc-row .in { height: 44px; width: 100%; min-width: 0; font-size: 14.5px; }
.cc-row .dp { min-width: 0; }
.cc-row .in-money .in { padding-left: 38px; padding-right: 10px; text-align: right; }
.cc-row .in-money > span { left: 12px; font-size: 13.5px; }
.cc-dy { align-items: center; }
.cc-days { font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cc-x { align-items: center; }
.cc-link { grid-column: 1 / -1; margin: -2px 0 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cc-link:empty { display: none; }
.cc-link.is-ok { color: var(--green-ink); }
.cc-tot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: 12px; padding: 14px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); }
.cc-tot > b { margin-right: auto; font-size: 14.5px; font-weight: 600; }
.cc-tot span { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cc-tot small { font-size: 12px; color: var(--muted); }
.cc-tot span b { font-size: 15.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cc-tot .cc-all b { color: var(--green-ink); }
/* narrower: each bill becomes a card of labelled boxes */
@media (max-width: 1180px) {
  .cc-head { display: none; }
  .cc-l { display: block; }
  .cc-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 14px; padding: 16px 18px; }
  .cc-dealer { grid-column: span 2; }
  .cc-bd, .cc-cd { grid-column: span 2; }
  .cc-bn { grid-column: span 2; }
  .cc-m { grid-column: span 2; }
  .cc-cn { grid-column: span 2; }
  .cc-dy { grid-column: span 1; align-items: flex-start; }
  .cc-dy .cc-days { height: 44px; display: flex; align-items: center; }
  .cc-x { grid-column: span 1; align-items: flex-end; justify-content: flex-end; flex-direction: row; align-self: end; }
}
@media (max-width: 640px) {
  .cc-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; gap: 12px; }
  .cc-dealer { grid-column: 1 / -1; }
  .cc-bd, .cc-cd, .cc-bn, .cc-m, .cc-cn { grid-column: span 1; }
  .cc-tot { gap: 10px 18px; }
  .cc-tot > b { flex: 1 1 100%; }
}
/* the Quick Bill sheet uses the room: wide on a computer (the products, bills and cash collect rows get space) */
@media (min-width: 641px) { .sheet:has([data-qday]) { width: min(1320px, calc(100vw - 24px)); } }

/* Packed as: units in a box, boxes in a case, units in a case side by side */
.pack-sec .f-row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; }
@media (max-width: 640px) { .pack-sec .f-row3 { grid-template-columns: minmax(0, 1fr); } }

/* Stock history: a delivery found by its invoice number */
.hist-invn { margin: 4px 0 12px; }
.hist-inv { margin-bottom: 18px; }
.hist-invh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; width: 100%; padding: 10px 2px 8px; background: none; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.hist-invh b { font-weight: 600; }
.hist-invh .hist-invt { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hist-invh:hover b { text-decoration: underline; }

/* Stock history filters: the dates in full beside the invoice search */
.hist-ctl:has([data-histq]) .dp { min-width: 190px; }
.hist-ctl [data-hist="P"] { max-width: 300px; }
@media (max-width: 640px) { .hist-ctl [data-hist="P"] { max-width: none; } }

/* Stock in: from the company / from last month */
.sk-tabs { margin: -6px 0 16px; }
.sk-tabs .tab { display: inline-flex; align-items: center; gap: 7px; }
.cf-split { margin: 4px 0 10px; }
.cf-was { margin-bottom: 12px; }
/* Deliveries: the months brought forward */
.cf-list { margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; }
.cf-lh { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cf-lh b { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.cf-list ul { list-style: none; margin: 8px 0 0; padding: 0; }
.cf-list li button { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; width: 100%; padding: 8px 2px; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.cf-list li:first-child button { border-top: 0; }
.cf-list li button b { font-weight: 600; }
.cf-list li button .muted { font-size: 13px; }
.cf-list .cf-v { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.cf-list li button:hover b { text-decoration: underline; }
.cf-list .hint { margin: 6px 0 0; }

/* Month-end stock: close the month / open it again */
.mc-state { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: -4px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; }
.mc-state > span { flex: 1 1 200px; }
.mc-state b { font-weight: 600; }
.mc-state.is-shut { background: var(--surface-2); }
.mc-warn { margin: 8px 0; padding-left: 18px; color: var(--amber-ink); }
.mc-warn li { margin: 4px 0; }
@media print { .mc-state { display: none; } }

/* Overview: Close the month, in the quick-add bar */
.ab-btn.ab-close { border-color: rgba(255, 255, 255, .35); }

/* Stock history: Change the date */
.md-what { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.md-what > div:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.md-what b { font-weight: 600; }
.md-full { margin-top: 6px; }

/* Edit product: its promo version */
.promo-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.promo-row > span { flex: 1 1 260px; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.promo-row b { font-weight: 600; }

/* Stock levels / Products: the biscuit search is wide enough for a full product name */
.hist-ctl label:has([data-stockq]) { flex: 1 1 460px; max-width: 620px; }
.hist-ctl [data-stockq] { width: 100%; }
@media (max-width: 640px) { .hist-ctl label:has([data-stockq]) { flex-basis: 100%; max-width: none; } }

/* Stock levels / Products: Sort beside Find */
.hist-ctl .psort .in { min-width: 160px; }
@media (max-width: 640px) { .hist-ctl .psort { flex: 1 1 100%; } .hist-ctl .psort .in { width: 100%; } }

/* every dropdown looks the same: the form dropdown's chevron (.in-select), regular weight, on filter bars too */
:root { --sel-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23696964' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="dark"] { --sel-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239D9D97' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
select.in { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px; font-weight: 400; text-overflow: ellipsis;
  background-image: var(--sel-chev); background-repeat: no-repeat; background-position: right 13px center; background-size: 16px 16px; }
.in-select select.in { background-image: none; }   /* it has its own chevron icon */
select.in:disabled { cursor: not-allowed; opacity: .6; }
select.in::-ms-expand { display: none; }
.hist-ctl input.in { font-weight: 400; }

/* dropdowns: the app's own list (ui.js), placed under or over the box */
.sg-list.dd-pop { position: fixed; z-index: 600; left: 0; right: auto; top: auto; width: max-content; }
.dd-o { padding: 9px 12px; min-height: 40px; }
.dd-o .sg-t b { font-weight: 500; font-size: 14.5px; }
.dd-o.is-sel .sg-t b { font-weight: 600; }
.dd-o.is-off { opacity: .45; cursor: not-allowed; }
select.is-open { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.in-select > .ic { transition: transform .2s ease; }
.in-select:has(select.is-open) > .ic { transform: translateY(-50%) rotate(180deg); }
/* Add product: packing copied from the product chosen */
.copied-note { display: flex; align-items: flex-start; gap: 7px; margin: -4px 0 14px; color: var(--green-ink); }
.copied-note .ic { flex: none; margin-top: 2px; }
.copied-note b { font-weight: 600; }

/* Add product: the same price as a product there is */
.same-cost { display: flex; align-items: flex-start; gap: 8px; margin: -6px 0 16px; padding: 10px 12px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; line-height: 1.45; }
.same-cost[hidden] { display: none; }
.same-cost .ic { flex: none; margin-top: 1px; }
.same-cost b { font-weight: 600; }

/* Daily trips › Fleet: a card is never narrower than its figures (8 columns made 190px cards on a wide screen),
   and a figure wraps between its parts (205c 32b · Rs …), never inside a number */
.fleet { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.vcard .vc-rows div { align-items: flex-start; }
.vcard .vc-rows dt { padding-top: 1px; }
.vcard .vc-rows dd { flex: 1 1 auto; overflow-wrap: break-word; word-break: normal; line-height: 1.4; }
.vcard .vc-rows dd small { white-space: nowrap; }

/* Add stock to lorry: where the stock comes from */
.mv-none { padding: 6px 2px 10px; }
.f-set + .f-tip { margin-top: 14px; }   /* Add stock to lorry › Another lorry: the note under the From lorry tiles */
[data-sec] .qfind { margin-top: 14px; }  /* Add stock to lorry: the Find bar clear of the note above it */
[data-sec] > .f-tip { margin-bottom: 4px; }

/* a long dropdown list: a search box stays at its top while the list scrolls under it */
.dd-find { position: sticky; top: -6px; z-index: 1; margin: -6px -6px 6px; padding: 8px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.dd-find .ic { position: absolute; left: 20px; color: var(--muted); pointer-events: none; }
.dd-find input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.dd-find input:focus { border-color: var(--line-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 18%, transparent); }
.dd-find input::placeholder { color: var(--muted); }
.dd-pop .sg-o[hidden], .dd-pop .sg-g[hidden], .dd-pop .sg-new[hidden] { display: none; }

/* a ref says what it is: its word under it in a list, a dotted line + hover text inside a sentence */
.ref-w { display: inline; margin-left: 6px; font-size: 11.5px; font-weight: 400; letter-spacing: 0; color: var(--muted); white-space: nowrap; font-variant-numeric: normal; }
.ref-tip { text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; cursor: help; }
td > .ref-w { display: block; margin: 1px 0 0; }   /* in a list column: the word under the code */

/* brand picker: each brand's logo on a card; tick one brand or both */
.bpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.bp { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .1s ease; }
.bp:hover { border-color: var(--line-2); }
.bp:active { transform: scale(.985); }
.bp input { position: absolute; opacity: 0; pointer-events: none; }
.bp-logo { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--surface); box-shadow: 0 0 0 1px var(--line); filter: grayscale(.85); opacity: .7; transition: filter .2s ease, opacity .2s ease; }
.bp-logo img { width: 100%; height: 100%; object-fit: cover; }
.bp-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.bp-t b { font-weight: 600; font-size: 15px; }
.bp-t small { color: var(--muted); font-size: 12.5px; }
.bp-ck { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 1.5px solid var(--line-2); color: transparent; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.bp:has(input:checked) { background: var(--surface); border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.bp:has(input:checked) .bp-logo { filter: none; opacity: 1; }
.bp:has(input:checked) .bp-ck { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.bp:has(input:focus-visible) { outline: 2px solid var(--orange); outline-offset: 2px; }
.bpick + .hint { margin-top: 10px; }

/* Shop payment: the shop's owed bills, one tap to pay another */
.owed-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 14px; }
.owed-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; transition: border-color .15s ease, background .15s ease, transform .1s ease; }
.owed-chip b { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.owed-chip small { color: var(--muted); font-size: 12px; }
.owed-chip:hover { border-color: var(--line-2); }
.owed-chip:active { transform: scale(.97); }
.owed-chip.is-on { background: var(--surface); border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* Overview: the period its figures are for (a day by default), picked at the top */
.ov-per { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 2px 4px 0; font-size: 13px; color: var(--muted); }
.ov-per .ic { color: var(--ink-2); }
.ov-per b { font-weight: 600; color: var(--ink); font-size: 14px; }
.ov-per span::before { content: '\00b7'; margin-right: 8px; }
.ov-rp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kpis:has(> .ov-per) { grid-template-rows: auto; grid-auto-rows: 1fr; }   /* the period line stays one line; the figures take the height */

/* the period picker keeps one size: Day, Month, Year and Custom all take the same width, so nothing jumps */
@media (min-width: 641px) {
  .rp-step, .rp-range { width: 430px; box-sizing: border-box; justify-content: space-between; }
  .rp-step .mswitch-l { flex: 1; }
  .rp-step .dp { flex: 1 1 auto; width: auto; min-width: 220px; }
  .rp-range .dp { flex: 1 1 0; width: auto; min-width: 0; }
}

/* Quick Bill view: how each dealer paid */
.qbv-how { line-height: 1.5; }
.qbv-how small { margin-left: 4px; }
.tbl tr.is-this td { background: color-mix(in srgb, var(--ink) 5%, transparent); }

/* Staff: which brand each person works for */
.wf { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wf-logo { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); font-size: 11px; font-weight: 600; flex: none; }
.wf-logo + .wf-logo { margin-left: -10px; box-shadow: 0 0 0 2px var(--surface); }
.wf-logo img { width: 100%; height: 100%; object-fit: cover; }
.wf-t { font-size: 13px; color: var(--ink-2); }
.plain-people li .wf { margin-left: auto; }

/* Quick Bill step 3: products against the bills while they are typed */
.qb-diff { position: sticky; top: -1px; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 16px -12px rgba(0, 0, 0, .5); }
.qb-diff span { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 11px; background: var(--surface-2); min-width: 0; }
.qb-diff small { font-size: 11.5px; color: var(--muted); }
.qb-diff b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qb-diff em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.qb-diff .is-ok { background: var(--green-soft); } .qb-diff .is-ok b { color: var(--green-ink); }
.qb-diff .is-off { background: var(--amber-soft); } .qb-diff .is-off b { color: var(--amber-ink); }
@media (max-width: 640px) { .qb-diff b { font-size: 13.5px; } .qb-diff span { padding: 7px 9px; } }

/* Quick Bill step 3: the biscuit(s) that make up the difference */
.qb-match { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 12px; padding: 10px 12px; border-radius: 14px; background: var(--amber-soft); }
.qb-match[hidden] { display: none; }
.qb-m-h { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.qb-m { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; text-align: left; padding: 8px 12px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; transition: border-color .15s ease, transform .1s ease; }
.qb-m:hover { border-color: var(--line-2); } .qb-m:active { transform: scale(.985); }
.qb-m b { font-weight: 600; font-variant-numeric: tabular-nums; }
.qb-m small { color: var(--muted); font-size: 12px; }
.qb-m i { font-style: normal; color: var(--muted); font-size: 12px; margin: 0 2px; }

/* Stock levels: the main stock or one lorry */
.loc-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 0 0 16px; }
.loc-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; min-width: 0; transition: border-color .15s ease, background .15s ease, transform .1s ease; }
.loc-card:hover { border-color: var(--line-2); }
.loc-card:active { transform: scale(.985); }
.loc-card[aria-pressed="true"] { background: var(--surface); border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.loc-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); flex: none; }
.loc-card[aria-pressed="true"] .loc-ic { background: var(--ink); color: var(--surface); }
.loc-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.loc-t b { font-weight: 600; font-size: 14.5px; }
.loc-t small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-card em { font-style: normal; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.loc-card.is-all .loc-t small { white-space: normal; }   /* the total says how it is made up */

/* Stock levels and Products: the search stays in sight while the list scrolls */
.hist-ctl:has([data-stockq]) { position: sticky; top: 0; z-index: 4; margin: 0 -22px 16px; padding: 12px 22px; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
@media (max-width: 640px) { .hist-ctl:has([data-stockq]) { margin: 0 -18px 14px; padding: 10px 18px; } }
.pack-sec .in:disabled { opacity: .55; cursor: not-allowed; background: transparent; border-style: dashed; }   /* no boxes: Boxes in a case is not used */
.loose-row { margin-top: 10px; }
.loose-row[hidden] { display: none; }
.back-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; font-size: 13px; }   /* To main stock: Select all / Clear */
.lvl-p { min-width: 190px; }   /* Stock levels: the biscuit name keeps its width beside the value columns */
/* the load form's lorry boxes: each addition / move lists its biscuits; Edit sits on the heading row */
.keep-carried .kc-h .kc-edit { order: 1; margin-left: auto; }
.keep-carried .kc-h small { order: 2; }
.keep-carried li.kc-entry { display: block; padding: 8px 0 6px; }
.kc-entry .kc-eh { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kc-entry .kc-eh span { flex: 1; min-width: 0; }
.keep-carried ul.kc-items { margin: 6px 0 0; padding: 2px 0 2px 12px; border-left: 2px solid var(--line); font-size: 13px; }
.keep-carried .kc-items li { padding: 3px 0; border-top: 0; color: var(--ink-2); }
.keep-carried .kc-items li b { font-weight: 600; }
.keep-carried.kc-bottom { margin-top: 14px; }   /* Already on the lorry: under the biscuit boxes */
.qlist.load + .keep-carried { margin-top: 14px; }   /* the lorry boxes under the biscuit boxes */
/* Stock › Print: only what is chosen — the table on a landscape page, the choices in the print line */
@page stock-wide { size: A4 landscape; margin: 12mm; }
@media print {
  .stock-pg { page: stock-wide; }
  .stock-pg .strip, .stock-pg .tabs, .stock-pg .loc-bar, .stock-pg .hist-ctl, .stock-pg .find-n, .stock-pg .ph { display: none !important; }
  .stock-pg .card, .stock-pg .tbl-wrap { border: 0; padding: 0; break-inside: auto !important; box-shadow: none; }   /* a long table runs on over pages */
  .stock-pg .tbl { font-size: 9pt; }
  .stock-pg .tbl td, .stock-pg .tbl th { padding: 5px 6px; }
  .stock-pg .tbl .lvl .ticks, .stock-pg .tbl .lvl [class*="tick"] { display: none !important; }
  .stock-pg .tbl tr { break-inside: avoid; }
  .stock-pg .tbl thead { display: table-header-group; }
  .stock-pg .lvl-p { min-width: 250px; }
  .stock-pg .tbl small { font-size: 8pt; }
}
/* Stock › Print: the picker, and the copied sections (only they print, each on its own landscape page) */
.pp-locs { display: grid; gap: 6px; margin-top: 12px; text-align: left; }
.pp-loc { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.pp-loc span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pp-loc b { font-weight: 600; color: var(--ink); }
.pp-loc small { font-size: 12px; color: var(--muted); }
.pp-loc:has(input:checked) { border-color: var(--ink); }
#print-pack { display: none; }
@page stock-pack { size: A4 landscape; margin: 12mm; }
@media print {
  html.pp-on .app, html.pp-on #layer, html.pp-on .toasts { display: none !important; }
  html.pp-on #print-pack { display: block; page: stock-pack; color: #000; }
  #print-pack .pp-sec + .pp-sec { break-before: page; }
  #print-pack .print-head { display: flex; }
  #print-pack .tbl-wrap { overflow: visible; border: 0; }
  #print-pack .tbl { font-size: 9pt; width: 100%; }
  #print-pack .tbl td, #print-pack .tbl th { padding: 5px 6px; }
  #print-pack .tbl th { background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-pack .tbl thead { display: table-header-group; }
  #print-pack .tbl tr { break-inside: avoid; }
  #print-pack .tbl .act, #print-pack .ticks { display: none !important; }
  #print-pack .hide-sm { display: table-cell !important; }
  #print-pack .lvl-p { min-width: 250px; }
  #print-pack .tbl small { font-size: 8pt; }
  #print-pack .list-sum { font-size: 9pt; color: #444; margin: 0 0 6px; }
}
.pp-loc.is-in { opacity: .6; cursor: default; }   /* in All stock: ticked and locked */
.pp-loc.is-in b::after { content: ' \00b7  included in All stock'; font-weight: 400; color: var(--muted); font-size: 12px; }
.list-sum .tot-line { color: var(--ink); font-weight: 600; white-space: nowrap; }   /* Stock levels: the total of what is listed */
/* Bills later: the choices in the dialog, the note on the load */
.dlg-btns:has([data-alt]) { flex-wrap: wrap; }
#dlg-d .bl-ch { display: block; margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line); }
.view-note.qb-back { align-items: center; }   /* Munchee Close day, step 2: back to the Quick Bills */
.view-note.qb-back span { flex: 1; }
/* Close day: the day's expenses */
.dexp .f-tools { flex-wrap: wrap; }
.dx-list { display: grid; gap: 8px; }
.dx-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.4fr) minmax(120px, .8fr) auto; gap: 10px; align-items: end; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.dx-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; color: var(--muted); }
.dx-f small { font-size: 11px; }
.dx-f[hidden] { display: none !important; }
.dx-del { align-self: center; }
.dx-sum { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.dx-sum b { color: var(--ink); font-weight: 600; }
.s-less { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .dx-row { grid-template-columns: 1fr 1fr; } .dx-del { justify-self: end; } }
.cat-list .cl-l small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }   /* Expenses › Office › Salary advance */
/* Overview › Stock: each row is name + value (+ edit), with its stock text on a line of its own under the name */
.stk-split li, .stk-split li:first-child { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 1px; column-gap: 10px; }
.stk-split li > span { grid-column: 1; grid-row: 1; }
.stk-split li > b { grid-column: 2; grid-row: 1; }
.stk-split li > .icon-btn { grid-column: 3; grid-row: 1 / span 2; }
.stk-split li > small { grid-column: 1 / 3; grid-row: 2; padding-left: 20px; white-space: normal; overflow-wrap: normal; }
/* a switch with four or more choices: an even grid, so a narrow window never leaves one choice alone on a second line */
.seg:has(> label:nth-child(4)) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 20px; align-self: stretch; }
.seg:has(> label:nth-child(4)) span { justify-content: center; }
/* Stock levels › place cards: name and its stock text beside the icon, the value under them — nothing squeezed */
.loc-card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center; align-content: start; }
.loc-card .loc-ic { grid-row: 1 / span 2; align-self: start; }   /* the icon sits top left, beside the name */
.loc-card .loc-t { grid-column: 2; min-width: 0; }
.loc-card .loc-t small { white-space: normal; overflow: visible; text-overflow: clip; }
.loc-card em { grid-column: 2; }
.seg:has(> label:nth-child(4)) label { display: flex; min-width: 0; }
.seg:has(> label:nth-child(4)) label > span { flex: 1; }
/* Stock › Transfers */
.trf-k { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.trf-k.is-lorry { background: color-mix(in srgb, #3b82f6 14%, transparent); }
.trf-k.is-main, .trf-k.is-new { background: color-mix(in srgb, #16a34a 14%, transparent); }
.trf-k.is-back { background: color-mix(in srgb, #f59e0b 16%, transparent); }
.trf-ft { min-width: 180px; }
.trf-w { min-width: 220px; }
.trf-items { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 1px; font-size: 12px; color: var(--muted); }
.trf-items li { display: flex; justify-content: space-between; gap: 10px; }
.trf-items b { font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.hist-ctl .dp { min-width: 232px; }   /* a full date (Wed, 4 Nov 2026) always fits in the filter row's date boxes */
.strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }   /* five figures still fit one row on a ~1000px window */
@media screen and (max-width: 1499px) { .lvl-last { display: none !important; } }   /* Stock levels: the batches already show when each came in */
@media screen and (max-width: 1499px) { .stock-pg .tbl:has(.lvl-p) th, .stock-pg .tbl:has(.lvl-p) td { padding-left: 10px; padding-right: 10px; } }   /* Stock levels fits a laptop window */
@media screen and (max-width: 1499px) { .stock-pg .tbl .lvl-p { min-width: 165px; } .stock-pg .tbl:has(.lvl-p) td.act, .stock-pg .tbl:has(.lvl-p) th.act { padding-left: 4px; padding-right: 6px; } }
.lvl-u { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }   /* Stock levels: the units in the store, counted one by one */
/* Pay salaries: one card a person — pay, allowances, deductions, net */
.sl-list { display: grid; gap: 10px; }
.slr { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); }
.slr.off { opacity: .55; }
.slr-h { display: flex; align-items: center; gap: 12px; }
.slr-h .s-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slr-h .s-name b { font-weight: 600; }
.slr-h .s-name small { color: var(--muted); font-size: 12.5px; }
.slr-net { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.slr-net small { font-size: 11.5px; color: var(--muted); }
.slr-net b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.slr-act { display: flex; gap: 6px; }
.slr.is-paid .slr-h { flex-wrap: wrap; }
.slr-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.sl-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.sl-f .in { height: 38px; }
.sl-f small { font-size: 11.5px; }
.sl-f small b, .sl-adv b { color: var(--ink); font-weight: 600; }
.sl-adv b { font-size: 15px; line-height: 38px; }
.sl-err:empty { display: none; }
/* Payslip (dialog and print) */
.slip { max-width: 560px; margin: 0 auto; color: var(--ink); }
.slip-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.slip-t { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; }
.slip-t b { font-size: 16px; letter-spacing: .04em; }
.slip-who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.slip-who dt { font-size: 11px; color: var(--muted); }
.slip-who dd { margin: 0; font-weight: 600; }
.slip-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.slip-tbl th, .slip-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.slip-tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.slip-tot td { font-weight: 600; border-top: 2px solid var(--ink); }
.slip-net { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 10px; }
.slip-net span { font-weight: 600; letter-spacing: .04em; }
.slip-net b { font-size: 20px; font-variant-numeric: tabular-nums; }
.slip-net small { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.slip-sign { margin-top: 36px; font-size: 12px; color: var(--muted); }
@page slip-pack { size: A5 portrait; margin: 10mm; }
@media print { html.pp-on #print-pack.pp-slip { page: slip-pack; } #print-pack .slip { color: #000; } }
/* Quick Bill step 3: products typed more than is left on the load */
.qb-over { margin: 10px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--amber) 50%, transparent); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.qb-over-h > .ic { color: var(--amber-ink); }
.qb-over li.qb-over-t { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.qb-over[hidden] { display: none; }
.qb-over-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.qb-over-h b { font-weight: 600; }
.qb-over-h span { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.qb-over ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.qb-over li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; font-size: 13px; }
.qb-over li b { font-weight: 600; white-space: nowrap; }
.qb-over li small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
/* Quick Bill step 2: the dealers' returns for the whole Quick Bill */
.qb-retbox { margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.qb-retbox .chk-row small { display: block; font-size: 12px; color: var(--muted); }
.qb-rets { margin-top: 10px; }
/* Quick Bill: room between the steps, the line under them and the search bar (it no longer sits over the text) */
.qb-sec[data-qb-sec="2"] > .f-tip { margin: 0 0 12px; line-height: 1.45; }
.qb-sec[data-qb-sec="2"] .qfind { margin-top: 0; }
/* Quick Bill step 3: step 2's returns against the bills' returns */
.qb-rettally { margin: 10px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.qb-rettally[hidden] { display: none; }
.qb-rettally.is-ok { border-color: color-mix(in srgb, #16a34a 40%, transparent); background: color-mix(in srgb, #16a34a 8%, transparent); }
.qb-rettally.is-off { border-color: color-mix(in srgb, var(--red, #d93025) 45%, transparent); background: color-mix(in srgb, var(--red, #d93025) 9%, transparent); }
.qb-rt-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.qb-rt-h b { font-weight: 600; }
.qb-rt-h span { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.qb-rettally ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.qb-rettally li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; font-size: 13px; }
.qb-rettally li b { font-weight: 600; white-space: nowrap; }
.qb-rettally li small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
/* a Quick Bill's bill: its returns as an amount (the items are in Products, step 2) */
.qc-ramt { margin: 8px 0 4px; max-width: 420px; }
.qc-ramt .bcd-m { max-width: 260px; }
.qc-r4 { display: flex; align-items: flex-start; margin-top: 10px; }
.qc-r4 input { margin-top: 1px; flex: none; }
.qc-r4 span { display: flex; flex-direction: column; gap: 2px; font-weight: 500; color: var(--ink); }
.qc-r4 small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.qc-r4 small b { display: block; margin-top: 3px; font-weight: 600; color: var(--ink-2); }
.qc .qc-rt-amt { display: none; }
[data-qed] .qc .qc-rt-items, .qc:has(.qc-ramt.keep) .qc-rt-items { display: none; }
[data-qed] .qc .qc-rt-amt, .qc:has(.qc-ramt.keep) .qc-rt-amt { display: block; }
[data-qed] .qc .qc-rets, .qc .qc-rets.is-off { display: none !important; }
/* Quick Bill step 3: bills and RD apart — the difference typed */
.qb-rdgap { margin: 10px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.qb-rdgap[hidden] { display: none; }
.qb-rdgap.is-ok { border-color: color-mix(in srgb, #16a34a 40%, transparent); background: color-mix(in srgb, #16a34a 8%, transparent); }
.qb-rdgap.is-off { border-color: color-mix(in srgb, #f59e0b 50%, transparent); background: color-mix(in srgb, #f59e0b 10%, transparent); }
.qb-rg-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 10px; }
.qb-rg-h b { font-weight: 600; }
.qb-rg-h span { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.q-name .q-now { display: block; margin-top: 2px; color: var(--green-ink); }
.q-name .q-now b { font-weight: 600; }
.keep-carried .kc-more { margin-top: 6px; }
.keep-carried .kc-more summary { cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 2px 0; }
.keep-carried .kc-more summary:hover { color: var(--ink); }
.sh-b > .sh-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.qb-dexp { margin-top: 18px; }
.qb-dx-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
/* reports: every other line (1st, 3rd, 5th…) lightly shaded, so a line is easy to follow across the wide tables */
:root { --zebra: rgba(14, 16, 47, .05); }
[data-theme="dark"] { --zebra: rgba(255, 255, 255, .07); }
.page-reports .tbl > tbody > tr:nth-child(odd):not(.tot-row):not(.strong) > td { background: var(--zebra); }
.page-reports .tbl > tbody > tr:nth-child(odd):not(.tot-row):not(.strong) > td:first-child { border-radius: 10px 0 0 10px; }
.page-reports .tbl > tbody > tr:nth-child(odd):not(.tot-row):not(.strong) > td:last-child { border-radius: 0 10px 10px 0; }
@media print { .page-reports .tbl > tbody > tr:nth-child(odd) > td { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #f1f1f1; } }
/* free issue on a Quick Bill's bill: biscuits given free from the load */
.qc-free { padding: 12px; border-radius: 16px; margin: 4px 0 10px; background: color-mix(in srgb, var(--green-soft) 55%, var(--surface-2)); }
.qc-free[hidden] { display: none; }
.qf-list { display: grid; gap: 8px; }
.qf-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 10px; padding: 10px; border-radius: 12px; background: var(--surface); }
.qf-row .qf-v { grid-column: 1 / 2; color: var(--green-ink); font-size: 12.5px; }
.qf-row .qf-v:empty { display: none; }
.qf-row .qf-del { grid-row: 1; grid-column: 3; }
.qf-row .qf-q { grid-row: 1; grid-column: 2; }
.qc-free .rret-bar { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) { .qf-row { grid-template-columns: minmax(0, 1fr) auto; } .qf-row .qf-q { grid-row: 2; grid-column: 1 / -1; } .qf-row .qf-del { grid-row: 1; grid-column: 2; } }
/* Settings › Data, backups & phones: compact boxes, long lists folded into dropdowns */
.data-grid .data-box { gap: 8px; padding: 14px; }
.data-grid .data-box p { flex: none; margin: 0; }
.data-grid .data-box .btn-row-inline { margin-top: auto; }
.data-box details.dd { border-radius: 12px; background: var(--surface); }
.data-box details.dd > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.data-box details.dd > summary::-webkit-details-marker { display: none; }
.data-box details.dd > summary .ic { transition: transform .2s ease; color: var(--muted); }
.data-box details.dd[open] > summary .ic { transform: rotate(180deg); }
.data-box details.dd .dd-b { padding: 0 12px 10px; display: grid; gap: 6px; }
.data-box details.dd .path { margin: 0; word-break: break-all; }
.data-box details.dd .folders, .data-box details.dd .bk-list { margin: 0; }
.data-box details.dd-bk .dd-b { max-height: 260px; overflow: auto; }
.data-box .big-link { margin: 0; }
.clr { display: grid; gap: 12px; margin-top: 6px; }
.clr .clr-list { display: grid; gap: 4px; }
.clr .chk-row em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.clr .chk-row small { display: block; }
/* reports: the column headings stay in sight while a long table scrolls (wide screens: the table flows with the page;
   narrow screens keep the side-scroll and the usual headings) */
@media (min-width: 1100px) {
  .page-reports .tbl-wrap { overflow: clip visible; }
  @supports not (overflow: clip) { .page-reports .tbl-wrap { overflow: visible; } }
  .page-reports .tbl > thead > tr > th { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--line), 0 6px 12px -10px rgba(0, 0, 0, .35); }
}
@media print { .page-reports .tbl > thead > tr > th { position: static; box-shadow: none; } }
.qb-sec[data-qb-sec="4"] > .f-tip { margin: 0 0 4px; line-height: 1.45; }
.qb-sec[data-qb-sec="4"] .qb-dexp { margin-top: 8px; }
/* Shop payment › Partial: cash, cheques and the bank, each its own payment */
.pp-box { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 16px; margin: 2px 0 14px; }
.pp-box > .f-tip { margin: 0; }
.pp-box .f-sec-h { margin: 4px 0 0; }
.pp-chqs { display: grid; gap: 8px; }
.pp-chq .f-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; margin: 0; }
.pp-chq .b-f > *, .pp-chq .dp, .pp-chq .dp-face { min-width: 0; max-width: 100%; }
.pp-chq .dp-face { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pp-chq .b-f { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.pp-chq .icon-btn { margin-bottom: 6px; }
.pp-sum { margin: 0; font-size: 13.5px; }
[data-pp-more] { margin: -6px 0 12px; }
@media (max-width: 640px) { .pp-chq .f-row { grid-template-columns: 1fr 1fr; } }
/* Daily trips › By biscuit: the vehicle choice stays put */
.bb-veh { flex: 0 0 auto; display: block; }
.bb-veh .in { min-width: 190px; }
.bb-card .tbl-wrap { max-height: 560px; overflow: auto; }   /* the list scrolls inside the card: picking a lorry does not make the page jump */
.bb-card .tbl-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2, var(--surface)); }
/* Morning load: another day of this lorry, to look at */
.dayview { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 16px; margin: 6px 0 14px; background: var(--surface-2, transparent); }
.dayview .dv-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dayview .dv-h > div { flex: 1 1 260px; display: grid; gap: 2px; }
.dayview .dv-h small { color: var(--muted); font-size: 12.5px; }
.dayview .dv-sub, .dayview .dv-none { margin: 0; font-size: 13.5px; color: var(--ink-2); }
/* Quick bill: pick the day */
.qb-dayf { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.qb-dayf .b-f { flex: 0 0 220px; }
.qb-dayf > small { align-self: center; }
.pd-list { display: grid; gap: 8px; margin-top: 10px; }
.pd-list .btn small { margin-left: 6px; opacity: .7; }
/* a report table wider than its card: side-scroll in its box; long ones scroll inside it too, headings pinned */
.page-reports .tbl-wrap.is-wide { overflow: auto; max-height: calc(100vh - 120px); }


/* ===== 1280 × 720 and other short screens (the agency's office display): less height on chrome, more for the work ===== */
@media (min-width: 900px) and (max-height: 800px) {
  .app { padding: 12px 20px 26px 12px; row-gap: 16px; column-gap: 20px; min-height: calc(100dvh - 20px); }
  .brand { height: 44px; }
  .brand-logo { height: min(34px, 2.4vw); }
  .bsw, .user { height: 44px; }
  .bsw-logo { width: 30px; height: 30px; }
  .tool-group { padding: 3px; }
  .avatar { width: 34px; height: 34px; }
  .nav { padding: 4px; }
  .nav a { height: 34px; padding: 0 15px; font-size: 14px; }
  /* the side rail fits: smaller circles, less space between the groups */
  .rail { top: 12px; height: calc(100dvh - 164px); min-height: 0; gap: 10px; }   /* the whole rail shows on a 720 px screen, Lock included */
  .rail-group { gap: 3px; padding: 5px; }
  .rail-group .icon-btn { width: 36px; height: 36px; }
  /* page heads and figures */
  .ph { margin-bottom: 14px; gap: 10px 20px; }
  .ph h1 { font-size: 28px; }
  .ph-sub { margin-top: 4px; font-size: 14px; }
  .fig { min-height: 96px; padding: 12px 16px 14px; }
  .kpi { min-height: 128px; padding: 14px 16px; }
  .strip { margin-bottom: 12px; }
  /* quick-add toolbar: every button fits on one line */
  .ab-row, .actionbar { margin-bottom: 14px; }
  .ab-btn { height: 36px; padding: 0 12px; font-size: 13.5px; gap: 6px; }
  .ab-quick { height: 44px; padding: 0 18px; font-size: 14.5px; }
  /* forms (sheets): a slimmer head and foot, so the form itself gets the room */
  .sh-h { padding: 10px 14px 10px 18px; gap: 12px; }
  .sh-ico { width: 38px; height: 38px; border-radius: 12px; }
  .sh-tt h2 { font-size: 18px; }
  .sh-tt p { font-size: 12.5px; }
  .sh-f { padding: 10px 14px 10px 18px; }
  .sh-b { padding-top: 14px !important; }
}
/* at 1280 wide the quick-add buttons share the line with Quick bill */
@media (min-width: 900px) and (max-width: 1400px) {
  .ab-btn { padding: 0 12px; font-size: 13.5px; gap: 6px; }
  .ab-btn .ic { width: 15px; height: 15px; }
}

/* ---------- Reports › Month end: day end status and RD sales confirmation, day by day ---------- */
.me-top { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
.me-top .hist-ctl { margin: 0; }
.me-box { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--r-card); background: var(--surface-2); }
.me-box > div { flex: 1; min-width: 0; }
.me-box h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.me-todo { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.me-todo b { font-weight: 500; color: var(--ink); }
.me-done { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--green-ink); font-size: 14px; }
.me-done b { font-weight: 600; }
.me-box .btn[disabled] { opacity: .45; cursor: not-allowed; }
.me-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.me-legend span { display: inline-flex; align-items: center; gap: 6px; }
.me-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.me-legend i.is-today { background: var(--me-today); }
.me-legend i.is-ok { background: var(--green); }
.me-legend i.is-pending { background: var(--red); }
.me-scroll { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-inner); }
.me-grid { border-collapse: collapse; min-width: 100%; font-size: 13px; }
.me-grid th, .me-grid td { border-left: 1px solid var(--line); padding: 0; text-align: center; min-width: 58px; }
.me-grid tr + tr th, .me-grid tr + tr td, .me-grid tbody tr:first-child > * { border-top: 1px solid var(--line); }
.me-grid th[scope=row] { position: sticky; left: 0; z-index: 1; background: var(--surface); border-left: 0; padding: 10px 14px; text-align: left; font-weight: 600; white-space: nowrap; min-width: 170px; }
.me-grid thead th { font-weight: 600; }
.me-grid .is-sel { background: var(--surface-2); }
.me-grid thead .is-today .me-d { color: var(--me-today); box-shadow: inset 0 -2px 0 var(--me-today); }
.me-d, .me-c { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; padding: 8px 6px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.me-d[disabled], .me-c[disabled] { cursor: default; opacity: .55; }
.me-d:focus-visible, .me-c:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.me-mk { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid currentColor; }
.me-mk svg { width: 13px; height: 13px; }
.me-mk.is-ok { color: var(--green-ink); background: var(--green-soft); }
.me-mk.is-pending { color: var(--red-ink); background: var(--red-soft); }
.me-mk.is-wait { color: var(--amber-ink); background: var(--amber-soft); }
.me-mk.is-none { color: var(--faint); border-style: dashed; }
.me-tbl td { vertical-align: middle; }
.me-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.me-cell small { color: var(--ink-2); font-size: 13px; }
.me-cell .vc-link { display: inline-flex; width: auto; margin: 0; padding: 0; }
.me-v b, .me-v small { display: block; }
.me-v small { margin-top: 2px; }
.me-badge { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; }
.me-badge.is-wait { background: var(--amber-soft); color: var(--amber-ink); }
.me-badge.is-ok { background: var(--green-soft); color: var(--green-ink); }
.me-det .card-hr { display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) { .me-top { grid-template-columns: 1fr; } .me-box { flex-direction: column; align-items: stretch; } }
@media print { .me-box .btn, .me-tbl .btn, .me-tbl .vc-link, .me-det .card-hr .btn { display: none; } }
:root { --me-today: #2563EB; }
[data-theme="dark"] { --me-today: #60A5FA; }

/* Morning load: Delete this load-out (an incorrect one) — under the biscuit boxes */
.del-load { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.del-load small { flex: 1 1 260px; color: var(--muted); font-size: 12.5px; }
/* the lorry's stock on the date picked: each product, its units and value */
.keep-carried .kc-list ul.kc-items li { display: flex; justify-content: space-between; gap: 12px; }
.keep-carried .kc-list ul.kc-items li span small { display: block; font-size: 12px; }
.keep-carried .kc-list ul.kc-items { max-height: 260px; overflow-y: auto; }
/* a past day entered from paper bills: a calm note, and the way there from an open load's date */
.view-note.past-note { background: color-mix(in srgb, var(--me-today, #2563EB) 10%, var(--surface)); }
.err .past-go { margin-top: 8px; display: inline-flex; }
.hint .link-btn { display: inline; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.view-note.past-note b { color: var(--ink); }
.yd-ch { margin: 10px 0 0; }
.chk-row.inv-disc { margin-top: 8px; }
/* Stock in: the tax invoice lines under Less Discount */
.inv-vat { margin: 0 0 16px; }
.inv-vat .inv-vat-tot { border-top: 1px solid var(--line); padding-top: 8px; }
.inv-vat .inv-vat-tot span { color: var(--ink); font-weight: 500; }
.inv-vat[hidden], .f-row[data-invnet-row][hidden] { display: none; }   /* only when -3.3% is ticked */
.in.cl-note { margin-top: 10px; height: auto; min-height: 64px; padding: 10px 14px; resize: vertical; line-height: 1.45; }   /* Stock in: notes about the claim */
.keep-carried .kc-fill { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; }
.keep-carried .kc-fill small { flex: 1 1 240px; color: var(--muted); font-size: 12.5px; }
/* Add stock to lorry: what was already added to the lorry, each with Edit */
.al-adds { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.al-adds li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.al-adds li > span { display: grid; gap: 2px; }
.al-adds li b { color: var(--ink); font-weight: 600; }

/* Bad debt: the write-off form (inside the confirm) and the dealer's list */
.bd-form { display: block; margin-top: 14px; text-align: left; }
.bd-bills { display: block; max-height: 240px; overflow: auto; border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: 12px; padding: 4px 10px; margin-bottom: 12px; }
.bd-bills .chk-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-weight: 400; }
.bd-bills .chk-row + .chk-row { border-top: 1px solid var(--line, rgba(0,0,0,.08)); }
.bd-bills .chk-row span { flex: 1; }
.bd-bills .chk-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.bd-f { display: block; margin-top: 10px; }
.bd-f > span { display: block; font-size: 13px; margin-bottom: 4px; }
.bd-f .in { width: 100%; }
.bd-list li { line-height: 1.7; }
tr.is-done td { opacity: .6; }

/* Quick Bill step 6: return cheques collected on the route */
.rc-list { display: grid; gap: 10px; margin: 6px 0 12px; }
.rc-row { display: grid; grid-template-columns: minmax(200px, 1.6fr) 120px repeat(4, minmax(110px, 1fr)); gap: 10px; align-items: end; padding: 12px 14px; border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: 14px; }
.rc-who b { display: block; font-weight: 600; }
.rc-who small, .rc-owed small { display: block; color: var(--muted, #888); font-size: 12px; }
.rc-owed b { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .rc-row { grid-template-columns: 1fr 1fr; } .rc-who { grid-column: 1 / -1; } }

/* Profit & loss › Money & stock: the All money collected total */
.props .tot-row { border-top: 1px solid var(--line-2, rgba(127,127,127,.3)); }
.props .tot-row dt b, .props .tot-row dd b { font-weight: 600; color: var(--ink); }
.props .tot-row dd { flex-shrink: 0; white-space: nowrap; }
.props .tot-row dt { min-width: 0; }
.props .tot-row dt small { display: block; font-size: 12px; margin-top: 2px; white-space: normal; }
.props .tot-row dt { flex: 1 1 auto; overflow: hidden; }
.props .tot-row dt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

/* Partial: the 1% discount on the cash part, under its box */
.brow.qc .b-more > .qc-cashp { gap: 8px; }
.qc-cashp > .b-f, .qc-cashp > .qc-d1c { flex: none; }
.qc-d1c { align-items: flex-start; font-size: 13px; }
.qc-d1c input { flex: none; margin-top: 1px; }
.qc-d1c span { display: flex; flex-direction: column; gap: 2px; }
.qc-d1c small { font-size: 12px; color: var(--muted); }
.qc-d1c small:empty { display: none; }
.qc-d1c.is-off { opacity: .5; cursor: not-allowed; }

/* Quick Bill: the title and the 6 steps stay on top while the page scrolls; the sticky bars below sit under them */
.qb-top { position: sticky; top: -20px; z-index: 8; margin: -20px -4px 0; padding: 20px 4px 2px; background: var(--surface); }
.qb-top .qb-steps { margin-bottom: 14px; }
.qb-sec .qb-diff { top: calc(var(--qb-top, 0px) - 20px); }
.qb-sec .qfind { top: calc(var(--qb-top, 0px) - 20px); }
.qb-sec .cc-stick { top: calc(var(--qb-top, 0px) - 20px); }
@media (max-width: 640px) {                       /* a phone: the steps are one tall column, so they scroll away */
  .qb-top { position: static; margin: 0; padding: 0; }
  .qb-sec .qb-diff { top: -1px; } .qb-sec .qfind, .qb-sec .cc-stick { top: -20px; }
}

/* Import old bills: the CSV picker as a drop box, in the dashboard's look */
.ob-file { position: relative; display: flex; align-items: center; gap: 12px; min-height: 120px; padding: 14px 16px; border: 1.5px dashed var(--line-2); border-radius: 16px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background-color .15s; }
.ob-file:hover, .ob-file.is-over { border-color: var(--ink-2); }
.ob-file.is-over { background: var(--surface); }
.ob-file:focus-within { box-shadow: 0 0 0 3px var(--ring); }
.ob-file-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.ob-file.has-file .ob-file-ico { color: var(--green-ink); background: var(--green-soft); border-color: transparent; }
.ob-file-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ob-file-t b { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-file-t small { font-size: 12.5px; color: var(--muted); }
.ob-file .btn { flex: none; pointer-events: none; }
.ob-drop .field > .hint { display: block; margin-top: 6px; }

/* Stock in: every claim on the invoice in one box */
.claims-box { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 6px; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.claims-h { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.claims-h small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.claims-box .f-row { margin: 0; }
.claims-box .cl-note { margin: 0; }

/* Stock in: other amounts to pay the company — an amount and its note on each line */
.xp-list { display: flex; flex-direction: column; gap: 8px; }
.xp-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.xp-add { align-self: flex-start; }
.xp-box .err:empty { display: none; }
@media (max-width: 640px) { .xp-row { grid-template-columns: minmax(0, 1fr) auto; } .xp-row .in-money { grid-column: 1 / -1; } }

.inv-sum .is-row[hidden] { display: none; }

/* Quick Bill step 2: biscuits not on the lorry's load (found by search) */
.qb-off-h { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.qb-off-h small { font-size: 12px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.qrow.is-offload .qb-left { color: var(--amber-ink); }
.qrow.is-offload .qb-left { font-size: 0; }   /* 'Left on the lorry 0' says nothing here */
.qrow.is-offload .qb-left::before { content: 'Not on the lorry’s load'; font-size: 13px; }

/* Settings › Percentages */
.rates { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rate-f { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.rate-f b { font-size: 14px; font-weight: 600; }
.rate-f small { font-size: 12px; color: var(--muted); }
.rate-in { display: flex; align-items: center; gap: 8px; }
.rate-in .in { width: 110px; }
.rate-in span { color: var(--muted); }
.rate-in .rate-sign { font-size: 18px; font-weight: 600; color: var(--red-ink, var(--ink)); margin-right: -2px; }   /* a rate that is taken off */
html.rep-ro main tr[data-open] { cursor: default; }   /* staff on Reports: rows are not opened to change */
.rep-edit { margin-top: 10px; }
