/* ==========================================================================
   Heroes Coffee and Bar · Operations suite · design system v3
   Roasted espresso + gilt on porcelain. Cormorant Garamond for display,
   Jost for the interface. Signature: an Imigongo-inspired chevron motif.
   No photographs or logos anywhere; the brand mark is set in type.
   ========================================================================== */

@font-face { font-family: "Jost"; src: url("../fonts/Jost-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/Cormorant-var.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/Cormorant-Italic-var.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }

:root {
  /* brand (overridden by the colours chosen in Settings) */
  --brand: #3A2318;
  --accent: #C9A14A;
  --brand-ink: #F7EEDF;
  --accent-ink: #22150D;
  --roast: #1E130C;
  --gilt-hi: #DDBB6A;
  --gilt-lo: #B38A35;

  /* light surfaces */
  --bg: #F2EFEB;
  --surface: #FFFFFF;
  --surface-2: #F8F6F3;
  --surface-3: #EDE8E2;
  --line: #E5DFD7;
  --line-strong: #CFC5B9;
  --text: #241812;
  --text-2: #4E3F35;
  --muted: #7B6C61;
  --focus: #B8902F;

  /* status colours: amber new, lake blue cooking, volcano green ready */
  --c-new: #9C5D06;      --c-new-bg: #FBEFD9;
  --c-prep: #2C5C84;     --c-prep-bg: #E4EDF6;
  --c-ready: #2D6E4C;    --c-ready-bg: #E1F0E7;
  --c-served: #6A625C;   --c-served-bg: #EFEBE7;
  --c-danger: #A53628;   --c-danger-bg: #F8E5E1;
  --c-warn: #8F5A07;     --c-warn-bg: #FAF0DB;
  --c-info: #36597A;     --c-info-bg: #E5ECF3;
  --c-ok: #2D6E4C;       --c-ok-bg: #E1F0E7;

  --sidebar-bg: var(--roast);
  --sidebar-ink: rgba(244, 234, 219, .74);
  --sidebar-ink-dim: rgba(214, 178, 100, .72);
  --sidebar-hover: rgba(244, 234, 219, .06);

  --font-ui: "Jost", "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-title: "Cormorant", "Cormorant Garamond", Garamond, "Times New Roman", serif;

  --fs-xs: .78rem; --fs-sm: .86rem; --fs-md: .95rem; --fs-lg: 1.06rem; --fs-xl: 1.4rem; --fs-2xl: 1.9rem; --fs-3xl: 2.6rem;

  --r-sm: 8px; --r-md: 11px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(36, 24, 18, .05);
  --shadow-2: 0 14px 34px rgba(36, 24, 18, .12), 0 2px 6px rgba(36, 24, 18, .06);
  --shadow-3: 0 30px 70px rgba(30, 19, 12, .28);

  --sidebar-w: 256px;
  --sidebar-w-collapsed: 74px;
  --topbar-h: 68px;
  --tabbar-h: 0px;
  --gutter: 28px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* Imigongo chevron band (vector, drawn in CSS — not an image file) */
  --imigongo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 13 L7 6 L14 13 L21 6 L28 13' fill='none' stroke='%23C9A14A' stroke-width='1.2'/%3E%3Cpath d='M0 8 L7 1 L14 8 L21 1 L28 8' fill='none' stroke='%23C9A14A' stroke-width='1.2' opacity='.55'/%3E%3C/svg%3E");
  --imigongo-lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23C9A14A' stroke-width='1'%3E%3Cpath d='M32 2 L62 32 L32 62 L2 32 Z' opacity='.5'/%3E%3Cpath d='M32 12 L52 32 L32 52 L12 32 Z' opacity='.35'/%3E%3Cpath d='M32 22 L42 32 L32 42 L22 32 Z' opacity='.25'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #150E09; --surface: #1F160F; --surface-2: #271C14; --surface-3: #31241A; --line: #3B2D22; --line-strong: #56463A;
  --text: #F3E9DB; --text-2: #D6C7B5; --muted: #A69482; --focus: #E2BE6C;
  --c-new: #F0AE4E; --c-new-bg: #3A2710; --c-prep: #8DB8E8; --c-prep-bg: #182839; --c-ready: #6FCB98; --c-ready-bg: #13301F;
  --c-served: #B2A79D; --c-served-bg: #2C241E; --c-danger: #F08473; --c-danger-bg: #3D1913; --c-warn: #EFB458; --c-warn-bg: #39270F;
  --c-info: #98BCE0; --c-info-bg: #1A2836; --c-ok: #6FCB98; --c-ok-bg: #13301F;
  --sidebar-bg: #110A06;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 16px 36px rgba(0, 0, 0, .45);
  --shadow-3: 0 30px 70px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #150E09; --surface: #1F160F; --surface-2: #271C14; --surface-3: #31241A; --line: #3B2D22; --line-strong: #56463A;
    --text: #F3E9DB; --text-2: #D6C7B5; --muted: #A69482; --focus: #E2BE6C;
    --c-new: #F0AE4E; --c-new-bg: #3A2710; --c-prep: #8DB8E8; --c-prep-bg: #182839; --c-ready: #6FCB98; --c-ready-bg: #13301F;
    --c-served: #B2A79D; --c-served-bg: #2C241E; --c-danger: #F08473; --c-danger-bg: #3D1913; --c-warn: #EFB458; --c-warn-bg: #39270F;
    --c-info: #98BCE0; --c-info-bg: #1A2836; --c-ok: #6FCB98; --c-ok-bg: #13301F;
    --sidebar-bg: #110A06;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 16px 36px rgba(0, 0, 0, .45); --shadow-3: 0 30px 70px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: var(--font-ui); font-size: var(--fs-md); line-height: 1.55; color: var(--text); background: var(--bg); font-variant-numeric: tabular-nums lining-nums; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; }
h3 { font-size: var(--fs-lg); }
p { margin: 0; }
strong, b { font-weight: 600; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 1000; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* App-like page changes in browsers that support them (Chrome, Edge, Safari 18) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ---------- Brand mark (set in type, no image) ---------- */
.mark {
  --s: 40px;
  width: var(--s); height: var(--s); flex: none; border-radius: 50%; display: inline-grid; place-items: center; position: relative;
  background: radial-gradient(circle at 30% 25%, #4A2D1F, var(--roast) 70%);
  box-shadow: inset 0 0 0 1px rgba(221, 187, 106, .55), inset 0 0 0 calc(var(--s) * .07) var(--roast), inset 0 0 0 calc(var(--s) * .07 + 1px) rgba(221, 187, 106, .9);
  color: var(--gilt-hi);
}
.mark b { font-family: var(--font-title); font-weight: 600; font-size: calc(var(--s) * .42); letter-spacing: .02em; line-height: 1; transform: translateY(-.03em); }
.mark-img { object-fit: cover; background: #fff; box-shadow: 0 0 0 1px rgba(221, 187, 106, .6), 0 2px 8px rgba(0, 0, 0, .22); }
.band { height: 14px; background: var(--imigongo) repeat-x left center / 28px 14px; opacity: .55; }

/* ---------- App frame ---------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-ink);
  display: flex; flex-direction: column; z-index: 60; transition: width .2s ease, transform .25s ease; view-transition-name: sidebar;
  background-image: linear-gradient(180deg, rgba(201, 161, 74, .07), transparent 220px);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 18px 16px 14px; min-height: var(--topbar-h); text-decoration: none; }
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.sidebar-brand-text strong { font-family: var(--font-title); font-weight: 600; font-size: 1.16rem; line-height: 1.05; color: #F6EBD8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sidebar-brand-text span { font-size: var(--fs-xs); color: var(--sidebar-ink-dim); letter-spacing: .04em; }
.sidebar .band { margin: 0 16px 6px; opacity: .35; }
.sidebar .sidebar-close { margin-left: auto; color: #F6EBD8; display: none; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 14px; scrollbar-width: thin; scrollbar-color: rgba(244, 234, 219, .14) transparent; }
.nav-group { margin-top: 12px; }
.nav-group-title { font-family: var(--font-title); font-style: italic; font-size: 1.02rem; color: var(--sidebar-ink-dim); padding: 6px 12px 4px; }
.nav-link {
  display: flex; align-items: center; gap: 13px; width: 100%; padding: 9px 12px; border-radius: 10px; text-decoration: none;
  color: var(--sidebar-ink); background: none; border: 0; cursor: pointer; font-size: var(--fs-md); text-align: left; position: relative; transition: background-color .15s, color .15s;
}
.nav-link i { width: 20px; text-align: center; font-size: .98rem; opacity: .8; }
.nav-link:hover { background: var(--sidebar-hover); color: #FBF3E6; }
.nav-link.is-active { background: rgba(201, 161, 74, .13); color: #FBF1DF; font-weight: 500; }
.nav-link.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--gilt-hi), var(--gilt-lo)); }
.nav-link.is-active i { color: var(--gilt-hi); opacity: 1; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 600; display: inline-grid; place-items: center; }
.sidebar-foot { padding: 10px 12px 16px; border-top: 1px solid rgba(244, 234, 219, .07); }
.sidebar-scrim { display: none; }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s ease; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
  padding: 0 var(--gutter); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(1.3) blur(14px); backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--line); view-transition-name: topbar;
}
.topbar-menu { display: none; }
.topbar-title { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.topbar-title h1 { font-family: var(--font-title); font-weight: 600; font-size: 1.85rem; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.1; }
.topbar-sub { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar-clock { color: var(--muted); font-size: var(--fs-sm); margin-right: 8px; letter-spacing: .02em; }
.topbar-bell { position: relative; }
.dot-badge { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; border-radius: var(--r-pill); background: var(--c-danger); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
.page { flex: 1; padding: 26px var(--gutter) calc(40px + var(--safe-b) + var(--tabbar-h)); width: 100%; max-width: 1480px; margin: 0 auto; outline: none; }
.page.page-flush { padding: 0; max-width: none; }

html.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
html.sidebar-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }
html.sidebar-collapsed .nav-label, html.sidebar-collapsed .sidebar-brand-text, html.sidebar-collapsed .nav-group-title, html.sidebar-collapsed .sidebar .band { display: none; }
html.sidebar-collapsed .nav-link { justify-content: center; padding: 11px 0; }
html.sidebar-collapsed .nav-link.is-active::before { left: -12px; }
html.sidebar-collapsed .nav-badge { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
html.sidebar-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }
html.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 18px 0 14px; }

/* bottom tab bar: the phone and tablet navigation */
.tabbar { display: none; }
@media (max-width: 1023px) {
  :root { --gutter: 16px; --topbar-h: 60px; --tabbar-h: calc(64px + var(--safe-b)); }
  .sidebar { transform: translateX(-104%); width: min(310px, 86vw) !important; box-shadow: var(--shadow-3); z-index: 90; }
  .sidebar .sidebar-close { display: inline-grid; }
  html.sidebar-open .sidebar { transform: none; }
  html.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(20, 12, 7, .5); z-index: 85; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  .app-main, html.sidebar-collapsed .app-main { margin-left: 0; }
  html.sidebar-collapsed .nav-label, html.sidebar-collapsed .sidebar-brand-text, html.sidebar-collapsed .nav-group-title, html.sidebar-collapsed .sidebar .band { display: revert; }
  html.sidebar-collapsed .nav-link { justify-content: flex-start; padding: 9px 12px; }
  .sidebar-foot { display: none; }
  .topbar-menu { display: none; }
  .topbar-mark { display: inline-grid; }
  .topbar-clock, .user-chip-text, .user-chip .fa-chevron-down { display: none; }
  .topbar-title h1 { font-size: 1.55rem; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; height: var(--tabbar-h);
    padding: 6px 6px var(--safe-b); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
    border-top: 1px solid var(--line); view-transition-name: tabbar;
  }
  .tab-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 500; border: 0; background: none; cursor: pointer; border-radius: 12px; position: relative; padding: 4px 2px; touch-action: manipulation; }
  .tab-link i { font-size: 1.12rem; }
  .tab-link.is-active { color: var(--text); }
  .tab-link.is-active i { color: var(--brand); }
  :root[data-theme="dark"] .tab-link.is-active i { color: var(--accent); }
  .tab-link.is-active::after { content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .tab-link .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
}
.topbar-mark { display: none; text-decoration: none; }
@media (max-width: 599px) {
  .topbar { gap: 10px; }
  .topbar-title h1 { font-size: 1.4rem; }
  .topbar-sub { display: none; }
  .page { padding-top: 16px; }
}

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--surface); --b-ink: var(--text); --b-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 9px 18px;
  border-radius: var(--r-md); border: 1px solid var(--b-line); background: var(--b-bg); color: var(--b-ink);
  font-weight: 500; font-size: var(--fs-md); line-height: 1.2; letter-spacing: .01em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .06s, filter .15s; touch-action: manipulation;
}
.btn:hover { background: color-mix(in srgb, var(--b-bg) 93%, var(--text)); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { --b-bg: var(--brand); --b-ink: var(--brand-ink); --b-line: var(--brand); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 1px 2px rgba(36, 24, 18, .18); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 84%, #000); }
:root[data-theme="dark"] .btn-primary { --b-bg: var(--accent); --b-ink: var(--accent-ink); --b-line: var(--accent); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .btn-primary { --b-bg: var(--accent); --b-ink: var(--accent-ink); --b-line: var(--accent); } }
.btn-accent, .btn-gilt { --b-bg: var(--accent); --b-ink: var(--accent-ink); --b-line: color-mix(in srgb, var(--accent) 80%, #000); background-image: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff 20%), var(--accent) 55%, color-mix(in srgb, var(--accent) 88%, #000)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(36, 24, 18, .2); font-weight: 600; }
.btn-accent:hover, .btn-gilt:hover { filter: brightness(1.04); background-color: var(--accent); }
.btn-success { --b-bg: var(--c-ready); --b-ink: #fff; --b-line: var(--c-ready); }
:root[data-theme="dark"] .btn-success { --b-ink: #0E2417; }
.btn-success:hover { background: color-mix(in srgb, var(--c-ready) 86%, #000); }
.btn-danger { --b-bg: var(--c-danger); --b-ink: #fff; --b-line: var(--c-danger); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-outline-danger { --b-ink: var(--c-danger); --b-line: color-mix(in srgb, var(--c-danger) 40%, transparent); }
.btn-sm { min-height: 34px; padding: 6px 13px; font-size: var(--fs-sm); border-radius: var(--r-sm); gap: 7px; }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: var(--fs-lg); border-radius: 13px; }
.btn-block { width: 100%; }
.btn .fa-spinner { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; border: 0; background: transparent;
  color: var(--text-2); cursor: pointer; text-decoration: none; font-size: 1.05rem; flex: none; transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 34px; height: 34px; font-size: .9rem; border-radius: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-link { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- User menu ---------- */
.menu-wrap { position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.user-chip:hover { border-color: var(--line-strong); }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-chip-text strong { font-size: var(--fs-sm); font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text small { color: var(--muted); font-size: var(--fs-xs); }
.user-chip .fa-chevron-down { font-size: .7rem; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--gilt-hi); font-family: var(--font-title); font-weight: 600; font-size: 1.05rem; flex: none; box-shadow: inset 0 0 0 1px rgba(221, 187, 106, .45); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); padding: 6px; z-index: 80; animation: popIn .14s ease; }
.menu a, .menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border-radius: 9px; text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; font-size: var(--fs-md); color: var(--text); }
.menu a:hover, .menu button:hover { background: var(--surface-3); }
.menu i { width: 18px; color: var(--muted); }
.menu form { margin: 0; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-lead { color: var(--muted); max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
@media (max-width: 599px) {
  .page-actions { width: 100%; }
  .page-actions > .btn { flex: 1 1 auto; }
}
.section-title { font-family: var(--font-title); font-weight: 600; font-size: 1.6rem; margin: 34px 0 14px; display: flex; align-items: baseline; gap: 12px; line-height: 1.15; }
.section-title:first-child { margin-top: 0; }
.section-title small { font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.section-title small a { color: var(--text-2); }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { font-family: var(--font-title); font-size: 1.32rem; font-weight: 600; line-height: 1.15; }
.panel-head .muted { font-size: var(--fs-sm); }
.panel-head .panel-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-body { padding: 20px; }
.panel-body.tight { padding: 0; }
.panel-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.display { font-family: var(--font-title); }
.text-danger { color: var(--c-danger); }
.text-ok { color: var(--c-ok); }
.text-warn { color: var(--c-warn); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
@media (max-width: 1199px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-sidebar { grid-template-columns: 1fr; } }
@media (max-width: 899px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 699px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; position: relative; min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; transition: background-color .15s; }
a.stat:hover { background: var(--surface-2); }
.stat-label { color: var(--muted); font-size: var(--fs-sm); display: flex; align-items: center; gap: 8px; }
.stat-label i { width: 16px; color: var(--accent); }
.stat-value { font-family: var(--font-title); font-size: 2.3rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: lining-nums proportional-nums; }
.stat-value small { font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 400; color: var(--muted); margin-left: 6px; letter-spacing: .02em; }
.stat-note { font-size: var(--fs-xs); color: var(--muted); }
.stat.is-alert .stat-value { color: var(--c-danger); }
.stat.is-alert::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c-danger); }
@media (max-width: 599px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 1.9rem; }
  .stat-note { display: none; }
}
.delta-up { color: var(--c-ok); }
.delta-down { color: var(--c-danger); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span, .field-label { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.field .hint { font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.field-inline { flex-direction: column; }
.req::after { content: " *"; color: var(--c-danger); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
  font-size: var(--fs-md); color: var(--text); transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.field textarea, textarea.input { min-height: 88px; resize: vertical; line-height: 1.5; }
.field select, select.input { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--text)); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
.field input[type=color] { width: 58px; height: 44px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); }
.input-group { display: flex; align-items: stretch; }
.input-group > .input, .input-group > input { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; min-width: 0; }
.input-group > .addon { display: grid; place-items: center; padding: 0 13px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--surface-2); color: var(--muted); font-size: var(--fs-sm); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 599px) { .form-grid { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .input, .field input, .field select, .field textarea { font-size: 16px; } }
.check { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; font-size: var(--fs-md); min-height: 34px; }
.check input { width: 19px; height: 19px; accent-color: var(--brand); flex: none; }
:root[data-theme="dark"] .check input { accent-color: var(--accent); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 25px; border-radius: 13px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked + .track { background: var(--c-ready); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.filters .field { min-width: 150px; flex: 0 1 auto; }
.filters .field.grow { flex: 1 1 220px; }
.filters .custom-dates { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 599px) { .filters .field, .filters .custom-dates, .filters .custom-dates .field { flex: 1 1 100%; } .filters .btn { flex: 1; } }
.search-input { position: relative; }
.search-input i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input input { padding-left: 40px !important; }

/* ---------- Alerts ---------- */
.alert { padding: 13px 16px; border-radius: var(--r-md); margin-bottom: 16px; border: 1px solid transparent; border-left-width: 3px; font-size: var(--fs-md); display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--c-ok-bg); color: var(--c-ok); border-color: color-mix(in srgb, var(--c-ok) 22%, transparent); border-left-color: var(--c-ok); }
.alert-error { background: var(--c-danger-bg); color: var(--c-danger); border-color: color-mix(in srgb, var(--c-danger) 22%, transparent); border-left-color: var(--c-danger); }
.alert-warning { background: var(--c-warn-bg); color: var(--c-warn); border-color: color-mix(in srgb, var(--c-warn) 22%, transparent); border-left-color: var(--c-warn); }
.alert-info { background: var(--c-info-bg); color: var(--c-info); border-color: color-mix(in srgb, var(--c-info) 22%, transparent); border-left-color: var(--c-info); }
.alert a { color: inherit; font-weight: 600; }

/* ---------- Pills & chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; background: var(--c-served-bg); color: var(--c-served); line-height: 1.7; letter-spacing: .01em; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-pending, .pill-unpaid, .pill-active, .pill-booked, .pill-open { background: var(--c-new-bg); color: var(--c-new); }
.pill-preparing, .pill-confirmed, .pill-ordered, .pill-occupied, .pill-partial, .pill-seated, .pill-acknowledged { background: var(--c-prep-bg); color: var(--c-prep); }
.pill-ready, .pill-paid, .pill-available, .pill-completed, .pill-vacant, .pill-done, .pill-closed_ok { background: var(--c-ready-bg); color: var(--c-ready); }
.pill-cancelled, .pill-void, .pill-dirty, .pill-no_show, .pill-out_of_service, .pill-bill_requested { background: var(--c-danger-bg); color: var(--c-danger); }
.pill-credit, .pill-room, .pill-reserved, .pill-cleaning { background: var(--c-info-bg); color: var(--c-info); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; color: var(--text-2); text-decoration: none; transition: background-color .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--text-2); color: var(--text); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
:root[data-theme="dark"] .chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .count { background: color-mix(in srgb, currentColor 14%, transparent); border-radius: var(--r-pill); padding: 0 7px; font-size: var(--fs-xs); }
.tag { display: inline-block; padding: 1px 9px; border-radius: 6px; background: var(--surface-3); font-size: var(--fs-xs); color: var(--text-2); font-weight: 500; }

/* ---------- Tabs / segmented ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 11px 16px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; color: var(--muted); font-weight: 500; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; transition: color .15s; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { background: var(--surface-3); border-radius: var(--r-pill); padding: 0 8px; font-size: var(--fs-xs); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button, .segmented a { border: 0; background: none; padding: 7px 15px; border-radius: 9px; cursor: pointer; font-weight: 500; color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.segmented .is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(36, 24, 18, .12); }

/* ---------- Tables (become cards on phones) ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th { text-align: left; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; letter-spacing: .01em; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.is-muted td { color: var(--muted); }
.table .actions { text-align: right; white-space: nowrap; }
.table .row-link { text-decoration: none; font-weight: 600; white-space: nowrap; }
.table .row-link:hover { text-decoration: underline; }
.table tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line-strong); }
.table th.num { text-align: right; }
@media (max-width: 767px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-sm); text-align: left; font-weight: 400; flex: none; }
  .table-stack td[data-label=""]::before, .table-stack td:not([data-label])::before { content: none; }
  .table-stack td.cell-title { font-size: var(--fs-lg); justify-content: flex-start; text-align: left; }
  .table-stack td.actions { justify-content: flex-end; padding-top: 8px; }
  .table-stack tfoot { display: block; }
  .table-stack tbody tr:hover td { background: none; }
}

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 52px 22px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state > i { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); margin-bottom: 4px; }
.empty-state h2, .empty-state h3 { color: var(--text); font-family: var(--font-title); font-size: 1.45rem; font-weight: 600; }
.empty-state p { max-width: 46ch; }
.empty-state .btn { margin-top: 8px; }

/* ---------- Modal & sheet ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(20, 12, 7, .52); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn .16s ease; }
.modal-box { background: var(--surface); width: 100%; max-width: 540px; max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); display: flex; flex-direction: column; border-radius: var(--r-xl); box-shadow: var(--shadow-3); animation: popIn .2s cubic-bezier(.2, .9, .3, 1.1); border: 1px solid var(--line); }
.modal-box:focus { outline: none; }
.modal-box.wide { max-width: 780px; }
.modal-box.xwide { max-width: 1060px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-family: var(--font-title); font-weight: 600; font-size: 1.6rem; flex: 1; min-width: 0; line-height: 1.15; }
.modal-body { padding: 20px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 599px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-box, .modal-box.wide, .modal-box.xwide { max-width: none; border-radius: 24px 24px 0 0; max-height: 94vh; max-height: 94dvh; animation: sheetUp .26s cubic-bezier(.2, .9, .3, 1); border-bottom: 0; }
  .modal-box::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 9px auto -4px; flex: none; }
  .modal-head { padding-top: 14px; }
  .modal-foot { padding-bottom: calc(16px + var(--safe-b)); }
  .modal-foot .btn { flex: 1; }
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes sheetUp { from { transform: translateY(60px); opacity: .3; } }
.drawer { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: flex-end; background: rgba(20, 12, 7, .45); animation: fadeIn .15s; }
.drawer-box { width: min(500px, 100%); background: var(--surface); height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-3); animation: slideIn .22s ease; }
@keyframes slideIn { from { transform: translateX(40px); opacity: .5; } }

/* ---------- Toasts ---------- */
.toast-root { position: fixed; z-index: 200; right: 18px; bottom: calc(18px + var(--safe-b) + var(--tabbar-h)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; background: var(--roast); color: #F6EBD8; padding: 13px 18px; border-radius: 14px; box-shadow: var(--shadow-2); display: flex; gap: 11px; align-items: center; min-width: 250px; max-width: 440px; animation: popIn .22s ease; font-size: var(--fs-md); border: 1px solid rgba(221, 187, 106, .25); }
.toast i { color: var(--gilt-hi); }
.toast.is-error { background: #7E271C; border-color: transparent; }
.toast.is-error i { color: #FFD6CC; }
.toast.is-success i { color: #8FDDB0; }
@media (max-width: 599px) { .toast-root { left: 12px; right: 12px; bottom: auto; top: calc(10px + env(safe-area-inset-top, 0px)); } .toast { max-width: none; animation-name: dropIn; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item.is-wrap { flex-wrap: wrap; }
.list-item.is-wrap .grow { min-width: 180px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.row-actions:empty { display: none; }
.list-item .title { font-weight: 500; }
.list-item .meta { font-size: var(--fs-sm); color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }
.totals { display: grid; gap: 7px; }
.totals .row { display: flex; justify-content: space-between; gap: 12px; }
.totals .row.grand { font-family: var(--font-title); font-size: 1.7rem; font-weight: 600; padding-top: 10px; border-top: 1px solid var(--line-strong); margin-top: 4px; line-height: 1.2; }
.totals .row.balance { color: var(--c-danger); font-weight: 600; }

/* ---------- Quick links ---------- */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.quick a { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; min-height: 78px; transition: border-color .15s, background-color .15s; }
.quick a:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: var(--surface-2); }
.quick a i { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--brand); font-size: 1.05rem; flex: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
:root[data-theme="dark"] .quick a i { color: var(--accent); }
.quick a strong { display: block; font-weight: 500; }
.quick a span { color: var(--muted); font-size: var(--fs-sm); }

/* ---------- Order ticket (kitchen docket) ---------- */
.ticket {
  --t-c: var(--c-new); --t-bg: var(--c-new-bg);
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 6px 6px var(--r-md) var(--r-md);
  box-shadow: var(--shadow-1); display: flex; flex-direction: column; overflow: hidden;
}
.ticket::before { content: ""; height: 5px; background: var(--t-c); display: block; }
.ticket::after { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 7px; background: radial-gradient(circle at 6px -2px, var(--surface-2) 5px, transparent 5.5px) 0 0 / 12px 7px repeat-x; }
.ticket.is-preparing { --t-c: var(--c-prep); --t-bg: var(--c-prep-bg); }
.ticket.is-ready { --t-c: var(--c-ready); --t-bg: var(--c-ready-bg); }
.ticket.is-late { box-shadow: 0 0 0 2px var(--c-danger), var(--shadow-1); }
.ticket-head { padding: 15px 15px 8px; display: flex; gap: 8px; align-items: flex-start; }
.ticket-no { font-family: var(--font-title); font-weight: 700; font-size: 1.55rem; line-height: 1; letter-spacing: .01em; }
.ticket-where { font-weight: 600; font-size: var(--fs-md); }
.ticket-sub { color: var(--muted); font-size: var(--fs-sm); }
.ticket-timer { margin-left: auto; text-align: right; font-weight: 600; font-size: var(--fs-lg); color: var(--t-c); white-space: nowrap; }
.ticket-timer small { display: block; font-weight: 400; font-size: var(--fs-xs); color: var(--muted); }
.ticket.is-late .ticket-timer { color: var(--c-danger); }
.ticket-items { list-style: none; margin: 0; padding: 4px 15px 10px; border-top: 1px dashed var(--line-strong); }
.ticket-items li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.ticket-items li:last-child { border-bottom: 0; }
.ticket-qty { font-weight: 700; min-width: 30px; font-size: var(--fs-lg); }
.ticket-item-name { font-weight: 600; font-size: var(--fs-lg); line-height: 1.3; }
.ticket-mods { font-size: var(--fs-sm); color: var(--text-2); }
.ticket-note { font-size: var(--fs-sm); color: var(--c-danger); font-weight: 600; }
.ticket-request { margin: 0 15px 10px; padding: 8px 11px; background: var(--c-warn-bg); color: var(--c-warn); border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 500; }
.ticket-actions { margin-top: auto; padding: 10px 15px 15px; display: flex; gap: 8px; }
.ticket-actions .btn { flex: 1; }
.ticket-station { font-size: var(--fs-xs); font-weight: 600; padding: 2px 9px; border-radius: 6px; background: var(--t-bg); color: var(--t-c); }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 210px; }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; font-size: var(--fs-sm); }
.bar-row .bar { grid-column: 1 / -1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar-row .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 70%, var(--accent))); border-radius: 3px; }
:root[data-theme="dark"] .bar-row .bar span { background: var(--accent); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; justify-content: center; padding: 18px; flex-wrap: wrap; }
.page-link { min-width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0 9px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; background: var(--surface); font-size: var(--fs-sm); }
.page-link:hover { border-color: var(--line-strong); }
.page-link.is-current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.page-link.is-disabled { opacity: .4; }
.page-gap { padding: 0 6px; align-self: center; color: var(--muted); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.thumb { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); flex: none; display: grid; place-items: center; color: var(--muted); }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: .8em; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); }
.loading { display: grid; place-items: center; padding: 44px; color: var(--muted); gap: 10px; }
.loading i { animation: spin 1s linear infinite; font-size: 1.3rem; color: var(--accent); }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%) 0 0 / 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 10px; }
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.callout { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 13px 15px; color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .tabbar, .page-actions, .filters, .no-print, .toast-root, .pagination, .tabs { display: none !important; }
  .app-main { margin: 0 !important; }
  body { background: #fff; color: #000; }
  .panel, .stats { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .page { padding: 0; max-width: none; }
  .tab-panel { display: block !important; margin-bottom: 18px; }
}

/* ---------- Shift banner ---------- */
.shift-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--r-lg); background: var(--c-warn-bg); border: 1px solid color-mix(in srgb, var(--c-warn) 25%, transparent); margin-bottom: 18px; flex-wrap: wrap; }
.shift-banner > i { font-size: 1.25rem; color: var(--c-warn); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c-warn) 12%, transparent); }
.shift-banner.is-open { background: var(--c-ok-bg); border-color: color-mix(in srgb, var(--c-ok) 22%, transparent); }
.shift-banner.is-open > i { color: var(--c-ok); background: color-mix(in srgb, var(--c-ok) 12%, transparent); }
.shift-banner .grow { flex: 1; min-width: 200px; display: flex; flex-direction: column; }

/* ---------- Payment dialog ---------- */
.pay-due { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 18px; text-align: center; }
.pay-due strong { font-family: var(--font-title); font-size: 3rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.05; font-variant-numeric: lining-nums proportional-nums; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; margin-bottom: 16px; }
.pay-method { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 13px 8px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 500; font-size: var(--fs-sm); color: var(--text); transition: border-color .15s, background-color .15s; }
.pay-method i { font-size: 1.25rem; color: var(--brand); }
:root[data-theme="dark"] .pay-method i { color: var(--accent); }
.pay-method:hover { border-color: var(--accent); background: var(--surface-2); }
.pay-lines { display: grid; gap: 10px; }
.pay-line { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); }
.pay-line-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.pay-line-head .icon-btn { margin-left: auto; }
.pay-line-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pay-extra { margin-top: 12px; }
.pay-summary { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-strong); font-size: var(--fs-lg); }
.pay-summary .balance { color: var(--c-danger); }

/* ---------- Send receipt dialog ---------- */
.send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.send-grid .send-wide { grid-column: 1 / -1; }
.btn-wa { --b-bg: #1F8F55; --b-ink: #fff; --b-line: #1F8F55; }
.btn-wa:hover { background: #18774A; }
.pay-change { font-family: var(--font-title); font-size: 1.9rem; margin-top: 10px; line-height: 1.15; }
.pay-change strong { color: var(--c-ok); }

/* ---------- Bill view ---------- */
.bill-order { border-bottom: 1px dashed var(--line); padding: 11px 0; }
.bill-order:last-child { border-bottom: 0; }
.bill-order-head { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); color: var(--muted); margin-bottom: 4px; }
.bill-line { display: flex; gap: 10px; padding: 4px 0; }
.bill-line .q { min-width: 28px; font-weight: 600; }
.bill-line .n { flex: 1; min-width: 0; }
.bill-line .n small { display: block; color: var(--muted); }
.bill-line.is-void { color: var(--muted); text-decoration: line-through; }

/* ---------- Home (dashboard) ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 30px 32px; margin-bottom: 20px; color: #F6EBD8;
  background: radial-gradient(120% 140% at 100% 0%, rgba(201, 161, 74, .18), transparent 55%), linear-gradient(135deg, #2B1A11, var(--roast));
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: end; isolation: isolate;
}
.hero::before { content: ""; position: absolute; inset: 0; background: var(--imigongo-lattice) right -20px top -10px / 64px 64px; opacity: .22; z-index: -1; -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 85%); mask-image: linear-gradient(90deg, transparent 30%, #000 85%); }
.hero::after { content: ""; position: absolute; left: 32px; right: 32px; bottom: 0; height: 14px; background: var(--imigongo) repeat-x left center / 28px 14px; opacity: .35; }
.hero-date { color: rgba(221, 187, 106, .9); font-size: var(--fs-sm); letter-spacing: .03em; }
.hero h2 { font-family: var(--font-title); font-weight: 600; font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.05; margin: 6px 0 16px; }
.hero .btn-row .btn:not(.btn-accent) { --b-bg: rgba(246, 235, 216, .06); --b-line: rgba(246, 235, 216, .22); --b-ink: #F6EBD8; }
.hero .btn-row .btn:not(.btn-accent):hover { background: rgba(246, 235, 216, .12); }
.hero-figure { text-align: right; padding-bottom: 14px; }
.hero-figure .label { color: rgba(246, 235, 216, .7); font-size: var(--fs-sm); }
.hero-figure .value { font-family: var(--font-title); font-weight: 600; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; color: var(--gilt-hi); font-variant-numeric: lining-nums proportional-nums; }
.hero-figure .value small { font-family: var(--font-ui); font-size: .95rem; color: rgba(246, 235, 216, .7); margin-left: 6px; font-weight: 400; }
.hero-figure .note { color: rgba(246, 235, 216, .72); font-size: var(--fs-sm); margin-top: 6px; }
@media (max-width: 767px) {
  .hero { grid-template-columns: 1fr; padding: 22px 20px 28px; border-radius: 18px; }
  .hero::after { left: 20px; right: 20px; }
  .hero-figure { text-align: left; padding-bottom: 0; }
  .hero .btn-row .btn { flex: 1 1 auto; }
}
.live { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 899px) { .live { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1199px) { .home-grid { grid-template-columns: 1fr; } }
.side-stack { display: flex; flex-direction: column; gap: 18px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); text-decoration: none; }
.mini-row:last-child { border-bottom: 0; }
a.mini-row:hover { background: var(--surface-2); }
.mini-row .grow { flex: 1; min-width: 0; }
.mini-row .when { font-family: var(--font-title); font-weight: 600; font-size: 1.3rem; min-width: 56px; }

/* ---------- Standalone pages (installer, notices) ---------- */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 18px; background: radial-gradient(90% 80% at 50% 0%, rgba(201, 161, 74, .14), transparent 60%), var(--bg); }
.solo-card { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 32px; box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 14px; }
.solo-card h1 { font-family: var(--font-title); font-size: 2.1rem; font-weight: 600; line-height: 1.1; }
.solo-log { margin: 0; padding-left: 18px; color: var(--text-2); font-size: var(--fs-sm); max-height: 300px; overflow: auto; display: grid; gap: 4px; }

/* native file pickers in the same style as buttons */
input[type="file"] { font: inherit; font-size: var(--fs-sm); color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 500; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 8px 14px; margin-right: 10px; cursor: pointer; }

/* ---------- Late responsive overrides (must stay last) ---------- */
@media (max-width: 1023px) {
  .user-chip { padding: 3px; border-color: transparent; background: transparent; }
  .topbar-mark { display: inline-grid; }
  .topbar-clock, .user-chip-text, .user-chip .fa-chevron-down { display: none; }
}
@media (max-width: 420px) {
  .topbar-actions [data-theme-toggle] { display: none; }
}
.grid > .panel + .panel, .stack > .panel + .panel, .bill-cards > .panel + .panel { margin-top: 0; }
.grid + .panel, .panel + .grid, .grid + .grid, .stats + .grid { margin-top: 18px; }
