/* ==========================================================================
   Tap & Order — Zero-AI F&B Design System
   Food-grade Editorial Palettes | 3-Tier Typography | 4px/8px Grid
   ========================================================================== */

:root,
[data-template="viet-bistro"] {
  /* Template 1: Viet Bistro (Default — Quan An Gia Dinh & Bep Viet) */
  --bg: #FAF6F0;
  --surface: #FFFFFF;
  --surface-alt: #F3EDE2;
  --surface-elevated: #FFFFFF;
  --text: #1A1917;
  --text-muted: #645F57;
  --text-subtle: #8C857B;

  --accent: #B93829;
  --accent-hover: #9C2D20;
  --accent-soft: #F9EAE8;
  --accent-ink: #FFFFFF;

  --secondary: #2E5A36;
  --secondary-soft: #E9F1EB;
  --secondary-ink: #FFFFFF;

  --border: #E6DFD3;
  --border-strong: #CFC4B2;

  --status-new: #B93829;
  --status-new-bg: #F9EAE8;
  --status-prep: #B45309;
  --status-prep-bg: #FEF3C7;
  --status-done: #2E5A36;
  --status-done-bg: #E9F1EB;
  --status-danger: #B91C1C;
  --status-danger-bg: #FEE2E2;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Disciplined Radius Scale */
  --radius-tag: 4px;
  --radius-control: 8px;
  --radius-card: 12px;
  --radius-sheet: 16px;
  --radius-pill: 9999px;

  /* 4px / 8px Spacing Scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* Hairlines & Subtle Elevation (no heavy blurred shadows) */
  --shadow-bar: 0 -1px 0 var(--border), 0 -4px 12px rgba(26, 25, 23, 0.05);
  --shadow-sheet: 0 -8px 24px rgba(26, 25, 23, 0.12);
  --backdrop: rgba(26, 25, 23, 0.48);

  /* Layout Tokens */
  --heading-font: var(--font-display);
  --thumb-radius: 8px;
}

[data-template="artisan-coffee"] {
  /* Template 2: Artisan Coffee (Specialty Coffee & Bakery) */
  --bg: #F6F4F0;
  --surface: #FFFFFF;
  --surface-alt: #ECE8E1;
  --surface-elevated: #FFFFFF;
  --text: #231815;
  --text-muted: #6C5D55;
  --text-subtle: #96877E;

  --accent: #3E2723;
  --accent-hover: #291815;
  --accent-soft: #EFEBE9;
  --accent-ink: #FFFFFF;

  --secondary: #A16207;
  --secondary-soft: #FEF3C7;
  --secondary-ink: #FFFFFF;

  --border: #E2DDD5;
  --border-strong: #C9C1B5;

  --status-new: #A16207;
  --status-new-bg: #FEF3C7;
  --status-prep: #3E2723;
  --status-prep-bg: #EFEBE9;
  --status-done: #2E5A36;
  --status-done-bg: #E9F1EB;

  --heading-font: var(--font-display);
  --thumb-radius: 8px;
}

[data-template="modern-tea"] {
  /* Template 3: Modern Tea (Tra Sua & Do Uong Hien Dai) */
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --surface-alt: #EFF3F1;
  --surface-elevated: #FFFFFF;
  --text: #141B18;
  --text-muted: #5C6B63;
  --text-subtle: #88968F;

  --accent: #1F6E4A;
  --accent-hover: #175438;
  --accent-soft: #E6F3EC;
  --accent-ink: #FFFFFF;

  --secondary: #D95338;
  --secondary-soft: #FCECE8;
  --secondary-ink: #FFFFFF;

  --border: #E2E7E4;
  --border-strong: #C4CFD0;

  --status-new: #D95338;
  --status-new-bg: #FCECE8;
  --status-prep: #B45309;
  --status-prep-bg: #FEF3C7;
  --status-done: #1F6E4A;
  --status-done-bg: #E6F3EC;

  --heading-font: var(--font-sans);
  --thumb-radius: 8px;
}

