/* ==========================================================================
   ذوق (Thouq) — Dark POS design system
   يُحمَّل بعد shared/css/base.css ويعيد تعريف كل شيء: خلفية داكنة، زعفران، Tajawal،
   بدون Sidebar: شريط علوي + صف بلاطات تنقّل + Dock للجوال.
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap");

:root {
  --bg: #0f0f10;
  --bg-2: #141416;
  --surface: #1a1a1c;
  --surface-2: #232326;
  --surface-3: #2c2c30;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --border: var(--line);
  --text: #f5f1ea;
  --text-2: #cdc6ba;
  --muted: #9a958c;
  --faint: #6a665f;

  --brand: #f5a524;
  --brand-600: #e0911a;
  --brand-soft: rgba(245, 165, 36, .14);
  --saffron: #f5a524; --saffron-soft: rgba(245, 165, 36, .14);
  --ember: #e8590c;   --ember-soft: rgba(232, 89, 12, .16);
  --mint: #34d399;    --mint-soft: rgba(52, 211, 153, .14);
  --sky: #60a5fa;     --sky-soft: rgba(96, 165, 250, .14);
  --violet: #a78bfa;  --violet-soft: rgba(167, 139, 250, .15);
  --rose: #fb7185;    --rose-soft: rgba(251, 113, 133, .14);
  --success: var(--mint); --success-soft: var(--mint-soft);
  --warning: var(--saffron); --warning-soft: var(--saffron-soft);
  --danger: #ff6b3d; --danger-soft: var(--ember-soft);
  --info: var(--sky); --info-soft: var(--sky-soft);

  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03) inset;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .75);
  --glow: 0 0 0 1px rgba(245, 165, 36, .35), 0 14px 40px -12px rgba(245, 165, 36, .45);
  --glow-ember: 0 0 0 1px rgba(232, 89, 12, .45), 0 14px 40px -12px rgba(232, 89, 12, .5);

  --font: "Tajawal", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --topbar-h: 68px;
  color-scheme: dark;
}

html { overflow-x: clip; background: var(--bg); }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  color: var(--text); background: var(--bg);
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(245, 165, 36, .07), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(232, 89, 12, .05), transparent 60%);
  background-attachment: fixed; overflow-x: clip;
}
a { color: var(--brand); }
::selection { background: rgba(245, 165, 36, .35); color: #fff; }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -.01em; }
.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.ltr-in { direction: ltr; text-align: right; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.text-2 { color: var(--text-2); }
.t-saffron { color: var(--saffron); } .t-ember { color: var(--ember); } .t-mint { color: var(--mint); } .t-sky { color: var(--sky); } .t-violet { color: var(--violet); }
.center { text-align: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fw-5 { font-weight: 500; } .fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fs-18 { font-size: 18px; } .fs-24 { font-size: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 20px; } .mb-6 { margin-bottom: 28px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 20px; } .mt-6 { margin-top: 28px; }
.hstack { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vstack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 14px; } .gap-4 { gap: 20px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
[hidden] { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; transition: transform .12s ease, background .15s, border-color .15s, box-shadow .2s, color .15s;
  white-space: nowrap; text-decoration: none; color: var(--text); background: var(--surface-2);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--saffron); color: #1a1206; box-shadow: 0 8px 24px -10px rgba(245, 165, 36, .7); }
.btn-primary:hover { background: #ffb53d; box-shadow: var(--glow); color: #1a1206; }
.btn-ember { background: var(--ember); color: #fff; }
.btn-ember:hover { background: #f46a1f; box-shadow: var(--glow-ember); }
.btn-mint { background: var(--mint); color: #062317; }
.btn-mint:hover { background: #4be3ab; }
.btn-outline { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-outline:hover { border-color: var(--saffron); color: var(--saffron); }
.btn-ghost { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-ghost.danger, .btn.danger { color: #ff8a5c; }
.btn-dark { background: #0b0b0c; border-color: var(--line-2); }
.btn-sm { min-height: 34px; padding: 6px 13px; font-size: 13px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 16px; }
.btn-xl { min-height: 64px; padding: 14px 28px; font-size: 18px; border-radius: 20px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); cursor: pointer; transition: .15s;
}
.btn-icon:hover { color: var(--saffron); border-color: rgba(245, 165, 36, .4); }
.is-locked { opacity: .45; cursor: not-allowed !important; filter: grayscale(.4); }

/* ------------------------------------------------------------------ Top bar */
.topbar {
  position: sticky; top: 0; z-index: 60; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: rgba(15, 15, 16, .82); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.tb-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex-shrink: 0; }
