/* ==========================================================================
   MÌNH ƠI QUÁN — POS Design System v2
   Warm dark theme · Mobile-first · Touch targets ≥ 44px · Be Vietnam Pro
   ========================================================================== */

:root {
  /* Brand */
  --primary: #f5a623;
  --primary-strong: #fbbf24;
  --primary-hover: #d97706;
  --primary-dark-text: #231303;
  --primary-light: rgba(245, 166, 35, 0.13);
  --accent: #38bdf8;
  --accent-light: rgba(56, 189, 248, 0.12);
  --kitchen: #ea580c;
  --kitchen-strong: #f97316;

  --gradient-primary: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --gradient-kitchen: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);

  /* Surfaces (warm charcoal) */
  --bg-dark: #0d0b09;
  --bg-soft: #12100d;
  --surface: #1b1712;
  --surface-2: #241f19;
  --surface-card: #1b1712;
  --surface-border: #332b21;
  --surface-hover: #2a241c;

  /* Text */
  --text-main: #faf6ef;
  --text-muted: #bcae9d;
  --text-dim: #8a7d6c;

  /* States */
  --success: #34d399;
  --success-light: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.13);
  --warning: #fbbf24;
  --info: #38bdf8;

  /* Shape & depth */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 6px 20px rgba(217, 119, 6, 0.35);

  --font-main: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  --header-h: 62px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* Chống zoom khi bấm 2 lần liên tục (double-tap) — vẫn cho zoom bằng 2 ngón tay khi cần */
html, body, button, input, select, textarea, a,
.product-card, .tab-btn, .category-chip, .quick-table-chip, .qty-btn, .mode-capsule {
  touch-action: manipulation;
}

html { scroll-behavior: smooth; }
html, body { width: 100%; overflow-x: hidden; }