[data-template="night-bistro"] {
  /* Template 4: Night Bistro (Quan Nuong & Bistro Dem — Warm Charcoal, never pure #000) */
  --bg: #161615;
  --surface: #22211F;
  --surface-alt: #2A2825;
  --surface-elevated: #2C2A27;
  --text: #F4EFE6;
  --text-muted: #ABA396;
  --text-subtle: #7D766B;

  --accent: #D97706;
  --accent-hover: #F59E0B;
  --accent-soft: #352715;
  --accent-ink: #161615;

  --secondary: #E05D44;
  --secondary-soft: #361F1A;
  --secondary-ink: #F4EFE6;

  --border: #33302C;
  --border-strong: #4A453F;

  --status-new: #F59E0B;
  --status-new-bg: #352715;
  --status-prep: #FB923C;
  --status-prep-bg: #362216;
  --status-done: #4ADE80;
  --status-done-bg: #173021;
  --status-danger: #F87171;
  --status-danger-bg: #3B1B1B;

  --shadow-bar: 0 -1px 0 var(--border), 0 -4px 16px rgba(0, 0, 0, 0.35);
  --shadow-sheet: 0 -8px 28px rgba(0, 0, 0, 0.5);
  --backdrop: rgba(10, 10, 9, 0.72);

  --heading-font: var(--font-display);
  --thumb-radius: 8px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

img, svg {
  display: block;
}

/* 1.5px Stroke Icon System */
.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

.icon-lg {
  width: 22px;
  height: 22px;
}

/* Typography Utilities */
.font-display {
  font-family: var(--heading-font);
}

.font-serif {
  font-family: var(--font-display);
}

.font-mono,
.tabular-nums,
.price-text,
.timer-text,
.mono-code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.text-muted {
  color: var(--text-muted);
}

.text-subtle {
  color: var(--text-subtle);
}

.text-accent {
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   Core Containers & Shared Surfaces
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.container-wide {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.card-padded {
  padding: var(--sp-4);
}

/* ==========================================================================
   Buttons & Interactive Controls (8px radius)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 40px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm {
  height: 32px;
  padding: 0 var(--sp-3);
  font-size: 13px;
}

.btn-lg {
  height: 46px;
  padding: 0 var(--sp-5);
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-ink);
  border-color: var(--secondary);
}

.btn-outline {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--surface-alt);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--surface-alt);
  color: var(--text);
}

.btn-danger {
  background-color: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: transparent;
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--status-danger);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover:not(:disabled) {
  background: var(--surface-alt);
}

.btn-circle-add {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-circle-add:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-circle-add:disabled {
  background: var(--border-strong);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Badges & Tags (4px radius) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-tag);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-secondary {
  background: var(--secondary-soft);
  color: var(--secondary);
}

.badge-success {
  background: var(--status-done-bg);
  color: var(--status-done);
}

.badge-warning {
  background: var(--status-prep-bg);
  color: var(--status-prep);
}

.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.badge-muted {
  background: var(--surface-alt);
  color: var(--text-muted);
  border-color: var(--border);
}

.nfc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-tag);
  background: var(--secondary-soft);
  color: var(--secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nfc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Form Inputs (8px radius) */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
}

.textarea {
  min-height: 76px;
  resize: vertical;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  width: 44px;
  height: 24px;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  position: relative;
  transition: background-color 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform 0.18s ease;
}

.switch input:checked + .switch-track {
  background: var(--secondary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
  max-width: 340px;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 500;
}

.toast-error {
  background: var(--status-danger);
  color: #FFFFFF;
  border-color: var(--status-danger);
}

.toast-success {
  background: var(--secondary);
  color: #FFFFFF;
  border-color: var(--secondary);
}

/* ==========================================================================
   1. DEMO HUB (public/index.html)
   ========================================================================== */
.hub-shell {
  min-height: 100vh;
  padding-bottom: var(--sp-10);
}

.hub-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.hub-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 60px;
  flex-wrap: wrap;
  padding: var(--sp-2) 0;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.hub-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-brand-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
}

.hub-brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.hub-header-bar {
  padding: var(--sp-6) 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}

.hub-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.hub-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hub-subtitle {
  margin-top: var(--sp-1);
  color: var(--text-muted);
  font-size: 14px;
  max-width: 680px;
}

.hub-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.hub-grid {
  padding-top: var(--sp-5);
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--sp-6);
  align-items: start;
}

.hub-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.table-launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.table-launch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color 0.15s ease;
}

.table-launch-card:hover {
  border-color: var(--accent);
}

.table-launch-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
}

.table-launch-name {
  font-weight: 700;
  font-size: 15px;
}

.table-launch-zone {
  font-size: 12px;
  color: var(--text-muted);
}

.table-launch-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 6px 8px;
  border-radius: var(--radius-tag);
  border: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-launch-actions {
  display: flex;
  gap: var(--sp-2);
}

.system-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.role-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-3);
}

.role-card-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.role-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.role-card-title {
  font-weight: 700;
  font-size: 15px;
}

.role-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* 60s Judge Demo Script */
.script-card {
  padding: var(--sp-5);
}

.script-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.script-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.script-step:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.script-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-tag);
  padding: 4px 6px;
  text-align: center;
  height: fit-content;
}

.script-step-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}

.script-step-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* Live QR & Template Preview Panel in Demo Hub */
.preview-panel {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.preview-qr-box {
  background: #FFFFFF;
  color: #1A1917;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
}

.preview-qr-svg {
  width: 176px;
  height: 176px;
  padding: var(--sp-2);
  border: 1px solid #E6DFD3;
  border-radius: var(--radius-control);
  background: #FFFFFF;
}

.preview-qr-svg svg {
  width: 100%;
  height: 100%;
}

.template-pill-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
}

.template-mini-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 10px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.template-mini-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* ==========================================================================
   2. CUSTOMER MOBILE MENU (public/menu.html)
   ========================================================================== */
