/* ============================================================================
   Number One | #01 — back office
   Brutalist, monochrome. One ink, one paper, one accent used by data only.
   Type: Archivo Black-adjacent (Archivo 800/900 condensed by tracking) + IBM Plex Mono.
   Geometry: hard corners, 2px rules, 20px gutters, 240px sidebar inside a 2px frame.
   ========================================================================== */
:root {
  --paper: #eeefef;
  --sheet: #fbfbfb;
  --ink: #111110;
  --ink-2: #4a4945;
  --ink-3: #6f6d67;
  --rule: #111110;
  --hair: #dddddd;
  --fill: #e6e7e7;
  --fill-2: #d3d5d5;
  --accent: #ff4d00;
  --accent-ink: #111110;
  --neg: #b3261e;  --positive: #1f6b3a; --negative: #b3261e;

  --appbar: 72px;
  --side: 244px;
  --gut: 20px;
  --pad: 28px;
  --fs-title: 34px;
  --fs-kpi: 30px;
  --fs-section: 15px;
  --fs-body: 14px;
  --fs-small: 12px;
  --chart-1: #111110; --chart-2: #111110; --chart-3: #111110; --chart-4: #111110;
  --chart-muted: #a8a9a9; --chart-neutral: #4a4945; --chart-mark: #111110; --chart-track: #c9c6bf;
  --chart-span: 0.06; --axis-ink: #4a4945; --ink: #111110;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  --mark: "Jost", "Futura", "Century Gothic", "Avenir Next", Avenir, sans-serif;
  --t-press: 40ms;
  --t-ui: 160ms;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
/* The shell fills the viewport; main, navigation and dialogs own their scroll. */
body {
  margin: 0; background: var(--paper); color: var(--ink);
  height: 100%; overflow: hidden;
  font: 400 var(--fs-body)/20px var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure, ul, ol, dl, dd, blockquote { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--sheet); font-weight: 700; }
.skip:focus { top: 8px; }

/* type helpers ------------------------------------------------------------- */
.num, td, th, dd, dt, table.t, .rank, .pay-list, .lead-strip, .chart, .chart svg, .hour-cols, .shift, .flow, .kv, .prod-card, .bar-row, .kpi-value, .lead-value .big, .rank-row .qty, .pay-row .val, .bar-row .vl, .tickline, .side-block .note, .band-head .note, .panel header .note, .queue-bar, .pager { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
strong, b, bold, .kpi-value small, .delta, .lead-strip dd small { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.display { font-weight: 800; letter-spacing: -0.03em; line-height: 0.95; }
.section-kicker { font: 600 12px/16px var(--font); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ============================ shell ========================================= */
.app { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
.appbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--appbar); flex: none;
  display: flex; align-items: stretch; gap: 0;
  background: var(--paper); border-bottom: 2px solid var(--rule);
}
.brand { display: flex; align-items: center; padding: 0 24px; flex: none; }
.brand-logo { display: flex; flex-direction: column; gap: 3px; justify-content: center; color: var(--ink); align-items: flex-start; }
/* the wordmark is set, not a picture: Jost 500 matches the logo's 1, #, N and O proportions (see README) */
.wm { display: flex; align-items: baseline; font-family: var(--mark); font-weight: 500; font-size: 23px; line-height: 1; white-space: nowrap; }
/* the bar sits where the original puts it: 0.30em after "One", 0.52em before "#01" */
.wm-bar { margin-left: 0.30em; margin-right: 0.52em; font-weight: 400; color: var(--ink); }
/* the tagline is a justified line: its last letter lands on the wordmark's right edge (JS sets the tracking) */
.wm-sub { font-family: var(--mark); font-weight: 500; font-size: 10.5px; line-height: 1; letter-spacing: 0.045em; white-space: nowrap; transform-origin: left center; }
.modes { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 0 14px; }
.mode {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px; border: 2px solid var(--ink);
  font-weight: 700; font-size: 13px; line-height: 1; background: transparent;
  transition: background var(--t-ui) ease, color var(--t-ui) ease, transform var(--t-press) ease;
}
.mode b { font: 500 11px/1 var(--mono); color: var(--ink-2); }
a.mode:hover { background: var(--ink); color: var(--sheet); }
a.mode:hover b { color: var(--fill-2); }
.mode:active { transform: translateY(2px); }
.mode[data-mode="settings"] { border: 2px solid transparent; border-bottom: 0; color: var(--ink-2); height: 100%; padding: 0 16px; }
.mode[data-mode="settings"]:hover { background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.mode[data-mode="settings"][aria-current="page"] { color: var(--ink); box-shadow: inset 0 -4px 0 var(--ink); }
.whoami { display: flex; flex-direction: column; justify-content: center; padding: 0 20px; border-left: 2px solid var(--rule); min-width: 150px; }
.whoami-name { font-weight: 700; line-height: 18px; }
.whoami-role { font: 500 11px/14px var(--mono); color: var(--ink-2); }
.whoami-dot { display: none; }
.menu-btn { display: none; }

.body { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }

/* sidebar ---------------------------------------------------------------- */
.sidebar {
  display: flex; flex-direction: column;
  background: var(--paper); border-right: 2px solid var(--rule);
  min-height: 0;
  overflow: auto; overscroll-behavior: contain; z-index: 25;
}
.side-head { display: none; }
.nav { padding: 14px 0 8px; }
.nav-group + .nav-group { border-top: 1px solid var(--hair); margin-top: 10px; padding-top: 10px; }
.nav-label { padding: 6px 18px 8px; font: 600 11px/14px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 18px; font-weight: 600; font-size: 13.5px; color: var(--ink);
  border-left: 4px solid transparent; position: relative;
  transition: background var(--t-ui) ease, border-color var(--t-ui) ease;
}
.nav-item .ic { color: var(--ink-2); flex: none; }
.nav-item:hover { background: var(--fill); }
.nav-item[aria-current="page"] { background: var(--ink); color: var(--sheet); border-left-color: var(--accent); }
.nav-item[aria-current="page"] .ic { color: var(--sheet); }
.nav-item .count {
  margin-left: auto; font: 600 11px/1 var(--mono); padding: 4px 6px 3px;
  border: 2px solid currentColor; min-width: 22px; text-align: center;
}
.side-foot { margin-top: auto; padding: 14px 18px 18px; border-top: 1px solid var(--hair); display: grid; gap: 10px; }
.side-status { display: flex; gap: 8px; align-items: flex-start; font: 500 11px/15px var(--mono); color: var(--ink-2); }
.side-status b { flex: none; width: 8px; height: 8px; margin-top: 3px; background: var(--ink); }
.side-link { font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.side-close { display: none; }
.scrim { display: none; }

/* sheet ------------------------------------------------------------------ */
.sheet {
  margin: 12px 12px 12px 0; background: var(--sheet);
  border: 2px solid var(--rule); min-width: 0; min-height: 0;
  overflow: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable;
  scroll-padding: var(--pad);
}
.sheet:focus { outline: none; }
.view { padding: var(--pad) var(--pad) 96px; }

/* ============================ page title ==================================== */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--gut); flex-wrap: wrap; padding-bottom: 16px; border-bottom: 2px solid var(--rule); }
.title-row h1 { font-size: var(--fs-title); margin-left: -2px; }
.title-row .sub { margin-top: 10px; color: var(--ink-2); max-width: 64ch; }
.title-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.queue-bar { display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 12px 0 0; font: 500 12px/16px var(--mono); color: var(--ink-2); }
.queue-bar b { color: var(--ink); font-weight: 600; }
.queue-bar .warn { color: var(--neg); }

/* buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border: 2px solid var(--ink); background: var(--sheet);
  font-weight: 700; font-size: 13px; line-height: 1; white-space: nowrap;
  transition: background var(--t-ui) ease, color var(--t-ui) ease, transform var(--t-press) ease;
}
.btn:hover { background: var(--ink); color: var(--sheet); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--ink); color: var(--sheet); }
.btn.quiet { border-color: var(--hair); background: transparent; font-weight: 600; color: var(--ink-2); }
.btn.quiet:hover { border-color: var(--ink); background: var(--fill); color: var(--ink); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.ink { background: var(--ink); color: var(--sheet); }
.btn.ink:hover { background: var(--sheet); color: var(--ink); }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 2px solid var(--ink); background: transparent; }
.icon-btn:hover { background: var(--ink); color: var(--sheet); }
.link { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; background: none; border: 0; padding: 0; font-size: inherit; }
.link:hover { color: var(--accent-ink); background: var(--accent); }

/* ============================ dashboard ==================================== */
.lead { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); border: 2px solid var(--rule); margin-top: var(--gut); background: var(--sheet); }
.lead-main { padding: 20px 24px 18px; min-width: 0; }
.lead-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lead-head .date { font: 500 12px/16px var(--mono); color: var(--ink-2); }
.lead-label { font-weight: 700; font-size: 14px; }
.lead-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 14px; margin-top: 6px; }
.lead-value .big { font-size: 46px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.lead-value .big small { font-size: 0.42em; font-weight: 700; letter-spacing: 0; margin-right: 4px; vertical-align: 0.55em; }
.lead-value .delta { font: 500 12px/16px var(--mono); color: var(--ink-2); }
.lead-caption { margin-top: 8px; color: var(--ink-2); font-size: 13.5px; }
.lead-caption b { color: var(--ink); }
.lead-chart { margin: 22px 0 0; padding-top: 12px; border-top: 2px solid var(--rule); flex: 1; display: flex; flex-direction: column; }
.lead-chart .chart { flex: 1; }
.lead-chart .chart > svg { height: 100%; }
.lead-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--rule); margin-top: 16px; }
.lead-strip > div { padding: 12px 16px 12px; border-left: 1px solid var(--hair); min-width: 0; }
.lead-strip > div:first-child { border-left: 0; }
.lead-strip dt { font-size: 12px; color: var(--ink-2); line-height: 16px; white-space: nowrap; }
.lead-strip dd { margin: 4px 0 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.lead-strip dd small { display: block; font: 500 11px/14px var(--mono); color: var(--ink-2); margin-left: 0; margin-top: 2px; letter-spacing: 0; white-space: nowrap; }
.lead-side { border-left: 2px solid var(--rule); display: flex; flex-direction: column; min-width: 0; }
.side-block { padding: 16px 20px; }
.side-block + .side-block { border-top: 2px solid var(--rule); }
.side-block header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.side-block h2 { font-size: 14px; font-weight: 700; }
.side-block .note { font: 500 11px/14px var(--mono); color: var(--ink-2); }
.walkin { display: flex; gap: 18px; align-items: center; }
.walkin-big { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 0.9; }
.walkin-big span { font-size: 15px; font-weight: 700; letter-spacing: 0; display: block; margin-top: 6px; color: var(--ink-2); }
.walkin-map { flex: 1; min-width: 0; }
.tickline { display: flex; align-items: center; gap: 10px; font: 500 12px/16px var(--mono); color: var(--ink-2); padding: 4px 0; }
.tickline .bar { height: 10px; background: var(--ink); flex: none; }
.tickline.acc .bar { background: var(--accent); }
.tickline b { color: var(--ink); }
.pay-list { display: grid; gap: 8px; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; }
.pay-row .name { font-weight: 600; font-size: 13px; }
.pay-row .val { font: 600 13px/18px var(--mono); text-align: right; }
.pay-row .track { grid-column: 1 / -1; height: 6px; background: var(--fill); display: flex; }
.pay-row .track i { display: block; height: 100%; background: var(--ink); }
.pay-row .track i.a { background: var(--accent); }
.pay-row .track i.g { background: var(--fill-2); }
.shift { display: grid; gap: 8px; }
.shift-row { display: grid; grid-template-columns: 96px minmax(0,1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.shift-row .who { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ini { width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--fill); font: 600 11px/1 var(--mono); }
.shift-row .span { font: 500 11px/16px var(--mono); color: var(--ink-2); text-align: right; white-space: nowrap; }
.shift-bar { height: 12px; background: var(--fill); position: relative; }
.shift-bar i { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: var(--ink); border-radius: 0; }
.shift-bar i.acc { background: var(--accent); }
.shift-axis { display: grid; grid-template-columns: 104px minmax(0,1fr) auto; gap: 10px; font: 500 11px/14px var(--mono); color: var(--ink-3); }
.shift-axis div:nth-child(2) { display: flex; justify-content: space-between; }

/* section + grid ----------------------------------------------------------- */
.band { margin-top: var(--gut); }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 0 10px; }
.band-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.015em; }
.band-head .note { font: 500 12px/16px var(--mono); color: var(--ink-2); }
.panel { border: 2px solid var(--rule); background: var(--sheet); min-width: 0; display: flex; flex-direction: column; }
.panel > header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 16px; border-bottom: 2px solid var(--rule); }
.panel > header h2 { font-size: 14px; font-weight: 700; }
.panel > header .note { font: 500 11px/14px var(--mono); color: var(--ink-2); }
.panel-body { padding: 14px 16px; flex: 1; min-width: 0; }
.panels-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gut); }
.panels-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gut); }
.panels-32 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--gut); }
.chart { position: relative; min-width: 0; }

