:root {
  --primary: #E5422B;
  --primary-dark: #BE2E20;
  --primary-light: #F2765D;
  --accent: #3B8ED0;
  --accent-dark: #246FA8;
  --bg-warm: #F7FBFF;
  --bg-dark: #111111;
  --bg-card-dark: #1D1D1F;
  --surface-dark: #2A2A2D;
  --text-dark: #1F2933;
  --text-secondary: #526070;
  --text-light: #FFFFFF;
  --text-muted: #A0AEC0;
  --success: #48BB78;
  --danger: #FC8181;
  --warning: #F6E05E;
  --border: #E2E8F0;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg-warm);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============ UTILITIES ============ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-center { text-align: center; }
.w-full { width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 14px; border: none; cursor: pointer; transition: var(--transition);
  font-family: inherit; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(228,61,37,0.32); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #38A169; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #E53E3E; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text-dark); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled:hover { border-color: var(--border); color: inherit; transform: none; box-shadow: none; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  font-size: 12px; font-weight: 700; background: var(--primary); color: #fff;
}

/* ============ CUSTOMER PAGE ============ */
.customer-page { background: var(--bg-warm); min-height: 100vh; padding-bottom: 100px; }

.customer-header {
  background: #fff;
  color: var(--text-dark); padding: 14px 16px 16px; text-align: center;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 24px rgba(36,111,168,0.14);
  border-top: 6px solid transparent;
  border-image: linear-gradient(90deg, var(--accent) 0 50%, var(--primary) 50% 100%) 1;
}
.customer-header h1,
.kitchen-header h1,
.admin-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0;
}
.customer-header h1 { justify-content: center; font-size: 22px; font-weight: 800; }
.customer-header h1 span { color: var(--accent-dark); }
.header-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  flex: 0 0 auto;
}
.customer-header .table-badge {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 4px 16px; border-radius: 20px; font-size: 13px; margin-top: 5px; font-weight: 700;
}
.customer-header .table-badge small { display: block; font-size: 9px; font-weight: 600; opacity: .88; }
.branch-kicker { color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

/* Tabs */
.menu-tabs {
  display: flex; gap: 8px; padding: 16px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.menu-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0; padding: 10px 20px; border-radius: 25px;
  border: 2px solid var(--border); background: #fff; color: var(--text-secondary);
  font-weight: 600; font-size: 14px; cursor: pointer; transition: var(--transition);
  font-family: inherit; white-space: nowrap;
}
.tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Menu Grid */
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px; }
@media (min-width: 768px) { .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.menu-item {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: var(--transition); position: relative;
}
.menu-item:active { transform: scale(0.97); }
.menu-item-img {
  width: 100%; height: 120px; object-fit: cover; background: #edf4fb;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--primary-light);
}
.menu-item-img img { width: 100%; height: 100%; object-fit: cover; }
.menu-item-info { padding: 12px; }
.menu-item-name { font-weight: 600; font-size: 14px; line-height: 1.3; margin-bottom: 4px; }
.menu-item-description { color: var(--text-secondary); font-size: 11px; line-height: 1.45; margin-bottom: 6px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.menu-item-price { color: var(--primary); font-weight: 700; font-size: 15px; }
.menu-item-price:empty::after { content: '\00a0'; }
.btn:disabled { cursor: not-allowed; opacity: .58; }
.menu-item-popular {
  position: absolute; top: 8px; left: 8px; background: var(--danger);
  color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 10px; text-transform: uppercase;
}
.menu-item-controls {
  display: flex; align-items: center; justify-content: space-between; padding: 0 12px 12px;
}
.qty-control { display: flex; align-items: center; gap: 12px; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--primary);
  background: transparent; color: var(--primary); font-size: 18px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); font-family: inherit;
}
.qty-btn:hover { background: var(--primary); color: #fff; }
.qty-btn.minus { border-color: var(--danger); color: var(--danger); }
.qty-btn.minus:hover { background: var(--danger); color: #fff; }
.qty-value { font-weight: 700; font-size: 16px; min-width: 20px; text-align: center; }

/* Floating Cart */
.floating-cart {
  position: fixed; bottom: 20px; left: 16px; right: 16px; z-index: 200;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-radius: var(--radius); padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 8px 30px rgba(228,61,37,0.32); cursor: pointer;
  transition: var(--transition); max-width: 500px; margin: 0 auto;
}
.floating-cart:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(228,61,37,0.4); }
.cart-info { display: flex; align-items: center; gap: 12px; }
.cart-count { background: rgba(255,255,255,0.25); width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.cart-total { font-size: 18px; font-weight: 800; }

/* Cart Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-content {
  background: #fff; border-radius: var(--radius) var(--radius) 0 0; width: 100%;
  max-width: 500px; max-height: 80vh; overflow-y: auto; padding: 24px;
  transform: translateY(100%); transition: var(--transition);
}
.modal-overlay.open .modal-content { transform: translateY(0); }
.modal-overlay.admin-modal { align-items: center; padding: 24px; }
.modal-overlay.admin-modal .modal-content {
  border-radius: var(--radius); transform: translateY(24px) scale(0.98);
}
.modal-overlay.admin-modal.open .modal-content { transform: translateY(0) scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 20px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--text-secondary); }
.cart-item { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item-name { font-weight: 500; }
.cart-item-detail { color: var(--text-secondary); font-size: 13px; }
.cart-item-price { font-weight: 700; color: var(--primary); white-space: nowrap; }
.cart-total-section { padding: 16px 0; border-top: 2px solid var(--text-dark); margin-top: 8px;
  display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; }
.cart-total-section span:last-child { color: var(--primary); }

/* Order History */
.order-history { padding: 16px; margin-top: 8px; }
.order-history h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text-secondary); }
.order-history-item {
  background: #fff; border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-left: 4px solid var(--success);
}
.order-history-item.pending { border-left-color: var(--warning); }
.order-history-item.awaiting_confirmation { border-left-color: #D97706; }
.order-history-item.confirmed { border-left-color: var(--accent); }
.order-history-item.rejected, .order-history-item.cancelled { border-left-color: var(--danger); opacity: .82; }
.order-history-item.preparing { border-left-color: var(--primary); }
.order-time { font-size: 12px; color: var(--text-secondary); }
.order-status-badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.order-status-badge.pending { background: #FEFCBF; color: #975A16; }
.order-status-badge.preparing { background: #FFF5EB; color: var(--primary-dark); }
.order-status-badge.completed { background: #E6FFFA; color: #276749; }

/* ============ KITCHEN PAGE ============ */
.kitchen-page { background: var(--bg-dark); min-height: 100vh; color: var(--text-light); }

.kitchen-header {
  background: var(--bg-card-dark); padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.kitchen-header h1 { font-size: 22px; font-weight: 800; }
.kitchen-header h1 span { color: var(--primary); }
.kitchen-header h1 small, .admin-header h1 small { color: var(--accent); font-size: 12px; font-weight: 700; margin-left: 4px; }
.kitchen-stats { display: flex; gap: 16px; }
.kitchen-stat { text-align: center; }
.kitchen-stat .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.kitchen-stat .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

.kitchen-orders {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px; padding: 20px;
}

.kitchen-order-card {
  background: var(--bg-card-dark); border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08); overflow: hidden;
  animation: slideIn 0.4s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.kitchen-order-header {
  background: var(--surface-dark); padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.kitchen-table-num { font-size: 20px; font-weight: 800; color: var(--accent); }
.kitchen-table-num small { display: block; color: var(--text-muted); font-size: 10px; font-weight: 600; margin-top: 2px; }
.kitchen-order-time { font-size: 12px; color: var(--text-muted); }
.kitchen-order-items { padding: 14px 18px; }
.kitchen-order-item {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.kitchen-order-item:last-child { border: none; }
.kitchen-item-name { font-weight: 500; }
.kitchen-item-qty { color: var(--accent); font-weight: 700; }
.kitchen-order-footer { padding: 14px 18px; }
.kitchen-order-footer { display: flex; gap: 8px; }
.kitchen-order-footer .btn { flex: 1; }
.kitchen-start { color: #fff; border-color: var(--accent); }
.kitchen-note { font-size: 12px; color: #FFB36B; font-style: italic; margin-top: 3px; }
.status-pill { background: var(--primary); color: #fff; padding: 3px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; margin-right: 8px; }
.kitchen-order-card.completed { opacity: .75; border-color: rgba(59,142,208,.4); }
#autoPrintToggle { background: var(--accent); }
#autoPrintToggle.off { background: #667085; }

.kitchen-empty {
  text-align: center; padding: 80px 20px; color: var(--text-muted);
}
.kitchen-empty .icon { font-size: 64px; margin-bottom: 16px; }

/* New order notification pulse */
.kitchen-order-card.new { border: 2px solid var(--primary); }
.kitchen-order-card.new .kitchen-order-header { background: var(--primary); }
.kitchen-order-card.new .kitchen-order-time { color: rgba(255,255,255,0.85); font-weight: 600; }
.kitchen-order-card.new .kitchen-table-num { color: #fff; }

/* ============ ADMIN PAGE ============ */
.admin-page { background: #F5F6FA; min-height: 100vh; }

.admin-header {
  background: #fff; padding: 16px 24px; box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  display: flex; justify-content: space-between; align-items: center;
}
.admin-header h1 { font-size: 22px; font-weight: 800; }
.admin-header h1 span { color: var(--primary); }
.admin-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.admin-overview-back { white-space: nowrap; border-color: #B9D7EB; color: var(--accent-dark); }
.admin-overview-back:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.admin-tabs {
  display: flex; background: #fff; border-bottom: 2px solid var(--border);
  padding: 0 24px; overflow-x: auto;
}
.admin-tab {
  padding: 14px 24px; font-weight: 600; font-size: 14px; color: var(--text-secondary);
  cursor: pointer; border-bottom: 3px solid transparent; transition: var(--transition);
  white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none;
  font-family: inherit;
}
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-tab:hover { color: var(--primary); }

.admin-content { padding: 24px; }
.admin-card { background: #fff; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); margin-bottom: 20px; }
.admin-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* Table Grid */
.table-grid-header { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.table-grid-stat {
  padding: 12px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
}
.table-grid-stat.occupied { background: #FFF5EB; color: var(--primary-dark); }
.table-grid-stat.empty { background: #E6FFFA; color: #276749; }

.table-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.table-layout { display: grid; gap: 18px; }
.table-floor-group { border: 1px solid var(--border); border-radius: var(--radius); background: #F8FBFD; padding: 16px; }
.table-floor-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 13px; }
.table-floor-heading span { color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: .11em; }
.table-floor-heading h3 { margin: 1px 0 0; font-size: 19px; }
.table-floor-heading strong { color: var(--text-secondary); font-size: 12px; }
.table-cell {
  aspect-ratio: 1; border-radius: var(--radius); display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer; transition: var(--transition);
  border: 2px solid var(--border); background: #fff; position: relative; font-family: inherit;
}
.table-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.table-cell.active { background: linear-gradient(135deg, #FFF5EB, #FFEDD5);
  border-color: var(--primary); }
.table-cell .table-num { font-size: 28px; font-weight: 800; color: var(--text-dark); }
.table-cell .table-location { color: var(--text-secondary); font-size: 9px; font-weight: 700; margin-top: 2px; }
.table-cell.active .table-num { color: var(--primary); }
.table-cell .table-total {
  font-size: 12px; font-weight: 600; color: var(--primary); margin-top: 4px;
}
.table-cell .table-label {
  font-size: 10px; color: var(--text-secondary); text-transform: uppercase; font-weight: 600;
}
.table-cell.active .table-label { color: var(--primary-dark); }

/* Admin Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text-secondary); }
.form-control {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; transition: var(--transition); background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(228,61,37,0.15); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23636E72' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* Menu List in Admin */
.menu-list-item {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 8px;
  transition: var(--transition);
}
.menu-list-item:hover { background: #FAFAFA; }
.menu-list-item.draggable { cursor: grab; }
.menu-list-item.dragging { opacity: 0.55; border-color: var(--primary); background: #FFF5EB; }
.menu-drag-handle {
  width: 28px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-weight: 800; flex-shrink: 0;
}
.admin-menu-tabs { padding: 0 0 16px; }
.menu-list-thumb {
  width: 50px; height: 50px; border-radius: 8px; background: #edf4fb;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 22px; overflow: hidden;
}
.menu-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.menu-list-info { flex: 1; }
.menu-list-name { font-weight: 600; font-size: 14px; }
.menu-list-cat { font-size: 12px; color: var(--text-secondary); }
.menu-list-price { font-weight: 700; color: var(--primary); white-space: nowrap; }
.menu-list-actions { display: flex; gap: 6px; }
.category-sort-help { margin-top: 4px; color: var(--text-secondary); font-size: 11px; }
.category-list-item { min-height: 62px; background: #fff; }
.category-list-item .menu-drag-handle { background: #EDF6FC; color: var(--accent-dark); font-size: 18px; cursor: grab; }
.category-list-item:active .menu-drag-handle { cursor: grabbing; }
.category-list-item.drag-over { border-color: var(--accent); background: #EFF8FE; transform: translateY(2px); }
.category-drag-copy { display: block; margin-top: 3px; color: var(--text-secondary); font-size: 10px; }
.category-modal-note { margin: -5px 0 18px; color: var(--text-secondary); font-size: 11px; line-height: 1.5; }

/* Reports */
.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.report-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; padding: 20px; border-radius: var(--radius); text-align: center;
}
.report-card.alt { background: linear-gradient(135deg, var(--success), #38A169); }
.report-card.blue { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }
.report-card .num { font-size: 32px; font-weight: 800; }
.report-card .label { font-size: 13px; opacity: 0.85; margin-top: 4px; }
.top-items-list { list-style: none; }
.top-items-list li { display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--border); }
.top-items-list li:last-child { border: none; }

/* Bill Modal */
.bill-content { font-family: monospace; max-width: 350px; margin: 0 auto; padding: 20px;
  background: #fff; border: 1px dashed #ccc; }
.bill-content h2 { text-align: center; font-family: 'Be Vietnam Pro', sans-serif; }
.bill-line { display: flex; justify-content: space-between; padding: 4px 0; }
.bill-divider { border-top: 1px dashed #ccc; margin: 8px 0; }
.bill-total { font-weight: 700; font-size: 16px; }

/* ============ LOGIN OVERLAY ============ */
.login-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: #fff; border-radius: var(--radius); padding: 32px; width: 90%; max-width: 360px;
  text-align: center; box-shadow: var(--shadow-lg);
}
.login-box h2 { margin-bottom: 8px; font-size: 24px; }
.login-logo { width: 86px; height: 86px; object-fit: cover; border-radius: 20px; margin-bottom: 14px; }
.login-box p { color: var(--text-secondary); margin-bottom: 20px; font-size: 14px; }
.login-box input { margin-bottom: 16px; }
.login-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

/* Toast notification */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 999; pointer-events: none; }
.toast {
  background: var(--success); color: #fff; padding: 14px 20px; border-radius: var(--radius-sm);
  margin-bottom: 8px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn 0.4s ease, toastOut 0.4s ease 2.6s forwards;
}
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text-dark); }
@keyframes toastIn { from { opacity:0; transform:translateX(100px); } }
@keyframes toastOut { to { opacity:0; transform:translateX(100px); } }

/* ============ PRINT STYLES ============ */
@media print {
  body * { visibility: hidden; }
  .bill-print, .bill-print * { visibility: visible; }
  .bill-print { position: absolute; left: 0; top: 0; width: 80mm; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
  .menu-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .menu-item-img { height: 100px; }
}

/* ============ HUYGOCOOK CUSTOMER DETAILS ============ */
.menu-empty { grid-column: 1/-1; min-width: 0; overflow: hidden; text-align: center; background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); padding: 44px 20px; color: var(--text-secondary); }
.menu-empty p { overflow-wrap: anywhere; }
.menu-empty div { font-size: 42px; margin-bottom: 8px; }
.menu-empty strong { display: block; color: var(--text-dark); margin-bottom: 4px; }
.customer-profile-box { background: #F4F9FD; border: 1px solid #CFE5F5; border-radius: 12px; padding: 14px; margin-top: 14px; }
.customer-profile-box > strong { display: block; color: var(--accent-dark); font-size: 13px; margin-bottom: 10px; }
.customer-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.consent-check { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; color: var(--text-secondary); line-height: 1.5; margin-top: 10px; }
.consent-check input { margin-top: 3px; accent-color: var(--accent); }
.customer-cart-item { flex-wrap: wrap; }
.cart-item-main { flex: 1; min-width: 180px; }
.cart-note { margin-top: 7px; padding: 7px 9px; font-size: 12px; border-style: dashed; }
.cart-item-actions { display: flex; align-items: center; gap: 7px; margin-left: 8px; }
.cart-item-actions button { width: 31px; height: 31px; border-radius: 50%; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 17px; }
.cart-item-actions button:nth-of-type(2) { background: var(--accent); color: #fff; border-color: var(--accent); }
.cart-item-actions .remove { background: #FFF0EE; color: var(--primary-dark); }
.cart-line-total { width: 100%; text-align: right; color: var(--primary); font-weight: 800; margin-top: 5px; }
.empty-copy { text-align: center; color: var(--text-secondary); padding: 24px; }
.order-line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13px; }
.order-note { font-size: 11px; color: #B45C00; font-style: italic; }
.order-subtotal { text-align: right; margin-top: 7px; font-weight: 800; color: var(--primary); }
.order-grand-total { text-align: right; padding: 12px 0; font-size: 17px; font-weight: 800; color: var(--accent-dark); }
.order-rejected-reason { margin-top: 7px; padding: 8px; border-radius: 8px; background: #FFF0EE; color: #B42318; font-size: 12px; }

/* ============ STAFF CONFIRMATION ============ */
.staff-body { background: #EEF5FA; min-height: 100vh; }
.staff-page { min-height: 100vh; }
.staff-header { background: #fff; padding: 26px clamp(18px,4vw,48px); border-top: 7px solid transparent; border-image: linear-gradient(90deg,var(--accent) 0 50%,var(--primary) 50%) 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 5px 24px rgba(36,111,168,.1); }
.staff-header .eyebrow { color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .09em; }
.staff-header h1 { font-size: clamp(24px,4vw,38px); line-height: 1.2; margin: 3px 0; }
.staff-header p { color: var(--text-secondary); font-size: 13px; }
.staff-pending-count { min-width: 112px; background: var(--accent); color: #fff; border-radius: 18px; padding: 12px 18px; text-align: center; }
.staff-pending-count strong { display: block; font-size: 30px; line-height: 1; }
.staff-pending-count span { font-size: 11px; text-transform: uppercase; font-weight: 700; }
.staff-orders { padding: 24px; display: grid; grid-template-columns: repeat(auto-fill,minmax(320px,1fr)); gap: 18px; }
.staff-order-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid #D9E8F3; }
.staff-order-top { display: flex; justify-content: space-between; padding: 17px 18px; background: #F4F9FD; border-bottom: 1px solid #D9E8F3; }
.staff-order-top span { color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.staff-order-top h2 { font-size: 25px; }
.staff-order-top .order-table-location { display: block; color: var(--text-secondary); font-size: 10px; font-weight: 600; margin-top: 2px; }
.staff-order-top time { color: var(--text-secondary); font-size: 12px; }
.staff-order-items { padding: 12px 18px; }
.staff-order-items > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.staff-order-items small { display: block; color: #B45C00; font-style: italic; margin: 2px 0 0 25px; }
.staff-order-total { display: flex; justify-content: space-between; padding: 12px 18px; color: var(--accent-dark); }
.staff-order-actions { display: grid; grid-template-columns: .7fr 1.3fr; gap: 8px; padding: 0 18px 18px; }
.staff-empty { text-align: center; padding: 90px 20px; color: var(--text-secondary); }
.staff-empty div { width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: #DDF4E8; color: #23875B; font-size: 34px; }

/* ============ ADMIN CRM & MEDIA ============ */
.item-image-preview { margin-top: 9px; min-height: 110px; border: 1px dashed var(--border); border-radius: 12px; background: #F8FAFC; display: grid; place-items: center; overflow: hidden; color: var(--text-secondary); font-size: 12px; }
.item-image-preview img { width: 100%; max-height: 220px; object-fit: cover; }
.image-error { color: #B42318; }
.customer-row { display: grid; grid-template-columns: 44px minmax(150px,1fr) 100px 140px auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.customer-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #DCEFFC; color: var(--accent-dark); font-weight: 900; }
.customer-main { display: flex; flex-direction: column; }
.customer-main span, .customer-metric span { color: var(--text-secondary); font-size: 11px; }
.customer-metric { display: flex; flex-direction: column; }
.consent-pill { padding: 4px 9px; border-radius: 99px; background: #F2F4F7; color: #667085; font-size: 10px; font-weight: 800; white-space: nowrap; }
.consent-pill.yes { background: #DDF4E8; color: #23875B; }
.customer-consent-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }

/* ============ SYSTEM ADMIN OVERVIEW ============ */
.overview-body { min-height: 100vh; background: #F2F7FB; }
.overview-page { min-height: 100vh; }
.overview-header { min-height: 82px; padding: 16px clamp(20px,4vw,54px); background: #fff; border-top: 6px solid transparent; border-image: linear-gradient(90deg,var(--accent) 0 50%,var(--primary) 50%) 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 5px 25px rgba(36,111,168,.09); }
.overview-brand { display: flex; align-items: center; gap: 12px; }
.overview-brand .header-logo { width: 46px; height: 46px; }
.overview-brand span { color: var(--primary); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.overview-brand h1 { font-size: clamp(20px,3vw,29px); line-height: 1.15; }
.overview-updated { display: flex; align-items: center; gap: 13px; color: var(--text-secondary); font-size: 12px; }
.overview-content { max-width: 1380px; margin: 0 auto; padding: 30px clamp(18px,4vw,50px) 60px; }
.overview-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 24px; }
.overview-eyebrow, .overview-section-heading span, .overview-customers > div > span { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.overview-intro h2, .overview-section-heading h2, .overview-customers h2 { margin: 5px 0; font-size: clamp(25px,4vw,37px); }
.overview-intro p, .overview-section-heading p, .overview-customers p { color: var(--text-secondary); font-size: 13px; }
.overview-periods { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.overview-summary { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 13px; }
.overview-stat { min-height: 138px; padding: 20px; border-radius: 18px; background: #fff; border: 1px solid #DCE7EF; box-shadow: 0 10px 28px rgba(36,111,168,.06); display: flex; flex-direction: column; }
.overview-stat > span { color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.overview-stat strong { color: var(--accent-dark); font-size: clamp(25px,3vw,34px); line-height: 1.1; margin: 13px 0 7px; }
.overview-stat strong em { color: var(--text-secondary); font-size: 15px; font-style: normal; }
.overview-stat small { color: var(--text-secondary); font-size: 10px; margin-top: auto; }
.overview-stat.revenue { background: linear-gradient(145deg,var(--accent),var(--accent-dark)); border-color: transparent; }
.overview-stat.revenue > span, .overview-stat.revenue strong, .overview-stat.revenue small { color: #fff; }
.overview-stat.pending strong { color: var(--primary); }
.overview-stat.kitchen strong { color: #B45C00; }
.overview-stat.customer strong { color: #23875B; }
.overview-alerts { margin: 14px 0 30px; }
.overview-alert { padding: 13px 17px; border-radius: 12px; background: #FFF3E8; border: 1px solid #FFD3A8; color: #9A4B00; font-size: 12px; }
.overview-alert.calm { background: #EAF8F1; border-color: #BDE8D1; color: #237653; }
.overview-section-heading { margin: 36px 0 15px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.overview-section-heading h2 { font-size: 25px; }
.overview-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.overview-branch-card { background: #fff; border: 1px solid #DCE7EF; border-radius: 21px; padding: 23px; box-shadow: 0 12px 35px rgba(36,111,168,.07); border-top: 5px solid var(--accent); }
.overview-branch-card.tdn { border-top-color: var(--primary); }
.overview-branch-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.overview-branch-top span { color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.overview-branch-card.tdn .overview-branch-top span { color: var(--primary); }
.overview-branch-top h3 { font-size: 25px; margin: 4px 0; }
.overview-branch-top p { color: var(--text-secondary); font-size: 11px; }
.branch-live { flex-shrink: 0; padding: 5px 10px; border-radius: 99px; background: #EAF8F1; color: #237653; font-size: 9px; font-weight: 800; }
.branch-live.attention { background: #FFF0EE; color: #B42318; }
.overview-branch-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 20px 0; }
.overview-branch-metrics > div { padding: 12px 9px; border-radius: 11px; background: #F4F8FB; }
.overview-branch-metrics span { display: block; color: var(--text-secondary); font-size: 9px; margin-bottom: 5px; }
.overview-branch-metrics strong { font-size: 16px; color: var(--text-dark); }
.overview-branch-actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.overview-branch-actions .btn { padding-inline: 10px; font-size: 11px; }
.overview-customers { margin-top: 22px; padding: 24px; border-radius: 19px; background: linear-gradient(120deg,#fff,#EDF7FD); border: 1px solid #CCE3F2; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.overview-customers h2 { font-size: 22px; }
.overview-body .toast-container { top: auto; bottom: 20px; }
.modal-open { overflow: hidden; }
.system-accounts-dialog { width: min(1120px,96vw); max-width: 1120px; max-height: 92vh; padding: 26px; }
.system-accounts-header { align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.system-accounts-header h2 { margin: 4px 0; font-size: 26px; }
.system-accounts-header p, .system-account-section-title p { color: var(--text-secondary); font-size: 12px; }
.system-security-card, .system-users-card { margin-top: 18px; padding: 18px; border: 1px solid #D9E7F1; border-radius: 16px; background: #fff; }
.system-security-card { background: linear-gradient(120deg,#F4FAFE,#fff); }
.system-account-section-title { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.system-account-section-title h3 { margin-bottom: 3px; font-size: 17px; }
.system-password-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 9px; }
.system-branch-tabs { display: flex; gap: 8px; margin-bottom: 15px; overflow-x: auto; }
.system-branch-tab { min-height: 44px; padding: 10px 16px; border: 1px solid #CFE0EC; border-radius: 12px; background: #F7FAFC; color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.system-branch-tab span { display: inline-grid; place-items: center; min-width: 24px; min-height: 24px; margin-left: 5px; border-radius: 99px; background: #E9EEF2; font-size: 11px; }
.system-branch-tab.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.system-branch-tab.active span { background: rgba(255,255,255,.22); }
.system-user-branch-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 5px 0 10px; }
.system-user-branch-heading strong { color: var(--accent-dark); font-size: 15px; }
.system-user-branch-heading span { color: var(--text-secondary); font-size: 11px; }
.system-user-create-grid { display: grid; grid-template-columns: 1fr 1.2fr .8fr 1.2fr auto; gap: 9px; margin-bottom: 16px; padding: 13px; border-radius: 13px; background: #F3F8FC; }
.system-users-list { display: grid; gap: 9px; }
.system-user-row { display: grid; grid-template-columns: minmax(150px,1fr) minmax(150px,1.1fr) minmax(175px,1.15fr) auto auto; gap: 8px; align-items: center; padding: 11px; border: 1px solid var(--border); border-radius: 12px; }
.system-user-row.inactive { background: #F4F5F7; opacity: .66; }

@media (max-width: 1050px) {
  .overview-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .overview-branches { grid-template-columns: 1fr; }
  .system-password-grid { grid-template-columns: 1fr 1fr; }
  .system-user-create-grid, .system-user-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .overview-header, .overview-intro, .overview-section-heading, .overview-customers { align-items: flex-start; flex-direction: column; }
  .overview-updated { width: 100%; justify-content: space-between; }
  .overview-periods { justify-content: flex-start; }
  .overview-summary { grid-template-columns: 1fr 1fr; }
  .overview-stat { min-height: 125px; }
  .overview-branch-top { flex-direction: column; }
  .overview-branch-metrics { grid-template-columns: 1fr 1fr; }
  .overview-branch-actions { grid-template-columns: 1fr; }
  .modal-overlay.admin-modal .system-accounts-dialog { width: 100vw; max-width: 100vw; max-height: 100%; min-height: 100%; border-radius: 0 !important; padding: 16px; }
  .modal-overlay.admin-modal { padding: 0; }
  .system-accounts-header { position: relative; display: block; padding-right: 46px; }
  .system-accounts-header .modal-close { position: absolute; top: -6px; right: -5px; }
  .system-accounts-header h2 { font-size: 24px; }
  .system-password-grid, .system-user-create-grid, .system-user-row { grid-template-columns: 1fr; }
  .system-security-card, .system-users-card { padding: 14px; }
  .system-account-section-title { flex-direction: column; }
  .system-user-row .btn, .system-password-grid .btn, .system-user-create-grid .btn { width: 100%; }
}

@media (max-width: 720px) {
  .customer-profile-grid { grid-template-columns: 1fr; }
  .kitchen-header, .admin-header { flex-wrap: wrap; gap: 10px; }
  .kitchen-header h1 small, .admin-header h1 small { display: block; width: 100%; margin-left: 0; }
  .admin-header-actions { width: 100%; justify-content: space-between; }
  .customer-row { grid-template-columns: 40px 1fr auto; }
  .customer-metric { display: none; }
  .staff-header { align-items: flex-start; }
  .staff-orders { padding: 14px; grid-template-columns: 1fr; }
}

/* ============ QR TEMPLATE EDITOR ============ */
.qr-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.qr-section-heading h3 { margin-bottom: 5px; }
.qr-section-heading p { color: var(--text-secondary); font-size: 13px; }
.qr-template-dialog { width: min(1060px, 96vw); max-width: 1060px; max-height: 94vh; }
.qr-template-scope { margin-top: 4px; color: var(--text-secondary); font-size: 12px; }
.qr-template-editor { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr); gap: 28px; align-items: start; }
.qr-template-form .form-group { margin-bottom: 13px; }
.qr-template-tokens, .qr-template-safety { padding: 10px 12px; border-radius: 10px; background: #EEF7FD; color: var(--accent-dark); font-size: 11px; line-height: 1.55; }
.qr-template-tokens code { padding: 2px 4px; border-radius: 4px; background: #fff; color: var(--primary); }
.qr-template-safety { margin-top: 12px; background: #F5F6F8; color: var(--text-secondary); }
.qr-color-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 14px 0; }
.qr-color-grid label { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 8px 9px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.qr-color-grid input { width: 32px; height: 27px; padding: 0; border: 0; background: none; cursor: pointer; }
.qr-template-switches { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.qr-template-preview-wrap { padding: 15px; border-radius: 18px; background: #272324; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.qr-template-preview-wrap > span { display: block; margin-bottom: 10px; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-align: center; }
#qrTemplatePreview { display: block; width: min(100%, 480px); height: auto; margin: auto; background: #fff; }
.qr-template-actions { display: flex; gap: 9px; margin-top: 22px; flex-wrap: wrap; }

/* ============ STAFF CHECKOUT & INVOICE ============ */
.staff-tabs { display: flex; gap: 8px; padding: 18px clamp(18px,4vw,48px) 0; background: #EEF5FA; }
.staff-tab { padding: 12px 18px; border: 1px solid #CFE0EC; border-radius: 12px; background: #fff; color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.staff-tab.active { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 7px 18px rgba(36,111,168,.2); }
.staff-checkout { padding: 24px clamp(18px,4vw,48px) 55px; }
.staff-checkout-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.staff-checkout-heading span { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .11em; }
.staff-checkout-heading h2 { margin: 3px 0; font-size: 25px; }
.staff-checkout-heading p { color: var(--text-secondary); font-size: 12px; }
.staff-table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.staff-table-card { padding: 18px; border: 1px solid #D9E8F3; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.staff-table-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.staff-table-card-top > div > span { color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.staff-table-card h3 { color: var(--text-dark); font-size: 30px; line-height: 1; margin: 3px 0; }
.staff-table-card small { color: var(--text-secondary); font-size: 10px; }
.staff-table-status { padding: 5px 8px; border-radius: 99px; background: #DDF4E8; color: #237653; font-size: 9px; font-weight: 800; text-align: center; }
.staff-table-status.waiting { background: #FFF0EE; color: #B42318; }
.staff-table-status.kitchen { background: #FFF3E8; color: #9A4B00; }
.staff-table-metrics { display: grid; grid-template-columns: .65fr 1.35fr; gap: 8px; margin: 17px 0; }
.staff-table-metrics > div { padding: 10px; border-radius: 10px; background: #F4F8FB; }
.staff-table-metrics span { display: block; color: var(--text-secondary); font-size: 9px; }
.staff-table-metrics strong { display: block; margin-top: 3px; color: var(--accent-dark); font-size: 17px; }
.staff-bill-dialog { width: min(590px, 95vw); max-width: 590px; max-height: 92vh; }
.staff-bill-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 11px 13px; border-radius: 10px; background: #EEF7FD; color: var(--accent-dark); }
.staff-bill-meta span { color: var(--text-secondary); font-size: 11px; }
.staff-bill-item { display: flex; justify-content: space-between; gap: 14px; padding: 10px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.staff-bill-item small { display: block; margin: 2px 0 0 24px; color: #B45C00; }
.staff-bill-item b { white-space: nowrap; }
.staff-bill-total { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 15px 2px; border-top: 2px solid var(--text-dark); }
.staff-bill-total span { font-size: 12px; font-weight: 900; }
.staff-bill-total strong { color: var(--primary); font-size: 24px; }
.staff-bill-warning { margin: 0 0 13px; padding: 11px; border-radius: 9px; background: #FFF0EE; color: #B42318; font-size: 11px; font-weight: 700; }
.staff-bill-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.staff-bill-actions .btn { padding-inline: 10px; }
.kitchen-order-footer .kitchen-print { color: #DCEEFF; border-color: #5D7890; }

@media (max-width: 780px) {
  .qr-section-heading, .staff-checkout-heading { align-items: stretch; flex-direction: column; }
  .qr-template-editor { grid-template-columns: 1fr; }
  .qr-template-dialog { padding: 18px; }
  .staff-tabs { overflow-x: auto; }
  .staff-tab { flex: 0 0 auto; }
  .staff-bill-actions { grid-template-columns: 1fr; }
  .kitchen-order-footer { flex-wrap: wrap; }
  .kitchen-order-footer .btn { flex: 1 1 42%; }
}

/* ============ MOBILE OPERATIONS & ACCESSIBILITY ============ */
html, body { max-width: 100%; overflow-x: hidden; }
.btn, .tab-btn, .staff-tab, .modal-close { min-height: 44px; }
.btn-sm { min-height: 40px; }
.modal-close { min-width: 44px; display: inline-grid; place-items: center; line-height: 1; }
.menu-tools { position: sticky; top: 112px; z-index: 90; background: rgba(247,251,255,.97); backdrop-filter: blur(10px); box-shadow: 0 5px 14px rgba(36,111,168,.06); transition: top .2s ease; }
.menu-search-wrap { padding: 0 16px 12px; }
.menu-search-wrap .form-control { border-radius: 25px; padding: 11px 18px; background: #fff; }
.customer-header { transition: padding .2s ease; }
.customer-scrolled .customer-header { padding-block: 7px 8px; }
.customer-scrolled .customer-header h1 { font-size: 17px; }
.customer-scrolled .customer-header .header-logo { width: 28px; height: 28px; }
.customer-scrolled .branch-kicker { display: none; }
.customer-scrolled .customer-header .table-badge { position: absolute; right: 12px; top: 9px; margin: 0; padding: 4px 11px; }
.customer-scrolled .menu-tools { top: 55px; }
.table-access-message, .menu-only-notice { margin: 14px 16px 0; padding: 16px; border-radius: 14px; border: 1px solid #FFD0C7; background: #FFF4F1; color: #8D281B; }
.table-access-message strong { display: block; font-size: 16px; }
.table-access-message p { margin: 5px 0 12px; color: var(--text-secondary); font-size: 13px; }
.menu-only-notice { border-color: #B9DDF4; background: #EEF8FE; color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.menu-view-only { color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.floating-cart { border: 0; font: inherit; }
.app-dialog-overlay { z-index: 1000; }
.app-dialog { max-width: 440px !important; }
.app-dialog-message { margin: -6px 0 16px; color: var(--text-secondary); font-size: 13px; }
.app-dialog-input { margin-bottom: 16px; resize: vertical; }
.app-dialog-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 9px; }
.kitchen-live-state { display: flex; flex-direction: column; min-width: 150px; color: #72D9A6; font-size: 12px; font-weight: 800; }
.kitchen-live-state small { color: var(--text-muted); font-size: 10px; font-weight: 600; }
.kitchen-live-state .offline { color: #FF8D7A; }
.kitchen-live-state small.warning { color: #FFB36B; }
.staff-header-actions { display: flex; align-items: center; gap: 10px; }
.connection-pill { color: #23875B; font-size: 11px; font-weight: 800; white-space: nowrap; }
.connection-pill.offline { color: #B42318; }
.kitchen-header .push-enable, .kitchen-header .kitchen-logout { color: #fff; border-color: #536170; }
.user-create-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr 1.2fr auto; gap: 9px; margin-bottom: 18px; }
.branch-users-list { display: grid; gap: 9px; }
.branch-user-row { display: grid; grid-template-columns: minmax(160px,1.2fr) minmax(150px,1fr) minmax(160px,1fr) auto auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 12px; }
.branch-user-row.inactive { opacity: .6; background: #F4F5F7; }
.branch-user-identity { display: flex; flex-direction: column; min-width: 0; }
.branch-user-identity span { color: var(--text-secondary); font-size: 11px; overflow-wrap: anywhere; }
.qr-template-actions { position: sticky; bottom: -18px; z-index: 5; margin-inline: -18px; padding: 14px 18px 0; background: #fff; border-top: 1px solid var(--border); }

@media (max-width: 720px) {
  .btn-sm { min-height: 44px; }
  .customer-header .table-badge small { font-size: 12px; }
  .menu-item-description { font-size: 12px; line-height: 1.45; }
  .menu-tabs { padding: 10px 12px; }
  .tab-btn { padding: 9px 15px; font-size: 13px; }
  .menu-search-wrap { padding: 0 12px 10px; }
  .menu-grid { padding: 0 12px; }
  .qty-btn, .cart-item-actions button { width: 44px; height: 44px; }
  .staff-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 12px 14px 0; overflow: visible; }
  .staff-tab { min-width: 0; white-space: normal; line-height: 1.35; padding-inline: 10px; }
  .staff-header { padding: 17px 14px; }
  .staff-header p { display: none; }
  .staff-header-actions { flex-direction: column; align-items: stretch; }
  .staff-pending-count { min-width: 88px; padding: 9px 13px; }
  .staff-pending-count strong { font-size: 24px; }
  .kitchen-header { padding: 12px 14px; }
  .kitchen-header h1 { width: 100%; font-size: 18px; }
  .kitchen-stats { gap: 12px; }
  .kitchen-live-state { order: 5; min-width: 0; flex: 1; }
  .kitchen-logout { margin-left: auto; }
  #autoPrintToggle { min-height: 44px; }
  .kitchen-orders { grid-template-columns: minmax(0,1fr); padding: 12px; }
  .admin-content { padding: 12px; }
  .admin-card { padding: 16px; }
  .admin-header { padding: 12px; }
  .admin-header h1 { font-size: 18px; }
  .admin-tabs { padding: 0 8px; }
  .admin-tab { min-height: 48px; padding: 10px 14px; }
  .table-floor-group { padding: 10px; min-width: 0; }
  .table-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .table-cell { min-width: 0; }
  .table-cell .table-num { font-size: 23px; }
  .table-cell .table-location { font-size: 11px; }
  .table-floor-heading span, .table-cell .table-location, .table-cell .table-label { font-size: 12px; }
  .user-create-grid, .branch-user-row { grid-template-columns: 1fr; }
  .branch-user-row .btn { width: 100%; }
  .qr-template-actions { bottom: -18px; }
  .qr-template-actions .btn { flex: 1 1 100%; }
  .overview-updated { flex-wrap: wrap; }
  .connection-pill, .kitchen-live-state, .kitchen-live-state small, .kitchen-stat .label, .staff-pending-count span { font-size: 12px; }
  .overview-eyebrow, .overview-section-heading span, .overview-customers > div > span,
  .overview-stat > span, .overview-stat small, .overview-branch-metrics span, .overview-branch-actions .btn { font-size: 12px; }
  .overview-brand span, .overview-branch-top span, .overview-branch-top p, .branch-live { font-size: 12px; }
}

@media (max-width: 360px) {
  .menu-grid { gap: 8px; padding-inline: 8px; }
  .menu-item-info { padding: 10px; }
  .menu-item-controls { padding-inline: 10px; }
  .menu-item .btn-sm { padding-inline: 9px; font-size: 12px; }
  .staff-order-actions { grid-template-columns: 1fr; }
  .admin-content { padding: 8px; }
  .table-floor-group { padding: 8px; }
  .app-dialog-actions { grid-template-columns: 1fr; }
}