.menu-app {
  --menu-gutter: clamp(14px, 3vw, 36px);
  max-width: 1220px;
  min-height: 100vh;
  margin: auto;
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

.menu-header {
  padding: clamp(18px, 3vw, 32px) var(--menu-gutter) 12px;
  border-top: 5px solid var(--accent);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.menu-header-top, .menu-table-bar, .table-details {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-header-top, .menu-table-bar { justify-content: space-between; }
.menu-identity { min-width: 0; }
.menu-store-name {
  font: 700 clamp(22px, 3vw, 36px)/1.12 var(--heading-font);
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.menu-store-sub { margin-top: 5px; color: var(--text-muted); }
.menu-header .lang-toggle { flex-shrink: 0; height: 40px; }
.menu-header .lang-toggle button { min-width: 40px; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.lang-toggle button {
  padding: 0 8px;
  height: 100%;
  color: var(--text-muted);
}

.lang-toggle button.is-active {
  background: var(--text);
  color: var(--bg);
}

.btn-bell {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}

.btn-bell:hover {
  background: var(--surface-alt);
}

.menu-table-bar { margin-top: 14px; }
.table-details { flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.table-details .badge { white-space: normal; overflow-wrap: anywhere; }
.table-details [hidden] { display: none; }
.menu-table-bar .btn-bell { min-height: 44px; flex-shrink: 0; }
.order-tracker-head, .order-tracker-head > div { flex-wrap: wrap; }

#tableVerifiedBadge {
  max-width: 100%;
}

#tableBadgeText {
  overflow-wrap: anywhere;
}

.table-locked-banner {
  margin: var(--sp-3) var(--sp-4) 0;
  padding: var(--sp-3);
  border-radius: var(--radius-control);
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: 13px;
  font-weight: 500;
}

/* Live Order Status Stepper */
.order-tracker-bar {
  margin: var(--sp-3) var(--sp-4) 0;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.order-tracker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.tracker-order + .tracker-order,
.tracker-more {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.tracker-more summary {
  margin-bottom: var(--sp-3);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.tracker-items {
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.tracker-items ul {
  display: grid;
  gap: 6px;
  margin: 6px 0 8px;
  padding: 0;
  list-style: none;
}

.tracker-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  overflow-wrap: anywhere;
}

.tracker-item-detail {
  display: block;
  font-size: 12px;
}

#cancelItemsList {
  display: grid;
  gap: var(--sp-2);
}

.cancel-item-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.cancel-item-choice input {
  flex: 0 0 76px;
  width: 76px;
}

.order-cancelled-items {
  margin-top: var(--sp-2);
  padding: var(--sp-2);
  background: var(--surface-alt);
  border-radius: var(--radius-control);
  font-size: 13px;
}

.order-cancelled-items ul {
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.order-cancelled-items li,
.order-cancelled-total {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
}

.order-cancelled-items li > span:last-child,
.order-cancelled-total > strong:last-child {
  text-align: right;
}

.order-cancelled-total {
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.service-cancel-request {
  flex-wrap: wrap;
}

.service-cancel-request ul {
  margin: 2px 0 0;
  padding-inline-start: 1.25em;
}

.cart-duplicate-warning {
  padding: var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  font-size: 14px;
}

.cart-duplicate-warning ul {
  padding-inline-start: 1.4em;
}

.cart-duplicate-warning button {
  margin-top: var(--sp-2);
}

.cart-ordered-reminder {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.staff-call-btn[hidden] {
  display: none;
}

.order-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
  text-align: center;
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  z-index: 1;
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.step-item.is-active .step-dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.step-item.is-active .step-label {
  color: var(--accent);
}

.step-item.is-done .step-dot {
  border-color: var(--secondary);
  background: var(--secondary);
  color: var(--secondary-ink);
}

.step-item.is-done .step-label {
  color: var(--secondary);
}

.step-line {
  flex: 0.6;
  height: 1.5px;
  background: var(--border-strong);
  margin-bottom: 18px;
}

.step-line.is-done {
  background: var(--secondary);
}

/* Customer catalog */
.catalog { padding: 0 var(--menu-gutter); }
.catalog-title {
  font: 700 clamp(30px, 4vw, 46px)/1.1 var(--heading-font);
  letter-spacing: -.035em;
  margin: clamp(18px, 3vw, 36px) 0 16px;
}
.catalog-layout {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: clamp(18px, 2.6vw, 36px);
  align-items: start;
}
.catalog-tools {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  display: grid;
  gap: 8px;
  z-index: 20;
  background: var(--bg);
}
.catalog-search, #categorySelect {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  min-height: 46px;
}
.catalog-search { display: flex; align-items: center; padding: 0 10px; gap: 8px; color: var(--text-muted); }
.catalog-search:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.catalog-search input {
  width: 100%; min-width: 0; min-height: 44px; border: 0; outline: none;
  background: transparent; color: var(--text); font-size: 16px;
}
.catalog-filter-label { font-size: 13px; font-weight: 700; margin-top: 14px; }
#categorySelect { display: none; min-width: 0; padding: 0 8px; color: var(--text); font-size: 16px; }
#categoryTabs { display: grid; gap: 2px; }
.cat-tab {
  padding: 11px 12px; min-height: 44px; text-align: left; color: var(--text-muted);
  border-radius: var(--radius-control); font-weight: 600;
}
.cat-tab:hover { background: var(--surface-alt); }
.cat-tab[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.catalog-empty { padding: 28px 16px; text-align: center; }
.catalog-empty button { margin-top: 12px; }
.menu-section + .menu-section { margin-top: 28px; }
.menu-section-header {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-strong);
}
.menu-section-title { font: 700 22px/1.25 var(--heading-font); }
.menu-section-count { flex-shrink: 0; font-size: 13px; color: var(--text-muted); }
.dish-title { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }

[data-template="artisan-coffee"] .dish-title {
  font-family: var(--font-display);
  font-size: 16px;
}

.dish-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: 12px;
  color: var(--text-muted);
}

.dish-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-1);
}

.dish-price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.spicy-meter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--accent);
}

.prep-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.dish-list { display: grid; gap: 10px; }
.dish-row {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  cursor: pointer;
}
.dish-row:hover { border-color: var(--border-strong); }
.dish-row-info { display: grid; gap: 5px; flex: 1; min-width: 0; align-self: stretch; }
.dish-row-media { width: clamp(74px, 11vw, 104px); flex: none; overflow: hidden; border-radius: var(--thumb-radius); }
.dish-row-media svg { width: 100%; height: auto; }
.dish-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.dish-footer { align-self: end; gap: 6px; flex-wrap: wrap; }
.dish-footer .btn-circle-add {
  width: auto; height: 44px; padding: 0 14px; gap: 5px; border: none;
  font-size: 13px; font-weight: 700; border-radius: var(--radius-control);
}
@media (min-width: 1000px) {
  .dish-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .catalog-layout { display: block; }
  .catalog-tools {
    top: 0; max-height: none; overflow: visible; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    padding: 8px var(--menu-gutter); margin: 0 calc(0px - var(--menu-gutter)) 12px;
    border-bottom: 1px solid var(--border);
  }
  #categoryTabs { display: none; }
  #categorySelect { display: block; width: 100%; }
  .catalog-filter-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .catalog-title { margin-bottom: 4px; }
}

/* Out-of-stock muted state */
.is-out-of-stock {
  opacity: 0.55;
  cursor: not-allowed;
}

.is-out-of-stock .dish-title {
  text-decoration: line-through;
  text-decoration-color: var(--text-subtle);
}

/* Floating Cart Bar at Bottom */
.floating-cart-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
  text-align: left;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 516px;
  z-index: 35;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-bar);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.cart-bar-price { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#cartBarSub { display: block; }
.floating-cart-bar.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
}

.floating-cart-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.cart-count-pill {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: var(--radius-tag);
  background: rgba(255, 255, 255, 0.2);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.floating-cart-total {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
}

/* Bottom Sheet Drawer (16px top radius, slide-up) */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bottom-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.menu-app .bottom-sheet-backdrop[aria-hidden="true"] {
  visibility: hidden;
}

.bottom-sheet {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  background: var(--surface);
  color: var(--text);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  box-shadow: var(--shadow-sheet);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.bottom-sheet-backdrop.is-open .bottom-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.sheet-header {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.sheet-title {
  font-family: var(--heading-font);
  font-size: 18px;
  font-weight: 700;
}

.sheet-body {
  padding: var(--sp-4);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.sheet-footer {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.menu-app .sheet-footer {
  padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
}

/* Modifier Pill Chips & Add-on Rows */
.option-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.option-group-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.pill-chip {
  padding: 7px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pill-chip.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.addon-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  overflow: hidden;
}

.addon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
}

.addon-row:last-child {
  border-bottom: none;
}

.addon-row-left {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.addon-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  height: 40px;
}

.qty-stepper button {
  width: 36px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.qty-stepper-val {
  min-width: 28px;
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 14px;
}

/* Cart Items, Upsells, VietQR & Call Staff */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.cart-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.cart-item-mods {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.upsell-strip {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.upsell-strip::-webkit-scrollbar {
  display: none;
}

.upsell-card {
  flex: 0 0 180px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-2);
}

.vietqr-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #FFFFFF;
  color: #1A1917;
  padding: var(--sp-4);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}

.vietqr-frame {
  width: 200px;
  min-height: 200px;
  border: 1px solid #E6DFD3;
  border-radius: var(--radius-control);
  padding: var(--sp-2);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vietqr-frame img {
  max-width: 100%;
  height: auto;
}

.staff-call-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
}

.staff-call-btn {
  padding: var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.staff-call-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ==========================================================================
   3. KDS COUNTER (public/counter.html)
   ========================================================================== */
.kds-shell[hidden] { display: none; }

.kds-shell {
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.kds-shell > :not(.kds-board),
.kds-col-body > * {
  flex-shrink: 0;
}

.kds-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.kds-topbar-left,
.kds-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.kds-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.audio-unlock-banner {
  background: var(--status-prep-bg);
  color: var(--status-prep);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-2) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: 13px;
  font-weight: 600;
}

.service-alert-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-2) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  overflow-x: auto;
}

.service-alert-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 10px;
  border-radius: var(--radius-control);
  background: var(--status-new-bg);
  color: var(--status-new);
  border: 1px solid var(--status-new);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.kds-board {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) repeat(3, minmax(290px, 1fr));
  grid-template-rows: minmax(0, 1fr);
  min-height: 16rem;
  gap: var(--sp-4);
  padding: var(--sp-4);
  overflow-x: auto;
}

.kds-column {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.kds-column-priority {
  border-color: var(--accent);
  background: var(--surface-alt);
}

.priority-col-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  display: inline-block;
  flex-shrink: 0;
}

.priority-col-sub {
  padding: 7px var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
}

.kds-col-header {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kds-col-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.kds-col-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-tag);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.kds-col-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.kds-ticket {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--status-new);
  border-radius: var(--radius-card);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.kds-ticket.status-preparing {
  border-left-color: var(--status-prep);
}

.kds-ticket.status-completed {
  border-left-color: var(--status-done);
}

.kds-ticket.is-overdue {
  border-color: var(--status-danger);
  border-left-width: 4px;
}

.kds-ticket.is-priority {
  border-color: var(--accent);
  border-left-width: 4px;
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.ticket-item-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.ticket-item-wrap .ticket-item-row {
  flex: 1;
  min-width: 0;
}

.ticket-item-pin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 0 6px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.ticket-item-pin-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.ticket-item-pin-btn.is-pinned {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.priority-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-card);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.priority-card.level-urgent {
  border-color: var(--status-danger);
  border-left-width: 4px;
}

.priority-card.level-batch {
  border-left-color: var(--status-prep);
}

.priority-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.priority-rank-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-tag);
  background: var(--accent);
  color: var(--accent-ink);
}

.priority-card.level-urgent .priority-rank-badge {
  background: var(--status-danger);
}

.priority-score-pill {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-tag);
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.priority-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
  font-size: 12px;
}

.priority-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.priority-reason-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-tag);
  background: var(--status-prep-bg);
  color: var(--status-prep);
}

.priority-reason-chip.is-urgent {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.priority-tip {
  padding: 6px 9px;
  border-radius: var(--radius-tag);
  background: var(--surface-alt);
  border: 1px dashed var(--border-strong);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.priority-refs-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.priority-ref-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color 0.12s ease;
}

.priority-ref-row:hover {
  background: var(--surface-alt);
}

.kds-ticket.is-flash {
  box-shadow: 0 0 0 3px var(--accent);
}

.ticket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.ticket-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
}

.ticket-table {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.ticket-timer {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-tag);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.ticket-timer.is-overdue {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: var(--status-danger);
}

.ticket-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.ticket-item-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: 6px 8px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s ease;
}

.ticket-item-row:hover {
  background: var(--surface-alt);
}

.ticket-item-row.is-done {
  opacity: 0.55;
  text-decoration: line-through;
}

.ticket-item-qty {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  min-width: 24px;
}

.ticket-item-mods {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ticket-note {
  padding: 6px 10px;
  border-radius: var(--radius-tag);
  background: var(--status-prep-bg);
  color: var(--status-prep);
  font-size: 12px;
  font-weight: 600;
}

.ticket-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

.ticket-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==========================================================================
   4. ADMIN & NFC STUDIO (public/admin.html)
   ========================================================================== */
.admin-shell {
  min-height: 100vh;
  padding-bottom: var(--sp-10);
}

.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-3) 0;
  position: sticky;
  top: 0;
  z-index: 30;
}