/* ranking: row fill is the bar only in a one-figure list */
.rank { display: grid; gap: 2px; }
.rank-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--hair); }
.rank-row:last-child { border-bottom: 0; }
.rank-row .idx { font: 500 11px/1 var(--mono); color: var(--ink-3); }
.rank-row .nm { display: grid; gap: 4px; min-width: 0; }
.rank-row .nm b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .nm .bar { height: 4px; background: var(--fill); }
.rank-row .nm .bar i { display: block; height: 100%; background: var(--ink); }
.rank-row .qty { font: 600 13px/18px var(--mono); text-align: right; }
.rank-row .qty small { display: block; font-weight: 500; font-size: 11px; color: var(--ink-2); }
.rank-row.top .nm .bar i { background: var(--accent); }

/* tables ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border-top: 2px solid var(--rule); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { position: sticky; top: 0; z-index: 2; background: var(--sheet); height: 36px; padding: 0 12px; text-align: left; font: 600 11px/14px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--ink); white-space: nowrap; }
table.t th.n, table.t td.n { text-align: right; }
table.t td { height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--fill); }
table.t tfoot td { height: 42px; border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 700; background: var(--sheet); position: sticky; bottom: 0; }
table.t .id { font: 500 12px/16px var(--mono); }
table.t .sub { display: block; font: 500 11px/14px var(--mono); color: var(--ink-2); }
table.t .cell-strong { font-weight: 600; }
table.t button.link { font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 2px solid var(--rule); font: 500 12px/16px var(--mono); color: var(--ink-2); }
.pager .pages { display: flex; gap: 4px; }
.pager .pages button { min-width: 30px; height: 28px; border: 2px solid var(--ink); background: transparent; font: 600 12px/1 var(--mono); }
.pager .pages button:hover:not(:disabled) { background: var(--ink); color: var(--sheet); }
.pager .pages button[aria-current="true"] { background: var(--ink); color: var(--sheet); }
.pager .pages button:disabled { border-color: var(--hair); color: var(--ink-3); cursor: default; }

/* toolbar (filters) ------------------------------------------------------ */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 0; }
.field { display: grid; gap: 6px; }
.field > span { font: 600 11px/14px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.input, .select {
  height: 34px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 0; background: var(--sheet);
  font-size: 13px; min-width: 0;
}
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23111110'/%3E%3C/svg%3E"); background-position: calc(100% - 11px) 14px; background-size: 8px 5px; background-repeat: no-repeat; cursor: pointer; }
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.search { display: flex; align-items: center; gap: 8px; height: 34px; border: 2px solid var(--ink); background: var(--sheet); padding: 0 10px; }
.search input { border: 0; outline: 0; background: transparent; width: 220px; font-size: 13px; }
.search .ic { color: var(--ink-2); }
.seg { display: inline-flex; border: 2px solid var(--ink); height: 34px; }
.seg button { border: 0; border-left: 2px solid var(--ink); background: var(--sheet); padding: 0 12px; font-weight: 700; font-size: 12px; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.seg button:hover:not([aria-pressed="true"]) { background: var(--fill); }

/* tabs ------------------------------------------------------------------- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--ink); margin-top: var(--gut); overflow-x: auto; }
.tabs a { padding: 10px 16px 10px; font-weight: 700; font-size: 13px; color: var(--ink-2); border-right: 1px solid var(--hair); white-space: nowrap; }
.tabs a:hover { background: var(--fill); color: var(--ink); }
.tabs a[aria-selected="true"] { background: var(--ink); color: var(--sheet); }

/* KPI strip: one divided container -------------------------------------- */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 2px solid var(--rule); margin-top: var(--gut); background: var(--sheet); }
.kpi { padding: 14px 18px; min-width: 0; }
.kpi + .kpi { border-left: 2px solid var(--rule); }
.kpi-label { font: 600 11px/14px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.kpi-value { margin-top: 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; }
.kpi-value small { font-size: 0.55em; font-weight: 700; letter-spacing: 0; color: var(--ink-2); margin-left: 3px; }
.kpi .delta { margin-top: 6px; font: 500 11px/15px var(--mono); color: var(--ink-2); }
.kpi .delta.up, .lead-value .delta.up { color: var(--pos); }
.kpi .delta.down { color: var(--neg); }

/* pills & marks ---------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border: 1.5px solid var(--ink); font: 600 11px/1 var(--mono); white-space: nowrap; flex: none; }
.pill.acc { background: var(--accent); border-color: var(--ink); }
.pill.ink { background: var(--ink); color: var(--sheet); }
.pill.neg { color: var(--neg); border-color: var(--neg); }
.pill.warn { border-style: dashed; }
.dotb { display: inline-block; width: 8px; height: 8px; border: 1.5px solid var(--ink); }

/* drawer ----------------------------------------------------------------- */
body.drawer-open .sheet { overflow: hidden; }
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer[hidden] { display: none; }
.drawer::before { content: ""; position: absolute; inset: 0; background: rgba(17, 17, 16, 0.32); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%);
  background: var(--sheet); border-left: 2px solid var(--ink); overflow: auto;
  overscroll-behavior: contain; scrollbar-gutter: stable;
  animation: slide 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slide { from { transform: translateX(24px); opacity: 0.6; } }
.drawer-head { position: sticky; top: 0; z-index: 2; background: var(--sheet); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 2px solid var(--ink); }
.drawer-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.015em; }
.drawer-body { padding: 18px; display: grid; gap: 18px; }

/* receipt look ----------------------------------------------------------- */
.receipt { border: 2px solid var(--ink); background: var(--sheet); padding: 18px 18px 14px; }
.receipt .rh { text-align: center; display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 2px dashed var(--ink); }
.receipt .rh b { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.receipt .rh span { font: 500 11px/14px var(--mono); color: var(--ink-2); }
.receipt .rl { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 12px; padding: 6px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.receipt .rl > em { grid-column: 1 / -1; font: 500 11px/14px var(--mono); font-style: normal; color: var(--ink-2); }
.receipt .row2 { display: flex; justify-content: space-between; font: 500 12px/18px var(--mono); padding: 2px 0; }
.receipt .row2.total { padding-top: 10px; margin-top: 8px; border-top: 2px solid var(--ink); font-size: 15px; font-weight: 600; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--ink); border: 2px solid var(--ink); }
.kv > div { background: var(--sheet); padding: 10px 12px; }
.kv dt { font: 600 11px/14px var(--mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.kv dd { margin: 4px 0 0; font-weight: 700; font-size: 14px; }

/* first run: no records yet ------------------------------------------------ */
.start { border: 2px solid var(--rule); background: var(--sheet); padding: 26px 28px 28px; margin-top: var(--gut); display: grid; gap: 18px; }
.start h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; max-width: 22ch; }
.start p { max-width: 62ch; color: var(--ink-2); }
.start-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 2px solid var(--ink); margin-top: 4px; }
.start-step { padding: 14px 16px; border-left: 2px solid var(--ink); display: grid; gap: 6px; align-content: start; }
.start-step:first-child { border-left: 0; }
.start-step b { font: 600 11px/14px var(--mono); letter-spacing: 0.06em; color: var(--ink-2); }
.start-step strong { font-size: 15px; font-weight: 700; }
.start-step span { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.start-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 760px) { .start-steps { grid-template-columns: minmax(0, 1fr); } .start-step { border-left: 0; border-top: 2px solid var(--ink); } .start-step:first-child { border-top: 0; } }

/* empty & states --------------------------------------------------------- */
.empty { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; border: 2px dashed var(--fill-2); color: var(--ink-2); font-size: 13px; }
.notice { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 2px solid var(--ink); background: var(--fill); font-size: 13px; }

/* a field with its own suggestions (category) and a checkbox list (add-ons) */
.pick { position: relative; display: grid; gap: 6px; }
.pick .pick-hint { display: none; }
.pick .input { width: 100%; }
.pick-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 12; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--sheet); border: 2px solid var(--ink); max-height: 240px; overflow: auto; }
.pick-list li { padding: 7px 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.pick-list li[aria-selected="true"], .pick-list li:hover { background: var(--ink); color: var(--sheet); }
.pick-hint { font-size: 12px; line-height: 16px; color: var(--ink-2); }
.addon-list { border: 2px solid var(--ink); }
.chk { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--hair); font-size: 13px; cursor: pointer; }
.chk:last-child { border-bottom: 0; }
.chk input { appearance: none; width: 18px; height: 18px; flex: none; border: 2px solid var(--ink); background: var(--sheet); position: relative; cursor: pointer; }
.chk input:checked { background: var(--accent); }
.chk input:checked::after { content: "\2713"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 12px/1 var(--mono); color: var(--ink); }
.chk-name { font-weight: 600; }
.chk-price { margin-left: auto; font: 600 12px/1 var(--mono); color: var(--ink-2); }
.nav-item.sub { padding-left: 34px; height: 30px; font-size: 13px; font-weight: 500; }
.nav-item.sub .ic { width: 13px; height: 13px; }