body {
  font-family: var(--font-main);
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  line-height: 1.45;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Warm ambient glow, subtle */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 340px;
  background: radial-gradient(560px 260px at 85% -60px, rgba(245, 166, 35, 0.09), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

::selection { background: rgba(245, 166, 35, 0.35); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }

button { font-family: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ───────────────────────── Header ───────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  background: rgba(13, 11, 9, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--surface-border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-section { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.brand-text { min-width: 0; }
.brand-title { font-size: 16.5px; font-weight: 900; letter-spacing: 0.2px; color: #fff; white-space: nowrap; line-height: 1.2; }
.brand-subtitle { font-size: 11.5px; color: var(--primary-strong); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-actions { display: flex; align-items: center; flex-shrink: 0; }

.mode-capsule {
  display: flex; align-items: center; gap: 7px;
  min-height: 38px;
  padding: 7px 13px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 12.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
}
.mode-capsule:active { transform: scale(0.97); }

.mode-badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-light);
  animation: pulse 2.2s infinite;
  flex-shrink: 0;
}
.mode-capsule.remote .mode-badge-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ───────────────────────── Layout ───────────────────────── */
.app-container {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 14px 120px;
  position: relative;
  z-index: 1;
}
@media (min-width: 700px) { .app-container { padding: 18px 20px 48px; } }

/* ───────────────────────── Tabs ───────────────────────── */
.tab-navigation {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  display: flex;
  gap: 6px;
  padding: 8px;
  margin-bottom: 16px;
  background: rgba(27, 23, 18, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tab-navigation::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1 0 auto;
  min-height: 44px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
}
.tab-btn:hover { color: var(--text-main); background: var(--surface-hover); }
.tab-btn.active {
  background: var(--gradient-primary);
  color: var(--primary-dark-text);
  box-shadow: var(--shadow-glow);
}
.tab-btn.active:hover { background: var(--gradient-primary); }

/* Segmented control (receipt view) — separate from .tab-btn on purpose */
.seg-wrap {
  display: flex; gap: 6px;
  max-width: 460px;
  margin: 0 auto 20px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
}
.seg-btn {
  flex: 1;
  min-height: 40px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 12.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: all 0.18s;
}
.seg-btn.active { background: var(--gradient-primary); color: var(--primary-dark-text); }

/* ───────────────────────── Page heads / cards ───────────────────────── */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head.centered { justify-content: center; text-align: center; }
.page-title { font-size: 19px; font-weight: 800; color: #fff; line-height: 1.25; }
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

.settings-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) { .settings-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); } }

.settings-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 13px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.settings-grid .settings-card { margin-bottom: 0; }
.card-accent { border-color: rgba(56, 189, 248, 0.45); background: linear-gradient(180deg, rgba(56,189,248,0.06), var(--surface) 55%); }

.settings-card-title { font-size: 15px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.title-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-light);
  border-radius: 9px;
  font-size: 15px;
}
.title-note { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.card-text { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.card-text b { color: var(--text-main); }
.card-divider { border-top: 1px dashed var(--surface-border); margin: 2px 0; }
.subhead { font-size: 13.5px; font-weight: 800; color: #fff; }
.subhead.primary { color: var(--primary-strong); }
.subhead.accent { color: var(--accent); }
.hint { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; }

/* ───────────────────────── Forms ───────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.2px; }

.form-input, .form-select {
  width: 100%;
  min-height: 44px;
  background: var(--bg-soft);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-input[readonly] { color: var(--accent); font-weight: 600; }

.share-row { display: flex; gap: 8px; }
.share-row .form-input { flex: 1; min-width: 0; }
.share-row .btn-secondary, .share-row .btn-copy { flex-shrink: 0; }

.btn-copy {
  min-height: 44px;
  padding: 10px 16px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #082f42;
  font-size: 13px; font-weight: 800;
  cursor: pointer; white-space: nowrap;
}
.btn-copy:active { transform: scale(0.97); }

/* ───────────────────────── Buttons ───────────────────────── */
.btn-primary-print {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--primary-dark-text);
  font-size: 15px; font-weight: 900; letter-spacing: 0.2px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow-glow);
  transition: transform 0.12s, filter 0.15s;
}
.btn-primary-print:hover { filter: brightness(1.06); }
.btn-primary-print:active { transform: scale(0.98); }

.btn-kitchen-print {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  background: var(--gradient-kitchen);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 15px; font-weight: 900; letter-spacing: 0.2px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.35);
  transition: transform 0.12s, filter 0.15s;
}
.btn-kitchen-print:hover { filter: brightness(1.07); }
.btn-kitchen-print:active { transform: scale(0.98); }

.btn-secondary {
  min-height: 44px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--surface-hover); }
.btn-secondary:active { transform: scale(0.98); }
.btn-small { min-height: 38px; padding: 8px 12px; font-size: 12px; }

.btn-checkout {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  background: var(--success-light);
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: var(--radius-md);
  color: var(--success);
  font-size: 13.5px; font-weight: 800;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform 0.12s, background 0.15s;
}
.btn-checkout:active { transform: scale(0.98); }

.icon-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 15px;
  cursor: pointer;
}
.icon-btn:active { transform: scale(0.94); }

.spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────────────────── POS: tables ───────────────────────── */
.table-bar-wrap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.bar-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 24px; }
.bar-label { font-size: 12px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.8px; }

