/* ============================================================
   FrancoPOS — Design System
   Clean, modern, light + dark themes
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eceff6;
  --border: #e5e8f0;
  --border-strong: #d5dae6;
  --text: #1a2135;
  --text-2: #3c4a63;
  --muted: #64748b;
  --primary: #5b5bd6;
  --primary-strong: #4a4ac9;
  --primary-soft: #eef0fd;
  --success: #16a085;
  --success-soft: #e6f6f1;
  --warning: #e8930c;
  --warning-soft: #fdf3e0;
  --danger: #dc4b4b;
  --danger-soft: #fdeeee;
  --info: #2f80c9;
  --info-soft: #e8f2fa;
  --red: var(--danger);
  --shadow-sm: 0 1px 2px rgba(23, 30, 54, .05);
  --shadow-md: 0 6px 20px rgba(23, 30, 54, .08);
  --shadow-lg: 0 18px 50px rgba(23, 30, 54, .18);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --sidebar-bg: #0e1420;
  --sidebar-text: #94a3b8;
  --sidebar-active: #e6e9f5;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html[data-theme='dark'] {
  --bg: #0e131c;
  --surface: #151b26;
  --surface-2: #1a2230;
  --surface-3: #232c3d;
  --border: #263041;
  --border-strong: #33405a;
  --text: #e8ebf4;
  --text-2: #b9c2d4;
  --muted: #8a96b0;
  --primary: #8188f0;
  --primary-strong: #9aa0f5;
  --primary-soft: #232b4a;
  --success: #34d399;
  --success-soft: #123129;
  --warning: #f0b429;
  --warning-soft: #33290f;
  --danger: #f07070;
  --danger-soft: #3a1d1d;
  --info: #4aa7e8;
  --info-soft: #122c40;
  --red: var(--danger);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .4);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  --sidebar-bg: #0a0e16;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}

button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

a { color: var(--primary); text-decoration: none; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft), 0 0 0 1px var(--primary);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.neg { color: var(--danger); }
.money-text { font-weight: 600; font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.wrap { flex-wrap: wrap; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; }

.label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.value { font-size: 19px; font-weight: 800; }
.sub { font-size: 12px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(91, 91, 214, .3); }
.btn-primary:hover:not(:disabled) { background: var(--primary-strong); }

.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }

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

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(.95); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.95); }

.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 11px 18px; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- App shell ---------- */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar (always dark, looks modern in both themes) */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  transition: width .2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #6a6ff0, #8b5cf6);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .2px;
}
.brand-mark-lg { width: 58px; height: 58px; font-size: 26px; border-radius: 17px; }

.brand-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 10px; flex-shrink: 0; background: #fff; padding: 2px; }
.brand-logo-lg { width: 64px; height: 64px; border-radius: 16px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { color: #f3f5fb; font-size: 15px; font-weight: 700; letter-spacing: .1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 10px; color: #7b8aa6; font-weight: 700; letter-spacing: 1.6px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group { margin-bottom: 16px; }
.nav-group-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.3px; color: #5b6a85; padding: 0 10px; margin-bottom: 6px; font-weight: 700; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
  margin-bottom: 2px;
}
.nav-item svg { flex-shrink: 0; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #eef1f8; }

.nav-item-active {
  background: linear-gradient(135deg, rgba(110, 116, 240, .26), rgba(110, 116, 240, .1));
  color: var(--sidebar-active);
  box-shadow: inset 2px 0 0 var(--primary);
}
.nav-item-active svg { color: #9aa0f5; }

.nav-item-danger { color: #9ca8c0; }
.nav-item-danger:hover { background: rgba(240, 112, 112, .12); color: #f07070; }

.nav-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .07); }

/* Collapsible sidebar */
html[data-sidebar='collapsed'] .sidebar { width: 66px; min-width: 66px; }
html[data-sidebar='collapsed'] .sidebar-brand { justify-content: center; padding: 18px 8px; }
html[data-sidebar='collapsed'] .brand-text,
html[data-sidebar='collapsed'] .nav-group-label,
html[data-sidebar='collapsed'] .nav-label { display: none; }
html[data-sidebar='collapsed'] .sidebar-nav { padding: 12px 6px; }
html[data-sidebar='collapsed'] .nav-item { justify-content: center; padding: 9px 0; gap: 0; }
html[data-sidebar='collapsed'] .sidebar-foot { padding: 10px 6px; }
html[data-sidebar='collapsed'] .sidebar-foot .nav-item { justify-content: center; padding: 9px 0; gap: 0; }

/* Main column */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  gap: 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 40;
}
.topbar-title h1 { font-size: 16px; font-weight: 700; letter-spacing: -.1px; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* Sidebar toggle */
.sidebar-toggle {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.sidebar-toggle:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }

/* Theme toggle */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }

.theme-toggle-icons { position: relative; width: 16px; height: 16px; display: block; }
.theme-toggle-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity .2s ease, transform .2s ease; }
[data-theme='light'] .theme-icon-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme='light'] .theme-icon-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
[data-theme='dark'] .theme-icon-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
[data-theme='dark'] .theme-icon-moon { opacity: 1; transform: rotate(0) scale(1); }

