/* ============================================================================
   POS NHÀ LÀM ORDER — STANDALONE OFFLINE WAITER WEBAPP
   Modern Professional Minimalism · Touch-First Ergonomics (>= 48px targets)
   ============================================================================ */
:root {
  --brand: #0f4c81;
  --brand-dark: #0b2545;
  --brand-soft: #eff6ff;
  --kitchen: #ea580c;
  --kitchen-dark: #c2410c;
  --kitchen-soft: #fff7ed;
  --success: #15803d;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --purple: #6d28d9;
  --purple-soft: #f5f3ff;
  --bg-app: #f3f5f8;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.16);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans, "Be Vietnam Pro", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 14px;
  line-height: 1.4;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

button, input, select, textarea {
  font: inherit;
  touch-action: manipulation;
}

.hidden {
  display: none !important;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ================= LOGIN SCREEN ================= */
.login-view {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  background: linear-gradient(160deg, #0b2545 0%, #0f4c81 100%);
}

.login-card {
  width: 100%;
  max-width: 410px;
  background: var(--bg-card);
  border-radius: 18px;
  padding: 20px 18px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  text-align: center;
  margin-bottom: 12px;
}

.login-logos {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.brand-logo, .brand-emblem {
  border-radius: 12px;
  object-fit: contain;
}

.login-brand h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--brand-dark);
}

.login-brand p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-sub);
}

.server-pill-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  cursor: pointer;
  margin-bottom: 12px;
  text-align: left;
}

.server-url-text {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-edit-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
}

.conn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #94a3b8;
}
.conn-dot.online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.conn-dot.offline { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }

.quick-staff-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.staff-chip {
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 11.8px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
}
.staff-chip.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.field-group {
  margin-bottom: 10px;
}
.field-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.inp {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-main);
  font-size: 15px;
}
.inp:focus {
  outline: 2px solid rgba(15, 76, 129, 0.25);
  border-color: var(--brand);
}

.pin-display {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 6px;
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}

.num-key {
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
}
.num-key:active {
  background: #e2e8f0;
  transform: scale(0.98);
}
.num-key.fn {
  font-size: 14px;
  color: var(--text-sub);
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; font-size: 15px; font-weight: 800; }
.btn-sm { min-height: 34px; padding: 4px 10px; font-size: 12.5px; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-kitchen { background: var(--kitchen); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--border-strong); color: var(--text-main); }
.btn-danger-outline { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }

/* ================= APP SHELL ================= */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 768px;
  margin: 0 auto;
  background: var(--bg-app);
  box-shadow: 0 0 28px rgba(15, 23, 42, 0.08);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  background: var(--brand-dark);
  color: #fff;
  flex-shrink: 0;
}

.hdr-left {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
}
.hdr-logo {
  border-radius: 7px;
  flex-shrink: 0;
}
.hdr-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.hdr-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #cbd5e1;
  white-space: nowrap;
}

.hdr-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hdr-btn {
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.hdr-btn.takeaway-btn {
  background: var(--kitchen);
  border-color: var(--kitchen);
}

.outbox-pill {
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 999px;
  border: none;
  background: #f59e0b;
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

/* ================= ACTIVE TABLE BANNER ================= */
.active-table-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  background: var(--brand-soft);
  border-bottom: 1px solid #bfdbfe;
  flex-shrink: 0;
}

.atb-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
}
.atb-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  flex-shrink: 0;
}
.atb-info strong {
  color: var(--brand-dark);
  font-size: 13.5px;
  white-space: nowrap;
}
.atb-meta {
  font-size: 12px;
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atb-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.atb-chip-btn {
  min-height: 30px;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 11.8px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}
.atb-chip-btn.cash {
  background: var(--success-soft);
  border-color: #86efac;
  color: var(--success);
}

/* ================= CONTENT & FILTERS ================= */
.app-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 92px;
}

.sticky-filter-stack {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--bg-app);
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border);
}