/* variant rows in the product form: name, price, remove on one line */
.v-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 34px; gap: 10px; align-items: end; }
.v-row .icon-btn { margin-bottom: 2px; }
.variant-groups { display: grid; gap: 16px; }
.variant-group { border: 2px solid var(--ink); padding: 14px; display: grid; gap: 14px; min-width: 0; }
.variant-group-head { display: flex; gap: 12px; align-items: end; padding-bottom: 14px; border-bottom: 1px solid var(--hair); }
.variant-group-head .field { flex: 1; min-width: 0; }
.variant-items, .line-variants { display: grid; gap: 12px; min-width: 0; }
.variant-group > .btn { justify-self: start; }
@media (max-width: 640px) { .v-row { grid-template-columns: minmax(0, 1fr) 34px; } .v-row .field:nth-child(2) { grid-column: 1 / 2; } .v-row .icon-btn { grid-column: 2 / 3; grid-row: 1 / 2; } }

/* transaction lines: a menu, its variant, size, its add-ons and the custom add-on */
.line { border: 2px solid var(--ink); padding: 12px; background: var(--sheet); }
.line-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 88px; gap: 10px; }
.line-foot { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 12px; margin-top: 4px; }
.line-addons { border: 2px solid var(--ink); align-self: start; }
.line-side { display: grid; gap: 8px; }
@media (max-width: 760px) { .line-grid { grid-template-columns: minmax(0, 1fr); } .line-foot { grid-template-columns: minmax(0, 1fr); } }

