/* QR Menu demo — light warm theme (paper #fffbf5, accent #c2410c, Georgia
   serif headings). Kitchen board stays dark (#141210). OS dark preference
   restyles the light surfaces only; never forced globally. */
:root {
  color-scheme: light;
  --bg: #fffbf5; --card: #ffffff; --card2: #fff7ed; --card3: #ffedd5;
  --ink: #292524; --muted: #78716c; --line: #e7e5e4; --line2: #d6d3d1;
  --accent: #c2410c; --accent2: #ea580c; --accent-dark: #9a3412;
  --accent-soft: #fff7ed; --accent-line: #fdba74;
  --green: #15803d; --green-bg: #dcfce7; --green-ink: #14532d;
  --red: #b91c1c; --red-bg: #fee2e2; --red-ink: #7f1d1d;
  --amber: #b45309; --amber-bg: #fef3c7; --amber-ink: #78350f;
  --blue-bg: #dbeafe; --blue-ink: #1e3a8a;
  --radius: 18px; --shadow: 0 6px 24px rgba(41,37,36,.08);
  --header-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #171310; --card: #241d19; --card2: #2c231d; --card3: #332820;
    --ink: #faf7f4; --muted: #a8a29e; --line: #3d332b; --line2: #4a3f35;
    --accent: #f97316; --accent2: #fb923c; --accent-dark: #ea580c;
    --accent-soft: #431407; --accent-line: #9a3412;
    --green: #4ade80; --green-bg: #14532d; --green-ink: #bbf7d0;
    --red: #f87171; --red-bg: #450a0a; --red-ink: #fecaca;
    --amber: #fbbf24; --amber-bg: #451a03; --amber-ink: #fde68a;
    --blue-bg: #172554; --blue-ink: #bfdbfe;
    --shadow: 0 6px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.45; }
/* No horizontal page swipe/scroll anywhere in the app (the panel used to
   push the page wider than the viewport on phones). `clip` creates no
   scroll container, so sticky headers/carts keep working. Inner
   scrollers (category chips, charts) keep their own overflow. */