.search-row {
  display: flex;
  gap: 6px;
  margin-bottom: 7px;
}
.inp-search {
  min-height: 40px;
  font-size: 14px;
  padding: 6px 12px;
}
.icon-btn {
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.h-scroll-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.h-scroll-chips::-webkit-scrollbar { display: none; }

.chip-pill {
  flex-shrink: 0;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.chip-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.status-seg-row, .station-seg-row {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.status-seg-row::-webkit-scrollbar, .station-seg-row::-webkit-scrollbar { display: none; }

.st-seg {
  flex-shrink: 0;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.st-seg.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

/* ================= FLOOR TABLES GRID ================= */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 9px;
  padding: 10px;
}

.tbl-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-left: 5px solid #94a3b8;
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 102px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
}
.tbl-card:active {
  transform: scale(0.98);
}
.tbl-card.occupied {
  border-left-color: var(--brand);
  background: #f8fbff;
}
.tbl-card.reserved {
  border-left-color: var(--purple);
  background: var(--purple-soft);
}
.tbl-card.cleaning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}
.tbl-card.selected-now {
  box-shadow: 0 0 0 2px var(--brand);
}

.tbl-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
}
.tbl-name {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
}
.tbl-area {
  font-size: 11px;
  color: var(--text-muted);
}
.tbl-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: #f1f5f9;
  color: var(--text-sub);
  white-space: nowrap;
}
.tbl-card.occupied .tbl-badge { background: #dbeafe; color: var(--brand); }
.tbl-card.reserved .tbl-badge { background: #ede9fe; color: var(--purple); }
.tbl-card.cleaning .tbl-badge { background: #fef3c7; color: #b45309; }

.tbl-ready-alert {
  margin-top: 5px;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
  display: inline-block;
}

.tbl-bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 8px;
  font-size: 12px;
}
.tbl-total {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--brand-dark);
}

/* ================= MENU LIST ================= */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.dish-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.dish-card.in-draft {
  border-color: var(--kitchen);
  background: #fffcf9;
}
.dish-card.sold-out {
  opacity: 0.62;
  background: #f8fafc;
}

.dish-info {
  flex: 1;
  min-width: 0;
}
.dish-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}
.dish-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.dish-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand);
}
.dish-unit {
  font-size: 11.5px;
  color: var(--text-muted);
}

.st-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.st-tag.st-grill { background: #fff7ed; color: #c2410c; }
.st-tag.st-kitchen { background: #eff6ff; color: #0f4c81; }
.st-tag.st-bar { background: #f0fdfa; color: #0f766e; }

.soldout-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--danger-soft);
  color: var(--danger);
}

.dish-note-preview {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--kitchen-dark);
}

.dish-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-add-one {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}
.btn-add-one:active {
  background: var(--brand);
  color: #fff;
}

.inline-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--kitchen);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.step-btn {
  width: 38px;
  height: 40px;
  border: none;
  background: var(--kitchen-soft);
  color: var(--kitchen-dark);
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
}
.step-qty {
  min-width: 32px;
  text-align: center;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
}

.btn-dish-note {
  width: 38px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 15px;
  cursor: pointer;
}

/* ================= FLOATING SEND DOCK ================= */
.floating-send-dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(64px + var(--safe-bottom));
  width: calc(100% - 20px);
  max-width: 740px;
  background: var(--brand-dark);
  color: #fff;
  border-radius: 14px;
  padding: 8px 10px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 25;
}
.fsd-summary {
  flex: 1;
  cursor: pointer;
}
.fsd-count {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
}
.fsd-Sub {
  font-size: 11.5px;
  color: #cbd5e1;
}
.fsd-send-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
}

/* ================= CART & STATION ROUTING VIEW ================= */
.cart-container {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.section-hdr h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
}

.station-group-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
  background: var(--bg-subtle);
}
.station-group-title {
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px dashed var(--border);
}
.cart-line:first-of-type {
  border-top: none;
}