.table-bar {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.table-bar::-webkit-scrollbar { display: none; }

.quick-table-chip {
  min-height: 42px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px; font-weight: 700;
  white-space: nowrap; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.quick-table-chip.has-guest { border-color: rgba(52, 211, 153, 0.55); color: var(--text-main); background: rgba(52, 211, 153, 0.07); }
.quick-table-chip.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: var(--primary-dark-text);
  box-shadow: var(--shadow-glow);
}
.table-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.table-dot.occupied { background: var(--success); box-shadow: 0 0 0 3px var(--success-light); }
.table-dot.empty { background: #5c5142; }
.quick-table-chip.active .table-dot.occupied { background: #14532d; box-shadow: none; }
.quick-table-chip.active .table-dot.empty { background: rgba(35, 19, 3, 0.4); }

.table-kitchen-badge {
  font-size: 10.5px; font-weight: 800;
  background: var(--kitchen);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* Quick add */
.quick-add-row { display: flex; gap: 8px; margin-bottom: 6px; }
.quick-add-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1.5px dashed rgba(245, 166, 35, 0.45);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s, transform 0.1s;
}
.quick-add-btn b { color: var(--primary-strong); }
.quick-add-btn:active { transform: scale(0.97); background: var(--primary-light); }

/* Categories */
.category-bar {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  margin: 4px 0 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-bar::-webkit-scrollbar { display: none; }

.category-chip {
  min-height: 38px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 12.5px; font-weight: 700;
  white-space: nowrap; cursor: pointer; flex-shrink: 0;
  transition: all 0.15s;
}
.category-chip.active {
  background: var(--primary-light);
  color: var(--primary-strong);
  border-color: var(--primary);
}

/* ───────────────────────── POS: products ───────────────────────── */
.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .products-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 1100px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 13px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 9px;
  position: relative;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.product-card:hover { border-color: rgba(245, 166, 35, 0.5); }
.product-card:active { transform: scale(0.96); background: var(--surface-2); }

.product-emoji {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border-radius: 12px;
  font-size: 25px;
  line-height: 1;
}
.product-name {
  font-size: 14px; font-weight: 600; color: var(--text-main);
  line-height: 1.35;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.product-price { font-size: 15.5px; font-weight: 800; color: var(--primary-strong); white-space: nowrap; }
.product-add-plus {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--primary-dark-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 900; line-height: 1;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.4);
}
.product-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--kitchen-strong);
  color: #fff;
  font-size: 11px; font-weight: 800;
  min-width: 24px; height: 24px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.product-badge.cart-count { position: static; background: var(--gradient-primary); color: var(--primary-dark-text); }

/* ───────────────────────── Cart panel (desktop) ───────────────────────── */
.pos-layout { display: block; }
.cart-panel { display: none; }

@media (min-width: 900px) {
  .pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
  .cart-panel {
    display: flex; flex-direction: column; gap: 13px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--header-h) + 76px);
  }
  .mobile-bottom-bar { display: none !important; }
}

.cart-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--surface-border); }
.cart-title { font-size: 15.5px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }
.clear-btn { background: none; border: none; color: var(--danger); font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 6px 4px; }
.clear-btn:hover { text-decoration: underline; }

.table-selector-row { display: flex; gap: 8px; }
.table-input {
  flex: 1; width: 100%;
  min-height: 44px;
  background: var(--bg-soft);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px; font-weight: 700;
  outline: none;
}
.table-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.cart-items-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.cart-items-list::-webkit-scrollbar, .drawer-items-list::-webkit-scrollbar { width: 5px; }
.cart-items-list::-webkit-scrollbar-thumb, .drawer-items-list::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 4px; }

.cart-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}
.item-info { flex: 1; min-width: 0; }
.item-title { font-size: 13.5px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; flex-wrap: wrap; gap: 2px; line-height: 1.35; }
.item-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.item-sub b { color: var(--text-main); }

.qty-control { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.qty-btn {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-main);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; line-height: 1;
  transition: background 0.12s, transform 0.1s;
}
.qty-btn:active { background: var(--primary); color: var(--primary-dark-text); transform: scale(0.92); }
.qty-num { font-size: 14px; font-weight: 800; min-width: 18px; text-align: center; }

.badge-unprinted {
  font-size: 10.5px; font-weight: 800;
  background: rgba(234, 88, 12, 0.18);
  color: #fdba74;
  border: 1px solid rgba(234, 88, 12, 0.45);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.badge-printed { font-size: 10.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }

.cart-summary { padding-top: 12px; border-top: 1px dashed var(--surface-border); }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-muted); gap: 10px; }
.summary-row.total { font-size: 15px; font-weight: 800; color: var(--text-muted); letter-spacing: 0.3px; }
.summary-row.total .price-highlight { color: var(--primary-strong); font-size: 22px; font-weight: 900; white-space: nowrap; }

/* ───────────────────────── Mobile bottom bar ───────────────────────── */
.mobile-bottom-bar {
  display: flex; flex-direction: column; gap: 9px;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(19, 16, 12, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--surface-border);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.55);
}
@media (min-width: 900px) { .mobile-bottom-bar { display: none; } }