/* User chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface-2);
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a6ff0, #8b5cf6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.user-chip-text { display: flex; flex-direction: column; text-align: left; line-height: 1.25; min-width: 0; }
.user-chip-text strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.user-chip-text small { font-size: 11px; color: var(--muted); text-transform: capitalize; }

/* Content */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Flash messages */
.flash { padding: 10px 22px; font-size: 13.5px; font-weight: 600; }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-success { background: var(--success-soft); color: var(--success); }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }

/* ---------- Page ---------- */
.page { display: flex; flex-direction: column; gap: 20px; max-width: 1280px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-title { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.page-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.page-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14.5px; font-weight: 700; }
.card-body { padding: 18px; }
.card-actions { display: flex; gap: 8px; }

.span-2 { grid-column: span 2; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat-card {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon-primary { background: var(--primary-soft); color: var(--primary); }
.stat-icon-green { background: var(--success-soft); color: var(--success); }
.stat-icon-red { background: var(--danger-soft); color: var(--danger); }
.stat-icon-amber { background: var(--warning-soft); color: var(--warning); }
.stat-info { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 20px; font-weight: 800; letter-spacing: -.3px; line-height: 1.25; }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.stat-value-sm { font-size: 15px; }

/* ---------- Grids ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.dash-grid-2 { grid-template-columns: 1fr 1fr; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.text-right { text-align: right; }

/* ---------- Charts ---------- */
.chart-box { width: 100%; min-width: 0; }
.chart-box-lg { height: 240px; }
.chart-donut { display: flex; justify-content: center; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; }
.chart-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.chart-legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.chart-legend-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend-value { margin-left: auto; font-weight: 600; color: var(--text-2); white-space: nowrap; }

/* ---------- Reports ---------- */
.report-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.report-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s ease;
}
.report-tab:hover { border-color: var(--border-strong); color: var(--text); }
.report-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dash-chart-card .card-body { padding-bottom: 8px; }

/* ---------- Charts ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 220px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bar-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.bar-fill { width: 100%; background: linear-gradient(180deg, var(--primary), var(--primary-strong)); border-radius: 8px 8px 3px 3px; min-height: 4px; transition: height .4s ease; }
.bar-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.bar-value { font-size: 10.5px; color: var(--muted); }

.top-items { display: flex; flex-direction: column; gap: 12px; }
.top-item { display: flex; align-items: center; gap: 10px; }
.top-item-name { font-weight: 600; font-size: 13px; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-item-bar { flex: 1; height: 8px; background: var(--surface-3); border-radius: 8px; overflow: hidden; }
.top-item-bar div { height: 100%; background: linear-gradient(90deg, var(--success), var(--primary)); border-radius: 8px; }
.top-item-qty { font-size: 12px; color: var(--muted); white-space: nowrap; }

.low-stock-list { display: flex; flex-direction: column; }
.low-stock-item { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.low-stock-item:last-child { border-bottom: none; }
.low-stock-item > svg { color: var(--danger); }
.low-stock-info { flex: 1; display: flex; flex-direction: column; }
.low-stock-info strong { font-size: 13.5px; }
.low-stock-info span { font-size: 12px; color: var(--muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  padding: 2.5px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-gray { background: var(--surface-3); color: var(--muted); }
.badge-success, .badge-green { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info, .badge-blue { background: var(--info-soft); color: var(--info); }

.veg-dot { display: inline-block; border-radius: 50%; border: 2px solid currentColor; position: relative; flex-shrink: 0; }
.veg-dot-green { color: var(--success); background: var(--success); box-shadow: inset 0 0 0 2px var(--surface); }
.veg-dot-red { color: var(--danger); background: var(--danger); box-shadow: inset 0 0 0 2px var(--surface); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.req { color: var(--danger); }
.field-hint { font-size: 11.5px; color: var(--muted); }

.input, .select, textarea.input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input:focus, .select:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input:disabled, .select:disabled { opacity: .6; }
textarea.input { resize: vertical; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-row-badges { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin: 8px 0 14px; }

.logo-field { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 64px; height: 64px; border: 1px dashed var(--border, rgba(127, 127, 127, .35)); border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview span { color: var(--muted, #889); font-size: 12px; }
.logo-controls { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 180px; }

.toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: none; padding: 0; }
.toggle-knob {
  width: 38px; height: 22px; border-radius: 20px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  position: relative;
  transition: all .2s ease;
  flex-shrink: 0;
}
.toggle-knob::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: all .2s ease;
  box-shadow: var(--shadow-sm);
}
.toggle-on .toggle-knob { background: var(--primary); border-color: var(--primary); }
.toggle-on .toggle-knob::after { left: 18px; }
.toggle-label { font-size: 13.5px; font-weight: 600; }

.switch-sm { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch-sm input { opacity: 0; width: 0; height: 0; }
.slider-sm { position: absolute; inset: 0; background: var(--surface-3); border-radius: 20px; transition: .2s; cursor: pointer; }
.slider-sm::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch-sm input:checked + .slider-sm { background: var(--primary); }
.switch-sm input:checked + .slider-sm::before { transform: translateX(18px); }
.advance-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 4px; font-weight: 600; font-size: 13px; }

input.check { accent-color: var(--primary); width: 16px; height: 16px; }

.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  min-width: 200px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-input input { border: none; outline: none; background: none; color: var(--text); flex: 1; font-size: 13.5px; }
.search-input input::placeholder { color: var(--muted); }

.inline-group { display: flex; gap: 8px; }
.inline-group > * { flex: 1; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table, .data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; }
.cell-name { display: flex; align-items: center; gap: 8px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* ---------- Empty ---------- */
.empty, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 8px;
  color: var(--muted);
  font-size: 13.5px;
}
.empty-icon { width: 62px; height: 62px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--muted); }
.empty-state h4 { font-size: 15px; color: var(--text); }
.empty-state p { color: var(--muted); font-size: 13px; max-width: 320px; }

