/* Walk-in Count. Layout: one centered column; sticky header with tabs; on the
   report screen a sticky save bar at the bottom. Kitchen-label vernacular
   from the original app: condensed caps, masking-tape chips. */
:root {
  --bg: #f2f4f3;
  --surface: #ffffff;
  --sunk: #e6eae8;
  --ink: #18211e;
  --muted: #5b6763;
  --line: #d3dad7;
  --accent: #0e6a5b;
  --accent-ink: #ffffff;
  --accent-soft: #d7ebe6;
  --tape: #f3d77a;
  --tape-ink: #3d3210;
  --warn: #8a5208;
  --warn-soft: #f8e7cc;
  --crit: #b3261e;
  --crit-soft: #f6d9d6;
  --ok: #2c6e3f;
  --ok-soft: #dcefe0;
  --fill: #fff4c2;
  --series-a: #0e6a5b;
  --series-b: #c2620a;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111715; --surface: #19211e; --sunk: #222c29; --ink: #e7eeeb; --muted: #9aa8a3; --line: #2f3b37;
    --accent: #4fb8a2; --accent-ink: #08201b; --accent-soft: #1d3a34; --tape: #d9bd5c; --tape-ink: #2a2208;
    --warn: #e3a64f; --warn-soft: #3a2d17; --crit: #f08a80; --crit-soft: #3d1f1c; --ok: #7cc791; --ok-soft: #1c3324;
    --fill: #3b3415; --series-a: #4fb8a2; --series-b: #f0a050;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 980px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .03em; }
p { margin: 0; }
.muted { color: var(--muted); }
.tip { font-size: 13px; color: var(--muted); }
.label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* brand */
.brand { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.brand span { background: var(--tape); color: var(--tape-ink); padding: 0 6px; margin-left: 4px; transform: rotate(-1.5deg); display: inline-block; }

/* boot + login */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(100%, 380px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 16px; }
.login .brand { font-size: 34px; }
.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 400; font-size: 16px; color: var(--ink); min-width: 0; }

/* header */
header.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding-top: 12px; }
header.top .who { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
nav.tabs { display: flex; gap: 4px; width: 100%; overflow-x: auto; }
nav.tabs a { flex: 1 0 auto; text-align: center; font-weight: 600; color: var(--muted); padding: 10px 8px; border-bottom: 3px solid transparent; text-decoration: none; white-space: nowrap; }
nav.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
main { padding-block: 18px 120px; display: grid; gap: 16px; }
.view { display: grid; gap: 16px; min-width: 0; }

/* cards, buttons */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.btn { font-weight: 700; border: 0; border-radius: var(--radius); padding: 12px 18px; cursor: pointer; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.secondary { background: var(--sunk); color: var(--ink); }
.btn.ghost { background: none; color: var(--accent); padding: 6px 4px; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
:is(.btn, a, input, select, textarea, button, summary):focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > .grow { flex: 1 1 180px; }
.seg { display: inline-flex; background: var(--sunk); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
textarea.input { resize: vertical; font-size: 15px; line-height: 1.45; }
.notice { border-radius: var(--radius); padding: 12px 14px; font-size: 14px; display: grid; gap: 4px; }
.notice.err { background: var(--crit-soft); color: var(--crit); }
.notice.info { background: var(--accent-soft); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }
.spinner { width: 16px; height: 16px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--crit-soft); color: var(--crit); }
.pill.incomplete { background: var(--warn-soft); color: var(--warn); }
.pill.none { background: var(--sunk); color: var(--muted); }
.pill.tape { background: var(--tape); color: var(--tape-ink); }

/* report header */
.rhead { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); align-items: end; }
.quick { display: flex; gap: 6px; }
.mic { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; border: 2px solid var(--accent); color: var(--accent); background: var(--surface); border-radius: 999px; padding: 10px 18px; cursor: pointer; }
.mic[aria-pressed="true"] { background: var(--crit); border-color: var(--crit); color: var(--surface); }
.mic svg { width: 20px; height: 20px; }

/* product lines */
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tools input[type=search] { flex: 1 1 200px; }
.lines { display: grid; gap: 10px; }
.pl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 10px; min-width: 0; }
.pl.bad { border-color: var(--crit); }
.pl > header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl h3 { font-size: 16px; font-weight: 700; margin-right: auto; }
.unitsw button { padding: 3px 10px; font-size: 12px; }
.grp2 { display: grid; gap: 10px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grp { display: grid; gap: 6px; min-width: 0; }
.grp .label { display: flex; justify-content: space-between; gap: 8px; }
.cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cell { display: grid; gap: 2px; min-width: 0; }
.cell > span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell input { width: 100%; min-width: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 16px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.cell input.carry { color: var(--muted); border-style: dashed; }
.cell input.filled { background: var(--fill); }
.cell input.invalid { border-color: var(--crit); background: var(--crit-soft); }
.cell .ro { font-family: var(--mono); font-size: 16px; padding: 7px 8px; text-align: right; color: var(--muted); border-radius: 8px; background: var(--sunk); }
.cell small { font-size: 11px; color: var(--muted); text-align: right; min-height: 1.2em; }
.cell small.bad { color: var(--crit); font-weight: 600; }
.extra { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.extra .field { flex: 1 1 160px; }
.extra .field select, .extra .field input { font-size: 14px; padding: 7px 10px; }
@media (max-width: 420px) { .cells { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* save bar */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.savebar .wrap { display: flex; gap: 10px 14px; align-items: center; padding-block: 10px; flex-wrap: wrap; }
.savebar .counts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; align-self: center; margin-right: auto; font-size: 13px; }
.savebar .counts .pill { line-height: 1.4; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-wrap.tall { max-height: 30rem; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; white-space: nowrap; }
td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td .sub { font-size: 12px; color: var(--muted); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--sunk); }
td.bad { color: var(--crit); }
td input, td select { font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); width: 100%; min-width: 4rem; }
td input[type=checkbox] { width: auto; min-width: 0; }

/* dashboard */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; }
.kpi b { font-family: var(--display); font-size: 32px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi b.bad { color: var(--crit); }
.charts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.chart { position: relative; min-height: 220px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--body); }
.chart .grid { stroke: var(--line); }
.chart .axis { stroke: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.ttip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.15); padding: 6px 10px; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; z-index: 5; }
.ttip .d { color: var(--muted); }
.empty { text-align: center; padding: 28px 16px; display: grid; gap: 6px; justify-items: center; color: var(--muted); }
.empty .big { font: 700 20px var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--ink); }

/* language switch and save button detail */
.langsw button { padding: 4px 10px; font-size: 12px; letter-spacing: .04em; }
header.top .who { flex-wrap: wrap; justify-content: flex-end; }
.savefor { font-weight: 500; opacity: .85; }
.savefor:not(:empty)::before { content: " · "; }
#r-draft { display: flex; gap: 8px 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#r-draft[hidden] { display: none !important; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--crit); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live i { animation: none; } }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 8px; vertical-align: 0; }
.bar { position: relative; min-width: 120px; height: 20px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; background: var(--warn-soft); }
.bar span.bad { background: var(--crit-soft); }
.bar em { position: relative; font-style: normal; font-size: 12px; font-weight: 600; padding-left: 8px; line-height: 20px; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; cursor: pointer; }
.order-cell b { font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums; }
.order-cell b.zero { color: var(--muted); font-weight: 500; }
.order-cell .sub { display: block; white-space: nowrap; }
.order-cell .move { color: var(--accent); }
td.buy b { font-family: var(--mono); font-size: 17px; }
.moves { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* Photo entry */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
label.btn { cursor: pointer; display: inline-flex; align-items: center; }
label.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumbs figure { margin: 0; width: 76px; font-size: 11px; line-height: 1.2; text-align: center; color: var(--muted, #667); }
.thumbs img { width: 76px; height: 58px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; display: block; margin-bottom: 3px; }
.thumbs figure.ok img { border-color: #1b6b4f; }
.thumbs figure.bad img { border-color: #b3261e; }
.thumbs figure.wait img { opacity: .55; }

/* Previous days, on each product card */
details.prev { border-top: 1px solid var(--line); margin-top: 4px; }
details.prev summary { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 2px; font-weight: 600; font-size: 13px; color: var(--accent); cursor: pointer; list-style: none; }
details.prev summary::-webkit-details-marker { display: none; }
details.prev summary::after { content: "▾"; }
details.prev[open] summary::after { content: "▴"; }
.prev-wrap { overflow-x: auto; }
table.prevt { width: 100%; border-collapse: collapse; font: 500 12px var(--mono); margin-top: 6px; }
table.prevt th { font: 600 10px var(--body); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: right; padding: 4px 3px; border-bottom: 1px solid var(--line); background: none; }
table.prevt td { text-align: right; padding: 6px 3px; border-bottom: 1px solid var(--sunk); white-space: nowrap; }
table.prevt th:first-child, table.prevt td:first-child { text-align: left; }
table.prevt td:first-child button { font: 500 12px var(--body); color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
table.prevt tbody tr { cursor: pointer; }
table.prevt td.bad { color: var(--crit); font-weight: 700; }
table.prevt .g { border-left: 1px solid var(--line); }
.prev-note { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }

/* What needs attention, on the dashboard */
ul.attn { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
ul.attn li button { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 6px; font: inherit; color: var(--ink); cursor: pointer; }
ul.attn li button:hover { background: var(--sunk); }
ul.attn i { flex: 0 0 9px; height: 9px; border-radius: 50%; background: var(--muted); transform: translateY(-1px); }
ul.attn .l1 i { background: var(--crit); }
ul.attn .l2 i { background: var(--series-b); }
ul.attn .none { color: var(--muted); padding: 6px; }

/* ───────── restaurant switcher, Users screen ───────── */
.rest-switch { max-width: 12rem; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; }
.uhead { align-items: center; flex-wrap: wrap; }
.uhead h2 { margin: 0; }
.uform { margin: 12px 0; display: grid; gap: 10px; }
.uform h3 { margin: 0; }
.uform .tip { margin: 0; }
.uform .field small { display: block; margin-top: 4px; }
.ubranches { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 10px; margin: 0; display: grid; gap: 6px; }
.ubranches legend { padding: 0 4px; font-size: 13px; color: var(--muted); }
.ulist { display: grid; gap: 10px; margin-top: 12px; }
.ucard { display: grid; gap: 6px; }
.ucard .row { align-items: center; flex-wrap: wrap; gap: 6px; }
.ucard.off { opacity: .7; }
.ufacts { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.uacts { margin-top: 2px; }
code.temp { font-family: var(--mono); font-size: 16px; padding: 2px 8px; border-radius: 6px; background: var(--fill); user-select: all; }

/* ───────── passwords, My account ───────── */
.pwbox { position: relative; display: flex; }
.pwbox input { flex: 1; padding-right: 5.5rem; }
.pwtoggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--accent); font-weight: 600; font-size: 13px; padding: 8px 10px; cursor: pointer; }
.linkbtn { border: 0; background: none; padding: 6px 0; color: var(--accent); font-weight: 600; cursor: pointer; text-align: left; justify-self: start; }
.login h2 { margin: 4px 0 0; font-size: 20px; }
header.top a#who { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.acform { display: grid; gap: 10px; margin-top: 12px; max-width: 34rem; }
.acform h3, .acform p { margin: 0; }