.admin-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.admin-nav-toggle { display: none; }

@media screen {
  .admin-shell {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  .admin-workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
  }
  .admin-content {
    min-width: 0;
    overflow: auto;
    padding: var(--sp-5) clamp(16px, 2vw, 36px);
  }
}

.admin-tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-3);
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
}

.admin-tab {
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-align: left;
}

.admin-dish-summary { display: flex; align-items: center; gap: 12px; }
.admin-dish-thumb { flex: 0 0 60px; height: 60px; overflow: hidden; border-radius: 10px; background: var(--surface-alt); }
.admin-dish-thumb svg, .dish-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.admin-dish-summary .js-edit-item { margin-top: 4px; }

.admin-tab:hover { background: var(--accent-soft); }

.admin-tab.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.admin-panel {
  display: none;
}

.admin-panel.is-active {
  display: block;
}

/* Keep navigation and filters above the menu's scrollable rows. */
@media screen {
  #panelMenu.is-active {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .admin-topbar, .admin-tabs, .admin-toolbar { flex-shrink: 0; }
  #panelMenu .admin-table-wrap { min-height: 10rem; max-height: none; }
  #panelMenu .admin-table { min-width: 1020px; }
  #panelMenu .admin-table td:nth-child(2) { min-width: 220px; }

  .admin-table-wrap, .bestseller-list {
    overflow: auto;
    max-height: 52dvh;
  }

  #panelStats .card { min-width: 0; }
  .admin-table-wrap { scroll-padding-top: 3rem; }
  .admin-table th { position: sticky; top: 0; z-index: 1; }

  @media (max-width: 640px), (max-height: 560px) {
    .admin-topbar { position: static; }
  }
}