/* ---------- Modal ---------- */
.modal-backdrop, .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 24, .55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: popIn .18s ease;
}
.modal-lg { max-width: 760px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head, .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot, .modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.confirm-message { color: var(--muted); font-size: 13.5px; }
.modal-add-price { margin-right: auto; display: flex; align-items: baseline; gap: 6px; }
.modal-add-price strong { font-size: 17px; }
.modal-add-price small { color: var(--muted); font-size: 12px; }

.section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 18px 0 8px; }

/* Tags & profile rows */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; background: var(--info-soft); color: var(--info); font-size: 12px; font-weight: 600; }
.profile-rows { display: flex; flex-direction: column; }
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.profile-row:last-child { border-bottom: 0; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } }
.toast-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.toast-dot-success { background: var(--success); }
.toast-dot-error { background: var(--danger); }
.toast-dot-info { background: var(--info); }

/* ---------- Spinner ---------- */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; height: 100%; min-height: 200px; color: var(--muted); font-weight: 600; }
.btn-danger .spinner, .btn-ghost .spinner { border-color: var(--muted); border-top-color: currentColor; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  background:
    radial-gradient(900px 480px at 85% -10%, var(--primary-soft), transparent),
    radial-gradient(700px 420px at -10% 110%, var(--info-soft), transparent),
    var(--bg);
}
.theme-float {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: color .15s ease, border-color .15s ease;
}
.theme-float:hover { color: var(--text); border-color: var(--border-strong); }