.ops-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.op-tile-btn {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 12.8px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.op-tile-btn.urge { background: var(--kitchen-soft); border-color: #fdba74; color: var(--kitchen-dark); }
.op-tile-btn.cash { background: var(--success-soft); border-color: #86efac; color: var(--success); }
.op-tile-btn.danger { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }

/* ================= KDS PICKUP VIEW ================= */
.kds-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kds-ticket-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.kds-ticket-card.ready {
  border-color: #86efac;
  border-left-color: var(--success);
  background: #f0fdf4;
}
.kds-ticket-card.urged {
  border-left-color: var(--danger);
}

/* ================= BOTTOM NAVIGATION ================= */
.bottom-tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 768px;
  height: calc(58px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid var(--border-strong);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 30;
}

.tab-btn {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 2px;
}
.tab-btn.active {
  color: var(--brand);
  font-weight: 800;
}
.tab-ico-wrap {
  position: relative;
  display: inline-flex;
}
.tab-ico {
  font-size: 19px;
  line-height: 1;
}
.tab-lbl {
  font-size: 11px;
  font-weight: 700;
}
.nav-badge {
  position: absolute;
  top: -5px;
  right: -11px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--kitchen);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-badge.green {
  background: var(--success);
}

/* ================= BOTTOM SHEET MODAL ================= */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-box {
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(18px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
}

.pref-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}
.pref-chip {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.pref-chip.active {
  background: var(--kitchen-soft);
  border-color: var(--kitchen);
  color: var(--kitchen-dark);
}

/* ================= TOAST ================= */
.toast-stack {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 440px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.toast-msg {
  padding: 10px 14px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
}
.toast-msg.success { background: #15803d; }
.toast-msg.error { background: #dc2626; }

/* ================= SMART SUGGESTIONS & ACRONYM ORDERING ================= */
.mob-smart-hints {
  padding: 8px 10px 2px;
}

.mob-smart-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 6px;
}

.mob-smart-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.mob-smart-scroll::-webkit-scrollbar {
  display: none;
}

.mob-hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #f0f7ff;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.mob-hint-chip:active {
  background: #dbeafe;
}

.mhc-plus {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.mhc-price {
  color: var(--brand);
  font-size: 12px;
}

.quick-code-badge {
  display: inline-block;
  padding: 1px 5px;
  margin-left: 4px;
  border-radius: 4px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 10.5px;
  font-weight: 800;
  vertical-align: middle;
}

.mob-reason-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 10.5px;
  font-weight: 800;
}

mark.acr-hl {
  background: #fef08a;
  color: #713f12;
  padding: 0 1.5px;
  border-radius: 3px;
  font-weight: 800;
}

/* ================= SMART SERVER GATEWAY & PWA ERGONOMICS ================= */
.gateway-card {
  max-width: 460px;
}

.gw-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-dark);
  margin: 10px 0 8px;
}

.gw-link-btn {
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.gw-link-btn:active {
  background: var(--brand-soft);
}

.gw-autolaunch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  border: 1.5px solid #93c5fd;
  margin-bottom: 12px;
}
.gw-autolaunch-text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--brand-dark);
}

.gw-server-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.gw-server-card {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gw-server-card.pinned {
  border-color: var(--brand);
  background: #f8fbff;
}

.gw-srv-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.gw-srv-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-dark);
}
.gw-srv-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  margin-top: 2px;
  word-break: break-all;
}
.gw-srv-meta {
  font-size: 11.5px;
  color: var(--text-sub);
  margin-top: 2px;
}

.gw-srv-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.gw-srv-actions .btn-connect-srv {
  flex: 1;
  min-height: 44px;
}

.gw-pin-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
}
.gw-pin-btn.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.gw-add-box {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  margin-bottom: 12px;
}
.gw-add-box summary {
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--brand);
  cursor: pointer;
  list-style: none;
}
.gw-add-box summary::-webkit-details-marker {
  display: none;
}
.gw-add-body {
  padding: 0 12px 12px;
}

.gw-pin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  margin: 4px 0 10px;
  cursor: pointer;
}
.gw-pin-check input {
  width: 18px;
  height: 18px;
}

.gw-tip-box {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.45;
}

.pwa-install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  margin-bottom: 10px;
}
.pwa-install-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1.35;
}
.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.pwa-close-btn {
  min-width: 32px;
  min-height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.staff-picker-wrap {
  margin-bottom: 10px;
}
.staff-picker-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.staff-picker-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}
.quick-staff-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 0;
  scrollbar-width: none;
}
.quick-staff-row::-webkit-scrollbar {
  display: none;
}
.quick-staff-row .staff-chip {
  flex-shrink: 0;
  min-height: 38px;
  padding: 6px 11px;
  white-space: nowrap;
}