.mob-cart-trigger { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 2px 0; min-height: 36px; }
.mob-cart-left { display: flex; align-items: center; gap: 9px; }
.mob-table-pill {
  background: var(--primary-light);
  color: var(--primary-strong);
  border: 1px solid var(--primary);
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 12.5px; font-weight: 800;
}
.mob-item-qty { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.mob-cart-right { display: flex; align-items: center; gap: 10px; }
.mob-total-price { font-size: 19px; font-weight: 900; color: #fff; }
.mob-expand-hint { font-size: 11.5px; color: var(--primary-strong); font-weight: 700; }

.mob-action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mob-btn-kitchen, .mob-btn-receipt {
  min-height: 48px;
  padding: 11px;
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14.5px; font-weight: 900;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform 0.1s;
}
.mob-btn-kitchen { background: var(--gradient-kitchen); box-shadow: 0 4px 14px rgba(234, 88, 12, 0.4); }
.mob-btn-receipt { background: var(--gradient-primary); color: var(--primary-dark-text); box-shadow: var(--shadow-glow); }
.mob-btn-kitchen:active, .mob-btn-receipt:active { transform: scale(0.97); }
.mob-flame-badge { font-size: 12px; font-weight: 800; background: rgba(0,0,0,0.25); padding: 2px 7px; border-radius: var(--radius-full); }

/* ───────────────────────── Mobile drawer ───────────────────────── */
.mobile-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
}
.mobile-drawer {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-height: 86vh;
  z-index: 2001;
  background: var(--surface);
  border-top: 1px solid var(--surface-border);
  border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 12px;
  animation: slideDrawer 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 700px) { .mobile-drawer { left: 50%; right: auto; transform: translateX(-50%); width: 560px; animation: slideDrawerC 0.28s cubic-bezier(0.16, 1, 0.3, 1); } }
@keyframes slideDrawer { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideDrawerC { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }

.drawer-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--surface-border); margin: 2px auto 0; }
.mobile-drawer-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 11px; border-bottom: 1px solid var(--surface-border); }
.drawer-title { font-size: 16px; color: #fff; display: flex; align-items: center; gap: 8px; }
.drawer-close-btn {
  min-height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  color: var(--text-main);
  font-size: 12.5px; font-weight: 700;
  cursor: pointer;
}
.drawer-items-list { max-height: 42vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.drawer-footer { padding-top: 12px; border-top: 1px solid var(--surface-border); display: flex; flex-direction: column; gap: 9px; }
.drawer-total { margin-bottom: 2px; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.drawer-actions .btn-kitchen-print, .drawer-actions .btn-primary-print { min-height: 48px; font-size: 14px; }

/* ───────────────────────── Receipt K80 ───────────────────────── */
.receipt-wrapper {
  max-width: 370px; width: 100%;
  margin: 0 auto;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.55));
}
.receipt-paper {
  background: #fff;
  color: #1c1917;
  padding: 22px 18px 26px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  border-radius: 6px 6px 0 0;
  position: relative;
}
/* Răng cưa mép dưới giấy nhiệt */
.receipt-paper::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -9px;
  height: 10px;
  background: linear-gradient(-45deg, transparent 8px, #fff 0) 0 0 / 16px 16px repeat-x,
              linear-gradient(45deg, transparent 8px, #fff 0) 8px 0 / 16px 16px repeat-x;
}
.receipt-center { text-align: center; }
.receipt-right { text-align: right; }
.receipt-bold { font-weight: 700; }
.receipt-title { font-size: 17px; font-weight: 900; margin-bottom: 2px; letter-spacing: 0.3px; }
.receipt-dash { border-bottom: 1px dashed #a8a29e; margin: 7px 0; }
.receipt-double { border-bottom: 2.5px solid #1c1917; margin: 7px 0; }
.receipt-row { display: flex; justify-content: space-between; gap: 10px; margin: 3px 0; }
.receipt-qr-wrap { text-align: center; margin: 10px 0 4px; }
.receipt-qr-wrap img { width: 132px; height: 132px; border: 1px solid #e7e5e4; padding: 4px; border-radius: 6px; }
.receipt-actions { max-width: 370px; margin: 26px auto 0; }

/* ───────────────────────── Mode selector (settings) ───────────────────────── */
.mode-card-selector {
  border: 2px solid var(--surface-border);
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  cursor: pointer;
  display: flex; gap: 12px; align-items: flex-start;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.mode-card-selector:hover { border-color: var(--text-dim); }
.mode-card-selector.selected { border-color: var(--primary); background: var(--primary-light); }
.mode-card-selector.selected::after {
  content: '✓';
  position: absolute; top: 10px; right: 12px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--primary-dark-text);
  font-size: 12px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.mode-icon { font-size: 25px; line-height: 1.2; }
.mode-text { flex: 1; min-width: 0; padding-right: 22px; }
.mode-name { font-weight: 800; font-size: 14px; color: #fff; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mode-tag { font-size: 10.5px; font-weight: 800; background: var(--gradient-primary); color: var(--primary-dark-text); padding: 2px 8px; border-radius: var(--radius-full); }
.mode-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* ───────────────────────── Menu manage ───────────────────────── */
.menu-manage-list { display: flex; flex-direction: column; gap: 8px; }
.menu-manage-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

/* ───────────────────────── Lock screen ───────────────────────── */
.lock-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(9, 7, 5, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.lock-card {
  max-width: 390px; width: 100%;
  background: var(--surface);
  border: 1px solid rgba(245, 166, 35, 0.4);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.lock-icon {
  width: 72px; height: 72px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light);
  border: 1px solid rgba(245, 166, 35, 0.4);
  border-radius: 20px;
  font-size: 34px;
}
.lock-title { font-size: 19px; font-weight: 900; color: #fff; margin-bottom: 4px; }
.lock-sub { font-size: 11.5px; color: var(--primary-strong); font-weight: 800; letter-spacing: 1.2px; margin-bottom: 14px; }
.lock-text { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 20px; }
.lock-text b { color: var(--text-main); }
.lock-form { display: flex; flex-direction: column; gap: 10px; }
.lock-input { text-align: center; font-size: 15px; letter-spacing: 2px; font-weight: 700; min-height: 50px; }
.lock-foot { font-size: 11px; color: var(--text-dim); margin-top: 18px; line-height: 1.5; }

/* ───────────────────────── Toast ───────────────────────── */
.toast-container {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex; flex-direction: column; gap: 7px;
  width: calc(100% - 28px);
  max-width: 380px;
  pointer-events: none;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  color: var(--text-main);
  padding: 12px 15px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 9px;
  pointer-events: auto;
  animation: slideDown 0.25s ease;
  line-height: 1.4;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }
@keyframes slideDown { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ───────────────────────── Misc ───────────────────────── */
#history-list .cart-item { margin-bottom: 0; }
#history-list { display: flex; flex-direction: column; gap: 9px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

@media print {
  body * { visibility: hidden; }
  .receipt-wrapper, .receipt-wrapper * { visibility: visible; }
  .receipt-wrapper { position: fixed; inset: 0 auto auto 0; filter: none; }
}

/* ───────────────────────── Search món ───────────────────────── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin: 8px 0 4px;
}
.search-icon {
  position: absolute;
  left: 13px;
  font-size: 15px;
  pointer-events: none;
  opacity: 0.85;
}
.search-input {
  width: 100%;
  min-height: 48px;
  background: var(--surface);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 11px 44px 11px 40px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.search-input::placeholder { color: var(--text-dim); font-size: 13.5px; }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute;
  right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.search-clear:active { background: var(--danger-light); color: var(--danger); }
.settings-card .search-box { margin: 0; }

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--surface);
  border: 1.5px dashed var(--surface-border);
  border-radius: var(--radius-md);
}
.no-results b { color: var(--primary-strong); }

/* Thẻ món đã gọi: viền amber + cụm − / số lượng (thay nút + cũ) */
.product-card.in-cart {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--primary-light), var(--surface) 72%);
}
.product-card-bottom { min-height: 36px; }
.card-stepper {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--primary);
  border-radius: var(--radius-full);
  padding: 3px 11px 3px 3px;
  flex-shrink: 0;
}
.card-minus {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #dc2626;
  border: none;
  color: #fff;
  font-size: 19px; font-weight: 900; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.4);
}
.card-minus:active { transform: scale(0.9); }
.card-qty { font-size: 14.5px; font-weight: 900; color: var(--primary-strong); min-width: 14px; text-align: center; }