.login-card {
  width: 420px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px;
  box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.login-brand h1 { font-size: 25px; font-weight: 800; margin-top: 13px; letter-spacing: -.4px; }
.login-brand h1 span { color: var(--primary); }
.login-brand p { color: var(--muted); font-size: 13px; }

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 18px;
  gap: 4px;
}
.login-tabs button {
  border: none;
  background: none;
  padding: 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.login-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 700; }

/* PIN pad */
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 6px 0 20px; }
.pin-dots .dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  transition: all .15s ease;
}
.pin-dots .dot.filled { background: var(--primary); border-color: var(--primary); }

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.pin-pad .key {
  height: 54px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.pin-pad .key:hover { background: var(--surface-3); border-color: var(--border-strong); }
.pin-pad .key:active { transform: scale(.96); }
.pin-pad .key-fn { color: var(--muted); font-size: 14px; }

.login-hint {
  margin-top: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}
.login-hint strong { color: var(--text-2); font-size: 12.5px; margin-bottom: 2px; }

/* ---------- POS ---------- */
.pos-page { display: flex; gap: 12px; height: calc(100vh - var(--topbar-h) - 48px); min-height: 420px; }
.pos-main { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.pos-main > div { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pos-side { width: 372px; min-width: 372px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.pos-side .pos-types, .pos-side .pos-tabs { width: 100%; box-sizing: border-box; }
.pos-side .pos-type, .pos-side .pos-tabs button { flex: 1; justify-content: center; }
.conn-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
}
.conn-pill.online { background: var(--success-soft); color: var(--success); }
.conn-pill.offline { background: var(--danger-soft); color: var(--danger); }
.conn-pill.pending { background: var(--warning-soft); color: var(--warning); }
.conn-pill.syncing { background: var(--info-soft); color: var(--info); }
.pos-types { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 12px; }
.pos-type {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 9px;
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  transition: background .15s ease, color .15s ease;
}
.pos-type.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.pos-table-pick { display: flex; align-items: center; gap: 8px; }
.pos-table-pick .input { width: auto; }
.pos-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.pos-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 12px; }
.pos-tabs button { border: none; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.pos-tabs button.active { background: var(--surface-3); color: var(--text); }
.count-pill { background: var(--primary); color: #fff; border-radius: 20px; font-size: 11px; padding: 1px 8px; font-weight: 700; }

.pos-body { flex: 1; display: flex; gap: 14px; min-height: 0; }
.pos-items { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; overflow: hidden; }
.pos-search-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pos-search-row .search-input { flex: 1; min-width: 200px; }
.filter-chips { display: flex; gap: 6px; }
.cat-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.item-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 10px;
  overflow-y: auto;
  align-content: start;
  padding: 2px;
}
.item-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  position: relative;
  color: var(--text);
}
.item-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.item-card-img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface-2);
}
.item-card-top { display: flex; align-items: center; gap: 6px; }
.item-code { font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: .4px; }
.bar-flag { color: var(--warning); display: inline-flex; }
.bestseller-flag {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .4px;
  background: var(--warning-soft);
  color: var(--warning);
  border-radius: 20px;
  padding: 1px 6px;
}
.item-name { font-weight: 600; font-size: 13px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-card-foot { display: flex; align-items: center; justify-content: space-between; }
.item-price { font-weight: 800; font-size: 14px; color: var(--primary); }
.item-add { color: var(--success); }

.pos-cart {
  flex: 1;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.cart-head h3 { font-size: 14.5px; }
.cart-count { font-size: 12px; color: var(--muted); font-weight: 600; }
.cart-lines { flex: 1; overflow-y: auto; padding: 6px 12px; max-height: 40vh; }
.cart-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: none; }
.cart-line-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-line-info strong { font-size: 13px; }
.cart-line-meta { font-size: 11.5px; color: var(--muted); }
.cart-note { color: var(--info); }
.cart-line-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.qty-btn {
  width: 24px; height: 24px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.qty-num { min-width: 18px; text-align: center; font-weight: 700; font-size: 13px; }
.qty-num-lg { font-size: 18px; min-width: 30px; }
.qty-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

.cart-summary { padding: 10px 15px; border-top: 1px solid var(--border); background: var(--surface-2); }
.cart-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; color: var(--muted); }
.cart-total { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 8px; font-weight: 800; font-size: 16px; color: var(--text); }
.cart-controls { padding: 12px 15px 14px; overflow-y: auto; }
.cart-control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cart-control-row .field:only-child { grid-column: span 2; }
.cart-controls .field { margin-bottom: 8px; }
.cart-buttons { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cart-buttons .btn { flex: 1; justify-content: center; }
.btn-place { flex: 2 !important; }

/* ---------- Modifier ---------- */
.item-modal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.item-modal-img { width: 100%; border-radius: var(--radius); margin-bottom: 12px; background: var(--surface-2); overflow: hidden; }
.item-modal-img img { width: 100%; height: 180px; object-fit: cover; display: block; }
.item-thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; vertical-align: middle; margin-right: 6px; background: var(--surface-2); }
.item-img-row { display: flex; gap: 12px; align-items: flex-start; }
.item-img-preview { width: 72px; height: 72px; border-radius: var(--radius); border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.item-img-preview img { width: 100%; height: 100%; object-fit: cover; }
.item-img-preview .muted { font-size: 11px; }
.item-img-controls { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.modifier-group { margin-bottom: 14px; }
.modifier-group-title { font-size: 12.5px; font-weight: 700; margin-bottom: 7px; }
.modifier-options { display: flex; flex-wrap: wrap; gap: 7px; }
.mod-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all .15s ease;
}
.mod-option:hover { border-color: var(--primary); }
.mod-option.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.mod-price { font-size: 11.5px; opacity: .85; }

/* ---------- Running orders ---------- */
.running-wrap { flex: 1; overflow-y: auto; }
.running-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.running-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.running-card-head { display: flex; align-items: center; justify-content: space-between; }
.running-card-head > div { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.running-card-head strong { font-size: 14px; }
.elapsed { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.elapsed-danger { color: var(--danger); }
.running-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.running-items { display: flex; flex-direction: column; gap: 5px; }
.running-item { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.ri-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ri-new { background: var(--info); }
.ri-preparing { background: var(--warning); }
.ri-ready { background: var(--success); }
.ri-served { background: var(--muted); }
.ri-qty { font-weight: 800; color: var(--primary); }
.ri-name { font-weight: 600; }
.ri-mods { color: var(--muted); font-size: 12px; }
.ri-note { color: var(--info); font-size: 12px; font-style: italic; }
.running-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--border); padding-top: 10px; }
.running-total { font-size: 17px; font-weight: 800; }
.running-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* ---------- Payment ---------- */
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.pay-summary > div { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.pay-summary span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.pay-summary strong { font-size: 16px; }
.pay-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pay-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.pay-line .input { flex: 1; }
.pay-quick { display: flex; gap: 4px; }
.pay-quick button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.pay-quick button:hover { color: var(--primary); border-color: var(--primary); }
.den-quick { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; padding-bottom: 2px; }
.den-quick button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.den-quick button:hover { color: var(--primary); border-color: var(--primary); }

.split-preview { display: flex; justify-content: space-between; background: var(--surface-2); border-radius: 10px; padding: 12px; font-size: 13px; }

.holds-list { display: flex; flex-direction: column; gap: 10px; }
.hold-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.hold-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.hold-items { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.hold-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Modify ---------- */
.modify-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modify-picker { display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--border); padding-right: 14px; }
.modify-picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 380px; overflow-y: auto; }
.modify-pick-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.modify-pick-row:hover { border-color: var(--primary); }
.modify-pick-row .item-price { margin-left: auto; }
.modify-pick-row svg { color: var(--success); }
.modify-lines { display: flex; flex-direction: column; gap: 4px; }
.modify-discount { margin-top: 10px; }

/* ---------- Receipt ---------- */
.receipt { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.receipt-head { text-align: center; display: flex; flex-direction: column; margin-bottom: 8px; }
.receipt-head strong { font-size: 15px; }
.receipt-head span { color: var(--muted); font-size: 12px; }
.receipt-row { display: flex; justify-content: space-between; }
.receipt-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 3px 0; }
.receipt-line div { display: flex; flex-direction: column; }
.receipt-line small { color: var(--muted); }
.receipt-total { font-size: 15px; }
.receipt-due { color: var(--danger); }
.receipt-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; }

/* ---------- Kitchen ---------- */
.kitchen-page { display: flex; flex-direction: column; gap: 14px; height: calc(100vh - var(--topbar-h) - 48px); min-height: 420px; }
.kitchen-head { display: flex; align-items: center; justify-content: space-between; }
.kitchen-head h2 { font-size: 19px; font-weight: 800; }
.kitchen-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 12px; }
.kitchen-tabs button { border: none; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kitchen-tabs button.active { background: var(--primary); color: #fff; }
.kitchen-lanes { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; min-height: 0; }
.kitchen-lane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.lane-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; font-weight: 700; font-size: 13px; }
.lane-count { background: var(--surface-3); border-radius: 20px; padding: 1px 9px; font-size: 12px; }
.lane-new .lane-head { background: var(--info-soft); color: var(--info); }
.lane-preparing .lane-head { background: var(--warning-soft); color: var(--warning); }
.lane-ready .lane-head { background: var(--success-soft); color: var(--success); }
.lane-served .lane-head { background: var(--surface-2); color: var(--muted); }
.lane-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.lane-foot { padding: 10px; border-top: 1px solid var(--border); }

.kot-card { border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 10px; padding: 11px; background: var(--surface-2); }
.kot-card[data-status='preparing'] { border-left-color: var(--warning); }
.kot-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.kot-head strong { font-size: 12.5px; }
.kot-meta { display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); margin-bottom: 7px; }
.kot-item { display: flex; gap: 8px; align-items: flex-start; }
.kot-item strong { font-size: 14px; }
.kot-mods { font-size: 12px; color: var(--primary); font-weight: 600; }
.kot-note { font-size: 12px; color: var(--info); font-style: italic; }
.kot-actions { margin-top: 9px; display: flex; justify-content: flex-end; }

/* ---------- Tables ---------- */
.floor-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.floor-toolbar .select { width: 220px; }
.floor-areas { display: flex; flex-direction: column; gap: 20px; }
.floor-area-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 10px; }
.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.table-card {
  text-align: left;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.table-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.table-occupied { border-color: var(--danger); background: var(--danger-soft); }
.table-card-head { display: flex; align-items: center; justify-content: space-between; }
.table-card-head strong { font-size: 16px; }
.table-status { font-size: 10px; font-weight: 800; letter-spacing: .6px; padding: 2px 8px; border-radius: 20px; }
.table-status.free { background: var(--success-soft); color: var(--success); }
.table-status.occupied { background: var(--danger); color: #fff; }
.table-card-meta { display: flex; gap: 12px; color: var(--muted); font-size: 12px; align-items: center; }
.table-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.table-orders { font-size: 12px; font-weight: 600; color: var(--danger); }
.table-detail-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.detail-orders { display: flex; flex-direction: column; gap: 8px; }
.detail-order { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.detail-order-total { font-weight: 800; }

/* ---------- Lists ---------- */
.list-row { display: flex; align-items: center; gap: 8px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row-main strong { font-size: 13.5px; }
.list-row-main .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.check-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); padding: 8px 12px; border-radius: 10px; background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 13px; }
.check-chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.check-chip small { color: var(--muted); font-weight: 500; }
.modifier-check-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.recipe-rows { display: flex; flex-direction: column; gap: 8px; }
.recipe-row { display: flex; gap: 8px; align-items: center; }
.recipe-row .input { flex: 1; }
.recipe-row .muted { min-width: 50px; }
.recipe-row select { flex: 2; }

.split-list { display: flex; flex-direction: column; }
.split-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.split-row:last-child { border-bottom: none; }

/* ---------- Register ---------- */
.register-summary { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.register-summary-row { display: flex; justify-content: space-between; font-size: 13.5px; }
.register-rows { display: flex; flex-direction: column; gap: 10px; }
.register-row { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.register-row > div:first-child { display: flex; flex-direction: column; }
.register-row span { font-size: 12px; color: var(--muted); }
.register-nums { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.register-nums span { font-size: 12.5px; }

/* ---------- Account ---------- */
.account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.account-head > div { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Report tabs ---------- */
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.report-tabs button {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
}
.report-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.report-range { display: flex; gap: 6px; }
.custom-range { display: flex; gap: 14px; align-items: flex-end; max-width: 480px; }
.custom-range .field { flex: 1; }

.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 11px; width: fit-content; }
.tabs button { border: none; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--muted); }
.tabs button.active { background: var(--surface-3); color: var(--text); }
.tab-content { margin-top: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .stat-grid, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1000px) {
  .sidebar { width: 66px; min-width: 66px; }
  .sidebar .brand-text, .sidebar .nav-group-label, .sidebar .nav-label { display: none; }
  .sidebar .sidebar-nav { padding: 12px 6px; }
  .sidebar .nav-item { justify-content: center; padding: 9px 0; gap: 0; }
  .sidebar .sidebar-foot { padding: 10px 6px; }
  .sidebar .sidebar-foot .nav-item { justify-content: center; padding: 9px 0; gap: 0; }
  .pos-page { flex-direction: column; }
  .pos-main, .pos-side { width: 100%; min-width: 0; }
  .pos-main { flex: 1 1 54%; min-height: 0; }
  .pos-side { flex: 1 1 46%; min-height: 0; }
  .pos-body { flex-direction: column; }
  .pos-cart { width: 100%; min-width: 0; flex: 1; }
  .cart-lines { max-height: none; }
  .dash-grid, .dash-grid-2, .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .kitchen-lanes { grid-template-columns: repeat(2, 1fr); }
  .modify-grid { grid-template-columns: 1fr; }
  .modify-picker { border-right: none; padding-right: 0; }
}

@media (max-width: 700px) {
  .stat-grid, .stat-grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kitchen-lanes { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .pos-page, .kitchen-page { height: auto; min-height: 100%; }
  .sidebar { position: fixed; z-index: 50; height: 100%; box-shadow: var(--shadow-lg); transform: translateX(-100%); transition: transform .25s ease; width: 260px; min-width: 260px; }
  html[data-sidebar='open'] .sidebar { transform: translateX(0); }
  html[data-sidebar='collapsed'] .sidebar { transform: translateX(-100%); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 49; }
  html[data-sidebar='open'] .sidebar-backdrop { display: block; }
  .topbar-title h1 { font-size: 14px; }
  .user-chip-text { display: none; }
  .pos-types { flex-wrap: wrap; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .item-card-img { height: 64px; }
  .running-grid { grid-template-columns: 1fr; }
}

.check-line { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.check-line input { margin: 0; flex: none; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; margin-top: 6px; max-height: 260px; overflow-y: auto; }