#adminAddItemDialog { width: min(660px, calc(100% - 24px)); }
#adminAddItemDialog .admin-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr));
  margin: 0;
}

.kds-actions { display: contents; }

.menu-table-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.menu-table-filters .select { width: auto; }
.menu-table-filters .input { width: 200px; }

@media screen and (max-width: 720px) {
  .kds-topbar-left, .kds-topbar-right { width: 100%; gap: var(--sp-2); }
  .kds-topbar-right .select { flex: 1; min-width: 0 !important; }
  .kds-actions {
    display: flex;
    width: 100%;
    gap: var(--sp-2);
    overflow-x: auto;
    padding: 3px;
  }
  .kds-actions > * { flex: none; }
  .admin-topbar-inner { gap: var(--sp-2); }
  .admin-shell { height: auto; }
  .admin-workspace { display: block; }
  .admin-nav-toggle { display: inline-flex; margin: var(--sp-3) var(--sp-4) 0; }
  .admin-tabs { border: 0; border-bottom: 1px solid var(--border); }
  .admin-nav-toggle[aria-expanded="false"] + .admin-tabs { display: none; }
  .admin-content { padding: var(--sp-4); }
  #panelMenu .admin-table-wrap { max-height: 65dvh; }
  .menu-table-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .menu-table-filters .select, .menu-table-filters .input { width: 100%; min-width: 0; }
  .menu-table-filters .btn { padding-inline: var(--sp-2); }
}