.staff-sheet-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 52dvh;
  overflow-y: auto;
  padding: 2px 0;
}
.staff-sheet-item {
  min-height: 48px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.staff-sheet-item.active {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.staff-sheet-item strong {
  font-size: 13px;
  color: var(--text-main);
}
.staff-sheet-item span {
  font-size: 11px;
  color: var(--text-muted);
}

.st-tag.st-custom {
  background: #f5f3ff;
  color: #5b21b6;
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* ================= VISUAL DISH THUMBNAILS, HOLD-TO-ZOOM SHOWCASE & MENU ACADEMY ================= */
.mob-academy-btn {
  min-height: 40px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #93c5fd;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.mob-academy-btn:active {
  background: #dbeafe;
}

.dish-card {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.dish-card.is-holding-zoom,
.mob-hint-chip.is-holding-zoom {
  transform: scale(0.985);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.22);
}

.dish-thumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #f8fafc;
  cursor: zoom-in;
}
.dish-thumb.tone-grill { background: #fff7ed; border-color: #fed7aa; }
.dish-thumb.tone-hotpot { background: #fef2f2; border-color: #fecaca; }
.dish-thumb.tone-seafood { background: #ecfeff; border-color: #a5f3fc; }
.dish-thumb.tone-drink { background: #f0fdfa; border-color: #99f6e4; }
.dish-thumb.tone-fresh { background: #f0fdf4; border-color: #bbf7d0; }
.dish-thumb.tone-grain { background: #fefce8; border-color: #fde047; }

.dish-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dish-thumb-icon {
  font-size: 24px;
  line-height: 1;
}
.mob-zoom-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.68);
  color: #fff;
  font-size: 10.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.mhc-thumb {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #bfdbfe;
  background: #fff;
}

/* Full-screen Mobile/Tablet Customer Showcase & Staff Learning Lightbox */
.mob-showcase-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(11, 20, 38, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(8px + var(--safe-top)) 8px calc(8px + var(--safe-bottom));
}

.mob-showcase-card {
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 16px - var(--safe-top) - var(--safe-bottom));
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.mob-sc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  background: var(--brand-dark);
  color: #fff;
  flex-shrink: 0;
}

.mob-sc-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.12);
  padding: 3px;
  border-radius: 9px;
}
.mob-sc-tab {
  min-height: 34px;
  padding: 4px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.mob-sc-tab.active {
  background: #fff;
  color: var(--brand-dark);
}

.mob-sc-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mob-sc-counter {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
}
.mob-sc-cam-btn {
  min-height: 34px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 11.8px;
  font-weight: 700;
  cursor: pointer;
}
.mob-sc-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.mob-sc-stage {
  position: relative;
  width: 100%;
  height: min(44dvh, 340px);
  min-height: 220px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  touch-action: none;
}

.mob-sc-img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.12s ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

.mob-sc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
  color: #e2e8f0;
}
.mob-sc-empty-ico {
  font-size: 54px;
  line-height: 1;
}

.mob-sc-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
}
.mob-sc-nav.prev { left: 8px; }
.mob-sc-nav.next { right: 8px; }

.mob-sc-zoom-pill {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  z-index: 4;
}

.mob-sc-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  z-index: 4;
}
.mob-sc-badge.pop { background: #fef08a; color: #713f12; }
.mob-sc-badge.out { background: #dc2626; color: #fff; }

.mob-sc-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mob-sc-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.28;
}
.mob-sc-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.mob-sc-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand);
}
.mob-sc-desc {
  margin: 0;
  font-size: 13.2px;
  color: var(--text-sub);
  line-height: 1.5;
  background: var(--bg-subtle);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.mob-learn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mob-learn-box {
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mob-learn-box .lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.mob-learn-box .val {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand-dark);
}

.mob-quiz-card {
  padding: 14px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1.5px dashed #60a5fa;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mob-sc-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mob-academy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 58dvh;
  overflow-y: auto;
  padding: 2px 0;
}
.mob-academy-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.mob-academy-thumb {
  width: 100%;
  height: 96px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.mob-academy-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mob-academy-info {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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


/* ==========================================================================
   NÂNG CẤP CHUẨN CUKCUK BÁN HÀNG & CÔNG THÁI HỌC 1 TAY (THUMB-ZONE 2026)
   ========================================================================== */

/* 1. Thanh Khóa Đưa Khách Tự Chọn Món (Guest E-Menu Lock) */
.guest-lock-banner {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  color: #fff;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.22);
  z-index: 40;
}
.guest-lock-banner .glb-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.guest-lock-banner .glb-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
}
.guest-lock-banner .glb-info span {
  display: block;
  font-size: 11px;
  opacity: 0.9;
}
.glb-unlock-btn {
  min-height: 36px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.glb-unlock-btn.holding {
  background: #fde68a;
  color: #78350f;
  border-color: #fde68a;
}

.app-shell.guest-locked .app-header,
.app-shell.guest-locked #activeTableBar,
.app-shell.guest-locked .tab-btn[data-tab="tables"],
.app-shell.guest-locked .tab-btn[data-tab="kds"],
.app-shell.guest-locked #btnMobMenuAcademy,
.app-shell.guest-locked #coursePacingBar {
  display: none !important;
}

/* 2. Thanh Ngữ Cảnh Bàn Đang Mở Thế Hệ Mới (2 dòng gọn sắc, thao tác 1 chạm) */
.active-table-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #eff6ff 0%, #e0f2fe 100%);
  border-bottom: 1px solid #bae6fd;
}
.active-table-bar.hidden {
  display: none !important;
}
.atb-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.atb-table-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid #38bdf8;
  background: #fff;
  color: #0c4a6e;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  max-width: 44%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.atb-table-pill .atb-caret {
  font-size: 11px;
  opacity: 0.7;
}
.atb-guest-stepper {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.atb-g-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #f0f9ff;
  color: #0369a1;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.atb-g-btn:active {
  background: #bae6fd;
}
.atb-g-val {
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  padding: 0 5px;
  white-space: nowrap;
}
.atb-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.atb-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}
.atb-chip-btn.qr {
  border-color: #6ee7b7;
  background: #ecfdf5;
  color: #047857;
}
.atb-chip-btn.cash {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}
.atb-chip-btn.ghost-ico {
  padding: 4px 7px;
}
.atb-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.8px;
  color: #0369a1;
  font-weight: 700;
  cursor: pointer;
  padding: 1px 2px;
}
.atb-flags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.atb-flag-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.atb-cart-jump {
  font-weight: 800;
  color: #0284c7;
  white-space: nowrap;
}