html, body { overflow-x: clip; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; }
h2 { font-size: 1.3rem; margin: 0 0 .6rem; }
h3 { font-size: 1.08rem; margin: 0 0 .5rem; }
img { max-width: 100%; }
.muted { color: var(--muted); font-size: .9rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; word-break: break-all; }
.hint { color: var(--muted); font-size: .88rem; margin: .4rem 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
main { max-width: 1100px; margin: 0 auto; padding: 0 12px 40px; }
/* Branch Manager panel: full viewport width (no centered 1100px cap) —
   scoped by body.owner-view-active, which switchView toggles, so the
   menu, kitchen, entry, Owner dashboard and auth views keep the
   centered container exactly as before. */
body.owner-view-active main { max-width: none; padding: 0 12px 40px; }
body.owner-view-active .topbar-row { max-width: none; }
@media (max-width: 480px) {
  body.owner-view-active main { padding: 0 10px 40px; }
}

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
/* Menu view only (body.menu-view-active, toggled by switchView): the top
   bar scrolls away with the page instead of sticking, and the category
   chips stick at the viewport top (no header-height gap left behind).
   Kitchen/Owner/Brand/Admin keep the sticky header exactly as before. */
body.menu-view-active .topbar { position: static; }
body.menu-view-active .category-chips { top: 0; }
.topbar-row { max-width: 1100px; margin: 0 auto; padding: .55rem 12px; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #fff; font-family: Georgia, serif; font-weight: 800; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-text { min-width: 0; }
.brand-text h1 { font-size: 1.25rem; margin: 0; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-sub { margin: 0; font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-switch { display: flex; gap: .35rem; flex-wrap: wrap; }
.switch-btn { border: 1px solid var(--line2); background: transparent; color: var(--ink); padding: .45rem .95rem; border-radius: 999px; cursor: pointer; font-size: .95rem; }
.switch-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.viewing-as { display: flex; align-items: center; gap: .45rem; font-size: .88rem; font-weight: 600; margin-bottom: 0; }
.viewing-as select { width: auto; min-width: 150px; margin-top: 0; }
.suspended-banner { background: var(--red-bg); border-top: 1px solid var(--red); color: var(--red-ink); padding: .5rem 12px; font-size: .92rem; text-align: center; font-weight: 600; }
/* TESTING COPY banner (no-login test mode only; the element stays
   `hidden` in live mode, so this never renders there). Body-level, in
   normal flow above the header: visible at the top of EVERY view
   without shifting any view's own layout. Fixed amber colors (not
   theme vars) so it reads identically in light + OS-dark. The subtle
   diagonal striping marks it as a test build at a glance. */
.test-mode-banner { background-color: #fbbf24; background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.07) 0 12px, transparent 12px 24px); color: #451a03; border-bottom: 2px solid #b45309; padding: .45rem 12px; font-size: .9rem; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
/* Test mode: the Owner dashboard sidebar Log out is hidden (persona
   switching replaces logout; the header logout is hidden by
   syncAuthMenu). The doLogout() guard is the backstop. */
body.test-mode #od-logout { display: none !important; }
/* Long persona labels (e.g. "Branch Manager — Wok Chef – Rawalpindi")
   size the select to its longest option, which overflows a 390px
   viewport once the "Viewing as" text is added (440px measured). The
   label may shrink (min-width:0) and takes its own full-width row on
   narrow screens, so the select clips its text instead of pushing the
   page wider. Scoped to body.test-mode: live-mode layout is untouched. */
body.test-mode .viewing-as { min-width: 0; white-space: nowrap; }
body.test-mode .viewing-as select { min-width: 0; max-width: min(420px, calc(100vw - 24px)); }
@media (max-width: 700px) {
  body.test-mode .viewing-as { flex: 1 1 100%; }
  body.test-mode .viewing-as select { flex: 1 1 auto; }
}
/* QR / customer mode (body.qr-mode, 2026-11-17): a table QR or shared
   menu link (?restaurant=... without a staff ?view=) shows ONLY the
   customer experience. The whole staff header row (brand, nav tabs,
   Viewing-as selector, auth menu), the TESTING COPY banner, and every
   staff/auth view are hidden with !important so no later render can
   re-show them. The suspended banner (customer-relevant) is NOT in
   .topbar-row, so it still shows. The bare domain never gets this
   class, so staff login is untouched. */
body.qr-mode .topbar-row { display: none !important; }
body.qr-mode .view-switch,
body.qr-mode .viewing-as,
body.qr-mode #auth-menu,
body.qr-mode #test-mode-banner { display: none !important; }
body.qr-mode #view-kitchen,
body.qr-mode #view-waiter,
body.qr-mode #view-owner,
body.qr-mode #view-brand,
body.qr-mode #view-admin,
body.qr-mode #view-login,
body.qr-mode #view-signup,
body.qr-mode #view-changepassword { display: none !important; }
body.qr-mode .topbar { border-bottom: none; }
.view { display: none; padding-top: 1rem; }
.view.active { display: block; }

/* Buttons, inputs */
.btn { border: 1px solid var(--line2); background: var(--card2); color: var(--ink); padding: .55rem .95rem; border-radius: 999px; cursor: pointer; font-size: .95rem; font-weight: 600; text-decoration: none; display: inline-block; text-align: center; }
.btn:hover { background: var(--card3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-danger.armed { background: var(--red); color: #fff; border-color: var(--red); }
.btn-ghost { background: var(--card2); }
.btn-block { width: 100%; padding: .8rem; font-size: 1.05rem; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
input, select, textarea { width: 100%; padding: .55rem .6rem; border: 1px solid var(--line2); border-radius: 10px; font-size: 1rem; background: var(--card); color: var(--ink); margin-top: .25rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .6rem; }
.row-gap { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: .8rem; }
.row-gap label { margin-bottom: 0; min-width: 150px; flex: 1; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.form-inline label { min-width: 160px; flex: 1; }
.form-inline h3 { width: 100%; }
.pill { display: inline-block; background: var(--card2); border: 1px solid var(--line2); color: var(--ink); border-radius: 999px; padding: .1rem .6rem; font-size: .82rem; font-weight: 700; }
.pill.green { background: var(--green-bg); border-color: var(--green); color: var(--green-ink); }
.pill.red { background: var(--red-bg); border-color: var(--red); color: var(--red-ink); }
.pill.amber { background: var(--amber-bg); border-color: var(--amber); color: var(--amber-ink); }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; font-weight: 600; margin-bottom: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.switch .slider { width: 44px; height: 24px; border-radius: 999px; background: var(--line2); position: relative; transition: background .2s; flex-shrink: 0; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .2s; }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::after { left: 23px; }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Banners + toasts */
.banner { border-radius: 12px; padding: .7rem .9rem; margin-bottom: 1rem; font-size: .95rem; }
.banner-danger { background: var(--red-bg); border: 1px solid var(--red); color: var(--red-ink); }
.banner-warn { background: var(--amber-bg); border: 1px solid var(--amber); color: var(--amber-ink); }
.banner-success { background: var(--green-bg); border: 1px solid var(--green); color: var(--green-ink); }
#toast-wrap { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 480px); }
.toast { background: #292524; color: #fff; padding: .7rem 1rem; border-radius: 12px; border: 1px solid #57534e; box-shadow: 0 4px 16px rgba(0,0,0,.4); font-size: .95rem; }
.toast.error { background: var(--red-bg); border-color: var(--red); color: var(--red-ink); }
.toast.success { background: var(--green-bg); border-color: var(--green); color: var(--green-ink); }

/* Hero */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 230px; margin-bottom: 1rem; box-shadow: var(--shadow); background: #292524; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,18,16,.35) 0%, rgba(20,18,16,.72) 100%); }
.hero-content { position: relative; padding: 1.4rem 1.2rem 1.1rem; color: #fff; max-width: 640px; }
.hero-content h2 { font-size: 2rem; margin: 0 0 .15rem; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.hero-tagline { margin: 0 0 .6rem; font-size: 1.02rem; color: #ffedd5; }
.hero-meta { margin: 0 0 .6rem; font-size: .88rem; color: #e7e5e4; }
.table-pill { width: auto; min-width: 170px; border-radius: 999px; border: none; padding: .55rem 1rem; font-weight: 700; background: #fff; color: #292524; margin-top: .25rem; }
/* Slim table strip: Menu view only, first child of #view-menu, in normal
   flow under the top bar — it scrolls away with the page. Subtle and
   small: just the picker. The select reuses .table-pill; the strip
   restyles it for the page background (border + card background) instead
   of the old hero-overlay look. */
.table-strip { display: flex; align-items: center; padding: 0 0 .55rem; }
.table-strip-label { display: flex; align-items: center; gap: .5rem; margin-bottom: 0; font-size: .88rem; font-weight: 600; color: var(--muted); }
.table-strip .table-pill { margin-top: 0; min-width: 0; padding: .4rem .8rem; font-size: .92rem; background: var(--card); color: var(--ink); border: 1px solid var(--line2); box-shadow: var(--shadow); }
/* Table sessions (QR/NFC): the strip shows a fixed "Table N" label
   instead of the picker, in the same pill shape. */
.table-fixed-label { display: inline-block; padding: .4rem .8rem; font-size: .92rem; font-weight: 700; background: var(--card); color: var(--ink); border: 1px solid var(--line2); box-shadow: var(--shadow); border-radius: var(--radius); }
/* Settings checkboxes (Menu page toggles): inline, not full-width. */
.check-line { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check-line input[type="checkbox"] { width: auto; margin: 0; flex: none; }
.hero-qr-note { margin: .3rem 0 0; font-size: .85rem; color: #e7e5e4; max-width: 520px; }
.hero-eyebrow { margin: 0 0 .35rem; font-size: .78rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--accent2, #fb923c); }
.hero-logo { height: 54px; width: auto; max-width: 220px; object-fit: contain; margin-bottom: .4rem; }
.hero-subtext { margin: 0 0 .5rem; font-size: .95rem; color: #faf7f4; max-width: 560px; }
.hero-rating { margin: 0 0 .5rem; font-size: .9rem; font-weight: 700; color: #fde68a; }
.hero-taxnote { margin: .5rem 0 0; font-size: .82rem; color: #e7e5e4; font-style: italic; }

/* Per-restaurant customer-menu theme (data-driven: values come from the
   restaurant's theme record via applyMenuTheme in app.js — never from the
   restaurant name). Only the menu view, its cart sheet, and the top bar
   while the menu view is active are themed; Owner/Admin/Kitchen are never
   touched by this. Restaurants without a theme keep the default light
   theme exactly. */
#view-menu[data-theme="dark"] .btn-primary,
#cart-sheet[data-theme="dark"] .btn-primary,
#view-menu[data-theme="dark"] .cart-bar { background: var(--accent-gradient, var(--accent)); border-color: transparent; }
#view-menu[data-theme="dark"] .btn-primary:hover,
#cart-sheet[data-theme="dark"] .btn-primary:hover { filter: brightness(1.08); }
#view-menu[data-theme="dark"] h2, #view-menu[data-theme="dark"] h3,
#view-menu[data-theme="dark"] .dish-name,
#cart-sheet[data-theme="dark"] h2,
#waiter-card[data-theme="dark"] h2 { color: var(--theme-heading, var(--ink)); }
#view-menu[data-theme="dark"] .dish-price,
#view-menu[data-theme="dark"] .countdown-big,
#view-menu[data-theme="dark"] .tracker-countdown { color: var(--accent2); }
#view-menu[data-theme="dark"] .chip-btn.active { background: var(--accent-gradient, var(--accent)); border-color: transparent; }

/* Preparing screen */
.preparing-card { text-align: center; border: 2px solid var(--accent); max-width: 560px; margin: 0 auto 1rem; }
.prep-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .4rem; }
.preparing-card h2 { font-size: 1.55rem; margin: .3rem 0; }
.countdown-big { font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: .4rem 0; line-height: 1.1; color: var(--accent); }
.prep-status { font-size: 1.05rem; font-weight: 600; }
.prep-steps { list-style: none; display: flex; gap: .4rem; padding: 0; margin: .8rem auto; max-width: 460px; }
.prep-steps li { flex: 1; font-size: .82rem; font-weight: 700; padding: .4rem .2rem; border-radius: 999px; background: var(--card2); border: 1px solid var(--line2); color: var(--muted); }
.prep-steps li.done { background: var(--green-bg); border-color: var(--green); color: var(--green-ink); }
.prep-steps li.active { background: var(--amber-bg); border-color: var(--amber); color: var(--amber-ink); }
.prep-steps li.cancelled-step { background: var(--red-bg); border-color: var(--red); color: var(--red-ink); }
.prep-items { list-style: none; padding: 0; margin: .8rem auto; max-width: 420px; text-align: left; }
.prep-items li { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.prep-total { font-size: 1.05rem; }
.prep-note { color: var(--muted); font-size: .92rem; }
/* Preparing-screen animation stage: the same chef/waiter scenes as the
   tracker stage (shared .tracker-anim paint + motion), centred above the
   big countdown. Chef while preparing, waiter once overdue. */
.prep-anim { max-width: 260px; margin: .2rem auto .1rem; }
.prep-anim .tracker-anim-svg { display: block; width: 100%; height: auto; }
.pay-note { color: var(--green); font-weight: 600; }

/* Tracker */
.tracker-card { border-left: 4px solid var(--accent); }
.tracker-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .4rem; }
.tracker-order { border: 1px solid var(--line); border-radius: 14px; padding: .7rem .8rem; margin-bottom: .6rem; background: var(--card2); }
.tracker-order-top { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; }
.tracker-countdown { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); }
.tracker-countdown.overdue { color: var(--amber); }
/* Overdue tracker line: the order is still live (preparing, past zero) —
   the countdown clamps at 00:00 and this line carries the "coming" wording. */
.tracker-coming { font-weight: 800; color: var(--amber); margin-top: .35rem; }
/* Tracker stage: chef animation + progress ring. The animation (left) and
   the ring (right) share one row; each live order keeps its own stage. */
.tracker-stage { display: flex; align-items: center; gap: .9rem; margin-top: .55rem; }
.tracker-anim { flex: 1 1 auto; min-width: 0; max-width: 230px; }
.tracker-anim-svg { display: block; width: 100%; height: auto; }
.tracker-view-row { margin-top: .3rem; }
.tracker-view-link { background: none; border: none; padding: .15rem 0; color: var(--muted); font-size: .82rem; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.tracker-view-link:hover { color: var(--accent); }
/* Progress ring: track + progress arc + a blurred halo arc. --ring-p (0..1,
   set from JS on every countdown tick) drives the shine: the progress
   arc's drop-shadow blur and the halo's opacity both scale with progress,
   so the ring is dim at the start and fully bright at 100%. Dashoffset
   transitions keep the fill smooth between 1-second ticks. */
.tracker-ring { position: relative; flex: 0 0 92px; width: 92px; height: 92px; --ring-p: 0; }
.tracker-ring svg { display: block; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-progress { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .8s linear, filter .8s ease; filter: drop-shadow(0 0 calc(1px + var(--ring-p, 0) * 7px) var(--accent2)); }
.ring-glow { fill: none; stroke: var(--accent2); stroke-width: 10; stroke-linecap: round; opacity: calc(.04 + var(--ring-p, 0) * .5); filter: blur(2.5px); transition: stroke-dashoffset .8s linear, opacity .8s ease; }
.tracker-ring-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; font-variant-numeric: tabular-nums; color: var(--ink); }
#view-menu[data-theme="dark"] .ring-progress { stroke: var(--accent2); }
@media (max-width: 480px) {
  .tracker-stage { gap: .6rem; }
  .tracker-ring { flex-basis: 84px; width: 84px; height: 84px; }
}
/* Chef animation paint: flat fills from theme variables so the scene reads
   in both the light warm theme and the dark Wok Chef theme. Fixed tones
   are used only where a theme variable would be wrong (chef whites, skin,
   the dark pan). */
.tracker-anim .chef-hat { fill: #f8f4ec; }
.tracker-anim .chef-hat-brim { fill: #f8f4ec; stroke: var(--line2); stroke-width: 1; }
.tracker-anim .chef-face { fill: #eab086; }
.tracker-anim .chef-feature { fill: #3f3a36; }
.tracker-anim .chef-smile { fill: none; stroke: #3f3a36; stroke-width: 1.6; stroke-linecap: round; }
.tracker-anim .chef-jacket { fill: var(--card); stroke: var(--line2); stroke-width: 1.5; }
.tracker-anim .chef-scarf { fill: var(--accent2); }
.tracker-anim .chef-arm-under { fill: none; stroke: var(--line2); stroke-width: 11; stroke-linecap: round; }
.tracker-anim .chef-arm { fill: none; stroke: var(--card); stroke-width: 8; stroke-linecap: round; }
.tracker-anim .pan-handle { fill: #57534e; }
.tracker-anim .pan-body { fill: #3f3a36; stroke: #57534e; stroke-width: 1; }
.tracker-anim .pan-top { fill: #57534e; }
.tracker-anim .anim-shadow { fill: var(--line2); opacity: .5; }
.tracker-anim .steam { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linecap: round; }
.tracker-anim .f1 { fill: none; stroke: var(--accent2); stroke-width: 3.5; stroke-linecap: round; }
.tracker-anim .f2 { fill: none; stroke: var(--green); stroke-width: 3.5; stroke-linecap: round; }
.tracker-anim .f3 { fill: var(--amber); }
.tracker-anim .f4 { fill: var(--accent); }
/* Chef animation motion: the pan tilts on its grip point while the food
   bits arc up and fall back on the same 1.6s loop (staggered), and steam
   wisps rise and fade. Idle (not started) pauses everything at the rest
   pose; Ready settles the toss and keeps only a slow, calm steam. */
.tracker-anim .pan-toss { transform-box: view-box; transform-origin: 84px 61px; animation: trackerPan 1.6s ease-in-out infinite; }
.tracker-anim .food-bit { transform-box: fill-box; transform-origin: center; animation: trackerFood 1.6s ease-in-out infinite; }
.tracker-anim .f1 { --jx: -3px; --jy: -26px; animation-delay: 0s; }
.tracker-anim .f2 { --jx: 2px; --jy: -31px; animation-delay: .14s; }
.tracker-anim .f3 { --jx: -1px; --jy: -22px; animation-delay: .28s; }
.tracker-anim .f4 { --jx: 5px; --jy: -28px; animation-delay: .42s; }
.tracker-anim .steam { animation: trackerSteam 2.6s ease-in-out infinite; opacity: 0; }
.tracker-anim .s2 { animation-delay: .7s; }
.tracker-anim .s3 { animation-delay: 1.4s; }
@keyframes trackerPan { 0%, 100% { transform: rotate(0deg) translateY(0); } 30% { transform: rotate(-9deg) translateY(-3px); } 55% { transform: rotate(6deg) translateY(1px); } 78% { transform: rotate(-2deg) translateY(0); } }
@keyframes trackerFood { 0%, 100% { transform: translate(0, 0); } 42% { transform: translate(var(--jx, 0px), var(--jy, -26px)); } 72% { transform: translate(calc(var(--jx, 0px) * .4), -4px); } }
@keyframes trackerSteam { 0% { opacity: 0; transform: translateY(5px); } 35% { opacity: .75; } 100% { opacity: 0; transform: translateY(-6px); } }
.tracker-anim.is-idle .pan-toss, .tracker-anim.is-idle .food-bit, .tracker-anim.is-idle .steam { animation-play-state: paused; }
.tracker-anim.is-ready .pan-toss, .tracker-anim.is-ready .food-bit { animation: none; }
.tracker-anim.is-ready .steam { animation-duration: 4.5s; }
/* Waiter animation paint: same approach as the chef scene — flat fills
   from theme variables so the walker reads in the light warm theme and
   the dark restaurant theme alike. Fixed tones only where a theme
   variable would be wrong (skin, hair). */
.tracker-anim .waiter-face { fill: #eab086; }
.tracker-anim .waiter-hair { fill: #3f3a36; }
.tracker-anim .waiter-shirt { fill: var(--card); stroke: var(--line2); stroke-width: 1.5; }
.tracker-anim .waiter-apron { fill: var(--accent2); }
.tracker-anim .waiter-leg path { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.tracker-anim .waiter-leg .waiter-shoe { stroke: var(--accent); }
.tracker-anim .waiter-tray-plate { fill: var(--card3); stroke: var(--line2); stroke-width: 1; }
.tracker-anim .waiter-cloche { fill: var(--accent); }
.tracker-anim .waiter-knob { fill: var(--accent2); }
.tracker-anim .waiter-dash { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linecap: round; }
/* Waiter animation motion: the legs alternate around the hip on a 0.9s
   loop (opposite phases), the upper body bobs twice per loop, the tray
   arm sways gently around the shoulder, the free arm counter-swings,
   and the shadow pulses with the steps. Dashes drifting past behind
   the walker add the sense of forward movement. */
.tracker-anim .waiter-leg { transform-box: view-box; transform-origin: 92px 64px; animation: waiterStep .9s ease-in-out infinite; }
.tracker-anim .leg-back { animation-delay: -.45s; }
.tracker-anim .waiter-upper { animation: waiterBob .9s ease-in-out infinite; }
.tracker-anim .waiter-tray { transform-box: view-box; transform-origin: 103px 42px; animation: waiterSway 1.8s ease-in-out infinite; }
.tracker-anim .waiter-arm-swing { transform-box: view-box; transform-origin: 82px 44px; animation: waiterSwing .9s ease-in-out infinite; animation-delay: -.45s; }
.tracker-anim .waiter-shadow { transform-box: fill-box; transform-origin: center; animation: waiterShadow .9s ease-in-out infinite; }
.tracker-anim .waiter-dash { animation: waiterDash .9s ease-in-out infinite; }
.tracker-anim .waiter-dash.d2 { animation-delay: .45s; }
@keyframes waiterStep { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(18deg); } }
@keyframes waiterBob { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-2.5px); } 50% { transform: translateY(0); } 75% { transform: translateY(-2.5px); } }
@keyframes waiterSway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes waiterSwing { 0%, 100% { transform: rotate(12deg); } 50% { transform: rotate(-14deg); } }
@keyframes waiterShadow { 0%, 100% { transform: scaleX(1); opacity: .5; } 50% { transform: scaleX(.88); opacity: .35; } }
@keyframes waiterDash { 0% { opacity: 0; transform: translateX(6px); } 40% { opacity: .8; } 100% { opacity: 0; transform: translateX(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .tracker-anim .pan-toss, .tracker-anim .food-bit, .tracker-anim .steam,
  .tracker-anim .waiter-leg, .tracker-anim .waiter-upper, .tracker-anim .waiter-tray,
  .tracker-anim .waiter-arm-swing, .tracker-anim .waiter-shadow, .tracker-anim .waiter-dash { animation: none; }
}
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: .5rem; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width .3s; }
.status-badge { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; font-weight: 700; text-transform: capitalize; background: var(--card3); color: var(--ink); border: 1px solid var(--line2); }
.status-badge.new { background: var(--blue-bg); color: var(--blue-ink); border-color: transparent; }
.status-badge.preparing { background: var(--amber-bg); color: var(--amber-ink); border-color: transparent; }
.status-badge.ready { background: var(--green-bg); color: var(--green-ink); border-color: transparent; }
.status-badge.served { background: var(--card3); color: var(--muted); }
.status-badge.cancelled { background: var(--red-bg); color: var(--red-ink); border-color: transparent; }

/* Category chips (sticky) + menu cards */
.category-chips { position: sticky; top: var(--header-h); z-index: 10; display: flex; gap: .4rem; overflow-x: auto; padding: .5rem 2px; margin-bottom: .4rem; background: var(--bg); scrollbar-width: none; }
.category-chips::-webkit-scrollbar { display: none; }
.chip-btn { flex-shrink: 0; border: 1px solid var(--line2); background: var(--card); color: var(--ink); padding: .45rem .95rem; border-radius: 999px; cursor: pointer; font-size: .92rem; font-weight: 600; }
.chip-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.category-block { margin-bottom: 1.2rem; }
.category-block h3 { font-size: 1.25rem; margin-bottom: .55rem; }
.dish-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.dish-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.dish-card.sold-out { opacity: .62; }
.dish-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--card3); }
.dish-body { padding: .6rem .7rem .7rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.dish-name { font-weight: 700; line-height: 1.25; }
.dish-desc { color: var(--muted); font-size: .85rem; flex: 1; }
.dish-foot { display: flex; justify-content: space-between; align-items: center; gap: .4rem; margin-top: .45rem; }
.dish-price { font-weight: 800; color: var(--accent); white-space: nowrap; }
.qty-stepper { display: flex; gap: .3rem; align-items: center; }
.qty-stepper button { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.qty-stepper span { min-width: 22px; text-align: center; font-weight: 700; }

/* Floating cart bar + bottom sheet */
.cart-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30; width: min(92vw, 480px); background: var(--accent); color: #fff; border: none; border-radius: 999px; padding: .85rem 1.1rem; font-size: 1rem; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.35); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.cart-bar-cta { background: rgba(255,255,255,.22); border-radius: 999px; padding: .25rem .8rem; font-size: .9rem; }
.sheet-overlay { position: fixed; inset: 0; background: rgba(20,18,16,.5); z-index: 40; }
.cart-sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 41; width: min(100vw, 560px); max-height: 84vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-bottom: none; border-radius: 20px 20px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 32px rgba(0,0,0,.3); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.sheet-head h2 { margin: 0; }
/* Cart lines: 3-column grid — flexible name block | qty stepper | FIXED-width
   right-aligned total. The total column's right edge is the sheet content
   edge on every line, so long names can never push a total sideways (the old
   space-between flex put the total in the middle, where its position moved
   with the name length). Name wraps inside its own column; the stepper and
   total columns never move. Unit price + quantity live under the name. */
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 96px; align-items: center; gap: .35rem .6rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.cart-line-main { min-width: 0; }
.cart-line-name { font-weight: 600; overflow-wrap: break-word; line-height: 1.3; }
.cart-line-sub { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.cart-line-total { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 480px) {
  .cart-line { grid-template-columns: minmax(0, 1fr) auto 88px; gap: .35rem .5rem; }
  .cart-line .qty-stepper button { width: 30px; height: 30px; }
}
.cart-note-label { margin-top: .8rem; }
.cart-total-row { display: flex; justify-content: space-between; font-size: 1.15rem; margin: .7rem 0 .3rem; }

/* Kitchen board (always dark) */
.kitchen-board { background: #141210; color: #faf7f4; border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.kitchen-board h2, .kitchen-board h3 { color: #fff; }
.kitchen-board-head { margin-bottom: .8rem; }
.kitchen-sub { color: #a8a29e; font-size: .88rem; margin: 0; }
.kitchen-columns { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 860px) { .kitchen-columns { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.kitchen-column { background: #1f1a17; border: 1px solid #3d332b; border-radius: 16px; padding: .8rem; min-width: 0; }
.kitchen-column .muted { color: #a8a29e; }
.kitchen-history-title { margin-top: 1.2rem; }
.kitchen-board .order-card { background: #292524; border: 1px solid #4a3f35; color: #faf7f4; }
.kitchen-board .order-card.overdue { border: 2px solid #f87171; background: #2b1512; }
.kitchen-board .muted { color: #a8a29e; }
.kitchen-board .order-meta { color: #a8a29e; }
.kitchen-board .prep-stepper button { background: #44403c; border-color: #57534e; color: #faf7f4; }
.kitchen-board .btn { background: #44403c; border-color: #57534e; color: #faf7f4; }
.kitchen-board .btn-primary { background: #c2410c; border-color: #c2410c; color: #fff; }
.kitchen-board .btn-danger { border-color: #7f1d1d; color: #f87171; }
.kitchen-board .history-row { background: #1f1a17; border: 1px solid #3d332b; }

/* Table-grouped kitchen cards (kitchen board only): one card per table per
   column; each order keeps its own sub-block, timer and buttons. */
.table-group-head { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; justify-content: space-between; padding-bottom: .55rem; margin-bottom: .6rem; border-bottom: 1px solid var(--line); }
.table-group-title { font-size: 1.25rem; }
.table-group-count { color: var(--muted); font-size: .9rem; }
.table-group-total { font-size: 1.1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kitchen-board .table-group-head { border-bottom-color: #4a3f35; }
.kitchen-board .table-group-count { color: #a8a29e; }
.group-order { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .65rem; margin-bottom: .55rem; min-width: 0; }
.group-order:last-child { margin-bottom: 0; }
.group-order.overdue { border: 2px solid var(--red); }
.kitchen-board .group-order { background: #1f1a17; border-color: #4a3f35; }
.kitchen-board .group-order.overdue { border: 2px solid #f87171; background: #2b1512; }
.group-items { list-style: none; padding-left: 0; }
.group-items li { display: flex; justify-content: space-between; gap: .8rem; }
.group-items li > span:first-child { overflow-wrap: anywhere; min-width: 0; }
.group-item-price { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Kitchen item checklist (preparing orders): one tick per item line, shared
   by the flat card and the group sub-block. The tick box sits at the RIGHT
   end of each line (after qty + name + price); the name flexes to push it
   there. 40px targets for mobile taps; ticked = filled green with an SVG
   check filling the box, unticked = hollow outline. Ready shows the same
   marks statically (not buttons). */
.order-items.has-checklist { list-style: none; padding-left: 0; }
.order-items.has-checklist li { margin-bottom: .35rem; }
.order-items.has-checklist li:last-child { margin-bottom: 0; }
.prep-line { display: flex; align-items: center; gap: .55rem; }
.group-items li.prep-line { justify-content: flex-start; }
.prep-line-name { overflow-wrap: anywhere; min-width: 0; flex: 1 1 auto; }
.prep-tick { flex: 0 0 auto; width: 40px; height: 40px; min-width: 40px; border-radius: 10px; border: 2px solid #78716c; background: transparent; color: #fff; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.prep-tick .prep-check { width: 32px; height: 32px; flex-shrink: 0; display: block; }
.prep-tick.ticked { background: #16a34a; border-color: #16a34a; color: #fff; }
.prep-tick:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.prep-tick:disabled { opacity: .6; cursor: wait; }
.prep-tick-static { cursor: default; }
.prep-tick-static:not(.ticked) { opacity: .55; }
.kitchen-board .prep-tick { border-color: #a8a29e; }
.kitchen-board .prep-tick.ticked { border-color: #16a34a; }
.prep-progress { font-weight: 700; margin: .45rem 0 .2rem; font-size: .92rem; }
.kitchen-board .prep-progress { color: #fdba74; }

/* Owner */
/* Branch Manager panel shell (2026-11-18): the SAME pattern as the
   Owner dashboard (.od-shell) — a light persistent collapsible sidebar
   + top bar. Desktop (>=1024px): sidebar is a sticky grid column
   (248px, collapsible to 76px icons-only with hover flyout labels).
   Mobile: the sidebar is an overlay opened by the top-bar button.
   --pm-accent is the selected branch's theme accent (JS sets it on
   #view-owner); the default matches the Owner dashboard default. */
#view-owner { --pm-accent: #c2410c; }
/* The panel SHELL (sidebar + top bar) has fixed light surfaces, so it
   pins the light palette on itself — exactly like .auth-view and
   #view-brand do. Without this, an OS dark preference flips the :root
   vars (--ink near-white, --muted light gray) and the shell text turns
   invisible on the white surfaces, while the content area (which keeps
   following the OS preference, as before) stays dark. Scoped to the two
   shell elements only: the section content below is untouched. */
.pm-sidebar, .pm-topbar {
  color-scheme: light;
  --bg: #fffbf5; --card: #ffffff; --card2: #fff7ed; --card3: #ffedd5;
  --ink: #292524; --muted: #78716c; --line: #e7e5e4; --line2: #d6d3d1;
  --accent: #c2410c; --accent2: #ea580c; --accent-dark: #9a3412;
  --accent-soft: #fff7ed; --accent-line: #fdba74;
  --green: #15803d; --green-bg: #dcfce7; --green-ink: #14532d;
  --red: #b91c1c; --red-bg: #fee2e2; --red-ink: #7f1d1d;
  --amber: #b45309; --amber-bg: #fef3c7; --amber-ink: #78350f;
  --blue-bg: #dbeafe; --blue-ink: #1e3a8a;
  --shadow: 0 6px 24px rgba(41,37,36,.08);
}
.pm-topbar { color: var(--ink); }
.pm-main { min-width: 0; }
.pm-topbar {
  display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; min-width: 0;
  flex-wrap: wrap; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: .5rem .6rem; box-shadow: var(--shadow);
}
.pm-topbar-text { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; min-width: 0; flex: 1; }
.pm-topbar-text h2 { margin: 0; overflow-wrap: anywhere; }
.pm-topbar #owner-back-row { margin: 0; }
.pm-topbar .owner-branch-switcher {
  display: flex; align-items: center; gap: .4rem; margin-bottom: 0;
  font-size: .85rem; font-weight: 600; color: var(--muted); flex: none;
}
.pm-topbar .owner-branch-switcher select { width: auto; max-width: 180px; margin-top: 0; padding: .4rem .5rem; font-size: .9rem; }
.pm-hamburger {
  width: 40px; height: 40px; flex: none; border: 1px solid var(--line2);
  background: var(--card); color: var(--ink); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pm-hamburger svg { width: 22px; height: 22px; }
/* Voice announcements toggle (panel top bar): visible across all
   sections. On-state reads green. */
.sound-toggle.is-on { background: var(--green-bg); border-color: var(--green); color: var(--green-ink); }
.sound-toggle:disabled { opacity: .55; cursor: not-allowed; }
.sound-hint { margin: -.4rem 0 1rem; }
.pm-sidebar {
  background: #ffffff; color: #292524;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem .9rem;
  display: flex; flex-direction: column; gap: .9rem;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  width: min(280px, 84vw); border-radius: 0;
  transform: translateX(-105%); visibility: hidden;
  transition: transform .2s ease, visibility .2s;
  overflow-y: auto; overscroll-behavior: contain;
}
.pm-sidebar.open { transform: none; visibility: visible; }
.pm-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(20, 10, 5, .5); }
.pm-brand-block { position: relative; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.pm-mark {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: var(--pm-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 800;
}
.pm-brand-text { min-width: 0; display: flex; flex-direction: column; }
.pm-brand-text strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; line-height: 1.2; overflow-wrap: anywhere; }
.pm-brand-text span { font-size: .8rem; color: var(--muted); }
.pm-collapse-btn {
  display: none; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: #fff; border: 1px solid var(--line2); color: var(--ink);
  font-size: 1rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow);
}
.pm-nav { display: flex; flex-direction: column; gap: .15rem; }
.side-group h3 { font-family: system-ui, sans-serif; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: .5rem .65rem 0; }
.side-group:first-child h3 { margin-top: 0; }
.side-btn {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  border: none; background: transparent; color: var(--ink);
  padding: .5rem .65rem; border-radius: 10px; font-size: .98rem;
  cursor: pointer; text-align: left;
}
.side-btn svg { width: 20px; height: 20px; flex: none; }
.side-btn span { min-width: 0; overflow-wrap: anywhere; }
.side-btn:hover { background: var(--card2); }
.side-btn.active { background: var(--pm-accent); color: #fff; font-weight: 700; }
.owner-section { display: none; }
.owner-section.active { display: block; }
@media (min-width: 1024px) {
  .pm-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 1rem; align-items: start; }
  .pm-shell.collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .pm-sidebar {
    position: sticky; top: 76px; transform: none; visibility: visible;
    width: auto; border-radius: var(--radius);
    max-height: calc(100vh - 88px); overflow-y: auto;
  }
  /* Collapsed: icons only, short enough to fit without scrolling, and
     overflow visible so the hover flyout labels are not clipped. */
  .pm-shell.collapsed .pm-sidebar { overflow-y: visible; max-height: none; }
  .pm-collapse-btn { display: flex; position: absolute; right: -14px; top: 6px; z-index: 3; }
  .pm-shell.collapsed .pm-brand-text,
  .pm-shell.collapsed .side-group h3,
  .pm-shell.collapsed .side-btn span { display: none; }
  .pm-shell.collapsed .pm-brand-block { justify-content: center; }
  .pm-shell.collapsed .side-btn { justify-content: center; padding-left: 0; padding-right: 0; position: relative; }
  .pm-shell.collapsed .side-btn:hover::after {
    content: attr(data-label); position: absolute; left: calc(100% + 12px); top: 50%;
    transform: translateY(-50%); background: #292524; color: #fff;
    padding: .35rem .6rem; border-radius: 8px; font-size: .85rem; font-weight: 600;
    white-space: nowrap; z-index: 50; pointer-events: none; box-shadow: var(--shadow);
  }
  .pm-backdrop { display: none !important; }
  .pm-hamburger { display: none; }
}
@media (max-width: 640px) {
  .pm-topbar .owner-branch-switcher select { max-width: 130px; }
}
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin-bottom: 1rem; }
.stat { display: flex; flex-direction: column; gap: .2rem; margin-bottom: 0; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-value { font-size: 1.5rem; font-weight: 800; }
@media (min-width: 860px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.revenue-line { font-weight: 700; margin: .2rem 0 .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.chip { border: 1px solid var(--line2); border-radius: 999px; padding: .2rem .6rem; font-size: .85rem; background: var(--card2); }
.chip.busy { background: var(--amber-bg); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }

/* Order cards (orders list + kitchen + history) */
.order-card { background: var(--card2); border: 1px solid var(--line); border-radius: 16px; padding: .8rem; margin-bottom: .6rem; }
.order-card.overdue { border: 2px solid var(--red); }
.order-card-head { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; }
.order-items { margin: .5rem 0; padding-left: 1.1rem; }
.order-items li { font-size: .95rem; }
.order-meta { color: var(--muted); font-size: .88rem; }
.order-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.kitchen-grid { display: grid; grid-template-columns: 1fr; gap: .7rem; margin-bottom: .4rem; }
.kitchen-grid .order-card { margin-bottom: 0; }
.kitchen-countdown { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent2); }
.kitchen-board .kitchen-countdown { color: #fb923c; }
.kitchen-countdown.overdue-text { color: var(--red); }
.kitchen-board .kitchen-countdown.overdue-text { color: #f87171; }
.overdue-badge, .new-badge, .paid-badge { border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; font-weight: 800; }
.overdue-badge { background: var(--red); color: #fff; }
.new-badge { background: var(--blue-bg); color: var(--blue-ink); }
.paid-badge { background: var(--green-bg); color: var(--green-ink); }
.prep-stepper { display: flex; gap: .4rem; align-items: center; margin: .5rem 0; flex-wrap: wrap; }
.prep-stepper button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.prep-stepper .prep-value { font-weight: 800; font-size: 1.05rem; min-width: 74px; text-align: center; }
.history-row { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 12px; margin-bottom: .45rem; background: var(--card2); font-size: .92rem; }

/* Tables */
.tables-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; }
@media (min-width: 600px) { .tables-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .tables-grid { grid-template-columns: repeat(3, 1fr); } }
.table-card { background: var(--card2); border: 1px solid var(--line); border-radius: 16px; padding: .8rem; text-align: center; }
.table-card.inactive { opacity: .6; }
.table-card img { max-width: 180px; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px; }
.table-card .mono { text-align: left; }
.table-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.table-card-head h3 { margin: 0; }
.table-label-row { display: flex; gap: .4rem; margin: .5rem 0; }
.table-label-row input { margin-top: 0; }
.qr-general { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.qr-general img { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px; flex-shrink: 0; }
.qr-general-text { flex: 1; min-width: 220px; }
.explainer { margin: .4rem 0; padding-left: 1.2rem; }
.explainer li { margin-bottom: .45rem; }

/* Print-all-table-cards mode */
#print-overlay { position: fixed; inset: 0; z-index: 50; background: #fff; color: #111; overflow-y: auto; padding: 1rem; }
.print-toolbar { max-width: 900px; margin: 0 auto 1rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; }
.print-toolbar h2 { margin: 0; color: #111; }
.print-cards { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.print-card { border: 2px solid #111; border-radius: 12px; padding: 1rem; text-align: center; break-inside: avoid; }
.print-card h3 { color: #111; font-size: 1.4rem; margin-bottom: .2rem; }
.print-card p { margin: .25rem 0; font-size: .9rem; color: #333; }
.print-card img { width: 200px; height: 200px; background: #fff; padding: 6px; }
@media print {
  body { background: #fff; }
  header, main, footer, #toast-wrap, .cart-bar, .sheet-overlay, .cart-sheet { display: none !important; }
  #print-overlay { position: static; display: block !important; overflow: visible; padding: 0; }
  #print-overlay[hidden] { display: none !important; }
  .print-toolbar { display: none !important; }
  .print-cards { max-width: none; }
  /* Receipt / KOT printing: body.printing-doc prints ONLY #print-doc. */
  body.printing-doc > *:not(#print-doc) { display: none !important; }
  body.printing-doc #print-doc { display: block !important; }
}

/* Menu manager + import */
.mm-photo-row { display: flex; gap: .8rem; align-items: center; margin: .4rem 0 .6rem; }
.mm-photo-preview { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: #fff; flex-shrink: 0; }
.mm-photo-row p { margin: 0 0 .4rem; }
.drop-zone { border: 2px dashed var(--line2); border-radius: 16px; padding: 1.6rem 1rem; text-align: center; cursor: pointer; background: var(--card2); }
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-plus { width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 2rem; cursor: pointer; line-height: 1; }
.drop-title { font-weight: 700; font-size: 1.05rem; margin: .6rem 0 .2rem; }
.review-row { display: grid; grid-template-columns: 1fr; gap: .4rem; border: 1px solid var(--line); border-radius: 14px; padding: .6rem; margin-bottom: .5rem; background: var(--card2); }
.review-row.uncertain { border-color: var(--amber); background: var(--amber-bg); }
.review-row label { margin-bottom: 0; }
@media (min-width: 700px) { .review-row { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; } }
.mm-item { display: flex; gap: .8rem; align-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 16px; padding: .7rem .8rem; margin-bottom: .5rem; flex-wrap: wrap; }
.mm-item.sold-out { opacity: .6; }
.mm-item .item-photo { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); background: var(--card3); }
.mm-item .item-info { flex: 1; min-width: 180px; }
.item-name { font-weight: 700; }
.item-desc { color: var(--muted); font-size: .88rem; }

/* Analytics */
.range-toggle { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.range-btn { border: 1px solid var(--line2); background: var(--card2); color: var(--ink); padding: .5rem 1rem; border-radius: 999px; cursor: pointer; }
.range-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; overflow-x: auto; padding-bottom: 4px; }
.bar-col { flex: 1; min-width: 34px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 100%; max-width: 44px; background: linear-gradient(180deg,#fb923c,#c2410c); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar-label { font-size: .7rem; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.bar-value { font-size: .7rem; font-weight: 700; white-space: nowrap; }
.kv-row { display: flex; justify-content: space-between; gap: .8rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); font-size: .95rem; flex-wrap: wrap; }
.kv-row:last-child { border-bottom: none; }

/* Admin */
.admin-totals { margin-bottom: .8rem; }
@media (min-width: 860px) { .admin-totals { grid-template-columns: repeat(5, 1fr); } }
.rest-card { background: var(--card2); border: 1px solid var(--line); border-radius: 16px; padding: .9rem; margin-bottom: .7rem; }
.rest-card.suspended { border-color: var(--red); background: var(--red-bg); }
.rest-head { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; }
.rest-stats { display: flex; flex-wrap: wrap; gap: 1rem; margin: .5rem 0; font-size: .92rem; }
.rest-edit { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-top: .6rem; }
.rest-edit label { min-width: 150px; flex: 1; margin-bottom: 0; }
.footer { text-align: center; padding: 1rem; }

/* Overview: range selector, clickable stat cards, drill-down modal */
.ov-date-line { margin: -.3rem 0 .8rem; font-size: 1rem; font-weight: 600; color: var(--ink); }
.ov-range-row label { max-width: 300px; }
.stat-clickable { font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; appearance: none; }
.stat-clickable:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.stat-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stat-hint { font-size: .8rem; color: var(--accent); font-weight: 700; }
.ov-overlay { z-index: 42; }
.ov-modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 43; width: min(92vw, 560px); max-height: 84vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.35); padding: 1rem; }
.ov-modal-foot { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .6rem; font-size: 1.05rem; }

/* Recent-orders rows (Overview "Recent orders" list + drill-down modals):
   3-part rows — prominent header, item list, total + status last. Theme
   variables only, so the rows read correctly in the light theme and in
   OS dark mode; long item lists wrap inside the row, never overflow. */
.ov-order-row { padding: .6rem 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.ov-order-row:last-child { border-bottom: none; }
.ov-order-head { display: flex; flex-wrap: wrap; gap: .15rem .8rem; justify-content: space-between; align-items: baseline; min-width: 0; }
.ov-order-title { font-size: 1.12rem; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.ov-order-time { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.ov-order-items { font-size: .95rem; line-height: 1.5; color: var(--ink); margin-top: .15rem; overflow-wrap: anywhere; }
.ov-order-foot { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; margin-top: .3rem; font-size: .95rem; }
.ov-order-total { font-size: 1rem; font-weight: 800; }
.ov-order-sep { color: var(--muted); }

/* Overview: active-tables card — one chair-table-chair visual per active
   table. Each visual is a <button> opening the table detail modal.
   Green = table has a live order (new/preparing/ready); blue = served,
   awaiting payment (no live order); yellow = free. Occupied visuals show
   a small live sitting timer under the status line; free tables show
   none. Number sits on the table top itself. Blue uses the --blue-*
   variables (defined for light and OS-dark) plus a fixed mid-blue border
   that reads on both, so the Served state stays distinct in either
   theme. */
.ov-tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.ov-table-visual { background: var(--card2); border: 1.5px solid var(--line); border-radius: 16px; padding: .7rem .5rem .8rem; text-align: center; font: inherit; color: inherit; width: 100%; cursor: pointer; appearance: none; }
.ov-table-visual:hover { background: var(--accent-soft); border-color: var(--accent-line); }
.ov-table-visual:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ov-table-visual.is-active { border-color: var(--green); }
.ov-table-visual.is-served { border-color: #60a5fa; }
.ov-table-visual.is-free { border-color: #eab308; }
.ov-seating { width: 100%; max-width: 180px; height: auto; display: block; margin: 0 auto .2rem; }
.ov-chair rect { fill: var(--card3); stroke: var(--muted); stroke-width: 1.5; }
.ov-table-top { fill: #fef9c3; stroke: #eab308; stroke-width: 2; }
.is-active .ov-table-top { fill: var(--green-bg); stroke: var(--green); }
.is-served .ov-table-top { fill: var(--blue-bg); stroke: #60a5fa; }
.ov-table-num { font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 700; fill: #292524; }
.is-active .ov-table-num { fill: var(--green-ink); }
.is-served .ov-table-num { fill: var(--blue-ink); }
.ov-table-caption { font-weight: 800; font-size: .95rem; }
.ov-table-pill { display: inline-block; border-radius: 999px; padding: .15rem .7rem; font-size: .8rem; font-weight: 800; margin-top: .25rem; }
.ov-table-pill.pill-active { background: var(--green-bg); color: var(--green-ink); border: 1px solid var(--green); }
.ov-table-pill.pill-served { background: var(--blue-bg); color: var(--blue-ink); border: 1px solid #60a5fa; }
.ov-table-pill.pill-free { background: #fef9c3; color: #854d0e; border: 1px solid #eab308; }
.ov-table-status { font-size: .82rem; color: var(--muted); min-height: 1.2em; }
.ov-table-sitting { font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); min-height: 1.2em; }
.is-served .ov-table-sitting { color: var(--blue-ink); }
/* POS-only extras on the shared visuals (emitted only with ovTableVisual
   opts): the meta line (custom table name / seat count), the live
   running total, the neutral state (no overview access — grey, no
   occupancy claim) and the selected affordance. Selected uses outline
   + shadow only, never border-color, so it never clashes with the
   Active/Served/Free border colors. */
.ov-table-meta { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.ov-table-running-total { font-size: .95rem; font-weight: 800; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.ov-table-visual.is-neutral { border-color: var(--line); }
.is-neutral .ov-table-top { fill: var(--card3); stroke: var(--muted); }
.is-neutral .ov-table-num { fill: var(--ink); }
.ov-table-visual.is-selected { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--accent-soft); }

/* Table detail modal orders (inside the shared Overview drill-down modal) */
.ov-sitting-line { background: var(--blue-bg); color: var(--blue-ink); border-radius: 10px; padding: .55rem .7rem; font-weight: 700; margin-bottom: .7rem; font-variant-numeric: tabular-nums; }
.ov-section-label { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .7rem 0 .4rem; }
.ov-section-label:first-child { margin-top: 0; }
.ov-paid-row { margin-top: .7rem; }
.ov-table-order { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; margin-bottom: .7rem; background: var(--card2); }
.ov-table-order.overdue { border: 2px solid var(--red); }
.ov-table-order.is-served-unpaid { border-left: 4px solid #60a5fa; }
.ov-table-order-head { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; }
.ov-table-condition { font-weight: 700; margin-top: .25rem; }
.ov-table-items { list-style: none; margin: .5rem 0; padding: 0; }
.ov-table-items li { display: flex; justify-content: space-between; gap: .8rem; padding: .15rem 0; }
.ov-table-total { display: flex; justify-content: space-between; gap: .8rem; border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .4rem; }
.ov-table-timer { margin-top: .5rem; }

@media (max-width: 700px) {
  :root { --header-h: 118px; }
  .topbar-row { gap: .45rem; }
  .brand-text h1 { font-size: 1.1rem; }
  .hero-content h2 { font-size: 1.6rem; }
  .countdown-big { font-size: 2.8rem; }
  .dish-grid { gap: .55rem; }
  .print-cards { grid-template-columns: 1fr; }
  #view-menu { padding-bottom: 76px; }
}

/* ---------- Brand dashboard ---------- */
/* Light owner/admin styling (theme variables only). One card per branch;
   single-branch brands show one card with no special-casing. The menu-copy
   panel is inline inside the target branch's card: pick a same-brand
   source branch, copy, and the "N copied, M skipped" report stays visible
   in the card. */
.brand-select-row label { max-width: 300px; }
.brand-cards { display: grid; grid-template-columns: 1fr; gap: .8rem; }
@media (min-width: 600px) { .brand-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .brand-cards { grid-template-columns: repeat(3, 1fr); } }
.brand-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem; min-width: 0; }
.brand-card.suspended { border-color: var(--red); }
.brand-card-head { display: flex; flex-wrap: wrap; gap: .4rem .6rem; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.brand-card-head h3 { margin: 0; overflow-wrap: anywhere; }
.brand-card-stats { margin: .2rem 0 .6rem; }
.brand-card-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.brand-copy-panel { border-top: 1px dashed var(--line); margin-top: .7rem; padding-top: .7rem; }
.brand-copy-panel label { margin-bottom: .5rem; }
.brand-copy-result { font-weight: 700; margin: .5rem 0 0; overflow-wrap: anywhere; }
.brand-copy-result.error { color: var(--red); }
/* Owner dashboard redesign (2026-11-15; nav restructure 2026-11-15t):
   the "Branches" heading shows for owners (super admins keep the
   Owner selector + cards as before). Clicking a branch card selects
   it — the selected card is outlined — and opens its full Branch
   Manager panel in the standalone view. Sub-page headers and the
   Reports breakdown rows live here too. */
#brand-branches-heading { margin: 1.2rem 0 .6rem; }
.brand-card { cursor: pointer; }
.brand-card.selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.od-page-head { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; justify-content: space-between; margin: 0 0 .8rem; }
.od-page-head h2 { margin: 0; }
.od-page-head .row-gap { margin-bottom: 0; }
.od-report-row { padding: .7rem 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .35rem; }
.od-report-row:first-child { border-top: none; padding-top: 0; }
.od-report-row-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.od-report-row .brand-card-mini { grid-template-columns: repeat(4, 1fr); }
.od-back-row { margin: 0 0 .6rem; }
@media (max-width: 480px) {
  .od-report-row .brand-card-mini { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Call waiter ---------- */
/* Customer fixed button: bottom-right, fixed while scrolling. Theme-
   independent gold-on-charcoal styling reads on the light menu and the
   dark (Wok Chef) menu alike. JS adds .lifted while the floating cart
   bar is visible (so the two never overlap) and hides the button while
   the cart sheet or the preparing screen is open. */
.call-waiter-fab { position: fixed; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 29; display: flex; align-items: center; gap: .45rem; padding: .7rem 1rem; border-radius: 999px; border: 1px solid #b8860b; background: linear-gradient(135deg, #2b2118, #1f1a17); color: #fde68a; font-size: .95rem; font-weight: 700; font-family: inherit; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.35); max-width: calc(100vw - 28px); white-space: nowrap; }
.call-waiter-fab .waiter-icon { width: 22px; height: 22px; fill: #f5c542; flex-shrink: 0; }
.call-waiter-fab.lifted { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
.call-waiter-fab:hover { filter: brightness(1.15); }
.call-waiter-fab:disabled { opacity: .72; cursor: default; filter: none; }
.call-waiter-fab.called { border-color: #4ade80; }
/* Preparing-screen Call waiter button: same gold styling, full width. */
.btn-call-waiter { display: flex; align-items: center; justify-content: center; gap: .5rem; background: linear-gradient(135deg, #2b2118, #1f1a17); border: 1px solid #b8860b; color: #fde68a; margin-bottom: .6rem; }
.btn-call-waiter:hover { filter: brightness(1.15); background: linear-gradient(135deg, #2b2118, #1f1a17); }
.btn-call-waiter .waiter-icon { width: 22px; height: 22px; fill: #f5c542; flex-shrink: 0; }
.btn-call-waiter:disabled { opacity: .72; cursor: default; filter: none; }
.btn-call-waiter.called { border-color: #4ade80; }
/* Staff alerts: blinking banner (text + bell icon, not color-only), one
   line per REQUEST (multiple requests from one table list individually),
   each with its own Attended button. The same amber banner is used in
   the Owner panel and on the dark kitchen boards. */
@keyframes waiterBlink { 0%, 100% { background-color: #fef3c7; border-color: #d97706; } 50% { background-color: #fde68a; border-color: #b45309; } }
@keyframes callingBlink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.waiter-alerts { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.waiter-alerts[hidden] { display: none; }
.waiter-alert { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; border: 2px solid #d97706; border-radius: 14px; padding: .7rem .9rem; font-weight: 700; color: #78350f; animation: waiterBlink 1.1s ease-in-out infinite; }
.waiter-alert .waiter-icon { width: 24px; height: 24px; fill: #b45309; flex-shrink: 0; }
.waiter-alert-text { flex: 1; min-width: 160px; font-size: 1.02rem; }
.waiter-alert .btn-attended { flex-shrink: 0; background: #78350f; border-color: #78350f; color: #fff; }
.waiter-alert .btn-attended:hover { background: #451a03; }
.waiter-alerts-kitchen { margin-bottom: .8rem; }
/* Blinking badge on the affected table visual in the Active Tables card. */
.calling-badge { display: block; width: fit-content; margin: .3rem auto 0; border-radius: 999px; padding: .15rem .7rem; font-size: .8rem; font-weight: 800; background: #fef3c7; color: #92400e; border: 1.5px solid #d97706; animation: callingBlink 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .waiter-alert, .calling-badge { animation: none; } }
/* Waiter request card: one compact centered card (like the Overview
   drill-down modal), content-sized — it never covers the whole screen,
   and the dimmed page stays visible around it. Uses theme
   variables (applyMenuTheme sets them on #waiter-card, as on the cart
   sheet), so the same markup reads on the light menu and the dark
   (Wok Chef) menu. z-index sits above the cart sheet / overview modal. */
.waiter-card-overlay { z-index: 44; }
.waiter-card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 45; width: min(92vw, 560px); max-height: 84vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.waiter-card-sub { color: var(--muted); margin: 0 0 .8rem; font-size: .95rem; }
/* Options render as small tiles in a 3-column grid (DOM order = row
   order: Water, Napkins, Cutlery / Clean table, Get bill, Assistance).
   The same grid holds the Water sub-step's priced bottle tiles. Tiles
   are vertical: icon on top, label under it, price/hint/cooldown below.
   The water tile's chevron sits in its top-right corner. */
.wc-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.wc-option { display: flex; flex-direction: column; align-items: center; gap: .35rem; width: 100%; min-width: 0; padding: .75rem .35rem .65rem; border: 1px solid var(--line2); border-radius: 14px; background: var(--card2); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 700; text-align: center; cursor: pointer; position: relative; }
.wc-option:hover:not(:disabled) { background: var(--card3); border-color: var(--accent-line); }
.wc-option:focus-visible, .wc-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wc-option:disabled { opacity: .62; cursor: default; }
.wc-option-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wc-option-icon .wc-icon { width: 24px; height: 24px; }
.wc-option-label { min-width: 0; overflow-wrap: break-word; line-height: 1.25; }
.wc-option-price { font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.wc-option-hint { font-size: .78rem; font-weight: 600; color: var(--muted); line-height: 1.25; }
.wc-water-note { color: var(--muted); margin: 0 0 .6rem; font-size: .9rem; }
.wc-chevron { position: absolute; top: .3rem; right: .5rem; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.wc-cooldown { font-variant-numeric: tabular-nums; font-weight: 800; font-size: .9rem; color: var(--amber-ink); background: var(--amber-bg); border: 1px solid var(--amber); border-radius: 999px; padding: .2rem .65rem; white-space: nowrap; flex-shrink: 0; }
.wc-back { display: inline-flex; align-items: center; gap: .3rem; background: none; border: none; color: var(--accent); font: inherit; font-weight: 700; font-size: .98rem; cursor: pointer; padding: .3rem .2rem; margin-bottom: .6rem; }
.wc-back-icon { width: 20px; height: 20px; }
/* Table-picker attention flash: shown when Call waiter is tapped before a
   table has been picked (general menu link with no table in the URL). */
.table-picker-attention { outline: 3px solid #f5c542; outline-offset: 3px; border-radius: 12px; }
/* Cart quotation (replaces the old payment disclaimer in the cart sheet). */
.cart-quote { font-family: Georgia, "Times New Roman", serif; font-style: italic; color: var(--muted); text-align: center; margin: .3rem 0 .7rem; font-size: 1rem; }

/* ---------- Get Bill flow (customer panel) ----------
   One compact centered panel like the waiter request card, content-sized,
   themed via applyMenuTheme (theme variables on #bill-panel) so it reads
   on the light menu and the dark (Wok Chef) menu alike. */
.bill-overlay { z-index: 46; }
.bill-panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 47; width: min(92vw, 560px); max-height: 84vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
#bill-panel[data-theme="dark"] h2 { color: var(--theme-heading, var(--ink)); }
#bill-panel[data-theme="dark"] .btn-primary { background: var(--accent-gradient, var(--accent)); border-color: transparent; }
.bill-order { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; margin-bottom: .6rem; background: var(--card2); }
.bill-order-head { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; }
.bill-items { list-style: none; margin: .45rem 0; padding: 0; }
.bill-items li { display: flex; justify-content: space-between; gap: .8rem; padding: .15rem 0; }
.bill-order-total { display: flex; justify-content: space-between; gap: .8rem; border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .35rem; }
.bill-grand { display: flex; justify-content: space-between; gap: .8rem; font-size: 1.2rem; font-weight: 800; margin: .7rem 0; }
.bill-method-label { font-weight: 700; margin: .6rem 0 .45rem; }
.bill-methods { display: flex; flex-direction: column; gap: .55rem; }
.bill-method { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; width: 100%; padding: .75rem .85rem; border: 1px solid var(--line2); border-radius: 14px; background: var(--card2); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.bill-method:hover { background: var(--card3); border-color: var(--accent-line); }
.bill-method:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bill-method-name { font-weight: 800; font-size: 1.02rem; }
.bill-method-hint { font-size: .88rem; color: var(--muted); font-weight: 400; }
.bill-result { text-align: center; padding: .4rem 0 .2rem; }
.bill-result h3 { margin-bottom: .3rem; }
.bill-sent h3 { color: var(--green); }
/* Reward discount lines in the customer bill panel: one row per applied
   discount, then the reduced total. The original total stays visible. */
.bill-discount-row { display: flex; justify-content: space-between; gap: .8rem; padding: .35rem 0; color: var(--green); font-weight: 700; }
.bill-original-total { text-align: right; color: var(--muted); font-size: .9rem; margin: -.3rem 0 .4rem; }
/* Customer "Collect reward" button + applied state in the bill panel:
   the label is long ("Collect reward — 50% off your meal"), so the
   button wraps instead of overflowing on a 390px phone. */
.bill-collect-reward { margin: .2rem 0 .3rem; white-space: normal; line-height: 1.35; }
.bill-collect-hint { margin: 0 0 .6rem; color: var(--muted); font-size: .88rem; text-align: center; }
.bill-reward-applied { border: 1px solid var(--green); background: var(--green-bg); color: var(--green-ink); border-radius: 12px; padding: .6rem .8rem; font-weight: 700; margin: .2rem 0 .6rem; }

/* ---------- Entry screen (table QR/NFC links) ----------
   Mobile-first, theme-aware: every color comes from the theme variables
   applyMenuTheme sets on #view-menu, so Wok Chef's dark red-orange theme
   and the default light warm theme both read correctly. The hero shows
   the restaurant's theme hero photo when one exists, else an accent
   gradient banner (no invented photos). The circular logo overlaps the
   banner bottom-left: a logo image when the theme has one, else the
   restaurant's initial letter. */
#entry-screen { max-width: 560px; margin: 0 auto 1rem; }
.entry-hero { position: relative; height: 190px; border-radius: var(--radius); overflow: visible; margin-bottom: 44px; }
.entry-hero-media { position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: var(--shadow); }
.entry-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry-hero-media.entry-hero-gradient::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 160% at 15% 0%, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 55%); }
.entry-logo { position: absolute; left: 16px; bottom: -30px; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; border: 3px solid var(--card); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; font-family: Georgia, "Times New Roman", serif; font-size: 1.9rem; font-weight: 800; overflow: hidden; z-index: 2; }
.entry-logo img { width: 100%; height: 100%; object-fit: cover; }
.entry-head { padding: 0 .2rem; }
.entry-head h2 { font-size: 1.6rem; margin: 0 0 .15rem; }
#view-menu[data-theme="dark"] .entry-head h2 { color: var(--theme-heading, var(--ink)); }
.entry-tagline { margin: 0 0 .3rem; color: var(--muted); font-size: .98rem; }
.entry-table { margin: 0 0 .9rem; color: var(--muted); font-size: .92rem; }
.entry-cards { display: flex; flex-direction: column; gap: .6rem; }
.entry-card { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; padding: .85rem .95rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; box-shadow: var(--shadow); text-decoration: none; }
.entry-card:hover { border-color: var(--accent-line); background: var(--card2); }
.entry-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.entry-card-icon { width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.entry-card-icon svg { width: 26px; height: 26px; }
.entry-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.entry-card-label { font-weight: 800; font-size: 1.05rem; line-height: 1.25; }
.entry-card-sub { color: var(--muted); font-size: .88rem; line-height: 1.3; }
.entry-card-dots { display: flex; gap: 5px; margin-top: .3rem; }
.entry-card-dots[hidden] { display: none; }
.entry-dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--accent); background: transparent; }
.entry-dot.filled { background: var(--accent); }
.entry-card-chevron { color: var(--muted); font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.entry-socials { display: flex; gap: 1rem; justify-content: center; margin-top: 1.2rem; }
.entry-socials[hidden] { display: none; }
.entry-socials a { width: 46px; height: 46px; padding: 0; border: none; background: none; display: flex; align-items: center; justify-content: center; }
.entry-socials a:hover { transform: scale(1.07); }
.entry-socials a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 14px; }
.entry-socials svg { width: 46px; height: 46px; display: block; filter: drop-shadow(0 3px 6px rgba(0,0,0,.28)); transition: transform .15s ease, filter .15s ease; }
.entry-socials a:hover svg { filter: drop-shadow(0 5px 10px rgba(0,0,0,.32)); }
.entry-home-link { background: none; border: none; color: var(--accent); font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; padding: .4rem .4rem .4rem 0; margin-right: .4rem; white-space: nowrap; }
.entry-home-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Rewards / stamp card ---------- */
#entry-rewards-view, #entry-suggestion-view { max-width: 560px; margin: 0 auto 1rem; }
.stamp-card { text-align: center; }
.stamp-slots { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; margin: .9rem 0 .5rem; }
.stamp-slot { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 2px dashed var(--line2); background: var(--card2); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.stamp-slot.filled { border-style: solid; border-color: var(--accent); background: var(--accent); }
.stamp-slot svg { width: 26px; height: 26px; }
.stamp-slot .stamp-num { color: var(--muted); font-weight: 700; font-size: .95rem; }
.stamp-slot.is-bonus::after { content: "★"; position: absolute; top: -9px; right: -5px; font-size: 15px; line-height: 1; color: var(--amber); text-shadow: 0 0 0 #fff; }
.stamp-progress { font-weight: 800; font-size: 1.1rem; margin: .3rem 0; }
.reward-banner { border-radius: 12px; padding: .7rem .9rem; font-weight: 700; margin: .7rem 0; }
.reward-banner.advance { background: var(--amber-bg); border: 1px solid var(--amber); color: var(--amber-ink); }
.reward-banner.ready { background: var(--green-bg); border: 1px solid var(--green); color: var(--green-ink); }
.rewards-identity { color: var(--muted); font-size: .92rem; margin: .5rem 0; }
.linklike { background: none; border: none; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.cart-identity-row { margin: .6rem 0 0; font-size: .92rem; text-align: center; color: var(--muted); }
.cart-identity-row strong { color: var(--ink); }

/* ---------- Staff reward block (table detail modal) ---------- */
.reward-block { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 12px; padding: .7rem .85rem; margin-bottom: .7rem; }
.reward-block.applied { border-color: var(--green); background: var(--green-bg); }
.reward-block-title { font-weight: 800; margin-bottom: .2rem; }
.reward-block .muted { margin: .15rem 0; }
.reward-block .btn { margin-top: .45rem; }
.reward-discount-line { display: flex; justify-content: space-between; gap: .8rem; font-weight: 700; margin-top: .3rem; }

/* ---------- Customers + Suggestions (Owner) ---------- */
.customer-row { display: grid; grid-template-columns: minmax(110px, 1.5fr) minmax(140px, 1.2fr) auto auto auto auto; grid-template-areas: "name phone stamps visits lastvisit lastbill"; gap: .3rem .9rem; align-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .85rem; margin-bottom: .5rem; }
.customer-row[role="button"] { cursor: pointer; }
.customer-row[role="button"]:hover { border-color: var(--accent-line); }
.customer-row[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.customer-head { background: transparent; border: none; padding: .1rem .85rem .3rem; margin-bottom: 0; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.customer-cell { min-width: 0; overflow-wrap: anywhere; }
.customer-row .customer-name { grid-area: name; font-weight: 800; }
.customer-phone { grid-area: phone; }
.customer-stamps { grid-area: stamps; font-weight: 800; white-space: nowrap; }
.customer-stamps .stamp-mini { color: var(--accent); letter-spacing: 1px; }
.customer-visits { grid-area: visits; white-space: nowrap; }
.customer-lastvisit { grid-area: lastvisit; white-space: nowrap; color: var(--muted); font-size: .9rem; }
.customer-lastbill { grid-area: lastbill; white-space: nowrap; font-weight: 700; }
.customer-wa { display: inline-flex; align-items: center; gap: .35rem; color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; padding: .15rem .1rem; border-radius: 6px; }
.customer-wa svg { flex-shrink: 0; }
.customer-wa.is-none { color: var(--muted); text-decoration: none; font-weight: 400; }
@media (max-width: 640px) {
  .customer-head { display: none; }
  .customer-row { grid-template-columns: 1fr auto; grid-template-areas: "name stamps" "phone phone" "visits lastvisit" "lastbill lastbill"; }
  .customer-lastvisit, .customer-visits { font-size: .88rem; }
  .customer-lastbill { font-size: .95rem; }
}
/* Customer detail modal (shares .ov-modal positioning). */
.cust-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; margin: .4rem 0 .8rem; }
.cust-stat { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .7rem; }
.cust-stat-label { display: block; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cust-stat.is-unpaid { border-color: var(--amber, #b45309); }
.cust-visit-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: .3rem .8rem; align-items: baseline; border-top: 1px solid var(--line); padding: .5rem 0; }
.cust-visit-row:last-child { border-bottom: 1px solid var(--line); }
.cust-visit-total { font-weight: 800; white-space: nowrap; }
.cust-visit-stamps { color: var(--muted); font-size: .88rem; white-space: nowrap; }
@media (max-width: 480px) {
  .cust-visit-row { grid-template-columns: 1fr auto; }
}
.suggestion-row { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .85rem; margin-bottom: .5rem; }
.suggestion-row .suggestion-message { overflow-wrap: anywhere; white-space: pre-wrap; }
.suggestion-row .suggestion-meta { color: var(--muted); font-size: .88rem; margin-top: .3rem; }

/* ---------- Login + accounts (2026-11-15) ---------- */
/* Header user menu: name + role label, Change password, Log out. */
.auth-menu { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.auth-user { font-size: .9rem; white-space: nowrap; }
.auth-role { color: var(--muted); font-size: .82rem; font-weight: 600; }
/* Auth views are global pages on the DEFAULT LIGHT theme — never
   per-restaurant themed, and never OS-dark. The light palette is pinned
   on the view itself so every control inside reads the light values. */
.auth-view {
  color-scheme: light;
  --bg: #fffbf5; --card: #ffffff; --card2: #fff7ed; --card3: #ffedd5;
  --ink: #292524; --muted: #78716c; --line: #e7e5e4; --line2: #d6d3d1;
  --accent: #c2410c; --accent2: #ea580c; --accent-dark: #9a3412;
  --accent-soft: #fff7ed; --accent-line: #fdba74;
  --green: #15803d; --green-bg: #dcfce7; --green-ink: #14532d;
  --red: #b91c1c; --red-bg: #fee2e2; --red-ink: #7f1d1d;
  --amber: #b45309; --amber-bg: #fef3c7; --amber-ink: #78350f;
  --blue-bg: #dbeafe; --blue-ink: #1e3a8a;
  --shadow: 0 6px 24px rgba(41,37,36,.08);
  color: var(--ink);
}
.auth-card { max-width: 460px; margin: 1.5rem auto; }
.auth-card h2 { text-align: center; }
.auth-switch { text-align: center; color: var(--muted); font-size: .92rem; }
/* Auth landing redesign (2026-11-15): login + signup only. Scoped to
   .auth-card-landing so the change-password card keeps its old look.
   Pinned-light via .auth-view above; mobile-first, nothing wider than
   the card, no horizontal overflow at 390px. */
.auth-card-landing { max-width: 480px; padding: 1.6rem 1.5rem 1.4rem; border-top: 4px solid var(--accent); }
.auth-card-landing h2 { font-size: 1.7rem; margin-bottom: .35rem; }
.auth-eyebrow { text-align: center; margin: 0 0 .35rem; font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.auth-card-landing .auth-sub { text-align: center; margin-bottom: 1.1rem; }
.auth-trial { text-align: center; font-weight: 700; font-size: .95rem; background: var(--green-bg); border: 1px solid var(--green); color: var(--green-ink); border-radius: 12px; padding: .65rem .9rem; margin: 0 0 .8rem; }
.auth-field { margin-bottom: .9rem; }
.auth-field-label { display: block; }
.auth-field input { margin-top: .3rem; padding: .7rem .7rem; }
.auth-field-hint { display: block; font-weight: 400; font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.auth-card-landing .remember-line { margin: .2rem 0 .9rem; }
.auth-card-landing .btn-block { padding: .85rem; }
.auth-forgot { text-align: center; margin-top: .8rem; }
.auth-card-landing .auth-switch { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: 1rem; margin-bottom: 0; }
@media (max-width: 480px) {
  .auth-card-landing { margin: 1rem auto; padding: 1.3rem 1.1rem 1.2rem; }
  .auth-card-landing h2 { font-size: 1.5rem; }
}
#cp-back { margin-top: .6rem; }
/* Trial countdown (Owner dashboard). */
.trial-banner { border-radius: 12px; padding: .7rem .9rem; font-weight: 700; margin-bottom: .8rem; background: var(--green-bg); border: 1px solid var(--green); color: var(--green-ink); }
.trial-banner.expired { background: var(--red-bg); border-color: var(--red); color: var(--red-ink); }
/* Owner branch switcher (Branch Manager panel header). */
.owner-branch-switcher { display: flex; align-items: center; gap: .45rem; font-size: .88rem; font-weight: 600; margin-bottom: 0; }
.owner-branch-switcher select { width: auto; min-width: 150px; margin-top: 0; }
/* Staff + owner rows (shared layout). */
.staff-row { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .85rem; margin-bottom: .5rem; }
.staff-main { overflow-wrap: anywhere; }
.staff-meta { display: flex; flex-wrap: wrap; gap: .3rem .5rem; color: var(--muted); font-size: .9rem; margin: .25rem 0 .5rem; overflow-wrap: anywhere; }
.staff-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.staff-editor { margin-top: .7rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.staff-form { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; }
/* Subscription payments (2026-11-15): pending-count badge on the Admin
   nav button + the Payments heading, history totals, billing plan rows
   (which reuse .staff-row/.staff-meta). No new colors — pills only. */
.switch-btn .nav-count { margin-left: .35rem; padding: 0 .45rem; font-size: .75rem; }
#payments-pending-badge { margin-left: .4rem; vertical-align: middle; }
#payments-totals { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .85rem; margin: .6rem 0; }
#payments-totals .kv-row { display: flex; flex-wrap: wrap; gap: .2rem .6rem; justify-content: space-between; }
#billing-card h3, #payments-card h3 { margin-top: 1rem; }
#billing-plans { margin-bottom: .4rem; }
#billing-form textarea, #payments-card textarea { width: 100%; box-sizing: border-box; }
/* Permission checkboxes: two-column grid on wide screens, one on mobile. */
.perm-checkboxes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .15rem .8rem; margin-bottom: .6rem; }
@media (max-width: 480px) { .perm-checkboxes { grid-template-columns: 1fr; } }
.perm-checkboxes .check-line { margin-bottom: .35rem; }

/* ---------- Password-field UX (2026-11-15) ----------
   Eye show/hide toggle + keep-me-logged-in checkbox. Colors come from
   theme variables only, so the toggle reads on the pinned-light auth
   views and on Owner/Admin panels in light and OS-dark alike. The
   toggle sits inside the field's right edge; the input keeps right
   padding so typed text never slides under the icon. */
.pw-wrap { position: relative; display: block; margin-top: .25rem; }
.pw-wrap input[type="password"], .pw-wrap input[type="text"] { margin-top: 0; padding-right: 52px; }
.pw-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; min-width: 44px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 10px; color: var(--muted); cursor: pointer; padding: 0; }
.pw-toggle:hover { color: var(--ink); background: var(--card2); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pw-toggle svg { width: 22px; height: 22px; flex: none; pointer-events: none; }
.remember-line { font-weight: 500; }
.remember-line input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Owner dashboard redesign (2026-11-18, light theme) ----------
   Light collapsible sidebar + content layout INSIDE #view-brand only;
   the top nav is untouched. The dashboard is pinned to the LIGHT
   palette (the theme vars are re-declared on #view-brand, so an OS
   dark preference never restyles it). --od-accent is the viewed
   brand's accent (see odBrandAccent in app.js; default #c2410c) and
   drives the active nav item, the highlighted revenue card, the hero
   and primary buttons inside this view only. Desktop (>=1024px): the
   sidebar is a sticky rail; the collapse arrow shrinks it to
   icons-only with hover flyout labels. Mobile: drawer overlay. */
#view-brand {
  --od-accent: #c2410c;
  color-scheme: light;
  /* `color` must be set here (not just the vars): without it, text that
     relies on inheritance (e.g. the top-bar user chip name) picks up
     the BODY's computed color, which under an OS dark preference is
     near-white — invisible on this view's white surfaces. Same leak
     family as the panel shell fix (2026-11-18 sidebarfix). */
  color: var(--ink);
  --bg: #fffbf5; --card: #ffffff; --card2: #fff7ed; --card3: #ffedd5;
  --ink: #292524; --muted: #78716c; --line: #e7e5e4; --line2: #d6d3d1;
  --accent: var(--od-accent); --accent2: var(--od-accent); --accent-dark: var(--od-accent);
  --accent-soft: #fff7ed; --accent-line: #fdba74;
  --green: #15803d; --green-bg: #dcfce7; --green-ink: #14532d;
  --red: #b91c1c; --red-bg: #fee2e2; --red-ink: #7f1d1d;
  --amber: #b45309; --amber-bg: #fef3c7; --amber-ink: #78350f;
  --blue-bg: #dbeafe; --blue-ink: #1e3a8a;
  --shadow: 0 6px 24px rgba(41,37,36,.08);
}
#view-brand {
  --accent-soft: color-mix(in srgb, var(--od-accent) 9%, #ffffff);
  --accent-line: color-mix(in srgb, var(--od-accent) 45%, #ffffff);
}
.od-shell { min-width: 0; }
.od-main { min-width: 0; }
.od-sidebar {
  background: #ffffff; color: #292524;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem .9rem;
  display: flex; flex-direction: column; gap: .9rem;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  width: min(280px, 84vw); border-radius: 0;
  transform: translateX(-105%); visibility: hidden;
  transition: transform .2s ease, visibility .2s;
  overflow-y: auto; overscroll-behavior: contain;
}
.od-sidebar.open { transform: none; visibility: visible; }
.od-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(20, 10, 5, .5); }
.od-brand-block { position: relative; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.od-mark {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: var(--od-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 800;
}
.od-brand-text { min-width: 0; display: flex; flex-direction: column; }
.od-brand-text strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; line-height: 1.2; overflow-wrap: anywhere; }
.od-brand-text span { font-size: .8rem; color: var(--muted); }
.od-collapse-btn {
  display: none; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: #fff; border: 1px solid var(--line2); color: var(--ink);
  font-size: 1rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow);
}
.od-nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: .5rem .65rem 0; }
.od-nav-label:first-child { margin-top: 0; }
.od-nav { display: flex; flex-direction: column; gap: .15rem; margin-bottom: 1rem; }
.od-nav-btn {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  border: none; background: transparent; color: var(--ink);
  padding: .55rem .65rem; border-radius: 10px; font-size: .98rem;
  cursor: pointer; text-align: left;
}
.od-nav-btn svg { width: 20px; height: 20px; flex: none; }
.od-nav-btn:hover { background: var(--card2); }
.od-nav-btn.active { background: var(--od-accent); color: #fff; font-weight: 700; }
.od-logout {
  margin-top: auto; display: flex; align-items: center; gap: .65rem;
  border: none; border-top: 1px solid var(--line); background: transparent;
  color: var(--ink); padding: .8rem .65rem .2rem; border-radius: 0 0 10px 10px;
  font-size: .98rem; cursor: pointer; text-align: left;
}
.od-logout svg { width: 20px; height: 20px; flex: none; }
.od-logout:hover { background: var(--card2); }
.od-topbar {
  display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; min-width: 0;
  flex-wrap: wrap; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: .5rem .6rem; box-shadow: var(--shadow);
}
.od-hamburger {
  width: 40px; height: 40px; flex: none; border: 1px solid var(--line2);
  background: var(--card); color: var(--ink); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.od-hamburger svg { width: 22px; height: 22px; }
.od-search {
  flex: 1; min-width: 140px; display: flex; align-items: center; gap: .45rem;
  background: var(--card); border: 1px solid var(--line2); border-radius: 999px;
  padding: .3rem .3rem .3rem .8rem; margin-bottom: 0; color: var(--muted);
}
.od-search svg { width: 19px; height: 19px; flex: none; }
.od-search input { border: none; margin-top: 0; padding: .35rem .2rem; min-width: 0; }
.od-search input:focus { outline: none; border: none; }
.od-search:focus-within { outline: 2px solid var(--accent); outline-offset: 0; }
.od-owner-select, .od-branch-switch {
  display: flex; align-items: center; gap: .4rem; margin-bottom: 0;
  font-size: .85rem; font-weight: 600; color: var(--muted); flex: none;
}
.od-owner-select select, .od-branch-switch select { width: auto; max-width: 180px; margin-top: 0; padding: .4rem .5rem; font-size: .9rem; }
.od-open-pill {
  border-radius: 999px; padding: .45rem .9rem; font-weight: 700; font-size: .9rem;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap; flex: none; font-family: inherit;
}
.od-open-pill.is-open { background: var(--green-bg); color: var(--green-ink); border-color: var(--green); }
.od-open-pill.is-closed { background: var(--red-bg); color: var(--red-ink); border-color: var(--red); }
.od-open-pill:disabled { opacity: .6; cursor: wait; }
.od-user-chip { display: flex; align-items: center; gap: .5rem; min-width: 0; flex: none; margin-left: auto; }
.od-avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--od-accent); color: #fff; font-weight: 800; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}
.od-user-meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.od-user-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; font-size: .95rem; }
.od-user-role { font-size: .8rem; color: var(--muted); }
.od-hero {
  position: relative; overflow: hidden; border-radius: var(--radius);
  padding: 1.2rem 1.3rem; margin-bottom: 1rem; color: #fff;
  background: var(--od-accent);
  background-size: cover; background-position: center;
  scroll-margin-top: 76px;
}
.od-hero-scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 10, 5, .22), rgba(20, 10, 5, 0)); }
.od-hero.has-photo .od-hero-scrim { background: linear-gradient(90deg, rgba(20, 10, 5, .74), rgba(20, 10, 5, .38)); }
.od-hero-text { position: relative; z-index: 1; }
.od-hero-text h2 { margin: 0 0 .15rem; font-size: 1.6rem; color: #fff; }
.od-hero-title { margin: 0 0 .3rem; font-weight: 700; font-size: 1.05rem; }
.od-hero-sub { margin: 0; opacity: .92; max-width: 36rem; font-size: .95rem; }
.od-trial-row { display: flex; gap: .6rem; align-items: flex-start; flex-wrap: wrap; }
.od-trial-row .trial-banner { flex: 1 1 260px; margin-bottom: .8rem; }
.od-trial-row .btn { margin-bottom: .8rem; flex: none; }
.od-plan-line { font-weight: 600; color: var(--muted); margin: 0 0 1rem; }
.od-stats-card, #od-branches-section,
#staff-card, #add-branch-card, #billing-card,
#od-staff-overview, #od-activity-card { scroll-margin-top: 76px; }
.od-stats-head { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: flex-end; justify-content: space-between; }
.od-stats-head h2 { margin: 0; }
.od-range-row { margin-bottom: 0; }
.od-stat-grid .od-stat { position: relative; }
.od-stat-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--accent-soft); color: var(--od-accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: .15rem;
}
.od-stat-icon svg { width: 20px; height: 20px; }
.od-stat .stat-value { font-size: 1.35rem; overflow-wrap: anywhere; }
.od-stat-revenue { border: 2px solid var(--od-accent); background: var(--accent-soft); }
.od-stat-revenue .od-stat-icon { background: var(--od-accent); color: #fff; }
.od-stat-pending.has-pending { border-color: var(--amber); }
.od-stat-pending.has-pending .od-stat-icon { background: var(--amber-bg); color: var(--amber-ink); }
.od-stat-pending.has-pending .stat-value { color: var(--amber-ink); }
.od-trend { font-size: .85rem; font-weight: 700; }
.od-trend.up { color: var(--green); }
.od-trend.down { color: var(--red); }
.od-charts-row, .od-feed-row { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; margin-bottom: 1rem; }
.od-chart-card .bar-chart { height: 160px; }
.od-bar-chart .bar { background: var(--od-accent); }
.od-line-chart svg { width: 100%; height: auto; display: block; }
.od-chart-range { font-size: .85rem; white-space: nowrap; }
.od-today-row {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  border: none; border-top: 1px dashed var(--line); background: transparent;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  padding: .55rem .2rem; min-width: 0;
}
.od-today-row:first-child { border-top: none; }
.od-today-row:hover { background: var(--card2); }
.od-today-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.od-today-meta { color: var(--muted); font-size: .85rem; white-space: nowrap; flex: none; }
.od-today-total { font-weight: 800; white-space: nowrap; flex: none; }
.od-dot-dinein { background: var(--od-accent); }
.od-dot-takeaway { background: #f59e0b; }
.od-dot-delivery { background: #3b82f6; }
.od-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.od-main .brand-cards { grid-template-columns: 1fr; }
.od-main .brand-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.brand-card-photo { height: 120px; overflow: hidden; background: linear-gradient(135deg, #7c2d12, #c2410c); flex: none; }
.brand-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-card-photo-fallback { display: flex; align-items: center; justify-content: center; }
.brand-card-photo-fallback span { font-family: Georgia, "Times New Roman", serif; font-size: 2.4rem; font-weight: 800; color: rgba(255, 255, 255, .92); }
.brand-card-body { padding: .9rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.brand-card-body .brand-card-head { margin-bottom: 0; }
.brand-card-body .brand-card-head h3 { font-size: 1.12rem; }
.brand-card-address { margin: 0; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.brand-card-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; background: var(--card2); border-radius: 12px; padding: .55rem .65rem; }
.brand-mini { min-width: 0; }
.brand-mini span { display: block; font-size: .78rem; color: var(--muted); }
.brand-mini strong { font-size: .95rem; overflow-wrap: anywhere; }
.brand-card-live { margin: .1rem 0 .3rem; font-size: .85rem; }
.od-bottom-row { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
.od-donut-wrap { position: relative; width: 150px; margin: .2rem auto .6rem; }
.od-donut-wrap svg { display: block; width: 100%; height: auto; }
.od-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.od-donut-center strong { font-size: 1.5rem; line-height: 1.1; }
.od-donut-center span { font-size: .78rem; color: var(--muted); }
.od-legend { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .35rem; }
.od-legend li { display: flex; align-items: center; gap: .5rem; }
.od-legend strong { margin-left: auto; }
.od-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.od-dot-active { background: #22c55e; }
.od-dot-pending { background: #f59e0b; }
.od-dot-inactive { background: #a8a29e; }
.od-card-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .2rem; }
.od-card-head h2, .od-card-head h3 { margin: 0; }
.od-activity-row { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 0; border-top: 1px solid var(--line); }
.od-activity-row:first-child { border-top: none; }
.od-activity-icon {
  width: 32px; height: 32px; flex: none; border-radius: 10px;
  background: var(--accent-soft); color: var(--od-accent);
  display: flex; align-items: center; justify-content: center;
}
.od-activity-icon svg { width: 18px; height: 18px; }
.od-activity-body { flex: 1; min-width: 0; }
.od-activity-body p { margin: 0; overflow-wrap: anywhere; }
.od-activity-meta { color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.od-activity-time { font-size: .8rem; color: var(--muted); white-space: nowrap; flex: none; }
@media (min-width: 640px) {
  .od-main .brand-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .od-bottom-row { grid-template-columns: 1fr 1.4fr; }
  .od-charts-row, .od-feed-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .od-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 1rem; align-items: start; }
  .od-shell.collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .od-sidebar {
    position: sticky; top: 76px; transform: none; visibility: visible;
    width: auto; border-radius: var(--radius); overflow-y: visible;
  }
  .od-collapse-btn { display: flex; position: absolute; right: -14px; top: 6px; z-index: 3; }
  .od-shell.collapsed .od-brand-text,
  .od-shell.collapsed .od-nav-label,
  .od-shell.collapsed .od-nav-btn span,
  .od-shell.collapsed .od-logout span { display: none; }
  .od-shell.collapsed .od-brand-block { justify-content: center; }
  .od-shell.collapsed .od-nav-btn,
  .od-shell.collapsed .od-logout { justify-content: center; padding-left: 0; padding-right: 0; }
  .od-shell.collapsed .od-nav-btn,
  .od-shell.collapsed .od-logout { position: relative; }
  .od-shell.collapsed .od-nav-btn:hover::after,
  .od-shell.collapsed .od-logout:hover::after {
    content: attr(data-label); position: absolute; left: calc(100% + 12px); top: 50%;
    transform: translateY(-50%); background: #292524; color: #fff;
    padding: .35rem .6rem; border-radius: 8px; font-size: .85rem; font-weight: 600;
    white-space: nowrap; z-index: 50; pointer-events: none; box-shadow: var(--shadow);
  }
  .od-backdrop { display: none !important; }
  .od-hamburger { display: none; }
  .od-stat-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 640px) {
  .od-branch-switch-label { display: none; }
  .od-branch-switch select, .od-owner-select select { max-width: 130px; }
}
@media (max-width: 480px) {
  .od-user-role { display: none; }
  .od-user-meta strong { max-width: 96px; }
  .od-hero-text h2 { font-size: 1.35rem; }
  .od-activity-time { white-space: normal; text-align: right; max-width: 86px; }
}

/* ---------- New-owner onboarding (2026-11-16) ---------- */
/* Plan cards (owner add-branch): selectable radio-style buttons, theme
   vars only so light + OS-dark both read. Selected = accent border +
   soft fill + checkmark. */
.plan-cards-field { border: 0; padding: 0; margin: 0 0 .6rem; flex: 1 1 100%; min-width: 0; }
.plan-cards-field legend { font-size: .9rem; font-weight: 600; padding: 0; margin-bottom: .25rem; }
.plan-cards { display: grid; grid-template-columns: 1fr; gap: .6rem; }
@media (min-width: 640px) { .plan-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan-card {
  appearance: none; border: 2px solid var(--line2); background: var(--card);
  color: var(--ink); border-radius: 14px; padding: .8rem .9rem; cursor: pointer;
  text-align: left; display: flex; flex-direction: column; gap: .15rem;
  min-width: 0; font-size: 1rem; line-height: 1.35;
}
.plan-card:hover { border-color: var(--accent-line); }
.plan-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow); }
.plan-card-name { font-size: 1.05rem; overflow-wrap: anywhere; }
.plan-card.selected .plan-card-name::after { content: " ✓"; color: var(--accent); }
.plan-card-tables { color: var(--muted); font-size: .9rem; }
.plan-card-price { font-weight: 700; overflow-wrap: anywhere; }
/* Locked-owner panels: plain card + roomy text; the Add Branch button
   is the only action, so there is never a dead end. */
.locked-panel p { overflow-wrap: anywhere; }
.locked-panel .row-gap { margin-bottom: 0; }
.brand-approval-note { overflow-wrap: anywhere; }

/* ---------- Counter POS, offers, expenses, drawer, inventory (2026-11-17) ---------- */
/* Order-type badges: dine-in is neutral, takeaway amber, delivery blue.
   Never render "Table 0" — non-table orders show only this badge. */
.type-badge { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; font-weight: 700; background: var(--card3); color: var(--ink); border: 1px solid var(--line2); }
.type-badge.type-takeaway { background: var(--amber-bg); color: var(--amber-ink); border-color: transparent; }
.type-badge.type-delivery { background: var(--blue-bg); color: var(--blue-ink); border-color: transparent; }
.status-badge.completed, .status-badge.delivered { background: var(--green-bg); color: var(--green-ink); border-color: transparent; }
/* Best-seller badge on the customer menu + Menu Manager rows. */
.best-seller-badge { display: inline-block; border-radius: 999px; padding: .1rem .55rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; vertical-align: middle; }
/* Promo banners (entry screen + above the customer menu). */
.promo-banners { display: grid; gap: .7rem; margin-bottom: 1rem; }
.promo-banner { display: flex; gap: .8rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem; overflow: hidden; }
.promo-banner-img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.promo-banner-title { font-weight: 800; font-size: 1.05rem; }
.promo-banner-sub { color: var(--muted); font-size: .9rem; }
/* Cart coupon row (customer cart sheet). */
.cart-coupon-row { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; margin: .6rem 0 .2rem; }
.cart-coupon-row label { flex: 1; min-width: 150px; margin-bottom: 0; }
.cart-coupon-line { display: flex; justify-content: space-between; gap: .8rem; padding: .35rem 0; color: var(--green-ink); font-weight: 600; }
/* POS layout: menu grid + sticky cart panel. */
.pos-type-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: .9rem; }
.pos-type-btn { border: 1px solid var(--line2); background: var(--card2); color: var(--ink); padding: .55rem 1.1rem; border-radius: 999px; cursor: pointer; font-size: 1rem; font-weight: 600; }
.pos-type-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pos-table-wrap { margin-bottom: 0; min-width: 170px; flex: 0 1 220px; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (min-width: 760px) { .pos-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (min-width: 1100px) { .pos-layout { grid-template-columns: minmax(0, 1fr) 400px; } }
/* POS menu grid fills the available width: as many dish columns as fit
   (2 on a phone, more on tablet/desktop). Scoped to .pos-grid — the
   customer menu grid is untouched. */
.dish-grid.pos-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pos-menu-col, .pos-cart { min-width: 0; }
/* Current-sale panel: deliberately large — bigger text, roomier rows and
   inputs, so each step (items, discount, totals, tender, change) reads
   without zooming on a phone. The panel never overlaps the menu grid:
   single column below 760px, a 340px column from 760px, 400px from 1100px. */
.pos-cart { position: sticky; top: calc(var(--header-h) + 12px); font-size: 1.08rem; padding: 1.25rem; }
.pos-cart h3 { font-size: 1.4rem; }
.pos-cart .cart-line { font-size: 1.06rem; padding: .7rem 0; }
.pos-cart .cart-line-sub { font-size: .92rem; }
.pos-cart .qty-stepper button { width: 38px; height: 38px; font-size: 1.25rem; }
.pos-cart .qty-stepper span { min-width: 26px; font-size: 1.1rem; }
.pos-cart label { font-size: 1rem; }
.pos-cart input, .pos-cart select { padding: .65rem .7rem; font-size: 1.05rem; }
.pos-cart .hint { font-size: .95rem; }
/* Complete / Clear are never joined: a real gap + distinct styling
   (Complete = primary, Clear = danger outline). */
.pos-actions { display: flex; flex-direction: column; gap: .7rem; margin-top: 1rem; }
.pos-actions .btn-block { padding: .9rem; font-size: 1.1rem; }
.pos-grid .dish-card { cursor: default; }
.pos-stock { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.pos-stock.is-low { color: var(--amber-ink); font-weight: 700; }
.pos-line { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.pos-coupon-row { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.pos-coupon-row label { flex: 1; min-width: 140px; margin-bottom: 0; }
.pos-totals { border-top: 1px solid var(--line); margin: .8rem 0; padding-top: .6rem; font-size: 1.08rem; }
.pos-total-row { display: flex; justify-content: space-between; gap: .8rem; padding: .3rem 0; }
.pos-total-row.pos-grand { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .55rem; font-size: 1.4rem; font-weight: 800; }
.pos-success { border-color: var(--green); background: var(--green-bg); }
.pos-success h3 { color: var(--green-ink); }
/* Offers / expenses / drawer rows. */
.offer-row { display: flex; flex-wrap: wrap; gap: .5rem .8rem; justify-content: space-between; align-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: .65rem .8rem; margin-bottom: .5rem; }
.offer-main { flex: 1; min-width: 200px; }
.offer-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
/* Stock editor (Menu Manager rows + Inventory list). */
.mm-stock-editor, .stock-editor { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: .5rem .7rem; align-items: end; border-top: 1px dashed var(--line); padding-top: .6rem; margin-top: .2rem; }
.mm-stock-editor label, .stock-editor label { margin-bottom: 0; min-width: 90px; flex: 0 1 130px; }
.mm-stock-editor label.check-line { flex: 0 0 auto; }
.mm-best-line { margin-bottom: 0; }
.inv-item { align-items: flex-start; }
/* Bill-adjustment form inside the table detail modal. */
.billadj-form { border: 1px dashed var(--line2); border-radius: 12px; padding: .7rem; margin: .6rem 0; background: var(--card); }
.billadj-form h4 { margin: 0 0 .5rem; font-size: 1rem; }
/* Timeline modal sits above the Overview drill-down modal. */
.timeline-overlay { z-index: 44; }
.timeline-modal { z-index: 45; }
.timeline-list { list-style: none; margin: 0; padding: 0; }
.timeline-row { padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.timeline-row:last-child { border-bottom: none; }
.timeline-step { font-weight: 700; }
.timeline-note { font-size: .92rem; overflow-wrap: anywhere; }
/* Cancel confirm dialog: above the table modal (and the timeline
   modal) so a cancel started from either stays on top. */
.cancel-confirm-overlay { z-index: 46; }
.cancel-confirm-modal { z-index: 47; }
.cancel-confirm-modal label { display: block; margin: .6rem 0 .8rem; }
.cancel-confirm-modal input[type="text"] { width: 100%; margin-top: .25rem; }
/* Dish-minus: per-line Remove button (Orders list, table modal,
   waiter detail). The line's first span flexes so the button sits
   flush right without shifting the price. */
.order-items li.has-remove, .ov-table-items li.has-remove, .to-detail-items li.has-remove { display: flex; align-items: center; gap: .6rem; }
.order-items li.has-remove > span:first-child, .ov-table-items li.has-remove > span:first-child, .to-detail-items li.has-remove > span:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
/* Order-line qty steppers (2026-11-19): same flex row as the old
   Remove buttons, with 38px tap targets for mobile. */
.order-items li.has-stepper, .ov-table-items li.has-stepper, .to-detail-items li.has-stepper { display: flex; align-items: center; gap: .6rem; }
.order-items li.has-stepper > span:first-child, .ov-table-items li.has-stepper > span:first-child, .to-detail-items li.has-stepper > span:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.line-stepper button { width: 38px; height: 38px; font-size: 1.25rem; }
.line-stepper span { min-width: 26px; font-size: 1.05rem; }
.line-remove { flex: 0 0 auto; }
/* Receipt / KOT print document: hidden on screen, the only thing
   printed (see @media print). Narrow, receipt-like, black on white. */
#print-doc { display: none; }
.print-receipt, .print-kot { max-width: 320px; margin: 0 auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: #111; background: #fff; }
.pr-name { font-family: inherit; font-size: 1.15rem; text-align: center; margin: 0 0 .3rem; }
.pr-meta { text-align: center; margin: .15rem 0; }
.pr-line { display: flex; justify-content: space-between; gap: .8rem; padding: .1rem 0; }
.pr-line.pr-total { font-weight: 800; font-size: 1.05rem; border-top: 1px solid #111; margin-top: .3rem; padding-top: .3rem; }
.pr-kot-line { font-size: 1rem; justify-content: flex-start; }
.pr-thanks { text-align: center; font-weight: 700; margin-top: .6rem; }

/* ---------- Owner dashboard + POS redesign (2026-11-18) ---------- */
/* Screen-reader-only label text (POS list table header). */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* POS header row: title + drawer actions (Float / Petty Cash Out /
   Close Drawer) wired to the existing shift endpoints. */
.pos-header-row { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; justify-content: space-between; margin-bottom: .2rem; }
.pos-header-row h2 { margin: 0; }
.pos-drawer-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.pos-drawer-panel h3 { margin-top: 0; }
.pos-drawer-panel .row-gap { margin-bottom: 0; }
/* POS left column: big search + List/Grid switch above the chips. */
.pos-search-row { display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; margin-bottom: .6rem; }
.pos-search-big { flex: 1; min-width: 200px; margin-bottom: 0; }
.pos-search-big input { font-size: 1.15rem; padding: .7rem .8rem; }
.pos-view-switch { display: flex; border: 1px solid var(--line2); border-radius: 999px; overflow: hidden; flex: none; margin-bottom: 0; }
.pos-view-btn { border: none; background: var(--card2); color: var(--ink); padding: .6rem 1.1rem; cursor: pointer; font-weight: 600; font-size: .95rem; font-family: inherit; }
.pos-view-btn.active { background: var(--accent); color: #fff; font-weight: 700; }
/* POS List view: table rows. The wrapper scrolls horizontally on very
   narrow screens so the page itself never overflows. */
#pos-list-wrap { overflow-x: auto; margin-bottom: .5rem; }
.pos-list-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.pos-list-table th, .pos-list-table td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pos-list-table th { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pos-list-table tr:last-child td { border-bottom: none; }
.pos-list-table tr.sold-out { opacity: .65; }
.pos-list-name { font-weight: 700; overflow-wrap: anywhere; }
.pos-list-cat { color: var(--muted); font-size: .85rem; }
.pos-list-price { font-weight: 700; white-space: nowrap; }
.pos-list-stock { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.pos-list-stock.is-low { color: var(--amber-ink); font-weight: 700; }
.pos-list-table .qty-stepper { display: inline-flex; }
/* POS right column: Running Tabs + Current sale + totals. On desktop
   the whole column sticks and scrolls internally when taller than the
   viewport; on mobile the columns stack (products first, cart below). */
.pos-side-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.pos-side-col .card { margin-bottom: 0; }
.pos-cart { position: static; }
@media (min-width: 760px) {
  .pos-side-col { position: sticky; top: calc(var(--header-h) + 12px); max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto; padding-bottom: 2px; }
}
.pos-tabs-card h3 { margin-bottom: .4rem; }
.pos-tab-row {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card2);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  padding: .55rem .7rem; margin-bottom: .5rem; min-width: 0;
}
.pos-tab-row:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.pos-tab-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pos-tab-total { font-weight: 800; white-space: nowrap; flex: none; }
.pos-totals-card .pos-totals { border-top: none; margin: 0 0 .8rem; padding-top: 0; }

/* ---------- Branch Manager panel shell + POS completion (2026-11-18b) ---------- */
/* POS Minimal view: compact rows, no photos — name + price + stepper/Add.
   Same qty stepper / Add behavior as List/Grid (posChangeQty only). */
.pos-minimal { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: .5rem; }
.pos-min-row { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border-bottom: 1px solid var(--line); min-width: 0; }
.pos-min-row:last-child { border-bottom: none; }
.pos-min-row.sold-out { opacity: .65; }
.pos-min-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.pos-min-price { font-weight: 700; white-space: nowrap; flex: none; }
.pos-min-row .qty-stepper { flex: none; }
/* POS top tables strip (dine-in only, directly under the mode tabs):
   the single table-selection UI. The grid reuses the shared Overview
   visuals (.ov-table-visual) at the same geometry as .ov-tables-grid. */
.pos-tables-strip { margin-bottom: .9rem; }
.pos-tables-strip h3 { margin-bottom: .4rem; }
.pos-table-search { display: block; margin-bottom: .6rem; }
.pos-table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
/* POS payment tiles: the same 6 methods as the old select, same values. */
.pos-pay-label { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; }
.pos-pay-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .8rem; }
.pos-pay-tile {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  border: 1px solid var(--line2); background: var(--card2); color: var(--ink);
  border-radius: 12px; padding: .6rem .3rem; cursor: pointer; font: inherit; font-size: .88rem;
  min-width: 0; text-align: center;
}
.pos-pay-tile svg { width: 22px; height: 22px; flex: none; }
.pos-pay-tile span { overflow-wrap: anywhere; line-height: 1.2; }
.pos-pay-tile:hover { border-color: var(--accent-line); }
.pos-pay-tile.active { border: 2px solid var(--accent); background: var(--accent-soft); font-weight: 700; }
/* Cash received + Exact Tender sit side by side. */
.pos-cash-row-inner { display: flex; gap: .5rem; align-items: end; }
.pos-cash-row-inner label { flex: 1; min-width: 0; margin-bottom: 0; }
.pos-cash-row-inner .btn { flex: none; margin-bottom: .1rem; }
/* Table seats editor (Tables & QR cards): label + seats share the row. */
.table-seats-row { display: flex; gap: .4rem; margin: .5rem 0; align-items: end; }
.table-seats-row label { flex: 1; min-width: 0; margin-bottom: 0; text-align: left; font-size: .88rem; }
.table-seats-row input { margin-top: .2rem; }

/* ---------- Take Order / Order Taker (2026-11-18f) ---------- */
/* Mobile-first waiter view: table chips on top (occupied/free only,
   never a total), the shared dish-grid below, and the order card in
   a right column on desktop / stacked below on phones. The sticky
   bottom bar mirrors the customer cart bar (mobile only). */
.to-tables-card { margin-bottom: .9rem; }
.to-table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .55rem; }
.to-table-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: .2rem;
  border: 1px solid var(--line2); background: var(--card2); color: var(--ink);
  border-radius: 12px; padding: .6rem .7rem; cursor: pointer; font: inherit;
  text-align: left; min-width: 0;
}
.to-table-chip:hover { border-color: var(--accent-line); }
.to-table-chip.is-occupied { border-color: var(--green); }
.to-table-chip.is-selected { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--accent-soft); }
.to-table-num { font-weight: 800; font-size: 1rem; }
.to-table-meta { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.to-table-pill { display: inline-block; border-radius: 999px; padding: .1rem .6rem; font-size: .78rem; font-weight: 800; }
.to-table-pill.pill-occupied { background: var(--green-bg); color: var(--green-ink); border: 1px solid var(--green); }
.to-table-pill.pill-free { background: #fef9c3; color: #854d0e; border: 1px solid #eab308; }
/* Waiter table detail panel: what the tapped occupied table ordered
   (items + quantities + status only — no amounts by construction, the
   markup never renders a price). One block per order, Add item below. */
.to-table-detail { margin-bottom: .9rem; }
.to-table-detail h3 { margin-top: 0; }
.to-detail-order { border-top: 1px dashed var(--line); padding: .6rem 0; }
.to-detail-order:first-of-type { border-top: none; }
.to-detail-items { list-style: none; margin: .4rem 0; padding: 0; }
.to-detail-items li { padding: .15rem 0; font-size: .95rem; }
.to-detail-timer { margin: .2rem 0 .3rem; font-weight: 700; }
.to-detail-timer.is-overdue { color: var(--red); }
.to-detail-actions { margin-top: .7rem; }
.to-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (min-width: 760px) { .to-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (min-width: 1100px) { .to-layout { grid-template-columns: minmax(0, 1fr) 400px; } }
.dish-grid.to-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.to-side-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.to-side-col .card { margin-bottom: 0; }
@media (min-width: 760px) {
  .to-side-col { position: sticky; top: calc(var(--header-h) + 12px); max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto; padding-bottom: 2px; }
}
.to-cart .qty-stepper button { width: 38px; height: 38px; font-size: 1.25rem; }
.to-cart .qty-stepper span { min-width: 26px; font-size: 1.1rem; }
/* Cart lines have no total column (no totals in this view): name |
   stepper | Remove. */
.cart-line.to-line { grid-template-columns: minmax(0, 1fr) auto auto; }
@media (max-width: 480px) {
  .cart-line.to-line { grid-template-columns: minmax(0, 1fr) auto auto; }
  .cart-line.to-line .qty-stepper button { width: 30px; height: 30px; }
}
/* Mobile sticky bar: same shape as the customer .cart-bar, scoped to
   this section. Hidden on desktop (the order card is always visible
   there); the section keeps bottom padding so it never covers the
   Clear button on phones. */
.to-cart-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  width: min(92vw, 480px); background: var(--accent); color: #fff; border: none;
  border-radius: 999px; padding: .85rem 1.1rem; font-size: 1rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
}
.to-cart-bar[hidden] { display: none; }
@media (min-width: 760px) { .to-cart-bar { display: none; } }
@media (max-width: 759px) { #sec-takeorder, #view-waiter { padding-bottom: 96px; } }