/* 4-Template Live Switcher */
.template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4);
}

.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.template-card:hover {
  border-color: var(--border-strong);
}

.template-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.template-swatch-bar {
  display: flex;
  height: 44px;
  border-radius: var(--radius-control);
  overflow: hidden;
  border: 1px solid var(--border);
}

.template-swatch-bar span {
  flex: 1;
}

/* Menu & Stock Table */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.admin-edit-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(480px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  color: var(--text);
  overflow: auto;
}

.admin-edit-dialog::backdrop {
  background: rgba(15, 18, 24, 0.6);
}

.admin-edit-dialog > form {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
}

.admin-edit-dialog h2 {
  font-size: 20px;
}

.admin-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-form-card {
  margin-top: var(--sp-5);
  padding: var(--sp-5);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

/* Table Control & Hybrid NFC + QR Standees */
.standee-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.standee-card {
  background: #FFFFFF;
  color: #1A1917;
  border: 1px dashed #1A1917;
  border-radius: var(--radius-card);
  padding: var(--sp-4);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  grid-template-rows: auto auto auto 1fr auto;
  column-gap: var(--sp-4);
  row-gap: 6px;
  align-items: start;
  text-align: left;
  break-inside: avoid;
}

.standee-store {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.standee-table {
  grid-column: 1;
  grid-row: 2;
  font-size: 18px;
  font-weight: 700;
  color: #B93829;
}

.standee-nfc-prompt {
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-tag);
  background: #FAF6F0;
  border: 1px solid #E6DFD3;
  font-size: 12px;
  font-weight: 600;
}

.qr-svg-box {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: center;
  justify-self: end;
  width: 136px;
  height: 136px;
  padding: 8px;
  border: 1px solid #E6DFD3;
  border-radius: var(--radius-control);
  background: #FFFFFF;
}

.qr-svg-box svg {
  width: 100%;
  height: 100%;
}

.standee-url {
  grid-column: 1;
  grid-row: 4;
  align-self: end;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #645F57;
  word-break: break-all;
}

@media screen {
  #panelTables .standee-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    align-content: start;
    gap: 12px;
  }
  .table-control-card {
    grid-template-columns: minmax(0, 1fr) 104px;
    grid-template-rows: auto 1fr auto;
    border: 1px solid var(--border);
    gap: 6px 12px;
    padding: 14px;
  }
  .table-control-card .standee-store,
  .table-control-card .standee-url,
  .table-control-card .standee-nfc-prompt { display: none; }
  .table-control-card .standee-table { grid-row: 1; font-size: 16px; overflow-wrap: anywhere; }
  .table-control-card .qr-svg-box {
    grid-row: 1 / 3;
    width: 104px;
    height: 104px;
    padding: 3px;
  }
  .table-summary {
    display: grid;
    justify-items: start;
    gap: 5px;
    color: var(--text-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  .table-controls {
    grid-column: 1 / -1;
    display: grid;
    gap: 7px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
  .table-control-row, .table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .table-control-row { justify-content: space-between; font-size: 13px; }
}

/* Stats & Shift Closing */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.kpi-card {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 700;
}

.bestseller-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.bestseller-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }

  .template-grid,
  .stats-kpi-grid,
  .admin-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .standee-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .table-launch-grid,
  .system-role-grid,
  .template-grid,
  .stats-kpi-grid,
  .admin-form-grid,
  .standee-grid,
  .template-pill-row,
  .staff-call-grid {
    grid-template-columns: 1fr;
  }
  .menu-app {
    border-left: none;
    border-right: none;
  }
}

/* ==========================================================================
   Staff / Owner PIN Gate Modal (Admin & KDS)
   ========================================================================== */
.pin-gate-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(24, 22, 19, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

.pin-gate-backdrop[hidden] {
  display: none;
}

.pin-gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sheet);
  padding: var(--sp-6);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.pin-gate-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}

.pin-gate-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-control);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pin-gate-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.pin-input-box {
  width: 100%;
  height: 50px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  padding: 0 var(--sp-4);
  outline: none;
  transition: border-color 0.15s ease;
}

.pin-input-box:focus {
  border-color: var(--accent);
}

.pin-gate-error {
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger);
  font-size: 13px;
  font-weight: 500;
}

.table-pin-card {
  gap: var(--sp-3);
  max-height: 92vh;
  overflow-y: auto;
}

.pin-gate-notice {
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--status-done-bg);
  color: var(--status-done);
  border: 1px solid var(--status-done);
  font-size: 13px;
  font-weight: 500;
}

.pin-rescue-wrap {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pin-rescue-wrap[hidden],
.pin-gate-notice[hidden],
.pin-gate-error[hidden],
.table-locked-banner[hidden],
#tablePinBadge[hidden] {
  display: none;
}

