/* Ferculon - one stylesheet for every web screen (sign-in, back office, kitchen display, table
   ordering, online ordering). Same family as Lakaz Fresh: warm market-paper ground, deep forest,
   Hanken Grotesk throughout (no serif), semibold for headlines and figures. Calmer and flatter than
   the storefront because it is a tool used for hours: hairlines instead of shadows, colour only for
   state. Controls are soft squares (4-5px); only status dots are round. */

:root {
  --ground: #F4F1E8; --surface: #FFFFFF; --surface-2: #F8F6F0; --surface-3: #EEEADF; --surface-4: #E4DFD1;
  --ink: #14201A; --ink-soft: #37443B; --ink-muted: #5F6A60; --ink-faint: #8F978C;
  --line: #E5E0D3; --line-strong: #D2CBBB;
  --forest: #0F3322; --forest-2: #174A31; --brand: #12503A; --brand-2: #1E7A4E; --leaf: #2CA45A; --mint: #6FCE8F; --wash: #E4F1E7;
  --accent: #EE7B30; --accent-press: #D9671E; --accent-soft: #FBE7D3; --accent-ink: #8A3F0E;
  --lagoon: #12897F; --lagoon-soft: #D8EEEC; --gold: #B9812A; --gold-soft: #F3E9D2;
  --danger: #C2412D; --danger-soft: #FBE4DF; --info: #2B6CB0; --info-soft: #E3EEFA;
  --s-free: var(--surface); --s-seated: var(--lagoon); --s-cooking: var(--gold); --s-ready: var(--leaf); --s-eating: var(--brand-2); --s-bill: var(--accent); --s-attention: var(--danger);
  --display: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif; --sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-xs: 3px; --r: 4px; --r-card: 5px;
  --shadow: 0 1px 0 rgba(20, 32, 26, .04), 0 10px 30px -18px rgba(18, 40, 28, .22);
  --shadow-lift: 0 24px 60px -24px rgba(18, 40, 28, .35);
  color-scheme: light;
}
[data-theme="dark"] {
  --ground: #0B1310; --surface: #121D17; --surface-2: #15221B; --surface-3: #1B2B22; --surface-4: #233629;
  --ink: #E9F1E9; --ink-soft: #C9D6CC; --ink-muted: #A5B7AB; --ink-faint: #7E9186;
  --line: #213028; --line-strong: #2E4034;
  --brand: #1A6A48; --brand-2: #57B584; --leaf: #4CC27A; --wash: #1A3326;
  --accent: #F2913D; --accent-soft: #33251A; --accent-ink: #F7C79A;
  --lagoon: #3EB6AB; --lagoon-soft: #17302D; --gold: #D2A24E; --gold-soft: #30281A;
  --danger: #F07762; --danger-soft: #3A1E19; --info: #7DB3F0; --info-soft: #1A2838;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .03); --shadow-lift: 0 24px 60px -20px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand-2); width: 16px; height: 16px; }
.ico { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; flex: none; }
.ico.sm { width: 15px; height: 15px; } .ico.lg { width: 22px; height: 22px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); } .faint { color: var(--ink-faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.stack > *, .grid-2 > *, .grid-2e > *, .grid-3 > *, .kpis > * { min-width: 0; }

/* ── Type ── */
.display { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
.display em, h1 em, h2 em { font-style: normal; font-weight: inherit; color: var(--brand-2); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
h1 { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.12; letter-spacing: -.02em; }
h2 { font-size: 16px; } h3 { font-size: 15px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.figure { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums lining-nums; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid transparent; font-weight: 650; font-size: 14px; letter-spacing: -.005em; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .08s; user-select: none; }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 17px; height: 17px; stroke-width: 2; }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-2); }
[data-theme="dark"] .btn-primary { background: var(--brand); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-press); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-faint); }
.btn-quiet { background: transparent; color: var(--ink-soft); }
.btn-quiet:hover { background: var(--surface-3); }
.btn-soft { background: var(--wash); color: var(--brand-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-icon { width: 36px; padding: 0; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-block { width: 100%; }
.link { color: var(--brand-2); font-weight: 650; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Fields ── */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 650; color: var(--ink-soft); }
.field small { color: var(--ink-faint); font-size: 12px; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 12px; font-size: 14.5px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent); }
.input-prefix { position: relative; } .input-prefix > b { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-weight: 600; color: var(--ink-faint); font-size: 14px; } .input-prefix .input { padding-left: 38px; }
.search { position: relative; } .search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); } .search .input { padding-left: 36px; height: 38px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--r-card); }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink-muted); font-weight: 650; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.switch { position: relative; display: inline-block; vertical-align: middle; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: var(--r); background: var(--surface-4); transition: background .18s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: var(--r-xs); background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .18s; }
.switch input:checked + i { background: var(--brand-2); }
.switch input:checked + i::after { transform: translateX(16px); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--ink-soft); font-size: 12px; font-weight: 650; white-space: nowrap; }
.chip.good { background: var(--wash); color: var(--brand-2); } .chip.warn { background: var(--gold-soft); color: var(--gold); }
.chip.bad { background: var(--danger-soft); color: var(--danger); } .chip.hot { background: var(--accent-soft); color: var(--accent-ink); }
.chip.info { background: var(--lagoon-soft); color: var(--lagoon); } .chip.ink { background: var(--forest); color: #fff; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card-head h2 { font-size: 15px; }
.card-head .ico { color: var(--ink-faint); }
.card-body { padding: 16px 18px 18px; }
.card-foot { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; gap: 10px; align-items: center; }

/* ── App shell (back office) ── */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--forest); color: #DDE9DF; padding: 16px 12px; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; text-decoration: none; }
.side-brand svg { width: 26px; height: 26px; }
.side-brand b { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
/* The wordmark, as the logo pack sets it: lowercase, Hanken Grotesk Bold, tight. */
.wordmark { font-family: 'Hanken Grotesk', var(--display); font-weight: 700 !important; letter-spacing: -.035em !important; text-transform: none; }
.side-brand small { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); font-weight: 700; margin-top: -2px; }
.venue { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: var(--r-card); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); color: #fff; text-align: left; }
.venue:hover { background: rgba(255, 255, 255, .1); }
.venue-mark { width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 15px; color: #fff; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.venue b { display: block; font-size: 14px; line-height: 1.2; } .venue small { color: #9FB9A8; font-size: 12px; }
.venue .ico { margin-left: auto; color: #9FB9A8; }
.nav { display: grid; gap: 2px; margin-top: 18px; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #7FA08B; font-weight: 700; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: var(--r); color: #C8D9CD; text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: #F4F1E8; color: var(--forest); }
.nav a .count { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 1px 6px; border-radius: var(--r-xs); background: var(--accent); color: #fff; }
.side-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot a, .side-foot button { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: var(--r); color: #9FB9A8; text-decoration: none; font-weight: 600; font-size: 13.5px; background: none; border: 0; text-align: left; }
.side-foot a:hover, .side-foot button:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 18px 32px 16px; background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.top h1 { font-size: 26px; }
.top .sub { color: var(--ink-muted); font-size: 13.5px; margin-top: 2px; }
.page { padding: 8px 32px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.burger { display: none; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--ink-muted); }
.live .dot { color: var(--leaf); box-shadow: 0 0 0 0 color-mix(in srgb, var(--leaf) 50%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ── KPIs ── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; display: grid; gap: 8px; }
.kpi .eyebrow { display: flex; align-items: center; gap: 7px; }
.kpi .delta { font-size: 12.5px; font-weight: 650; color: var(--ink-muted); display: flex; gap: 6px; align-items: center; }
.kpi .delta.up { color: var(--brand-2); } .kpi .delta.down { color: var(--accent-ink); }
[data-theme="dark"] .kpi .delta.down { color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.grid-2e { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
/* Cards side by side end level: each card in a row takes the row's height, and a closing note sits at its foot. */
.grid-2 > .card, .grid-2e > .card, .grid-3 > .card { display: flex; flex-direction: column; }
.grid-2 > .card > .card-foot, .grid-2e > .card > .card-foot, .grid-3 > .card > .card-foot { margin-top: auto; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

/* The AI brief: a paper card with a quiet sparkle, each point a line with a status dot. */
.brief { position: relative; overflow: hidden; background: var(--forest); color: #E6F0E8; border: 0; }
.brief::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 100% 0%, rgba(111, 206, 143, .16), transparent 55%); pointer-events: none; }
.brief > * { position: relative; }
.brief .card-head { padding-top: 18px; } .brief .card-head h2 { color: #fff; font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.brief .card-head .ico { color: var(--mint); }
.brief-tag { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mint); display: inline-flex; gap: 6px; align-items: center; }
.brief ul { list-style: none; margin: 0; padding: 6px 18px 18px; display: grid; gap: 2px; }
.brief li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 14px; line-height: 1.45; color: #D7E5DB; }
.brief li:first-child { border-top: 0; }
.brief li .dot { margin-top: 7px; }
.brief li.good .dot { color: var(--mint); } .brief li.warn .dot { color: #F6C453; } .brief li.info .dot { color: #9FB9A8; }

/* Bars (sales by hour, by day): plain divs, the value on hover. */
.bars { display: flex; align-items: flex-end; gap: 6px; padding-top: 22px; }
.bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-width: 0; }
.bars i { display: block; border-radius: var(--r-xs) var(--r-xs) 0 0; background: var(--surface-4); min-height: 3px; transition: background .15s; position: relative; }
.bars > div:hover i { background: var(--brand-2); }
.bars > div.peak i { background: var(--forest); }
[data-theme="dark"] .bars > div.peak i { background: var(--brand-2); }
.bars span { height: 15px; line-height: 15px; font-size: 11px; color: var(--ink-faint); text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.bars i::after { content: attr(data-v); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--ink); white-space: nowrap; opacity: 0; transition: opacity .12s; }
.bars > div:hover i::after { opacity: 1; }

.meter { height: 6px; border-radius: var(--r-xs); background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--brand-2); border-radius: var(--r-xs); }
.meter.warn > i { background: var(--gold); } .meter.bad > i { background: var(--danger); }

/* ── Data tables ── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.data td { padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr.click { cursor: pointer; }
table.data tbody tr.click:hover { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .ref { font-weight: 700; font-variant-numeric: tabular-nums; }
/* ── Tables that fit: a row becomes a small card when the columns do not fit the box ──
   pos-core.js (POS.fitTables) adds .cards to a table wider than its box, at any window width, and
   names each value after its column. A phone gets cards for the tables built for them (.resp). */
table.data.cards thead { display: none; }
table.data.cards, table.data.cards tbody, table.data.cards tr, table.data.cards td { display: block; width: 100%; }
table.data.cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
table.data.cards tbody tr:last-child { border-bottom: 0; }
table.data.cards td { padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
table.data.cards td.num { text-align: right; white-space: normal; }
table.data td.acts { white-space: nowrap; }
table.data.cards td.acts { grid-column: 1 / -1; text-align: left; white-space: normal; }
table.data.cards td.acts .btn { margin: 4px 6px 0 0; }
table.data.cards td:first-child, table.data.cards td.wide { grid-column: 1 / -1; }
table.data.cards td.hide-sm, table.data.cards td.hide-md { display: none; }
table.data.cards td[data-l]:not([data-l=""])::before { content: attr(data-l) ' '; color: var(--ink-faint); font-size: 12px; font-weight: 600; }
table.data.cards tfoot { display: block; }
table.data.cards tfoot tr { grid-template-columns: minmax(0, 1fr) auto; }
.t-name { font-weight: 650; } .t-sub { font-size: 12.5px; color: var(--ink-muted); }

.empty { display: grid; justify-items: center; gap: 8px; padding: 42px 20px; text-align: center; color: var(--ink-muted); }
.empty .ico { width: 30px; height: 30px; color: var(--ink-faint); }
.empty b { color: var(--ink); font-size: 15px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Category list (menu) */
.catrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border: 0; background: none; border-radius: var(--r); font-weight: 600; font-size: 14px; text-align: left; color: var(--ink-soft); }
.catrow:hover { background: var(--surface-2); }
.catrow.on { background: var(--wash); color: var(--brand-2); }
@media (max-width: 900px) { .menu-layout { grid-template-columns: minmax(0, 1fr) !important; } }

/* ── Modal (edits happen here, with an always-visible Save) ── */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(14, 30, 22, .42); display: grid; place-items: center; padding: 24px; opacity: 0; transition: opacity .18s; }
.scrim.in { opacity: 1; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-lift); transform: translateY(10px) scale(.99); transition: transform .2s; }
.scrim.in .modal { transform: none; }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-card) var(--r-card); }

/* Side panel (order detail): slides in from the right. */
.panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(480px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lift); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
.panel.in { transform: none; }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.panel-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: var(--r-card); background: var(--forest); color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lift); opacity: 0; transform: translateY(8px); transition: all .2s; }
.toast.in { opacity: 1; transform: none; }
.toast.error { background: var(--danger); }
.toast .ico { color: var(--mint); } .toast.error .ico { color: #fff; }

/* ── Receipt (a paper slip) ── */
.slip { background: #FFFEFA; color: #1C1C1C; border: 1px solid var(--line); border-radius: var(--r-xs); padding: 18px 18px 22px; font-size: 13px; position: relative; }
[data-theme="dark"] .slip { background: #F4F1E8; }
.slip h4 { text-align: center; font-family: var(--display); font-size: 17px; }
.slip .c { text-align: center; color: #666; font-size: 12px; }
.slip .ln { display: flex; gap: 10px; justify-content: space-between; padding: 3px 0; }
.slip .ln small { display: block; color: #777; font-size: 11.5px; }
.slip hr { border: 0; border-top: 1px dashed #BDB7A8; margin: 10px 0; }
.slip .tot { font-weight: 800; font-size: 15px; }

/* ── Floor plan ── */
.floor-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.floor { position: relative; width: 100%; aspect-ratio: 1000 / 620; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 20px 20px; background-position: 10px 10px; }
.tbl { position: absolute; display: grid; place-items: center; text-align: center; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-card); transform: translate(-50%, -50%); transition: box-shadow .15s, border-color .15s, background .15s; user-select: none; }
.tbl.round { border-radius: 50%; }
.tbl b { font-family: var(--display); font-size: 17px; line-height: 1; font-weight: 600; letter-spacing: -.02em; }
.tbl small { display: block; font-size: 10.5px; font-weight: 700; color: var(--ink-muted); margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .seats { position: absolute; inset: -9px; pointer-events: none; }
.tbl[data-s="seated"], .tbl[data-s="ordering"], .tbl[data-s="ready"], .tbl[data-s="bill"], .tbl[data-s="attention"] { border-color: transparent; color: #fff; }
.tbl[data-s="seated"] small, .tbl[data-s="ordering"] small, .tbl[data-s="ready"] small, .tbl[data-s="bill"] small, .tbl[data-s="attention"] small { color: rgba(255, 255, 255, .85); }
.tbl[data-s="seated"], .tbl[data-s="ordering"] { background: var(--lagoon); }
/* Solid when someone is needed; a soft tint while things are simply in progress. */
.tbl[data-s="cooking"] { background: var(--gold-soft); color: var(--ink); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.tbl[data-s="cooking"] small { color: var(--gold); }
.tbl[data-s="ready"] { background: var(--leaf); animation: glow 1.6s infinite; }
.tbl[data-s="eating"] { background: var(--wash); color: var(--ink); border-color: color-mix(in srgb, var(--brand-2) 35%, transparent); }
.tbl[data-s="eating"] small { color: var(--brand-2); }
.tbl[data-s="bill"] { background: var(--accent); }
.tbl[data-s="attention"] { background: var(--danger); animation: glow 1.2s infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 0%, rgba(255, 255, 255, 0)), 0 0 0 6px rgba(44, 164, 90, .18); } }
.tbl.edit { cursor: grab; } .tbl.edit:active { cursor: grabbing; }
.tbl.sel { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: var(--r-xs); display: inline-block; }

/* QR sheet: printable table cards. */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.qr-card { padding: 16px; display: grid; justify-items: center; gap: 8px; text-align: center; }
.qr-card svg { width: 132px; height: 132px; }
.qr-card b { font-family: var(--display); font-size: 22px; letter-spacing: -.02em; }
@media print {
  .side, .top, .no-print { display: none !important; }
  .shell { display: block; } .page { padding: 0; }
  .qr-card { break-inside: avoid; border: 1px solid #ccc; }
}

/* ── Sign-in ── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; background: var(--forest); color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(90% 70% at 100% 0%, rgba(111, 206, 143, .14), transparent 60%); pointer-events: none; }
.auth-art h1 { font-size: 52px; line-height: 1.02; max-width: 560px; color: #fff; position: relative; z-index: 1; }
.auth-art h1 em { color: var(--mint); }
.auth-art p { color: #BFD3C6; max-width: 460px; font-size: 16px; position: relative; z-index: 1; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: min(380px, 100%); display: grid; gap: 18px; }
.auth-box h2 { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -.025em; }
.devnote { font-size: 12.5px; color: var(--ink-muted); background: var(--surface-3); border-radius: var(--r); padding: 10px 12px; }
.ticket-art { position: relative; z-index: 1; display: grid; gap: 10px; width: min(380px, 100%); }

/* ── Kitchen display: dark by default, readable from across the pass; a light mode for bright kitchens ── */
body.kds { --k-bg: #0A100D; --k-bar: #0F1813; --k-line: #1E2B24; --k-seg: #17231C; --k-ink: #E9F1E9; --k-sub: #9FB2A5; --k-faint: #6F8B79; --k-btn: #C8D9CD; --k-strong: #fff; --k-card: #121C16; --k-card-line: #22322A; --k-head: #1A2820; --k-row: #1B2821; --k-on-bg: #E9F1E9; --k-on-ink: #0A100D; --k-ok: #8FE3AE; --k-amber: #F6C453; --k-amber-bg: #3A2C10; --k-red: #FF8E7A; --k-red-bg: #3B1712; --k-late-line: #5A2219; --k-note: #FF9F7A; --k-alg: #FFB199; --k-done: #5F7A69; }
html[data-theme="light"] body.kds { --k-bg: #F4F1E8; --k-bar: #FFFFFF; --k-line: #E2DED2; --k-seg: #ECE8DC; --k-ink: #14231B; --k-sub: #56695C; --k-faint: #6F8276; --k-btn: #2C3E33; --k-strong: #0E1A13; --k-card: #FFFFFF; --k-card-line: #E2DED2; --k-head: #F3F0E7; --k-row: #EEEBE2; --k-on-bg: #14231B; --k-on-ink: #FFFFFF; --k-ok: #1D7A44; --k-amber: #8A5A00; --k-amber-bg: #FBEFD2; --k-red: #B42318; --k-red-bg: #FDE7E3; --k-late-line: #F0B4A8; --k-note: #B4461C; --k-alg: #B42318; --k-done: #A3B0A7; }
body.kds { background: var(--k-bg); color: var(--k-ink); min-height: 100vh; --line: var(--k-line); }
.kds-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--k-bar); border-bottom: 1px solid var(--k-line); }
.kds-top .brand { font-family: var(--display); font-size: 19px; font-weight: 600; }
.kds-top .seg { background: var(--k-seg); } .kds-top .seg button { color: var(--k-sub); } .kds-top .seg button.on { background: var(--k-on-bg); color: var(--k-on-ink); }
.kds-clock { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.kds-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; padding: 14px 18px 90px; align-items: start; }
.tk { background: var(--k-card); border: 1px solid var(--k-card-line); border-radius: var(--r-card); overflow: hidden; display: flex; flex-direction: column; transition: opacity .25s, transform .25s; }
.tk-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--k-head); }
.tk-head > b { font-family: var(--display); font-size: 21px; letter-spacing: -.02em; flex: none; }
.tk-head .where { flex: 1; min-width: 0; font-size: 12.5px; color: var(--k-sub); font-weight: 600; line-height: 1.3; }
.tk-head .where b, .tk-head .where span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--sans); font-size: 13px; letter-spacing: 0; }
.tk-head .where b { color: var(--k-ink); font-weight: 700; }
.tk-time { white-space: nowrap; flex: none; margin-left: auto; font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: var(--r); }
.tk[data-age="ok"] .tk-time { color: var(--k-ok); } .tk[data-age="warn"] .tk-time { background: var(--k-amber-bg); color: var(--k-amber); } .tk[data-age="late"] .tk-time { background: var(--k-red-bg); color: var(--k-red); }
.tk[data-age="late"] { border-color: var(--k-late-line); }
.tk ul { list-style: none; margin: 0; padding: 4px 0; }
.tk li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--k-row); cursor: pointer; }
.tk li:first-child { border-top: 0; }
.tk li .q { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--k-strong); }
.tk li .n { font-size: 16px; font-weight: 650; line-height: 1.3; }
.tk li .m { font-size: 13px; color: var(--k-amber); margin-top: 2px; }
.tk li .note { font-size: 13px; color: var(--k-note); margin-top: 2px; font-weight: 600; }
.tk li.done .n, .tk li.done .q { text-decoration: line-through; color: var(--k-done); }
.tk li .course { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--k-faint); font-weight: 700; }
.tk-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--k-row); margin-top: auto; }
.tk-foot .btn { flex: 1; height: 44px; font-size: 15px; }
.tk .bump { background: #2CA45A; color: #fff; } .tk .bump:hover { background: #33B866; }
.tk.done { opacity: .55; }
@keyframes tkIn { from { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--k-amber); } to { transform: none; box-shadow: none; } }
.kds-top { flex-wrap: wrap; }
.kds-top .seg { overflow-x: auto; max-width: 100%; }
.tk.leaving { opacity: 0; transform: scale(.96); }
.kds-allday { position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: 8px; padding: 10px 18px; background: var(--k-bar); border-top: 1px solid var(--k-line); overflow-x: auto; }
.kds-allday span { white-space: nowrap; padding: 6px 10px; background: var(--k-seg); border-radius: var(--r); font-size: 13.5px; font-weight: 650; }
.kds-allday span b { font-family: var(--display); color: var(--k-amber); margin-right: 6px; }
.kds-empty { display: grid; place-items: center; align-content: center; min-height: 60vh; text-align: center; color: var(--k-faint); gap: 8px; }
.kds-empty b { font-family: var(--display); font-size: 28px; color: var(--k-btn); }
/* Kitchen pacing: course headings with fired and held times, held courses dimmed, allergens,
   rush and VIP, the order's note, tickets waiting for a course to be fired. */