/* products --------------------------------------------------------------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gut); }
.prod-card { border: 2px solid var(--ink); background: var(--sheet); display: grid; }
.prod-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 14px; border-bottom: 2px solid var(--ink); }
.prod-card h3 { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; line-height: 19px; }
.prod-card .sku { font: 500 11px/14px var(--mono); color: var(--ink-2); margin-top: 4px; }
.prod-card .var-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--hair); font-size: 13px; }
.prod-card .var-row:last-child { border-bottom: 0; }
.prod-card .var-row .price { font: 600 13px/18px var(--mono); }

/* materials -------------------------------------------------------------- */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; background: var(--ink); border: 2px solid var(--ink); }
.flow > div { background: var(--sheet); padding: 12px 14px; }
.flow dt { font: 600 11px/14px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.flow dd { margin: 4px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.bar-row { display: grid; grid-template-columns: minmax(0,1fr) 52px; gap: 3px 10px; align-items: center; padding: 6px 0; }
.bar-row .nm { font-weight: 600; font-size: 13px; }
.bar-row .vl { font: 600 12px/16px var(--mono); text-align: right; }
.bar-row .track { grid-column: 1 / -1; height: 6px; background: var(--fill); }
.bar-row .track i { display: block; height: 100%; background: var(--ink); }
.bar-row.low .track i { background: var(--accent); }
.bar-row.low .vl { color: var(--neg); }

/* settings --------------------------------------------------------------- */
.setting { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: var(--gut); padding: 18px 0; border-bottom: 2px solid var(--rule); }
.setting:last-child { border-bottom: 0; }
.setting h3 { font-size: 15px; font-weight: 800; }
.setting p { margin-top: 6px; color: var(--ink-2); font-size: 13px; }
.setting-panel { display: grid; gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13.5px; font-weight: 600; }
.switch { appearance: none; width: 40px; height: 22px; border: 2px solid var(--ink); background: var(--sheet); position: relative; flex: none; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--ink); transition: transform var(--t-ui) ease; }
/* an active switch is the one high-contrast mark: the accent with an ink border and a white knob */
.switch:checked { background: var(--accent); border-color: var(--ink); }
.switch:checked::after { transform: translateX(18px); background: var(--sheet); border: 1px solid var(--ink); }
.switch:checked:hover { background: var(--accent); filter: none; }
.switch:hover { border-color: var(--ink); }
.switch:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* toasts ----------------------------------------------------------------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--sheet); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--accent); padding: 10px 14px; font-weight: 600; font-size: 13px; animation: toastIn 160ms ease; }
.toast b { font: 600 11px/1 var(--mono); color: var(--accent); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ============================ responsive ================================== */
@media (max-width: 1180px) {
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead-side { border-left: 0; border-top: 2px solid var(--rule); }
  .lead-side { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .side-block + .side-block { border-top: 0; border-left: 2px solid var(--rule); }
  .panels-3 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .panels-3 > :nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  :root { --side: 0px; --pad: 18px; --fs-title: 28px; }
  .body { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh; width: min(320px, 86vw);
    transform: translateX(-102%); transition: transform var(--t-ui) ease; z-index: 50; border-right: 2px solid var(--rule);
  }
  .sidebar.open { transform: none; }
  .side-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 2px solid var(--rule); }
  .side-scope { font-weight: 800; }
  .side-close { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--ink); background: transparent; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(17,17,16,0.35); z-index: 45; }
  .scrim[hidden] { display: none; }
  .menu-btn { display: inline-grid; place-items: center; width: 64px; border: 0; border-right: 2px solid var(--rule); background: transparent; }
  .menu-btn:hover { background: var(--fill); }
  .brand { padding: 0 14px; }
  .wm { font-size: 19px; }
  .wm-sub { font-size: 9px; }
  .sheet { margin: 0; border-left: 0; border-right: 0; border-bottom: 0; min-height: 0; }
  .view { padding: var(--pad) var(--pad) 72px; }
  .lead-chart-head { flex-direction: column; align-items: flex-start; gap: 0; }
  .lead-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lead-strip > div:nth-child(3) { border-left: 0; }
  .lead-strip > div:nth-child(n+3) { border-top: 1px solid var(--hair); }
  .panels-2, .panels-32 { grid-template-columns: minmax(0, 1fr); }
  .modes .mode b { display: none; }
    .whoami { display: none; }
  .setting { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  :root { --pad: 20px; --gut: 14px; --fs-title: 26px; --appbar: 56px; }
  .mode[data-mode="settings"] { display: none; }
  .mode { padding: 0 10px; }
  .title-row h1 { font-size: 26px; }
  .lead-main { padding: 16px; }
  .lead-value .big { font-size: 36px; }
  .lead-side { grid-template-columns: minmax(0,1fr); }
  .side-block + .side-block { border-left: 0; border-top: 2px solid var(--rule); }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kpi + .kpi { border-left: 0; }
  .kpi:nth-child(2n) { border-left: 2px solid var(--rule); }
  .kpi:nth-child(n+3) { border-top: 2px solid var(--rule); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .panels-3 { grid-template-columns: minmax(0,1fr); }
  .panels-3 > :nth-child(3) { grid-column: auto; }
  .search input { width: 100%; }
  .search { flex: 1 1 100%; }
  .toolbar .field { flex: 1 1 46%; }
  .toolbar .field .select, .toolbar .field .input { width: 100%; }
  .flow { grid-template-columns: minmax(0,1fr); }
  /* tables become two-line rows */
  table.t thead { display: none; }
  table.t, table.t tbody, table.t tr, table.t td, table.t tfoot { display: block; }
  table.t tr { padding: 10px 0; border-bottom: 1px solid var(--hair); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; }
  table.t td { height: auto; padding: 0 14px; border: 0; }
  table.t td.n { text-align: right; }
  table.t td:first-child { grid-column: 1 / -1; }
  table.t td[data-l]::before { content: attr(data-l) " · "; font: 500 11px/14px var(--mono); color: var(--ink-3); }
  table.t tfoot tr { display: flex; justify-content: space-between; border-top: 2px solid var(--ink); }
  table.t tfoot td { padding: 10px 14px; }
  .drawer-panel { width: 100%; border-left: 0; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

/* ---------------- structured type: no strays off the grid ------------------ */
h1, h2, h3, .lead, .panel, .kpi, .rank-row, .shift-row, .pay-row, .bar-row, .flow dd {
  font-stretch: 100%; font-feature-settings: "ss01" 0; letter-spacing: normal; word-spacing: normal;
}
.display, .lead-value .big, .walkin-big, .kpi-value, .panel h2, .band-head h2, .title-row h1 {
  font-feature-settings: "zero" 0;
}

.lead-main { display: flex; flex-direction: column; }
.lead-strip { margin-top: auto; }
.side-block.tight { padding: 12px 20px 14px; }
.side-block.tight header { margin-bottom: 6px; }
.shift-total { font-size: 13px; line-height: 20px; }
.shift-total b { font-size: 18px; letter-spacing: -0.02em; }
.shift-note { margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.lead-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.lead-chart-head h2 { font-size: 13px; font-weight: 700; }
.lead-chart-head .note { font: 500 11px/14px var(--mono); color: var(--ink-2); }
.short-note { border: 2px dashed var(--fill-2); padding: 14px 16px; font-size: 13px; line-height: 19px; color: var(--ink-2); }
/* the hour shape: columns on one baseline, the peak in the accent */
.hour-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; align-items: end; height: 132px; margin-top: 6px; }
/* one or two hours are not a shape: the bar stops at a readable width */
.hour-cols:has(.hc:only-child) { grid-auto-columns: minmax(0, 28px); justify-content: start; }
.hc i { transition: height var(--t-ui) ease; }
.hc { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 4px; height: 100%; }
.hc i { display: block; background: var(--ink); min-height: 3px; }
.hc.acc i { background: var(--accent); }
.hc:only-child i { background: var(--ink-2); }
.hc.acc i { background: var(--accent); }
.hc b { font: 500 12px/16px var(--mono); color: var(--ink-2); text-align: center; }
.hc.acc b { color: var(--ink); font-weight: 600; }


/* Product ledger table list view */
.prod-table td { vertical-align: top; padding: 12px; }
.prod-table .menu-cell { display: flex; flex-direction: column; gap: 4px; }
.prod-table .menu-title { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.35; text-decoration: none; }
.prod-table .menu-title:hover { color: var(--accent); text-decoration: underline; }
.var-list-block { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.var-group-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; line-height: 1.4; }
.var-group-badge { font-weight: 700; color: var(--ink); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.var-chips-wrap { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.var-chip { display: inline-flex; align-items: center; padding: 1px 7px; background: var(--fill); border: 1px solid var(--rule); border-radius: 3px; font-size: 11.5px; font-family: var(--mono); color: var(--ink); }
.var-chip .delta { margin-left: 4px; font-weight: 600; color: var(--ink-2); }
.addon-chips-wrap { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; }
.addon-chip { display: inline-flex; align-items: center; padding: 1px 6px; background: transparent; border: 1px dashed var(--rule); border-radius: 3px; font-size: 11px; font-family: var(--mono); color: var(--ink-2); }