.pin-rescue-hint {
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

/* ==========================================================================
   Shared Cart Switcher, Order Rating, Table Folio Modal, K80 Print & /board TV
   ========================================================================== */
.shared-cart-mode-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.tracker-rating-card {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tracker-rating-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.rate-stars-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.rate-star-btn {
  border: 0;
  background: transparent;
  padding: 2px 3px;
  font-size: 18px;
  line-height: 1;
  color: var(--border-strong);
  cursor: pointer;
  transition: transform 0.12s ease, color 0.12s ease;
}

.rate-star-btn.is-lit {
  color: #D97706;
}

.rate-star-btn:hover {
  transform: scale(1.12);
}

.rate-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rate-tag-chip {
  font-size: 11px;
  padding: 4px 9px;
}

.rate-submit-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rate-comment-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  font-size: 12px;
  padding: 6px 10px;
}

.tracker-rating-done {
  margin-top: 8px;
}

/* Table Folio & Settle Modal on KDS */
.folio-page {
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 48px);
}
.folio-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.folio-inspect {
  flex: 1 1 160px;
  display: grid;
  justify-items: start;
  gap: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}
.folio-inspect:hover, .folio-inspect[aria-pressed="true"] {
  background: var(--secondary-soft);
  border-color: var(--secondary);
}
.folio-history { margin: 16px 0; }
.folio-history h2 { font-size: 18px; }
.folio-receipts { padding: 0; list-style: none; overflow-wrap: anywhere; }
.folio-receipts li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.folio-bills-title {
  margin: 24px 0 12px;
  font-size: 18px;
}

.folio-table-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.folio-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 16px;
  align-items: start;
}

.folio-lines-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  background: var(--bg);
}