.tb-mark {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #1a1206;
  background: radial-gradient(circle at 30% 20%, #ffd27a, var(--saffron) 45%, var(--ember)); box-shadow: 0 8px 22px -8px rgba(245, 165, 36, .8);
}
.tb-mark svg { width: 24px; height: 24px; }
.tb-name { font-size: 22px; font-weight: 800; line-height: 1; display: flex; flex-direction: column; gap: 4px; }
.tb-name small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.branch-pill {
  display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.branch-pill:hover { border-color: rgba(245, 165, 36, .5); }
.branch-pill svg { width: 15px; height: 15px; color: var(--muted); }
.branch-pill.locked { cursor: default; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
.dot.live, .live-dot { background: var(--mint); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.tb-search {
  flex: 1 1 auto; max-width: 460px; min-width: 0; margin-inline-start: auto; display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.tb-search:focus-within { border-color: rgba(245, 165, 36, .5); box-shadow: 0 0 0 4px rgba(245, 165, 36, .1); }
.tb-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 14px; }
.tb-search input::placeholder { color: var(--faint); }
.tb-search kbd { font: inherit; font-size: 11px; color: var(--faint); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; }
.tb-spacer { flex: 1; }
.tb-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tb-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; padding-inline: 6px; }
.tb-clock b { font-size: 20px; font-weight: 800; color: var(--saffron); letter-spacing: .02em; direction: ltr; }
.tb-clock small { font-size: 11px; color: var(--muted); }
.tb-btn { position: relative; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); cursor: pointer; }
.tb-btn:hover { color: var(--saffron); }
.dot-count { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--ember); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.user-btn { display: flex; align-items: center; gap: 9px; background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; padding: 0; text-align: start; }
.user-btn .meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-btn .meta b { font-size: 13.5px; } .user-btn .meta small { font-size: 11.5px; color: var(--muted); }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 80; width: 300px; max-width: calc(100vw - 24px);
  background: #1d1d20; border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .16s ease;
}
.tb-branch .dropdown-menu { inset-inline-end: auto; inset-inline-start: 0; width: 260px; }
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown-head small { display: block; color: var(--muted); font-size: 12px; }
.user-head { justify-content: flex-start; }
.dropdown-menu .item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 0; background: none;
  color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500; text-align: start; cursor: pointer; text-decoration: none;
}
.dropdown-menu .item:hover, .dropdown-menu .item.active { background: var(--surface-2); color: var(--text); }
.dropdown-menu .item.danger { color: #ff8a5c; }
.br-opt span:not(.dot) { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.br-opt small { color: var(--muted); font-size: 11.5px; }
.br-opt svg { color: var(--saffron); }
.notif-menu { width: 360px; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 11px; border-radius: 14px; color: var(--text); text-decoration: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item b { font-size: 14px; display: block; }
.notif-item p { margin: 2px 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.notif-item small { color: var(--faint); font-size: 11.5px; }
.notif-item.unread b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--saffron); margin-inline-start: 7px; vertical-align: middle; }
.n-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.n-saffron { background: var(--saffron-soft); color: var(--saffron); } .n-ember { background: var(--ember-soft); color: #ff7a3d; } .n-mint { background: var(--mint-soft); color: var(--mint); } .n-sky { background: var(--sky-soft); color: var(--sky); } .n-violet { background: var(--violet-soft); color: var(--violet); }
.dd-empty { padding: 24px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------------ Tile navigation */
.tilebar { position: sticky; top: var(--topbar-h); z-index: 50; background: linear-gradient(var(--bg) 70%, rgba(15, 15, 16, 0)); padding: 12px 22px 10px; }
.tilebar-in { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; scroll-snap-type: x proximity; }
.tilebar-in::-webkit-scrollbar { display: none; }
.navtile {
  position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; min-width: 128px; padding: 10px 16px 10px 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); text-decoration: none; font-weight: 700; font-size: 14px; scroll-snap-align: start;
  transition: background .15s, border-color .15s, color .15s, transform .12s;
}
.navtile:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.nt-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: .15s; }
.nt-ic svg { width: 19px; height: 19px; }
.navtile.active { background: linear-gradient(180deg, rgba(245, 165, 36, .16), rgba(245, 165, 36, .06)); border-color: rgba(245, 165, 36, .45); color: var(--text); box-shadow: 0 10px 30px -14px rgba(245, 165, 36, .6); }
.navtile.active .nt-ic { background: var(--saffron); color: #1a1206; }
.nt-label { white-space: nowrap; }
.nt-count { font-style: normal; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--ember); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; margin-inline-start: auto; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Content & page head */
.content { max-width: 1480px; margin: 0 auto; padding: 8px 22px 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; }
.ph-text { min-width: 0; }
.ph-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.page-head h1 { font-size: clamp(24px, 3vw, 34px); margin: 4px 0 0; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ph-actions > [data-ph-actions] { display: contents; }
.app-foot { max-width: 1480px; margin: 0 auto; padding: 18px 22px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--faint); font-size: 12.5px; border-top: 1px solid var(--line); }
.app-foot a { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.app-foot a:hover { color: var(--saffron); }
.app-foot img { width: 18px; height: 18px; object-fit: contain; filter: grayscale(1) brightness(1.6); }
.af-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; }
.af-brand svg { width: 16px; height: 16px; color: var(--saffron); }
.app-foot .sep { opacity: .5; }

/* Layout variants: data-layout="full" (KDS) / "pos" */
.layout-full .tilebar, .layout-full .app-foot, .layout-full .page-head { display: none; }
.layout-full .content { max-width: none; padding: 14px 16px 18px; }
.layout-pos .app-foot, .layout-pos .page-head { display: none; }
.layout-pos .content { max-width: none; padding: 4px 16px 16px; }
.layout-pos .tilebar { padding-block: 8px; }

/* ------------------------------------------------------------------ Grid systems */
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.bento > * { min-width: 0; grid-column: span 12; }
.bento > .c-3 { grid-column: span 3; } .bento > .c-4 { grid-column: span 4; } .bento > .c-5 { grid-column: span 5; } .bento > .c-6 { grid-column: span 6; }
.bento > .c-7 { grid-column: span 7; } .bento > .c-8 { grid-column: span 8; } .bento > .c-9 { grid-column: span 9; } .bento > .c-12 { grid-column: span 12; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-grid > * { min-width: 0; }

/* ------------------------------------------------------------------ Tiles (cards) */
.tile, .card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; min-width: 0; box-shadow: var(--shadow-sm);
}
.tile-2 { background: var(--surface-2); }
.tile-flat { padding: 0; overflow: hidden; }
.tile-glow { border-color: rgba(245, 165, 36, .35); box-shadow: var(--glow); }
.tile-glow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(500px 160px at 90% 0%, rgba(245, 165, 36, .12), transparent 70%); }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; position: relative; }
.tile-head h3 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 9px; }
.tile-head h3 svg { color: var(--saffron); width: 19px; height: 19px; }
.tile-head p, .tile-head small { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.tile-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tile-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section-title { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .02em; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chart-box { position: relative; height: 280px; min-width: 0; }
.chart-box.sm { height: 200px; } .chart-box.lg { height: 340px; }

/* ------------------------------------------------------------------ KPI */
.kpi {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; overflow: hidden; min-width: 0;
}
.kpi::after { content: ""; position: absolute; inset-inline-end: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, var(--k-soft, rgba(245, 165, 36, .18)), transparent 70%); pointer-events: none; }
a.kpi:hover { border-color: var(--line-2); transform: translateY(-1px); }
.kpi-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kpi-ic { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: var(--k-soft, var(--saffron-soft)); color: var(--k, var(--saffron)); flex-shrink: 0; }
.kpi-label { font-size: 13.5px; color: var(--muted); font-weight: 500; flex: 1; min-width: 0; }
.kpi-value { font-size: clamp(26px, 2.6vw, 36px); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value small { font-size: .45em; font-weight: 700; color: var(--muted); margin-inline-start: 4px; letter-spacing: 0; }
.kpi-foot { font-size: 12.5px; color: var(--muted); }
.kpi-spark { height: 32px; margin-top: -2px; } .kpi-spark svg { width: 100%; height: 100%; display: block; }
.k-saffron { --k: var(--saffron); --k-soft: var(--saffron-soft); }
.k-ember { --k: #ff7a3d; --k-soft: var(--ember-soft); }
.k-mint { --k: var(--mint); --k-soft: var(--mint-soft); }
.k-sky { --k: var(--sky); --k-soft: var(--sky-soft); }
.k-violet { --k: var(--violet); --k-soft: var(--violet-soft); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; direction: ltr; }
.delta svg { width: 13px; height: 13px; }
.delta.up { background: var(--mint-soft); color: var(--mint); }
.delta.down { background: var(--ember-soft); color: #ff7a3d; }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat small { color: var(--muted); font-size: 12.5px; }
.stat b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.big-num { font-size: clamp(34px, 4.4vw, 56px); font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Chips & badges */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); line-height: 1.4;
}
.chip svg { width: 14px; height: 14px; }
.chip .dot { width: 7px; height: 7px; }
.chip-saffron { color: var(--saffron); background: var(--saffron-soft); border-color: rgba(245, 165, 36, .2); }
.chip-ember { color: #ff7a3d; background: var(--ember-soft); border-color: rgba(232, 89, 12, .25); }
.chip-mint { color: var(--mint); background: var(--mint-soft); border-color: rgba(52, 211, 153, .2); }
.chip-sky { color: var(--sky); background: var(--sky-soft); border-color: rgba(96, 165, 250, .2); }
.chip-violet { color: var(--violet); background: var(--violet-soft); border-color: rgba(167, 139, 250, .22); }
.chip-rose { color: var(--rose); background: var(--rose-soft); border-color: rgba(251, 113, 133, .2); }
.chip-muted { color: var(--muted); }
button.chip { cursor: pointer; font-family: inherit; }
button.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.is-on, button.chip.active { background: var(--saffron); color: #1a1206; border-color: var(--saffron); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.badge .dot { width: 6px; height: 6px; }
.b-new { color: var(--sky); background: var(--sky-soft); border-color: transparent; }
.b-preparing { color: var(--saffron); background: var(--saffron-soft); border-color: transparent; }
.b-ready { color: var(--mint); background: var(--mint-soft); border-color: transparent; }
.b-ready .dot { animation: pulse 1.6s infinite; }
.b-served { color: var(--violet); background: var(--violet-soft); border-color: transparent; }
.b-paid { color: #8fd9b6; background: rgba(52, 211, 153, .07); border-color: rgba(52, 211, 153, .12); }
.b-cancelled { color: #ff7a3d; background: var(--ember-soft); border-color: transparent; text-decoration: line-through; text-decoration-thickness: 1px; }
.badge-success { color: var(--mint); background: var(--mint-soft); } .badge-warning { color: var(--saffron); background: var(--saffron-soft); }
.badge-danger { color: #ff7a3d; background: var(--ember-soft); } .badge-info { color: var(--sky); background: var(--sky-soft); } .badge-brand { color: var(--saffron); background: var(--saffron-soft); }
.type-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.type-tag svg { width: 15px; height: 15px; color: var(--muted); }
.type-tag.t-qr svg { color: var(--saffron); } .type-tag.t-delivery svg { color: var(--sky); } .type-tag.t-takeaway svg { color: var(--violet); } .type-tag.t-dine svg { color: var(--mint); }

/* Progress bar */
.bar { display: block; height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 40px; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--saffron); }
.bar-mint > i { background: var(--mint); } .bar-ember > i { background: var(--ember); } .bar-sky > i { background: var(--sky); } .bar-violet > i { background: var(--violet); }

/* Avatars & person */
.avatar { width: 38px; height: 38px; border-radius: 13px; display: inline-grid; place-items: center; flex-shrink: 0; font-weight: 800; font-size: 14px; color: #141414; background: var(--av, var(--saffron)); }
.avatar-sm { width: 32px; height: 32px; border-radius: 11px; font-size: 12.5px; }
.avatar-lg { width: 48px; height: 48px; border-radius: 16px; font-size: 17px; }
.avatar-xl { width: 76px; height: 76px; border-radius: 24px; font-size: 26px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-t { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.person-t b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-t small { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------------ Tables as dark cards (.dtable) */
.table-wrap { width: 100%; overflow-x: auto; min-width: 0; }
.dtable { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: -8px; }
.dtable thead th { text-align: start; font-size: 12px; font-weight: 700; color: var(--faint); padding: 4px 14px 2px; white-space: nowrap; }
.dtable tbody td { background: var(--surface-2); padding: 13px 14px; font-size: 14px; vertical-align: middle; border-block: 1px solid var(--line); }
.dtable tbody td:first-child { border-start-start-radius: 16px; border-end-start-radius: 16px; border-inline-start: 1px solid var(--line); }
.dtable tbody td:last-child { border-start-end-radius: 16px; border-end-end-radius: 16px; border-inline-end: 1px solid var(--line); }
.dtable tbody tr { transition: transform .12s; }
.dtable tbody tr[data-href], .dtable tbody tr.clickable { cursor: pointer; }
.dtable tbody tr:hover td { background: var(--surface-3); }
.dtable tbody tr.is-hot td { border-color: rgba(232, 89, 12, .4); }
.dtable tbody tr.is-hot td:first-child { box-shadow: inset -3px 0 0 var(--ember); }
.dtable .actions { display: flex; gap: 6px; justify-content: flex-end; }
.dtable tr.empty-row td { background: transparent; border: 0; }
.dtable td.num, .dtable th.num { text-align: end; }
.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.pager button { min-width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font: inherit; font-weight: 700; cursor: pointer; }
.pager button.active { background: var(--saffron); color: #1a1206; border-color: var(--saffron); }
.pager span { color: var(--faint); align-self: center; }
/* simple row lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; color: var(--text); text-decoration: none; }
a.list-row:hover { background: var(--surface-3); }
.list-row small { display: block; color: var(--muted); font-size: 12.5px; }
.oline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: .15s; }
.oline:hover { background: var(--surface-3); border-color: var(--line-2); }
.ol-no { font-weight: 800; color: var(--saffron); font-size: 15px; min-width: 44px; }
.ol-main { min-width: 0; display: flex; flex-direction: column; }
.ol-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-main small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ol-end b { font-size: 14px; }

/* ------------------------------------------------------------------ Forms */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field .hint, .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg-2);
  color: var(--text); font: inherit; font-size: 14.5px; outline: 0; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(245, 165, 36, .6); box-shadow: 0 0 0 4px rgba(245, 165, 36, .1); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239a958c' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-left: 38px; }
.select option { background: #1d1d20; }
input[type="date"], input[type="time"] { color-scheme: dark; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.search { position: relative; display: flex; align-items: center; min-width: 0; }
.search svg { position: absolute; inset-inline-start: 14px; color: var(--faint); pointer-events: none; }
.search .input { padding-inline-start: 42px; border-radius: 999px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 240px; }
.toolbar .select { width: auto; min-width: 150px; border-radius: 999px; }
/* switch */
.switch { position: relative; display: inline-block; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; right: 3px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + span { background: var(--mint); border-color: var(--mint); }
.switch input:checked + span::before { right: 23px; background: #062317; }
.switch.ember input:checked + span { background: var(--ember); border-color: var(--ember); }
/* segmented */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; font-size: 13.5px; padding: 7px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--saffron); color: #1a1206; }
/* tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--saffron); border-bottom-color: var(--saffron); }
.tab-panel { display: none; } .tab-panel.active { display: block; }
/* stepper */
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface-3); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.stepper button:hover { background: var(--saffron); color: #1a1206; }
.stepper b { min-width: 30px; text-align: center; font-size: 17px; }
.stepper.sm button { width: 30px; height: 30px; } .stepper.sm b { min-width: 22px; font-size: 14px; }

/* ------------------------------------------------------------------ Modal */
body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(5, 5, 6, .66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.modal-backdrop.show { opacity: 1; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #1b1b1e; border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); transition: transform .2s ease; overflow: hidden; }
.modal-backdrop.show .modal { transform: none; }
.modal.sm { max-width: 420px; } .modal.md { max-width: 560px; } .modal.lg { max-width: 820px; } .modal.xl { max-width: 1080px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.mh-t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mh-t h3 { margin: 0; font-size: 18px; }
.mh-t small { color: var(--muted); font-size: 12.5px; display: block; }
.mh-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--saffron-soft); color: var(--saffron); flex-shrink: 0; }
.modal-body { padding: 20px; overflow-y: auto; min-height: 0; }
.modal-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .18); }
.modal.sheet { max-width: 520px; }
.sheet-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sheet-tiles .navtile { min-width: 0; }
.success-box { text-align: center; padding: 8px 4px; }
.success-mark { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: var(--mint); color: #062317; box-shadow: 0 0 0 10px var(--mint-soft); }
.success-mark svg { width: 36px; height: 36px; stroke-width: 3; }
.info-list { display: grid; gap: 1px; background: var(--line); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.info-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface-2); }
.info-list small { color: var(--muted); }
.info-list b { font-size: 14px; text-align: end; }
.totals { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.totals > div { display: flex; justify-content: space-between; color: var(--text-2); font-size: 14px; }
.totals .grand { padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--line-2); color: var(--text); font-size: 18px; font-weight: 800; }
.totals .grand b { color: var(--saffron); }
/* order modal */
.om-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.om-items { display: flex; flex-direction: column; gap: 8px; }
.om-line { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.om-line small { display: block; color: var(--muted); font-size: 12px; }
.om-line em { display: block; font-style: normal; color: var(--saffron); font-size: 12px; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.steps.cancelled { display: flex; align-items: center; gap: 10px; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--faint); font-size: 12px; }
.step b { font-size: 12px; font-weight: 700; }
.step small { font-size: 11px; min-height: 15px; }
.sd { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); position: relative; z-index: 1; }
.sd svg { width: 16px; height: 16px; }
.step::before { content: ""; position: absolute; top: 17px; right: 50%; width: 100%; height: 2px; background: var(--line-2); }
.step:first-child::before { display: none; }
.step.done { color: var(--text-2); } .step.done .sd { background: var(--mint); color: #062317; border-color: var(--mint); } .step.done::before { background: var(--mint); }
.step.now { color: var(--saffron); } .step.now .sd { background: var(--saffron); color: #1a1206; border-color: var(--saffron); box-shadow: 0 0 0 6px var(--saffron-soft); } .step.now::before { background: var(--mint); }
/* pay modal */
.pay-total { text-align: center; padding: 16px; border-radius: 20px; background: radial-gradient(400px 120px at 50% 0%, rgba(245, 165, 36, .16), transparent), var(--surface-2); border: 1px solid rgba(245, 165, 36, .25); margin-bottom: 16px; }
.pay-total small { display: block; color: var(--muted); }
.pay-total b { display: block; font-size: 38px; font-weight: 800; color: var(--saffron); line-height: 1.2; }
.pay-total span { font-size: 12.5px; }
.pay-methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pm { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; transition: .15s; }
.pm svg { width: 24px; height: 24px; }
.pm.active { border-color: var(--saffron); color: var(--text); background: var(--saffron-soft); box-shadow: var(--glow); }
.pm.active svg { color: var(--saffron); }
.cash-box { margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.quick-cash { display: flex; gap: 8px; flex-wrap: wrap; }
.change { font-size: 14px; color: var(--text-2); } .change b { color: var(--mint); font-size: 18px; }
.loy-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.loy-row .input { flex: 1 1 180px; }
.loy-out { font-size: 13px; color: var(--saffron); }
/* modifiers picker */
.mp-hero { position: relative; display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.mp-hero h3 { margin: 0 0 4px; font-size: 20px; }
.mp-hero p { margin: 0 0 6px; font-size: 13.5px; }
.mp-base { color: var(--saffron); font-size: 17px; }
.mp-x { position: absolute; top: -4px; inset-inline-end: -4px; }
.mp-group { margin-top: 14px; }
.mp-gh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.mp-gh small { color: var(--muted); font-size: 12px; }
.mp-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.opt small { color: var(--saffron); font-size: 12px; }
.opt.active { background: var(--saffron-soft); border-color: var(--saffron); color: var(--text); }

/* ------------------------------------------------------------------ Toast */
.toast-wrap { position: fixed; z-index: 300; bottom: 22px; left: 22px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 18px; background: #222226; border: 1px solid var(--line-2); color: var(--text); box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .25s ease; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.t-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--mint); color: #062317; }
.t-icon svg { width: 17px; height: 17px; stroke-width: 3; }
.toast.error .t-icon { background: var(--ember); color: #fff; }
.toast.warning .t-icon { background: var(--saffron); color: #1a1206; }
.toast.info .t-icon { background: var(--sky); color: #06172d; }
.toast.order { border-color: rgba(245, 165, 36, .5); box-shadow: var(--glow); }
.toast.order .t-icon { background: var(--saffron); color: #1a1206; animation: ring 1s ease 2; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }

/* ------------------------------------------------------------------ Empty */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 16px; color: var(--muted); }
.empty-ic { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); color: var(--saffron); margin-bottom: 6px; }
.empty-ic svg { width: 28px; height: 28px; }
.empty b { color: var(--text); font-size: 15px; }
.empty small { font-size: 13px; }

/* ------------------------------------------------------------------ Dishes (menu / POS) */
.dish-img { position: relative; display: block; width: 52px; height: 52px; border-radius: 14px; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg, #2f2a22, #1c1a17); }
.dish-img::before { content: attr(data-emoji); position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; }
.dish-img img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.dish-img.sm { width: 40px; height: 40px; border-radius: 12px; } .dish-img.sm::before { font-size: 19px; }
.dish-img.lg { width: 96px; height: 96px; border-radius: 22px; } .dish-img.lg::before { font-size: 42px; }
.dish-img.fill { width: 100%; height: 100%; border-radius: 0; } .dish-img.fill::before { font-size: 44px; }
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.dish {
  position: relative; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-align: start; font: inherit; cursor: pointer; padding: 0; transition: transform .12s, border-color .15s, box-shadow .2s; min-width: 0;
}
.dish:hover { border-color: rgba(245, 165, 36, .45); transform: translateY(-2px); box-shadow: 0 16px 30px -18px rgba(245, 165, 36, .5); }
.dish:active { transform: scale(.98); }
.dish-photo { position: relative; aspect-ratio: 4 / 3; background: #201d19; }
.dish-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, .55)); }
.dish-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dish-body b { font-size: 14px; line-height: 1.35; }
.dish-price { color: var(--saffron); font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.dish-tag { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 1; }
.dish.is-off { opacity: .45; filter: grayscale(.8); }
.dish.is-off::after { content: "نفد"; position: absolute; top: 10px; inset-inline-end: 10px; background: var(--ember); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.cat-rail { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.cat-rail::-webkit-scrollbar { display: none; }
.cat-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.cat-btn.active { background: var(--saffron); color: #1a1206; border-color: var(--saffron); }
.cat-btn em { font-style: normal; font-size: 12px; opacity: .7; }
/* cart / ticket builder (POS) */
.cart { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); min-width: 0; overflow: hidden; }
.cart-head { padding: 16px; border-bottom: 1px solid var(--line); }
.cart-lines { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.cart-line small { color: var(--muted); font-size: 12px; display: block; }
.cart-foot { padding: 14px 16px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .15); }

/* ------------------------------------------------------------------ Floor plan */
.floor { display: grid; gap: 16px; }
.floor-zone { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; position: relative; overflow: hidden; }
.floor-zone > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 14.5px; }
.floor-zone.z-terrace { background: linear-gradient(135deg, rgba(52, 211, 153, .05), transparent 60%), var(--surface); }
.floor-zone.z-family { background: linear-gradient(135deg, rgba(167, 139, 250, .05), transparent 60%), var(--surface); }
.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.tbl {
  --tc: var(--faint); --tbg: var(--surface-2);
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 112px; padding: 12px 8px;
  border-radius: 20px; background: var(--tbg); border: 1.5px solid color-mix(in srgb, var(--tc) 45%, transparent); color: var(--text); font: inherit; cursor: pointer; transition: transform .12s, box-shadow .2s;
}
.tbl:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px var(--tc); }
.tbl.s-round { border-radius: 999px; aspect-ratio: 1; min-height: 0; }
.tbl.s-long { grid-column: span 2; }
.tbl-no { font-size: 28px; font-weight: 800; line-height: 1; color: var(--tc); }
.tbl-seats { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.tbl-seats svg { width: 13px; height: 13px; }
.tbl-timer { font-size: 13px; font-weight: 800; color: var(--text); }
.tbl-amt { font-size: 12px; color: var(--muted); }
.tbl-sub { font-size: 12px; color: var(--muted); }
.tbl-ready { position: absolute; top: 8px; inset-inline-end: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: #062317; animation: pulse 1.6s infinite; }
.tbl-ready svg { width: 14px; height: 14px; }
.tbl.t-free { --tc: #6a665f; border-style: dashed; }
.tbl.t-occupied { --tc: var(--saffron); --tbg: linear-gradient(180deg, rgba(245, 165, 36, .14), rgba(245, 165, 36, .04)); }
.tbl.t-bill { --tc: #ff7a3d; --tbg: linear-gradient(180deg, rgba(232, 89, 12, .2), rgba(232, 89, 12, .05)); box-shadow: 0 0 0 1px rgba(232, 89, 12, .35), 0 12px 30px -14px rgba(232, 89, 12, .6); }
.tbl.t-reserved { --tc: var(--sky); --tbg: rgba(96, 165, 250, .08); }
.tbl.t-cleaning { --tc: var(--violet); --tbg: rgba(167, 139, 250, .08); }
.tbl.selected { outline: 3px solid var(--saffron); outline-offset: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid; }
.lg-free i { border-color: #6a665f; border-style: dashed; } .lg-occupied i { border-color: var(--saffron); background: var(--saffron-soft); }
.lg-bill i { border-color: var(--ember); background: var(--ember-soft); } .lg-reserved i { border-color: var(--sky); background: var(--sky-soft); } .lg-cleaning i { border-color: var(--violet); background: var(--violet-soft); }

/* ------------------------------------------------------------------ KDS board */
.kds-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.kds-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(290px, 1fr); gap: 14px; overflow-x: auto; align-items: start; padding-bottom: 10px; min-height: calc(100vh - 170px); }
.kds-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; background: rgba(255, 255, 255, .02); border: 1px solid var(--line); border-radius: 22px; padding: 12px; min-height: 100%; }
.kds-col > header { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 6px; font-weight: 800; }
.kds-col > header .cnt { min-width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-variant-numeric: tabular-nums; }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; align-items: start; }
.ticket { --lv: var(--mint); position: relative; display: flex; flex-direction: column; background: #19191b; border: 1px solid var(--line-2); border-radius: 20px; overflow: hidden; border-top: 5px solid var(--lv); min-width: 0; }
.ticket.lv-ok { --lv: var(--mint); }
.ticket.lv-warn { --lv: var(--saffron); box-shadow: 0 12px 30px -18px rgba(245, 165, 36, .7); }
.ticket.lv-late { --lv: #ff5a1f; box-shadow: 0 0 0 1px rgba(232, 89, 12, .5), 0 16px 36px -16px rgba(232, 89, 12, .8); }
.ticket.lv-late .tk-timer { animation: blink 1.2s steps(2, start) infinite; }
.ticket.lv-ready { --lv: var(--sky); opacity: .85; }
.ticket.is-new { animation: popIn .5s ease; }
@keyframes popIn { 0% { transform: scale(.94); box-shadow: 0 0 0 0 rgba(245, 165, 36, .8); } 100% { transform: none; } }
@keyframes blink { to { opacity: .45; } }
.tk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px 6px; }
.tk-id { display: flex; flex-direction: column; min-width: 0; }
.tk-id > b { font-size: 24px; font-weight: 800; line-height: 1.1; }
.tk-type { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); font-weight: 700; }
.tk-type svg { width: 14px; height: 14px; }
.tk-timer { display: flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 12px; background: color-mix(in srgb, var(--lv) 18%, transparent); color: var(--lv); }
.tk-timer b { font-size: 20px; font-weight: 800; direction: ltr; }
.tk-timer svg { width: 16px; height: 16px; }
.tk-meta { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 14px 8px; font-size: 12px; color: var(--muted); align-items: center; }
.tk-meta span { display: inline-flex; align-items: center; gap: 4px; }
.tk-meta svg { width: 13px; height: 13px; }
.tk-items { list-style: none; margin: 0; padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 4px; border-top: 1px dashed var(--line-2); }
.tk-items li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.tk-items li:hover { background: var(--surface-2); }
.tk-items .qty { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-size: 15px; }
.tk-items span { font-weight: 700; font-size: 15px; }
.tk-items small { display: block; color: var(--saffron); font-size: 12.5px; }
.tk-items em { display: flex; align-items: center; gap: 4px; font-style: normal; color: #ff8a5c; font-size: 12.5px; }
.tk-items em svg { width: 13px; height: 13px; }
.tk-items .st { font-size: 11px; color: var(--faint); white-space: nowrap; }
.tk-items li.done { opacity: .45; }
.tk-items li.done span { text-decoration: line-through; }
.tk-items li.done .qty { background: var(--mint); color: #062317; }
.tk-note { margin: 0 12px 8px; padding: 8px 10px; border-radius: 12px; background: var(--saffron-soft); color: var(--saffron); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.tk-note svg { width: 15px; height: 15px; }
.tk-foot { padding: 10px 12px 12px; margin-top: auto; }

/* ------------------------------------------------------------------ Ticker / live feed */
.ticker { display: flex; flex-direction: column; gap: 8px; max-height: 430px; overflow-y: auto; scrollbar-width: thin; }
.ticker .oline.is-fresh { animation: popIn .6s ease; border-color: rgba(245, 165, 36, .5); }
.live-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; color: var(--mint); padding: 4px 10px; border-radius: 999px; background: var(--mint-soft); }

/* QR (pseudo) */
.qr { display: grid; grid-template-columns: repeat(var(--n, 25), 1fr); width: 132px; aspect-ratio: 1; background: #fff; padding: 8px; border-radius: 10px; }
.qr i { display: block; } .qr i.on { background: #111; }

/* ------------------------------------------------------------------ Receipt (paper) */
.receipt-wrap { display: flex; justify-content: center; }
.receipt { width: 100%; max-width: 330px; background: #fbf8f1; color: #1b1a17; border-radius: 6px; padding: 18px 16px 22px; font-size: 13px; line-height: 1.55; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .8); position: relative;
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 14px 100% repeat-x; mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 14px 100% repeat-x; padding-bottom: 28px; }
.rc-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.rc-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #1b1a17; color: #f5a524; margin-bottom: 4px; }
.rc-mark svg { width: 22px; height: 22px; }
.rc-head b { font-size: 16px; }
.rc-head small { font-size: 11.5px; color: #5b574f; }
.rc-title { margin: 12px 0 8px; text-align: center; font-weight: 800; padding: 6px; border-block: 1px dashed #b9b2a4; }
.rc-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12px; }
.rc-meta span { color: #6b665c; } .rc-meta b { text-align: end; font-weight: 700; }
.rc-items { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
.rc-items th { text-align: start; font-size: 11.5px; color: #6b665c; border-bottom: 1px dashed #b9b2a4; padding: 4px 0; }
.rc-items th:nth-child(n+2), .rc-items td:nth-child(n+2) { text-align: end; }
.rc-items td { padding: 5px 0; vertical-align: top; border-bottom: 1px dotted #ddd6c8; }
.rc-items td small { display: block; color: #7a7468; font-size: 11px; }
.rc-tot > div { display: flex; justify-content: space-between; font-size: 12.5px; }
.rc-tot .grand { font-size: 16px; font-weight: 800; border-top: 1px dashed #b9b2a4; margin-top: 6px; padding-top: 6px; }
.rc-qr { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 12px; }
.rc-qr .qr { width: 120px; padding: 0; }
.rc-qr small { font-size: 10.5px; color: #7a7468; }
.rc-foot { text-align: center; margin-top: 10px; font-size: 11.5px; color: #5b574f; }

/* ------------------------------------------------------------------ Phone dock */
.dock { display: none; }
@media (max-width: 760px) {
  :root { --topbar-h: 60px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .tb-name small, .tb-search, .user-btn .meta, .tb-clock small { display: none; }
  .tb-name { font-size: 19px; }
  .tb-mark { width: 38px; height: 38px; }
  .tb-clock b { font-size: 16px; }
  .branch-pill { height: 36px; padding: 0 10px; font-size: 13px; max-width: 150px; }
  .bp-name { overflow: hidden; text-overflow: ellipsis; }
  .tb-right { margin-inline-start: auto; gap: 6px; }
  .tb-btn { width: 38px; height: 38px; }
  .tilebar { display: none; }
  .content { padding: 4px 14px 24px; }
  .page-head { margin: 14px 0 16px; }
  .app-foot { padding-bottom: 100px; }
  .dock {
    display: flex; position: fixed; z-index: 70; bottom: 10px; left: 10px; right: 10px; justify-content: space-around; gap: 4px; padding: 7px;
    background: rgba(26, 26, 28, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow-lg);
  }
  .dock a, .dock button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 16px; color: var(--muted); text-decoration: none; font: inherit; font-size: 11px; font-weight: 700; background: none; border: 0; cursor: pointer; }
  .dk-ic { width: 40px; height: 32px; border-radius: 12px; display: grid; place-items: center; }
  .dk-ic svg { width: 22px; height: 22px; }
  .dock a.active { color: var(--text); }
  .dock a.active .dk-ic { background: var(--saffron); color: #1a1206; }
  .dock small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  body.has-dock { padding-bottom: 86px; }
  body.has-dock .toast-wrap { bottom: 96px; left: 12px; right: 12px; }
  .layout-full .content, .layout-pos .content { padding: 8px 10px 14px; }
}

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1200px) {
  .bento > .c-3 { grid-column: span 6; }
  .bento > .c-4, .bento > .c-5, .bento > .c-7, .bento > .c-8, .bento > .c-9 { grid-column: span 12; }
  .bento > .c-6 { grid-column: span 6; }
  .cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .tb-clock { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .bento > .c-3, .bento > .c-6 { grid-column: span 12; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .om-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 521px) and (max-width: 760px) { .tb-clock { display: flex; } }
@media (max-width: 640px) {
  .cols-2, .cols-3, .cols-4, .cols-5, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; gap: 6px; }
  .kpi-value { font-size: 23px; }
  .kpi-ic { width: 32px; height: 32px; border-radius: 11px; }
  .kpi-label { font-size: 12.5px; }
  .kpi .delta { display: none; }
  .tile, .card { padding: 16px; border-radius: 20px; }
  .pay-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal { max-width: 100% !important; max-height: 92vh; border-radius: 24px 24px 0 0; }
  .steps { gap: 2px; } .step b { font-size: 10.5px; } .sd { width: 28px; height: 28px; } .step::before { top: 14px; }
  .floor-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
  .tbl { min-height: 96px; } .tbl-no { font-size: 24px; }
  .dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kds-board { grid-auto-columns: minmax(84vw, 1fr); }
  .kds-grid { grid-template-columns: minmax(0, 1fr); }
  /* dtable → stacked cards */
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable td { display: block; width: 100%; }
  .dtable { border-spacing: 0; margin-top: 0; }
  .dtable tbody tr { margin-bottom: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 8px 4px; }
  .dtable tbody td { background: none !important; border: 0 !important; border-radius: 0 !important; padding: 6px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: end; }
  .dtable tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 700; text-align: start; flex-shrink: 0; }
  .dtable tbody td:not([data-label])::before { display: none; }
  .dtable tbody td[data-label=""]::before { display: none; }
  .dtable tr.empty-row { background: none; border: 0; }
  .dtable .actions { justify-content: flex-start; }
  .toolbar .select { flex: 1 1 140px; }
}
@media (max-width: 520px) { .branch-pill { max-width: 140px; } }
@media (max-width: 400px) { .branch-pill { max-width: 112px; } .topbar { gap: 6px; } }

/* ------------------------------------------------------------------ Print */
#printArea { display: none; }
@media print {
  body { background: #fff !important; color: #000; padding: 0 !important; }
  .topbar, .tilebar, .dock, .app-foot, .toast-wrap, .modal-backdrop, .ph-actions, .no-print { display: none !important; }
  .content { padding: 0 !important; max-width: none; }
  .tile, .card, .kpi { background: #fff !important; color: #000; border-color: #ccc; box-shadow: none; }
  body.print-receipt > *:not(#printArea) { display: none !important; }
  body.print-receipt #printArea { display: block !important; }
  #printArea .receipt { box-shadow: none; max-width: 80mm; margin: 0 auto; -webkit-mask: none; mask: none; background: #fff; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* KDS top bar wraps on narrow screens instead of widening the page */
.kds-bar { flex-wrap: wrap; row-gap: 8px; min-width: 0; }
.kds-bar > * { min-width: 0; }

/* ------------------------------------------------------------------ Product logo (image on light tile — dark UI) */
.tb-mark.has-logo { background: #fff8ec; border-radius: 10px; padding: 4px; box-shadow: 0 8px 22px -10px rgba(245, 165, 36, .7); }
.tb-mark .brand-logo { width: 100%; height: 100%; object-fit: contain; display: block; }
.af-logo { width: 22px; height: 22px; padding: 2px; border-radius: 6px; background: #fff8ec; display: inline-grid; place-items: center; flex-shrink: 0; }
.af-logo .brand-logo { width: 100%; height: 100%; object-fit: contain; display: block; }