.tk li.tk-course { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 12px; cursor: default; background: var(--k-bar); color: var(--k-sub); font-size: 12.5px; font-weight: 650; }
.tk li.tk-course span { display: inline-flex; align-items: center; gap: 5px; }
.tk li.tk-course.held { color: var(--k-amber); }
.tk li.held { opacity: .45; cursor: default; }
.tk li .alg { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12.5px; font-weight: 650; color: var(--k-alg); }
.tk li .meta-k { display: flex; gap: 10px; margin-top: 2px; font-size: 12px; color: var(--k-faint); font-weight: 600; }
.tk li .meta-k span { display: inline-flex; align-items: center; gap: 4px; }
.tk-prio { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.tk.prio-rush { border-color: #C2412D; } .tk.prio-rush .tk-prio { background: var(--k-red-bg); color: var(--k-red); }
.tk.prio-vip { border-color: #B9812A; } .tk.prio-vip .tk-prio { background: var(--k-amber-bg); color: var(--k-amber); }
.tk-note { display: flex; align-items: flex-start; gap: 6px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--k-note); border-bottom: 1px solid var(--k-row); }
.tk.waiting { opacity: .62; border-style: dashed; }
.tk-wait { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; color: var(--k-sub); font-size: 13.5px; font-weight: 600; }
.tk-time .ico { width: 15px; height: 15px; margin-right: 4px; vertical-align: -2px; }

/* ── Guest pages (table QR, online ordering): phone first ── */
body.guest { background: var(--ground); }
.g-wrap { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--ground); padding-bottom: 120px; }
.g-hero { position: relative; padding: 22px 20px 26px; background: var(--forest); color: #fff; overflow: hidden; }
.g-hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(90% 120% at 100% 0%, rgba(111, 206, 143, .18), transparent 60%); pointer-events: none; }
.g-hero > * { position: relative; z-index: 1; }
.g-hero h1 { font-size: 30px; color: #fff; margin-top: 14px; }
.g-hero p { color: #BFD3C6; margin: 6px 0 0; font-size: 14px; }
.g-table { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r); background: rgba(255, 255, 255, .1); font-weight: 700; font-size: 13px; }
.g-actions { display: flex; gap: 8px; margin-top: 16px; }
.g-actions .btn { flex: 1; background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .14); }
.g-cats { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.g-cats::-webkit-scrollbar { display: none; }
.g-cats button { height: 34px; padding: 0 13px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 650; font-size: 13.5px; white-space: nowrap; color: var(--ink-soft); }
.g-cats button.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.g-sec { padding: 18px 16px 4px; }
.g-sec h2 { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 8px; }
.g-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.g-item:first-of-type { border-top: 0; }
.g-item b { font-size: 15.5px; font-weight: 650; } .g-item p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-muted); line-height: 1.4; }
.g-item .price { font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.g-add { width: 38px; height: 38px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--brand-2); }
.g-item.off { opacity: .45; pointer-events: none; }
.g-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; width: min(528px, calc(100% - 28px)); z-index: 30; }
.g-bar .btn { width: 100%; height: 56px; justify-content: space-between; font-size: 16px; box-shadow: var(--shadow-lift); }
.g-bar .btn .n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: var(--r); background: rgba(255, 255, 255, .18); font-size: 13px; }
.sheet-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(14, 30, 22, .42); opacity: 0; transition: opacity .2s; }
.sheet-scrim.in { opacity: 1; }
.sheet { position: fixed; left: 50%; bottom: 0; z-index: 61; width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 8px 8px 0 0; transform: translate(-50%, 100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
.sheet.in { transform: translate(-50%, 0); }
.sheet-grab { width: 40px; height: 4px; border-radius: var(--r-xs); background: var(--line-strong); margin: 8px auto 0; }
.sheet-head { padding: 12px 18px 10px; display: flex; gap: 10px; align-items: flex-start; }
.sheet-head h2 { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.sheet-body { overflow-y: auto; padding: 4px 18px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.sheet-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.opt-group h3 { font-size: 14px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.opt input { width: 20px; height: 20px; accent-color: var(--brand-2); margin: 0; }
.opt span { flex: 1; font-weight: 550; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; height: 44px; background: var(--surface); }
.stepper button { width: 44px; height: 100%; border: 0; background: transparent; display: grid; place-items: center; }
.stepper b { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.g-status { margin: 16px; padding: 16px; display: grid; gap: 10px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps i { height: 5px; border-radius: var(--r-xs); background: var(--surface-4); }
.steps i.on { background: var(--brand-2); }
.veg { color: var(--leaf); } .hot { color: var(--danger); }

/* ── Responsive ── */
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 90; left: 0; width: 264px; transform: translateX(-100%); transition: transform .22s; }
  .side.open { transform: none; box-shadow: var(--shadow-lift); }
  .burger { display: inline-flex; }
  .top { padding: 14px 16px; } .page { padding: 4px 16px 40px; }
  .top h1 { font-size: 22px; }
  .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { min-height: 300px; padding: 28px; } .auth-art h1 { font-size: 36px; }
  .grid-2e { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) { .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; } .kpi { padding: 12px 14px; } .figure { font-size: 24px; } .modal-foot { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Selects draw their own chevron, inset from the edge like the icons on the left of a field. */
select.select, select.input { -webkit-appearance: none; appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235F6A60' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }

/* Kitchen: a ready button per course, a tick on each dish, and a line of help under the header. */
.tk li { grid-template-columns: 34px 1fr auto; }
.tk-tick { align-self: center; color: var(--k-faint); display: inline-flex; }
.tk li.done .tk-tick { color: var(--k-ok); }
.tk li.tk-go { display: block; padding: 4px 12px 12px; border-top: 0; cursor: default; }
.tk li.tk-go .btn { width: 100%; height: 44px; font-size: 15px; }
.tk li.tk-course.ready { color: var(--k-ok); }
.tk-foot:empty { display: none; }
.kds-hint { display: flex; align-items: center; gap: 8px; padding: 10px 18px 0; color: var(--k-sub); font-size: 13.5px; font-weight: 600; }

/* Fields side by side stay on one straight line: their labels share a row (a label that wraps makes
   the whole row taller) and their inputs share the next one (CSS subgrid). */
.field-row, .form-grid, .grid-2, .grid-2e { grid-auto-flow: row; }
:is(.field-row, .form-grid, .grid-2, .grid-2e) > .field:has(> :nth-child(2):last-child) { grid-row: span 2; display: grid; grid-template-rows: subgrid; row-gap: 6px; align-content: start; }
:is(.field-row, .form-grid, .grid-2, .grid-2e) > .field > span:first-child { align-self: end; }