/* 3. Tab 1: Dual Floor Mode (Sơ đồ Bàn <-> Đơn đang mở) & Cờ Bàn */
.floor-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.floor-mode-seg {
  display: inline-flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 11px;
  gap: 2px;
}
.fm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font-size: 12.2px;
  font-weight: 800;
  cursor: pointer;
}
.fm-btn.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.fm-count {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  background: #10b981;
  color: #fff;
}
.floor-quick-tools {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.fq-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 5px 9px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 11.8px;
  font-weight: 800;
  cursor: pointer;
}
.fq-chip.active {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}
.fq-chip.rsv {
  background: #faf5ff;
  border-color: #d8b4fe;
  color: #6b21a8;
}

.tbl-card {
  position: relative;
}
.tbl-more-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.04);
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.tbl-more-btn:active {
  background: rgba(15, 23, 42, 0.12);
}
.tbl-draft-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.8px;
  font-weight: 800;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.open-order-card {
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  cursor: pointer;
}
.open-order-card.takeaway {
  border-left: 4px solid #f59e0b;
}
.open-order-card.dinein {
  border-left: 4px solid #0ea5e9;
}
.open-order-card.selected-now {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22);
}

/* 4. Tab 2: Bố Cục Công Thái Học 1 Tay (Thumb Rail + Lưới ảnh + Danh sách) */
.menu-ergonomics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.menu-layout-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.ergo-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #1e293b;
  font-size: 11.3px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.ergo-pill:active {
  background: #f1f5f9;
}

.voice-btn.listening {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.course-pacing-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.course-pacing-bar::-webkit-scrollbar {
  display: none;
}
.pace-seg-lbl {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
}
.pace-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 11.3px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.pace-chip.active[data-pace="NOW"] {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}
.pace-chip.active[data-pace="STARTER"] {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}
.pace-chip.active[data-pace="HOLD"] {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309;
}

/* Split Workspace cho chế độ 1 Tay (Thumb Rail) */
.menu-split-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 55dvh;
}
.menu-split-wrap.mode-rail.hand-right {
  flex-direction: row-reverse;
}
.menu-split-wrap.mode-rail.hand-left {
  flex-direction: row;
}
.menu-split-wrap.mode-rail .menu-list {
  flex: 1;
  min-width: 0;
}
.menu-thumb-rail {
  width: 80px;
  flex-shrink: 0;
  position: sticky;
  top: 146px;
  max-height: calc(100dvh - 226px);
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 2px 2px 84px;
}
.menu-thumb-rail::-webkit-scrollbar {
  display: none;
}
.v-cat-btn {
  position: relative;
  width: 100%;
  min-height: 50px;
  padding: 7px 5px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.22;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  word-break: break-word;
}
.v-cat-btn.active {
  background: #0f4c81;
  border-color: #0f4c81;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(15, 76, 129, 0.24);
}
.v-cat-badge {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-split-wrap:not(.mode-rail) .menu-thumb-rail {
  display: none !important;
}
.menu-split-wrap:not(.mode-rail) .menu-list {
  width: 100%;
}

/* Chế độ Lưới Ảnh (Grid Showcase cho Tablet / Đưa khách xem) */
.menu-split-wrap.mode-grid .menu-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 10px;
}
.menu-split-wrap.mode-grid .dish-card {
  flex-direction: column;
  align-items: stretch;
  padding: 8px;
  gap: 8px;
}
.menu-split-wrap.mode-grid .dish-thumb {
  width: 100%;
  height: 116px;
  border-radius: 10px;
}
.menu-split-wrap.mode-grid .dish-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.menu-split-wrap.mode-grid .dish-controls {
  justify-content: space-between;
  width: 100%;
}