.folio-table-scroll {
  max-height: 290px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.folio-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

.folio-qr-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

@media (max-width: 760px) {
  .folio-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* K80 Thermal Receipt (hidden on screen) */
.kds-print-receipt {
  display: none;
}

/* Public Pickup TV Board (/board) */
.board-shell {
  min-height: 100vh;
  padding: 16px 22px 26px;
  max-width: 1520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.board-topbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.board-topbar-left,
.board-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.board-store-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
}

.board-clock {
  font-size: 20px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.board-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  flex: 1;
}

.board-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sheet);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.board-col-ready {
  border-color: var(--status-done);
  background: var(--status-done-bg);
}

.board-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.board-col-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.board-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.board-dot-prep {
  background: var(--status-prep);
}

.board-dot-ready {
  background: var(--status-done);
}

.board-col-count {
  font-size: 16px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.board-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.board-card.is-ready {
  border: 2px solid var(--status-done);
}

@keyframes boardReadyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
}

.board-card.is-just-ready {
  animation: boardReadyPulse 1.1s ease-in-out infinite;
}

.board-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.board-order-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.board-table-name {
  font-weight: 700;
  font-size: 15px;
}

.board-items-line {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.board-status-foot {
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.board-card.is-ready .board-status-foot {
  color: var(--status-done);
}

.board-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
  font-size: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
}

@media (max-width: 900px) {
  .board-columns {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Print Stylesheet (Hybrid NFC + QR Standees & K80 Thermal Receipt)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
  body {
    background: #FFFFFF !important;
    color: #1A1917 !important;
  }
  .no-print,
  .admin-topbar,
  .admin-tabs,
  .admin-toolbar {
    display: none !important;
  }
  .admin-shell,
  .admin-shell .container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .admin-panel {
    display: none !important;
  }
  .admin-panel.print-standees {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .standee-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 85.6mm) !important;
    justify-content: center !important;
    gap: 6mm !important;
  }
  .standee-card {
    width: 85.6mm !important;
    height: 54mm !important;
    box-sizing: border-box !important;
    padding: 4mm 4.5mm !important;
    border: 1px dashed #1A1917 !important;
    border-radius: 3.18mm !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 38mm !important;
    grid-template-rows: auto auto auto 1fr !important;
    column-gap: 3.5mm !important;
    row-gap: 1.5mm !important;
    align-items: start !important;
    text-align: left !important;
    overflow: hidden !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    box-shadow: none !important;
  }
  .standee-store {
    grid-column: 1 !important;
    grid-row: 1 !important;
    font-size: 8.5pt !important;
    line-height: 1.2 !important;
  }
  .standee-table {
    grid-column: 1 !important;
    grid-row: 2 !important;
    font-size: 11pt !important;
    line-height: 1.2 !important;
  }
  .standee-nfc-prompt {
    grid-column: 1 !important;
    grid-row: 3 !important;
    justify-self: start !important;
    font-size: 7pt !important;
    padding: 2px 6px !important;
    gap: 3px !important;
  }
  .standee-url {
    grid-column: 1 !important;
    grid-row: 4 !important;
    align-self: end !important;
    font-size: 5.5pt !important;
    line-height: 1.15 !important;
    max-height: 8mm !important;
    overflow: hidden !important;
  }
  .standee-card .qr-svg-box {
    grid-column: 2 !important;
    grid-row: 1 / span 4 !important;
    align-self: center !important;
    justify-self: end !important;
    width: 38mm !important;
    height: 38mm !important;
    padding: 1.5mm !important;
    box-sizing: border-box !important;
  }
  body.is-printing-k80 .kds-shell {
    display: none !important;
  }
  body.is-printing-k80 .kds-print-receipt {
    display: block !important;
    width: 76mm;
    margin: 0 auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #000000;
  }
  .receipt-paper {
    padding: 4px 2px;
  }
  .receipt-head {
    text-align: center;
  }
  .receipt-store {
    font-size: 14px;
    font-weight: 700;
  }
  .receipt-title {
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
  }
  .receipt-meta {
    font-size: 11px;
    margin-top: 2px;
  }
  .receipt-divider {
    text-align: center;
    margin: 6px 0;
  }
  .receipt-row,
  .receipt-total-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
  }
  .receipt-mod {
    font-size: 10px;
    padding-left: 10px;
  }
  .receipt-total-row {
    font-size: 13px;
    font-weight: 700;
    padding-top: 2px;
  }
  .receipt-qr-wrap {
    margin-top: 8px;
    text-align: center;
  }
  .receipt-qr-svg {
    width: 110px;
    height: 110px;
    margin: 0 auto;
  }
  .receipt-foot {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
  }
}


.payment-confirmed { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; padding: .75rem 1rem; border-radius: .65rem; background: #e5f4e9; color: #14532d; font-weight: 700; }

.menu-payment { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0; padding: .875rem 1rem; border: 1px solid var(--border, #ded7cb); border-radius: 1rem; background: var(--surface, #fff); }
.menu-payment[hidden] { display: none; }
.menu-payment > div, .menu-payment-orders li > div { display: grid; gap: .125rem; }
.menu-payment > div > strong, .menu-payment-dialog footer > strong { font-size: 1.2rem; }
.menu-payment-dialog { margin: auto; width: min(32rem, calc(100% - 2rem)); max-height: 85dvh; overflow: auto; padding: 1.25rem; color: inherit; }
.menu-payment-dialog::backdrop { background: rgb(25 20 15 / 55%); }
.menu-payment-dialog > header, .menu-payment-dialog footer, .menu-payment-orders li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.menu-payment-dialog h2 { margin: 0; font-size: 1.35rem; }
.menu-payment-dialog p { margin: .875rem 0; }
.menu-payment-orders { padding: 0; margin: .5rem 0; list-style: none; }
.menu-payment-orders li, .menu-payment-dialog footer { padding: .875rem 0; border-top: 1px solid var(--border, #ded7cb); }
.menu-payment-dialog [data-payment-back] { margin-top: .875rem; }

/* Customer checkout */
.menu-payment-dialog {
  padding: clamp(1rem, 4vw, 1.5rem);
  border-radius: 1.25rem;
  box-shadow: 0 1.5rem 5rem rgb(45 31 20 / 22%);
}
.menu-payment-dialog > header { margin-bottom: 1rem; }
.checkout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1rem 1.125rem;
  color: #fffaf2;
  background: #206440;
  border-radius: .875rem;
}
.checkout-summary strong { font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.menu-payment-orders { display: grid; gap: .5rem; }
.menu-payment-orders li { padding: .875rem; border: 1px solid #e4dcd0; border-radius: .75rem; }
.checkout-stage { display: grid; justify-items: center; gap: .75rem; padding: 1rem .5rem; text-align: center; }
.checkout-code {
  width: min(13rem, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: white;
  border: 1px solid #e4dcd0;
  border-radius: 1rem;
  padding: .625rem;
}
.checkout-code img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.checkout-stage.is-paid { color: #136540; }
.is-paid .checkout-code { background: #f1faf4; border-color: #cce5d5; }
.checkout-tick { width: 56%; overflow: visible; fill: #197747; }
.checkout-tick circle { transform-origin: center; animation: checkout-circle .35s ease-out both; }
.checkout-tick path { fill: none; stroke: white; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; animation: checkout-check .4s .16s ease-out both; }
@keyframes checkout-circle { from { transform: scale(.72); opacity: .35; } }
@keyframes checkout-check { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .checkout-tick circle, .checkout-tick path { animation: none; }
}
.checkout-details { margin: 0; padding: .25rem .875rem; background: #faf7f2; border-radius: .75rem; }
.checkout-details div { display: flex; justify-content: space-between; gap: .75rem; padding: .625rem 0; }
.checkout-details div + div { border-top: 1px solid #e4dcd0; }
.checkout-details dd { margin: 0; text-align: end; font-weight: 600; overflow-wrap: anywhere; }
.checkout-wait { color: #68594c; font-size: .875rem; text-align: center; }
.menu-payment-dialog [data-payment-back] { width: 100%; }

.revenue-card { margin-bottom: var(--sp-5); padding: clamp(16px, 2vw, 28px); }
.revenue-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.revenue-head h2 { font-size: 16px; font-weight: 600; }
#revenueTotal { display: block; margin-top: 4px; font-size: clamp(27px, 3vw, 38px); font-variant-numeric: tabular-nums; }
.revenue-tabs { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface-alt); }
.revenue-card button { font: inherit; font-weight: 600; color: var(--text-muted); cursor: pointer; border: 0; background: transparent; }
.revenue-tabs button { padding: 7px 15px; border-radius: 7px; font-size: 13px; }
.revenue-tabs button[aria-pressed=true] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px #0002; }
.revenue-range { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; color: var(--text-muted); }
.revenue-range button { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px; line-height: 1; font-size: 20px; }
.revenue-range button:disabled { opacity: .35; cursor: default; }
#revenuePlot { width: 100%; height: clamp(175px, 20vw, 230px); color: var(--accent); }
#revenuePlot svg { width: 100%; height: 100%; display: block; }
#revenuePlot text { font: 11px var(--font-sans); fill: var(--text-muted); }
#revenueDetail { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; min-height: 20px; }
@media (min-width: 1500px) { .stats-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
