/* Brand fonts, self-hosted (CSP font-src 'self'; no third-party request). SIL OFL 1.1: wwwroot/fonts/OFL-*.txt. Latin subset covers EN + Malay.
   ?v=1 = a versioned URL (Program.cs caches those for a year): bump it, and the preload in _Layout.cshtml, when a font file changes. */
@font-face { font-family: Nunito; src: url(../fonts/nunito-latin-var.woff2?v=1) format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: Anton; src: url(../fonts/anton-latin.woff2?v=1) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
/* the hidden attribute always wins over a class that sets display (grid/flex rows kept showing) */
[hidden] { display: none !important; }
/* Squid Boy HQ portal: app shell. Theme = option F "Squid Boy brand, calmer" (9 Oct 2026): pink only for the main action,
   blue for selected, white portal, Nunito text, Anton for money. Every page works at 360 px (docs/BUILD-CONVENTIONS.md section 4). */
:root {
  --bg: #f5f7fa; --card: #fff; --ink: #1f2a44; --muted: #5d6b82; --line: #e4e8ef; --line-2: #d3d9e3;
  --teal: #1570ac; --teal-d: #0f5a8c; --teal-wash: #eaf3fa;          /* "teal" = the SELECTED colour (blue in theme F); names kept from the shell */
  --pk: #d21e68; --pk-d: #a8124f; --gloss: linear-gradient(180deg, #e2407f 0%, #d21e68 55%, #b8155a 100%);
  --gold: #c27c00; --green: #12805c; --red: #c0392b; --pink: #fde1ea; --yellow: #fff1c2; --darkred: #a3001b;
  /* small status TEXT (11-13 px chips, pills, warnings) needs 4.5:1: --green is for FILLED buttons with white text only (4.9:1);
     --green-text is 5.5:1 on the pale green chips and 7:1 on white; --gold-text is 5.6:1 on white (--gold itself is 3.4:1: edges only) */
  --green-text: #0f6b4c; --gold-text: #8a5a00;
  --shadow: 0 1px 2px rgba(20,32,60,.05), 0 10px 26px rgba(20,32,60,.07);
  --shadow-sm: 0 1px 2px rgba(20,32,60,.06), 0 3px 8px rgba(20,32,60,.05);
  --f: Nunito, "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --fd: Anton, Impact, "Arial Narrow Bold", "Segoe UI", sans-serif;
  --sb-w: 248px; --sb-w-min: 68px; --tb-h: 58px; --pz: cubic-bezier(.22,.61,.36,1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); min-height: 100vh; }
a { color: var(--teal-d); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 900; margin: 0 0 4px; } h2 { font-size: 16px; font-weight: 800; margin: 0 0 10px; } h3 { font-size: 14px; font-weight: 800; margin: 0 0 6px; }
p { margin: 0 0 10px; } .muted { color: var(--muted); } .small { font-size: 12.5px; } .center { text-align: center; } .nowrap { white-space: nowrap; }
code, .mono { font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; font-size: .92em; }
/* keyboard focus: a solid dark-blue ring (7.3:1 on white, WCAG 2.4.7 / 1.4.11) with a white inner ring so it also shows on a pink or blue button
   and on the blue selected menu item; the old 45 %-opacity ring was about 1.9:1 and invisible on most pages */
:focus-visible { outline: 3px solid var(--teal-d); outline-offset: 2px; border-radius: 6px; box-shadow: 0 0 0 2px #fff; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; } .skip:focus { left: 8px; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #c8ccce; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }

/* ---------- shell: sidebar + main ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sb-w); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 60; transition: transform .22s var(--pz), width .18s var(--pz); }
.sb-brand { height: var(--tb-h); display: flex; align-items: center; gap: 10px; padding: 0 14px 0 16px; border-bottom: 1px solid var(--line); }
.sb-logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 900; text-decoration: none; min-width: 0; }
.sb-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--gloss); color: #fff; display: grid; place-items: center; font-size: 13px; letter-spacing: .5px; flex: 0 0 34px; box-shadow: 0 2px 6px color-mix(in srgb, var(--pk) 35%, transparent); }
.sb-name { font-size: 17px; white-space: nowrap; }
.sb-close { margin-left: auto; display: none; background: none; border: 0; font-size: 18px; color: var(--muted); cursor: pointer; padding: 6px; }
.sb-nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.sb-group { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding: 14px 10px 4px; white-space: nowrap; }
.sb-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; font-family: inherit; }
.sb-item:hover { background: #f2f6f6; text-decoration: none; }
.sb-item.on { background: color-mix(in srgb, var(--teal) 12%, #fff); color: var(--teal-d); }
.sb-ic { width: 24px; text-align: center; font-size: 17px; flex: 0 0 24px; }
.sb-foot { border-top: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.sb-ver { padding: 2px 14px 6px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-ver { margin: 12px 0 0; font-size: 11px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.sb-user .sb-lbl { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; } .sb-user small { color: var(--muted); font-size: 11px; }
.sb-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--teal-wash); color: var(--teal-d); display: grid; place-items: center; font-weight: 900; flex: 0 0 30px; }
.sb-logout { margin: 0; }
.backdrop { position: fixed; inset: 0; background: rgba(10,20,17,.45); z-index: 55; backdrop-filter: blur(2px); }

.main { flex: 1; min-width: 0; margin-left: var(--sb-w); display: flex; flex-direction: column; transition: margin-left .18s var(--pz); }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--tb-h); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: 0 1px 6px rgba(20,32,60,.05); }
.menu-btn { width: 44px; height: 44px; border-radius: 10px; border: 0; background: #eef1f6; cursor: pointer; display: grid; place-items: center; gap: 4px; padding: 10px; flex: 0 0 40px; }
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .15s; }
.menu-btn:hover { background: #e2e7ef; }
.tb-title { font-weight: 900; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }   /* the title gives way; the pill never wraps */
.tb-spacer { flex: 1; }
.tb-who { font-weight: 700; font-size: 13px; opacity: .95; white-space: nowrap; }
.net-pill { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 3px 9px; border-radius: 999px; background: #e3f4ec; color: var(--green-text); flex: 0 0 auto; white-space: nowrap; }
.net-pill.rej { cursor: pointer; } .net-pill.rej:not(.off) { background: #fff; color: var(--red); }   /* app.js: the server refused an offline entry - tap the pill to read them */
.net-pill.off { background: var(--red); color: #fff; }
.content { padding: 18px 20px 60px; max-width: 1400px; width: 100%; }

/* collapsed rail on desktop */
body.sb-collapsed .sidebar { width: var(--sb-w-min); }
body.sb-collapsed .main { margin-left: var(--sb-w-min); }
body.sb-collapsed .sb-name, body.sb-collapsed .sb-group, body.sb-collapsed .sb-lbl { display: none; }
body.sb-collapsed .sb-item { justify-content: center; padding: 10px 0; }
body.sb-collapsed .sb-brand { padding: 0; justify-content: center; }
body.sb-collapsed .sb-user { justify-content: center; }

/* phone / tablet: off-canvas drawer */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); width: min(300px, 86vw); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
  body.sb-open .sidebar { transform: none; }
  body.sb-collapsed .sidebar { width: min(300px, 86vw); }
  body.sb-collapsed .sb-name, body.sb-collapsed .sb-group, body.sb-collapsed .sb-lbl { display: initial; }
  body.sb-collapsed .sb-item { justify-content: flex-start; padding: 11px 10px; }
  body.sb-collapsed .sb-user .sb-lbl { display: flex; }
  .sb-close { display: block; }
  .main, body.sb-collapsed .main { margin-left: 0; }
  .content { padding: 14px max(12px, env(safe-area-inset-right)) 80px max(12px, env(safe-area-inset-left)); }
  .tb-who { display: none; }
  .sb-item { padding: 11px 10px; font-size: 15px; }
  .sb-icon-lbl { display: inline; }
  .btn, button.btn, a.btn { min-height: 44px; }
  /* standalone app (viewport-fit=cover): keep the notch, the rounded corners and the home indicator clear */
  .topbar { padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); height: calc(var(--tb-h) + env(safe-area-inset-top)); }
  .sidebar { padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); }
  .content { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toasts { bottom: max(14px + env(safe-area-inset-bottom), 14px + var(--bar-h, 0px)); }
  /* every sticky bottom bar (the modules each declare their own) clears the home indicator; #main outranks the module copies */
  #main .actionbar, #main .post-bar, #main .ck-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  /* drawer open: the page behind the backdrop must not move. The lock sits on <html> — once html clips, body's overflow never reaches the viewport */
  html.sb-open { overflow: hidden; }
  .backdrop { touch-action: none; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat .v { font-size: 24px; }
  .page-head .actions .btn { flex: 1 1 auto; justify-content: center; }
}
@supports (height: 100dvh) { .login-wrap { min-height: 100dvh; } .app { min-height: 100dvh; } }
/* touch: no hover-only affordances */
@media (hover: none) { tbody tr:hover { background: inherit; } .btn { padding: 11px 16px; } .btn-sm { padding: 8px 12px; } }

/* ---------- building blocks ---------- */
.card { background: var(--card); border: 1px solid #eef2f2; border-radius: 18px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.tight { padding: 12px 14px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
/* ONE .stat rule (theme F look: white tile, 1 px line, no accent). The legacy .k/.v/.s tiles and the theme-F b/span tiles (declared with
   .stat-grid below) share it; .stat-warn / .stat-crit come AFTER it so their coloured edge is never cancelled by the border shorthand */
.stat { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; }
.stat:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.stat .k { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.stat .v { font-size: 28px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--muted); }
.stat-warn { border-left: 5px solid var(--gold); } .stat-crit { border-left: 5px solid var(--red); }

.btn { border: 0; border-radius: 11px; padding: 9px 14px; font-weight: 700; font-size: 13.5px; cursor: pointer; background: var(--teal-wash); background: color-mix(in srgb, var(--teal) 8%, #fff); color: var(--teal-d); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-family: inherit; line-height: 1.2; transition: transform .08s, filter .1s; white-space: nowrap; }
.btn:hover { filter: brightness(.96); text-decoration: none; } .btn:active { transform: translateY(1px); }
/* BRAND F RULE: solid blue (.btn-teal) means SELECTED / CURRENT, never "another kind of action" - the pager's current page, an active pill.
   An action button is plain .btn (neutral), or .btn-primary (pink) when it is the ONE main action of the page. Never two pinks on one screen. */
.btn-teal { background: var(--teal); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--teal) 35%, transparent); } .btn-teal:hover { background: var(--teal-d); filter: none; }
.btn-gold { background: var(--gold); color: var(--ink); } .btn-green { background: var(--green); color: #fff; } .btn-del { background: #fde8e8; color: var(--red); } .btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink); }
.btn-block { width: 100%; justify-content: center; padding: 13px; font-size: 15px; margin-top: 18px; }
.btn-lg { padding: 13px 18px; font-size: 15px; } .btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

label { display: block; font-size: 12.5px; font-weight: 800; color: #344; margin: 12px 0 5px; }
input, select, textarea { width: var(--fw, 100%); max-width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 60%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; padding: 0; accent-color: var(--teal); }
input[type=number] { font-variant-numeric: tabular-nums; }
/* iOS Safari zooms into fields under 16px — a floor on phones, not a cap: :where() keeps it below any class rule, so the big-number
   fields (.num-big, .cq, .op-qtyin, .qvalue input…) keep their size and a module may not go under 16px on phones either */
@media (max-width: 1023px) { input:where(:not([type=checkbox]):not([type=radio]):not([type=range])), select, textarea { font-size: 16px; } }
.num-big { font-size: 22px; font-weight: 800; text-align: right; padding: 10px 12px; }
/* ---------- field widths: every field fits the KIND of data it holds (docs/FIELD-SIZES.md, Rachel 26/09/2026) ----------
   A class names the kind, never a pixel size. It goes on the field or on the div around its label and field. ch follows
   the field's own font, so the compact PC and the phone sizes both stay right. The fallbacks by type are :where() (no
   specificity): a kind class beats them, and a module's own class rule (.num-big, .cq, .fl-more input...) beats both. */
:where(input[type=number]) { --fw: calc(9ch + 28px); }
:where(input[type=date], input[type=month]) { --fw: calc(11ch + 48px); }
:where(input[type=time]) { --fw: calc(6ch + 48px); }
:where(input[type=datetime-local]) { --fw: calc(17ch + 48px); }
:where(input[type=email]) { --fw: calc(40ch + 28px); }
:where(select) { --fw: auto; }
:where(textarea) { --fw: 100%; }
.w-xs,   .w-xs   :is(input, select, textarea) { --fw: calc(5ch + 28px); }
.w-qty,  .w-qty  :is(input, select, textarea) { --fw: calc(9ch + 28px); }
.w-date, .w-date :is(input, select, textarea) { --fw: calc(11ch + 48px); }
.w-time, .w-time :is(input, select, textarea) { --fw: calc(6ch + 48px); }
.w-dt,   .w-dt   :is(input, select, textarea) { --fw: calc(17ch + 48px); }
.w-code, .w-code :is(input, select, textarea) { --fw: calc(16ch + 28px); }
.w-name, .w-name :is(input, select, textarea) { --fw: calc(24ch + 28px); }
.w-text, .w-text :is(input, select, textarea) { --fw: calc(40ch + 28px); }
.w-long, .w-long :is(input, select, textarea) { --fw: 100%; }
.w-auto, .w-auto :is(input, select, textarea) { --fw: auto; }
.w-qty input, input.w-qty, .w-xs input, input.w-xs { text-align: right; }
/* a row of fields at their own widths, wrapping when the line is full; `grow` takes the rest of the line */
.field-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: flex-end; }
.field-row > * { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.field-row > .grow { flex: 1 1 14rem; }
.grow, .grow :is(input, select, textarea) { --fw: 100%; }
.field-row > .w-long { flex: 1 1 100%; }
@media (max-width: 560px) {
  /* a phone: names and lines take the whole line (easy to tap and read); short kinds keep sharing lines */
  .w-name, .w-name :is(input, select, textarea), .w-text, .w-text :is(input, select, textarea), :where(input[type=email]) { --fw: 100%; }
  .field-row > .w-name, .field-row > .w-text { flex: 1 1 100%; }
}
/* the kinds in the other flex rows: a sized field keeps its width beside the camera button (.scan-wrap stretches a bare one),
   `grow` takes the rest of a toolbar, a long field gets a floor form's whole line, and on a phone a name or a line does in a toolbar */
.scan-wrap > input:is([class^="w-"], [class*=" w-"]) { flex: 0 1 auto; }
.toolbar > .grow { flex: 1 1 14rem; }
.fl-form > .w-long { flex: 1 1 100%; }
@media (max-width: 560px) { .toolbar > .w-name, .toolbar > .w-text { flex: 1 1 100%; } }
/* a read-only field (a unit that comes from the item, a setting only the OWNER changes) must not look typeable: muted box, no text
   cursor. input:where() keeps it one step above the base input rule only, so a module's own class rule still wins */
input:where([readonly]), textarea:where([readonly]) { background: var(--bg); cursor: default; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin: 10px 0; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.err { color: var(--red); font-size: 13px; margin-top: 12px; font-weight: 700; }
.pwrap { position: relative; } .pwrap input { padding-right: 44px; } .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; font-size: 16px; padding: 6px; }
.pin-input { letter-spacing: .5em; font-size: 22px; text-align: center; }

.tablewrap { overflow-x: auto; border-radius: 14px; border: 1px solid #eef2f2; background: #fff; }
/* app.js sets .more on a .tablewrap / .ktabs while there is content to the right — the fade is the scroll cue phones otherwise lack */
.tablewrap.more, .ktabs.more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 9px 12px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: color-mix(in srgb, var(--teal) 6%, #fff); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 800; white-space: nowrap; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; } tbody tr:hover { background: #f7fbfb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.compact th, table.compact td { padding: 6px 10px; font-size: 13px; }
td.pink { background: var(--pink); font-weight: 700; } td.warn, .warn { color: var(--gold-text); font-weight: 800; } td.crit { color: var(--red); font-weight: 800; }
tr.total td { font-weight: 800; background: #f7fbfb; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; background: #eef2f2; color: var(--muted); white-space: nowrap; }
.pill-ok, .pill-in { background: #e2f0e8; color: var(--green-text); } .pill-warn { background: var(--yellow); color: #7a5400; } .pill-crit { background: var(--darkred); color: #fff; } .pill-out { background: #fde8e8; color: var(--red); } .pill-teal { background: color-mix(in srgb, var(--teal) 14%, #fff); color: var(--teal-d); } .pill-gold { background: #fbeccd; color: #8a5a00; }

.flash { padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 700; border: 1px solid transparent; }
.flash-ok { background: #e2f0e8; color: #1a5c38; border-color: #c9e5d5; } .flash-warn { background: var(--yellow); color: #6b4a00; } .flash-err { background: #fde8e8; color: var(--red); border-color: #f6c9c9; }
.toasts { position: fixed; right: 14px; bottom: calc(14px + var(--bar-h, 0px)); display: flex; flex-direction: column; gap: 8px; z-index: 90; }   /* --bar-h: height of the sticky action bar on screen (app.js), so a toast never covers Save */
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 12px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: sbPop .18s ease; max-width: 80vw; }
.toast.err { background: var(--red); } .toast.ok { background: var(--green); }
@keyframes sbPop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

.ktabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 12px; }
.ktabs button, .ktabs a { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-size: 12.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 11px 14px; cursor: pointer; white-space: nowrap; font-family: inherit; text-decoration: none; scroll-snap-align: start; }
.ktabs button.on, .ktabs a.on { color: var(--teal-d); border-bottom-color: var(--teal); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.toolbar label { margin: 0 0 4px; } .toolbar > div { min-width: 140px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; } .kv dt { color: var(--muted); font-weight: 700; } .kv dd { margin: 0; }

.modal-bg { position: fixed; inset: 0; background: rgba(10,20,17,.45); backdrop-filter: blur(4px); display: none; align-items: flex-start; justify-content: center; padding: 24px 14px; overflow-y: auto; z-index: 80; }
.modal-bg.show { display: flex; }
.modal { animation: sbPop .18s ease; background: #fff; border-radius: 18px; width: 100%; max-width: 620px; padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal-wide { max-width: 980px; }

/* scan field */
.scan-field { position: relative; } .scan-field input { padding-left: 40px; font-family: ui-monospace, Consolas, monospace; font-size: 16px; }
.scan-field::before { content: "▌▍▌"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; letter-spacing: -1px; }
.scan-hint { font-size: 12px; color: var(--muted); }

/* login */
.login-body { margin: 0; }
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(160deg, #fff6ee 0%, #fde1ea 100%); }
.login-card { animation: sbPop .25s ease; background: #fff; border-radius: 20px; box-shadow: 0 18px 50px rgba(168,18,79,.16); padding: 34px 30px; width: 100%; max-width: 400px; }
@media (max-width: 400px) { .login-card { padding: 28px 20px; } }
.brand { text-align: center; font-size: 28px; font-weight: 900; color: var(--ink); letter-spacing: .4px; margin-bottom: 18px; }
.brand-mark { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; background: var(--gloss); color: #fff; font-size: 20px; letter-spacing: .5px; box-shadow: 0 6px 16px rgba(210,30,104,.3); }
.brand small { display: block; font-size: 14px; color: #7a8a8a; font-weight: 600; margin-top: 4px; }
.login-tabs { justify-content: center; }
.error-card { max-width: 560px; margin: 40px auto; }

/* print */
@media print {
  .sidebar, .topbar, .backdrop, .toasts, .page-head .actions, .noprint { display: none !important; }
  .main { margin: 0 !important; } .content { padding: 0; max-width: none; } body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; border-radius: 6px; break-inside: avoid; }
  th { position: static; }
  .tablewrap.more, .ktabs.more { -webkit-mask-image: none; mask-image: none; }
}

/* ---- login extras ---- */
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0 10px; } .or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.gbtn { display: flex; justify-content: center; min-height: 44px; margin-bottom: 8px; }

/* ---- language + pager ---- */
.sb-lang { display: flex; gap: 6px; padding: 6px 10px; } .sb-lang.center { justify-content: center; margin-top: 10px; }
.lang-pill { font-size: 11px; font-weight: 800; letter-spacing: .4px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); text-decoration: none; }
.lang-pill.on { background: var(--teal); border-color: var(--teal); color: #fff; } .lang-pill:hover { text-decoration: none; border-color: var(--teal); }
body.sb-collapsed .sb-lang { flex-direction: column; align-items: center; }
.pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 2px 0; font-size: 13px; color: var(--muted); }
.pager-btns { display: flex; gap: 4px; } .pager .btn.disabled { opacity: .4; pointer-events: none; } .pager-size { margin-left: auto; } .pager-size select { width: auto; padding: 6px 28px 6px 10px; font-size: 13px; }
@media (max-width: 1023px) { .pager-size select { font-size: 16px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- capture: photos + camera scanner ---- */
.photocap { border: 1px dashed var(--line-2); border-radius: 14px; padding: 10px 12px; margin: 10px 0; background: #fbfdfd; }
.photocap-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .photocap-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.photocap-btn { cursor: pointer; } .photocap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.photocap-tile { position: relative; margin: 0; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.photocap-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; } .photocap-tile figcaption { padding: 4px 6px; font-size: 11px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.photocap-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; cursor: pointer; }
.scan-wrap { display: flex; gap: 6px; align-items: center; } .scan-wrap input { flex: 1; } .scan-cam { flex: 0 0 auto; font-size: 18px; padding: 8px 10px; }
.scan-overlay { position: fixed; inset: 0; background: #000; color: #fff; z-index: 200; display: none; flex-direction: column; }
.scan-overlay.show { display: flex; } body.scan-open { overflow: hidden; }
.scan-top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; font-size: 16px; }
.scan-close { background: rgba(255,255,255,.15); border: 0; color: #fff; font-size: 18px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }
.scan-view { position: relative; flex: 1; min-height: 0; background: #000; } .scan-view video { width: 100%; height: 100%; object-fit: cover; }
.scan-box { position: absolute; left: 12%; right: 12%; top: 28%; height: 34%; border: 3px solid rgba(111,181,154,.95); border-radius: 14px; box-shadow: 0 0 0 2000px rgba(0,0,0,.35); pointer-events: none; }
.scan-bottom { padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; background: #111; }
.scan-manual { display: flex; gap: 8px; } .scan-manual input { flex: 1; background: #222; color: #fff; border-color: #444; } .scan-msg { color: #cfd8d6; min-height: 1.2em; }

/* phones: never let the page itself scroll sideways (sub-pixel rounding on some devices). clip, not hidden — hidden would turn <body>
   into a scroll container and nothing sticky (topbar, action bars, count-top) would stick; the html line is the fallback for old Safari */
@media (max-width: 1023px) { html { overflow-x: hidden; } html, body { overflow-x: clip; } .main { max-width: 100vw; } }

/* ---------- shared date selector (_DateRange) ---------- */
.drange { display: flex; flex-direction: column; gap: 4px; flex: 0 1 auto; min-width: 0; }
.toolbar > .drange { min-width: 0; }
.dr-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dr-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.dr-nav { border: 1px solid var(--line-2); background: var(--card, #fff); color: inherit; border-radius: 8px; width: 32px; height: 36px; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; flex: none; }
.dr-nav:hover { border-color: var(--teal); color: var(--teal-d); }
.dr-nav:disabled, .dr-nav.dr-off { opacity: .4; cursor: default; }   /* › at the boundary (nothing after today) */
.dr-nav:disabled:hover { border-color: var(--line-2); color: inherit; }
.drange .dr-select { width: auto; min-width: 150px; height: 36px; padding-top: 0; padding-bottom: 0; font-weight: 700; }
.dr-caption { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dr-custom { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.drange .dr-custom input { width: auto; height: 36px; }
.dr-dash { color: var(--muted); }

/* touch (no fine pointer, or any phone / tablet width): 44px targets */
@media (hover: none), (max-width: 1023px) {
  .dr-row { row-gap: 8px; }
  .dr-nav { width: 44px; height: 44px; }
  .drange .dr-select, .drange .dr-custom input { height: 44px; }
}
@media (max-width: 640px) {
  /* phone: ‹ [choice] › fill the line, the dates under it */
  .drange { flex: 1 1 100%; }
  .drange .dr-select { flex: 1 1 auto; min-width: 0; }
  .dr-caption { flex-basis: 100%; }
  .dr-custom { flex-basis: 100%; } .drange .dr-custom input { flex: 1 1 120px; min-width: 0; }
}

/* ---------- compact sidebar footer ---------- */
.sb-foot-compact { flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; }
.sb-me { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; color: inherit; padding: 4px 6px; border-radius: 8px; }
.sb-me:hover { background: var(--teal-wash); text-decoration: none; }
.sb-me .sb-lbl { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sb-me strong, .sb-me small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-me small { color: var(--muted); font-size: 11px; }
.sb-tools { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.sb-tools .sb-lang { padding: 0; gap: 4px; }
.sb-icon { border: 0; background: transparent; font-size: 16px; line-height: 1; cursor: pointer; padding: 5px 6px; border-radius: 6px; }
.sb-icon:hover { background: var(--teal-wash); }
.sb-icon-lbl { display: none; font-size: 13px; font-weight: 700; margin-left: 4px; }   /* the word "Sign out" — shown in the drawer, where a tooltip never appears */
body.sb-collapsed .sb-foot-compact { flex-direction: column; gap: 4px; }
body.sb-collapsed .sb-me .sb-lbl { display: none; }
body.sb-collapsed .sb-tools { flex-direction: column; }
body.sb-collapsed .sb-tools .sb-lang { flex-direction: column; }

/* ---------- touch targets (no fine pointer, or any phone / tablet width): the icon and pill controls the .btn rule does not reach ---------- */
@media (hover: none), (max-width: 1023px) {
  .sb-close, .sb-icon, .eye, .scan-cam { min-width: 44px; min-height: 44px; }
  .lang-pill, .ktabs a, .ktabs button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  .lang-pill { min-width: 44px; }
  .seg a, .seg label, .ot-suggest, .op-unscan { min-height: 44px; } .op-unscan { min-width: 44px; }
  .qlines .qline-btns span { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  .photocap-del { width: 34px; height: 34px; font-size: 14px; }
}

/* ---------- the menu stays put across page loads (browsers with cross-document view transitions) ---------- */
@view-transition { navigation: auto; }
#sidebar { view-transition-name: ckms-sidebar; }
/* reduced motion (WCAG 2.3.3): no page transition, and every animation or transition (toast / modal / login pop, drawer slide, stat lift) ends at once */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---- floor ---- */
.fl-big { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.fl-tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 16px; background: var(--card); border: 2px solid var(--teal); color: var(--ink); text-decoration: none; }
.fl-tile b { font-size: 20px; } .fl-tile:hover { text-decoration: none; background: var(--teal-wash); }
.fl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.fl-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 700; }
.fl-chip input { width: 20px; height: 20px; margin: 0; } .fl-chip:has(input:checked) { background: var(--teal-wash); border-color: var(--teal); color: var(--teal-d); }
.fl-end { display: flex; align-items: flex-end; }
.fl-box { display: flex; align-items: center; gap: 16px; padding: 14px; margin: 12px 0; border-radius: 16px; background: var(--teal-wash); }
.fl-boxno { font-size: 64px; line-height: 1; font-weight: 900; color: var(--teal-d); min-width: 90px; text-align: center; font-variant-numeric: tabular-nums; }
.fl-boxinfo { display: flex; flex-direction: column; gap: 4px; }
.fl-scanrow { display: flex; gap: 8px; } .fl-scanrow input { flex: 1; }
.fl-packs { list-style: none; margin: 10px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.fl-packs li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
/* floor session: step tabs, forms that sit in one row on a PC, the open box with its live count */
.fl-stats { margin-bottom: 12px; }
.fl-form { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 8px 0 14px; }
.fl-form > * { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.fl-form .fl-wide { flex: 1 1 18rem; --fw: 100%; }
.fl-form .fl-wide :is(input, select, textarea) { --fw: 100%; }
.fl-boxcount { margin-left: auto; display: flex; flex-direction: column; align-items: center; min-width: 84px; }
.fl-boxcount b { font-size: 44px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }
.fl-boxcount span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.fl-scanrow { position: relative; }
.scan-field:has(.fl-scanrow)::before { content: none; }
.fl-scanrow::before { content: "▌▍▌"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; letter-spacing: -1px; pointer-events: none; }
.fl-scanrow input { padding-left: 40px; font-size: 18px; min-height: 48px; }
tr.fl-cur td { background: var(--teal-wash); }
.fl-unboxed { margin: 6px 0 12px; } .fl-unboxed summary, .fl-staff summary { cursor: pointer; font-weight: 700; }

/* ---- compact density (PC screens) ----
   Rachel 19/09: "compact them so we can view more inside one page". Phones and tablets keep the 44 px touch sizes
   above; from 1024 px wide everything tightens: smaller type, padding and gaps, shorter controls, wider content.
   A mouse only (hover + fine pointer): a kitchen tablet in landscape is 1024 px or wider too and keeps the touch sizes. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  :root { --tb-h: 50px; --sb-w: 224px; }
  body { font-size: 14px; line-height: 1.4; }
  h1 { font-size: 19px; margin-bottom: 2px; } h2 { font-size: 14.5px; margin-bottom: 8px; } h3 { font-size: 13.5px; }
  .content { padding: 12px 16px 36px; max-width: 1680px; }
  .page-head { margin-bottom: 10px; gap: 8px; } .page-head p { margin: 0; font-size: 13px; }
  .card { padding: 12px 14px; margin-bottom: 10px; border-radius: 14px; }
  .grid2 { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
  .stats { gap: 8px; margin-bottom: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .stat { padding: 8px 12px; border-radius: 12px; } .stat .v { font-size: 22px; } .stat .k { font-size: 10.5px; }
  th, td { padding: 5px 9px; font-size: 13px; } th { font-size: 10.5px; }
  label { margin: 8px 0 3px; font-size: 12px; }
  input, select, textarea { padding: 6px 10px; font-size: 13.5px; border-radius: 8px; }
  .btn { padding: 6px 11px; font-size: 13px; border-radius: 9px; } .btn-lg { padding: 9px 14px; font-size: 14px; }
  .toolbar { gap: 6px; margin-bottom: 8px; }
  .sb-item { padding: 7px 10px; font-size: 13.5px; } .sb-group { padding: 10px 10px 3px; }
  .ktabs { margin-bottom: 10px; }
}
.kv > div { display: flex; gap: 8px; align-items: baseline; } .kv > div > span { color: var(--muted); font-weight: 700; min-width: 7em; }

/* ---- in-page tabs: <div data-tabs> <section data-tab="Name">…</section> … </div> (app.js builds the strip) ---- */
[data-tabs] [data-tab][hidden] { display: none !important; }
[data-tabs] .grid2, [data-tabs] .grid3 { display: block; } [data-tabs] .grid2 > *, [data-tabs] .grid3 > * { margin-bottom: 10px; }
@media print { [data-tabs] [data-tab][hidden] { display: block !important; } .ktabs[data-tabstrip] { display: none; } }

/* "More filters": rarely used filters folded into one control on list pages */
.more-filters > summary { cursor: pointer; font-weight: 700; padding: 8px 0; color: var(--teal-d); }
.more-filters[open] { flex-basis: 100%; } .more-filters > .toolbar { margin-top: 4px; }

/* "More": office tools folded out of a page's action row (details/summary, closes on an outside click in app.js) */
.more-menu { position: relative; display: inline-block; }
.more-menu > summary { list-style: none; cursor: pointer; } .more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.more-menu > div a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-weight: 700; text-decoration: none; }
.more-menu > div a:hover { background: var(--teal-wash); text-decoration: none; }

/* stock count: the manual count form folds under today's count */
.count-other > summary { cursor: pointer; } .count-other > summary h2 { display: inline; } .count-other[open] > summary { margin-bottom: 10px; }
.stock-totals > summary { cursor: pointer; font-weight: 700; color: var(--teal-d); margin: 4px 0 10px; }
.sys-tabs { margin-bottom: 12px; }   /* the System module's shared tab strip */
.eod-sched > summary { cursor: pointer; font-weight: 700; color: var(--muted); } .eod-sched[open] > summary { margin-bottom: 8px; }
.rp-files > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin: 2px 0 6px; }
/* Print labels: "print more" inline in the lot table; reprint / void side by side */
.fl-more { display: flex; gap: 6px; align-items: center; } .fl-more input { width: 124px; flex: 0 0 124px; }
.fl-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
/* "How to use this page" for staff who seldom use apps */
.howto { margin: 0 0 12px; padding: 10px 14px; border: 1px dashed color-mix(in srgb, var(--teal) 45%, transparent); border-radius: 12px; background: var(--teal-wash); }
.howto > summary { cursor: pointer; font-weight: 800; color: var(--teal-d); }
.howto ol { margin: 8px 0 2px; padding-left: 22px; display: grid; gap: 4px; font-size: 15px; line-height: 1.4; }
/* Label wording: the form beside the real stickers */
.lw-grid { display: grid; gap: 14px; margin-bottom: 14px; } .lw-grid > .card { margin: 0; }
@media (min-width: 1024px) { .lw-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .lw-side { position: sticky; top: calc(var(--tb-h, 56px) + 10px); } }
.lw-preview { display: flex; flex-wrap: wrap; gap: 14px; } .lw-preview figure { margin: 0; } .lw-preview figcaption { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.lw-count { font-weight: 600; color: var(--muted); font-size: 11.5px; } .lw-count.full { color: var(--red); }
.lw-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0; }
.lw-history { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 8px; }

/* ---------- theme F additions ---------- */
/* The ONE main action of a page: pink. Everything else is a plain or blue (selected) control. */
.btn-primary { background: var(--gloss); color: #fff; border-color: var(--pk-d); box-shadow: 0 2px 8px rgba(210,30,104,.25); }
.btn-primary:hover { filter: brightness(1.05); text-decoration: none; }
.money { font-family: var(--fd); letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.grid1 { display: grid; gap: 16px; max-width: 640px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.chip-ok { background: #e3f4ec; color: var(--green-text); } .chip-off { background: #fbe9e9; color: var(--red); } .chip-sel { background: var(--teal-wash); color: var(--teal-d); } .chip-warn { background: var(--yellow); color: #7a5200; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
/* theme-F tile markup: <div class="stat"><b>value</b><span>label</span></div> (the .stat box itself is declared once, above, next to .stats) */
.stat b { display: block; font-family: var(--fd); font-size: 30px; font-weight: 400; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 700; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.table-wrap table { min-width: 560px; }
/* ---------- lists: the way into a record ----------
   .row-link goes on the link in the first cell of a list (order number, member name, coupon code): bold, and on a phone or any touch
   screen a 44 px target that fills the cell's height (the 9 px cell padding is taken back), so the main way into a record is never the
   smallest thing on the page. The .btn rule covers buttons only. */
.row-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; max-width: 100%; }
@media (hover: none), (max-width: 1023px) { td .row-link { min-height: 44px; margin: -9px 0; padding: 0 6px 0 0; } }
/* ---------- phone: a main list (Orders, Members, Coupons) becomes one card per row instead of a sideways scroll ----------
   <div class="table-wrap cardtable"><table>: keep the <thead> (desktop and screen readers), give every secondary <td> a data-label="Column"
   (printed before the value on the card), and mark the cells that lead the card: class="cd-top" on the number / name cell, "cd-chip" on
   the status chip, "cd-sum" on the money. They sit on the card's first line, unlabelled, in that order, the money on the right. The whole
   card is the tap target: the .row-link stretches over its card. Taken from the Sales module's page-local .sl-cardtable, made generic. */
@media (max-width: 640px) {
  .cardtable { border: 0; background: transparent; overflow: visible; }
  .cardtable table { display: block; width: 100%; min-width: 0; background: transparent; }
  .cardtable thead { display: none; }
  .cardtable tbody { display: block; width: 100%; }
  .cardtable tr { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: 0 0 10px; padding: 10px 40px 10px 14px; min-height: 44px; box-shadow: var(--shadow-sm); }
  .cardtable tr:hover { background: #fff; }
  .cardtable td { display: block; flex: 1 1 100%; border: 0; padding: 0; white-space: normal; overflow-wrap: anywhere; text-align: left; font-size: 13.5px; }
  .cardtable td.num, .cardtable td.center { text-align: left; }   /* a labelled line reads left to right on a card (td.num is declared after this block) */
  .cardtable td:empty { display: none; }
  .cardtable td[data-label]::before { content: attr(data-label) ": "; font-weight: 800; color: var(--muted); margin-right: 4px; }
  .cardtable td.cd-top, .cardtable td.cd-chip, .cardtable td.cd-sum { flex: 0 1 auto; font-size: 15px; }
  .cardtable td.cd-top::before, .cardtable td.cd-chip::before, .cardtable td.cd-sum::before { content: none; }
  .cardtable td.cd-top { order: -3; } .cardtable td.cd-chip { order: -2; } .cardtable td.cd-sum { order: -1; margin-left: auto; text-align: right; }
  .cardtable tr:has(.row-link) { cursor: pointer; }
  .cardtable tr:has(.row-link)::after { content: "›"; position: absolute; right: 14px; top: 9px; font-size: 26px; line-height: 1; color: var(--muted); }   /* the chevron sits by the card's first line */
  .cardtable .row-link { min-height: 0; margin: 0; padding: 0; position: static; }
  .cardtable .row-link::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }   /* the whole card opens the record */
  .cardtable tr:has(.row-link:focus-visible) { outline: 3px solid var(--teal-d); outline-offset: 2px; }
  .cardtable .row-link:focus-visible { outline: none; box-shadow: none; }
  .cardtable tbody tr:last-child { margin-bottom: 0; }
}
/* ---------- empty state (_Empty partial): what is here, and the ONE thing to do next ---------- */
.empty { text-align: center; padding: 26px 16px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 14px; background: #fff; }
.empty .ic { font-size: 32px; line-height: 1; margin-bottom: 8px; }
.empty p { margin: 0 0 4px; font-weight: 700; color: var(--ink); }
.empty .actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.form-grid label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; min-height: 44px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 700; }
.check input { width: 22px; height: 22px; }
.hours { display: grid; grid-template-columns: 110px 1fr 1fr 70px; gap: 8px; align-items: center; }
@media (max-width: 480px) { .hours { grid-template-columns: 1fr 1fr; } .hours .day { grid-column: 1 / -1; font-weight: 800; } }
.opt-list { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 640px) { .content { padding: 14px 16px 40px; } h1 { font-size: 20px; } }
td.num, th.num { text-align: right; white-space: nowrap; }
a.stat { color: var(--ink); text-decoration: none; } a.stat:hover { border-color: var(--teal); }
.btn { min-height: 44px; }
a.back { display: inline-flex; align-items: center; min-height: 44px; }
.mt12 { margin-top: 12px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-end { display: flex; align-items: flex-end; }
.otp { font-size: 26px; font-weight: 800; letter-spacing: 2px; background: var(--teal-wash); border: 1px dashed var(--teal); border-radius: 12px; padding: 12px 16px; display: inline-block; user-select: all; }
.outlet-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 14px; margin-bottom: 12px; }
td.detail { font-family: ui-monospace, Consolas, monospace; font-size: 12px; max-width: 420px; word-break: break-word; }
.ticket { font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.35; background: #fffdf7; border: 1px dashed var(--line-2); border-radius: 12px; padding: 14px 16px; max-width: 34ch; white-space: pre; overflow-x: auto; }
/* 2-step verification (Pages/Account, Pages/Login2fa) */
.stack { display: flex; flex-direction: column; gap: 6px; max-width: 360px; margin: 8px 0 4px; }
.stack .btn { align-self: flex-start; }
.steps { margin: 0 0 12px 18px; padding: 0; } .steps li { margin-bottom: 4px; }
.qr { display: block; width: 240px; height: 240px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin: 4px 0 10px; }
.card-accent { border: 2px solid var(--gold); }
.recovery-codes { columns: 2; column-gap: 24px; margin: 8px 0 14px 18px; padding: 0; font-size: 16px; }
.recovery-codes li { margin-bottom: 6px; } .recovery-codes code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; user-select: all; }
.code-input { font-size: 22px; letter-spacing: 4px; text-align: center; }
details.recovery { margin: 10px 0; } details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--muted); }
@media (max-width: 420px) { .recovery-codes { columns: 1; } }