/* Full-Row Tap Feedback & Quick Multipliers (= N khách, +2, +4) */
.dish-card {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 130ms ease, border-color 150ms ease, background-color 150ms ease;
}
.dish-card.tap-pulse {
  transform: scale(0.985);
  border-color: #10b981 !important;
  background-color: #ecfdf5 !important;
}
.dish-quick-multi-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.qty-quick-chip {
  min-height: 26px;
  padding: 2px 8px;
  border-radius: 7px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.qty-quick-chip.guest-match {
  border-color: #6ee7b7;
  background: #ecfdf5;
  color: #047857;
}
.pace-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.8px;
  font-weight: 800;
}
.pace-mini-badge.starter {
  background: #dbeafe;
  color: #1e40af;
}
.pace-mini-badge.hold {
  background: #fef3c7;
  color: #b45309;
}

/* Nút tìm kiếm nổi tầm ngón cái */
.thumb-search-fab {
  position: fixed;
  left: 12px;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1.5px solid #bae6fd;
  background: rgba(255, 255, 255, 0.96);
  color: #0f4c81;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  cursor: pointer;
}
.menu-split-wrap.mode-rail.hand-left ~ .thumb-search-fab {
  left: auto;
  right: 12px;
}

/* 5. Tab 3: Kiểm đồ tại bàn, Nhịp ra món trên dòng giỏ, VietQR Tạm tính & CUKCUK Actions */
.cart-line-pacing {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.clp-btn {
  min-height: 25px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 10.8px;
  font-weight: 700;
  cursor: pointer;
}
.clp-btn.active {
  background: #0f4c81;
  border-color: #0f4c81;
  color: #fff;
}
.clp-btn.active[data-pace="HOLD"] {
  background: #d97706;
  border-color: #d97706;
}
.clp-btn.active[data-pace="STARTER"] {
  background: #2563eb;
  border-color: #2563eb;
}

.fire-hold-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #f59e0b;
}

.check-audit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 8px;
  border-radius: 11px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  font-size: 12.5px;
  font-weight: 800;
}

.audit-chk-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 2px solid #94a3b8;
  background: #fff;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.audit-chk-btn.checked {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}

.sent-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.btn-repeat-dish {
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #6ee7b7;
  background: #ecfdf5;
  color: #047857;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.btn-sent-more {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Pre-Bill & VietQR Card trên Điện thoại Phục vụ */
.waiter-prebill-card {
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  margin-bottom: 10px;
}
.waiter-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
  border: 1.5px solid #93c5fd;
  margin-bottom: 10px;
}
.waiter-qr-box img {
  width: 210px;
  height: 210px;
  object-fit: contain;
  background: #fff;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

/* 6. Tab 4: Bộ lọc Bàn của tôi & Cảnh báo Tiếp thực */
.kds-top-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kds-owner-seg {
  display: inline-flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
  flex: 1;
}
.ko-btn {
  flex: 1;
  min-height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-size: 12.2px;
  font-weight: 800;
  cursor: pointer;
}
.ko-btn.active {
  background: #fff;
  color: #047857;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.kds-ticket-card.mine-highlight {
  border-left: 4px solid #10b981;
}
.toast-msg.runner-alert {
  background: #065f46 !important;
  color: #fff !important;
  border: 1.5px solid #34d399 !important;
  font-weight: 800;
}
