/* Saffron POS: a working restaurant POS demo (concept project, sample data only). */
:root {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #faf8f4; --border: #e9e4da; --border-2: #ddd5c7;
  --text: #1c1917; --text-2: #44403c; --muted: #78716c; --faint: #a8a29e;
  --primary: #ea580c; --primary-2: #c2410c; --primary-soft: #fff1e7; --primary-ring: rgba(234, 88, 12, .22);
  --green: #15803d; --green-soft: #e8f7ee; --amber: #b45309; --amber-soft: #fef3dc; --red: #dc2626; --red-soft: #fdecec;
  --blue: #1d4ed8; --blue-soft: #e8effe; --violet: #6d28d9; --violet-soft: #f1eafe;
  --side: #191614; --side-2: #26211d; --side-text: #d3ccc4; --side-muted: #8d857d;
  --chair: #d9d1c3; --floor: #fbfaf6;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, .06);
  --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 8px 24px rgba(28, 25, 23, .06);
  --shadow-lg: 0 30px 80px rgba(28, 25, 23, .22);
  --r: 16px; --r-sm: 11px;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Display", Roboto, Arial, sans-serif;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e0d0c; --surface: #171513; --surface-2: #1d1a17; --border: #2a2622; --border-2: #37312b;
  --text: #f4f1ec; --text-2: #d6d0c8; --muted: #a39b92; --faint: #6f6860;
  --primary: #f97316; --primary-2: #fb923c; --primary-soft: rgba(249, 115, 22, .15); --primary-ring: rgba(249, 115, 22, .32);
  --green: #4ade80; --green-soft: rgba(74, 222, 128, .12); --amber: #fbbf24; --amber-soft: rgba(251, 191, 36, .13);
  --red: #f87171; --red-soft: rgba(248, 113, 113, .14); --blue: #93b4ff; --blue-soft: rgba(96, 140, 255, .16);
  --violet: #c4a6ff; --violet-soft: rgba(167, 139, 250, .16);
  --side: #0a0908; --side-2: #1a1613; --chair: #3a342e; --floor: #131110;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
.i { flex: none; display: block; }
.emoji { font-family: var(--emoji); line-height: 1; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; border-radius: 8px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 20px 14px 16px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand svg { width: 38px; height: 38px; }
.brand b { display: block; color: #fff; font: 700 17px/1.1 var(--display); letter-spacing: -.01em; }
.brand small { color: var(--side-muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-i { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--side-text); font-weight: 600; font-size: 14px; position: relative; }
.nav-i:hover { background: var(--side-2); color: #fff; }
.nav-i.on { background: linear-gradient(135deg, rgba(249, 115, 22, .22), rgba(249, 115, 22, .08)); color: #fff; }
.nav-i.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: #fb923c; }
.nav-i.on .i { color: #fb923c; }
.nb { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: #f97316; color: #fff; font: 700 11px/20px var(--font); text-align: center; }
.nb.warn { background: #3a2a1a; color: #fbbf24; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.shift { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--side-muted); padding: 10px 12px; border-radius: 11px; background: var(--side-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .16); flex: none; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.me b { display: block; color: #fff; font-size: 13.5px; }
.me small { color: var(--side-muted); font-size: 12px; }
.me .icon-btn { margin-left: auto; color: var(--side-muted); border-color: transparent; background: transparent; }
.me .icon-btn:hover { color: #fff; background: var(--side-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--font); color: #fff; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.top-brand { display: none; align-items: center; gap: 10px; font: 700 16px var(--display); }
.top-brand svg { width: 30px; height: 30px; }
.search-trigger { flex: 1; max-width: 460px; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); text-align: left; box-shadow: var(--shadow-sm); }
.search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 600 11px var(--font); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.clock { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; padding: 0 6px; }
.clock b { color: var(--text); font-weight: 700; }
.icon-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); }
.icon-btn:hover { border-color: var(--border-2); color: var(--text); }
.dot-badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--red); color: #fff; font: 700 10.5px/19px var(--font); font-style: normal; text-align: center; padding: 0 5px; border: 2px solid var(--bg); }
.page { padding: 26px 28px 48px; min-width: 0; }
.tabbar { display: none; }

/* ---------- common ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph h1 { font: 700 26px/1.15 var(--display); letter-spacing: -.02em; }
.ph p { color: var(--muted); margin-top: 6px; }
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-h h3 { font: 700 15.5px var(--display); }
.card-h small { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 18px; }
.btn { height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 650; white-space: nowrap; box-shadow: var(--shadow-sm); }
.btn:hover { border-color: var(--border-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #f97316, #ea580c); border-color: #dc5409; color: #fff; box-shadow: 0 8px 18px rgba(234, 88, 12, .28), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { border-color: #c2410c; background: linear-gradient(180deg, #fb7f24, #e2540b); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-2); box-shadow: none; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; box-shadow: none; }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn-lg { height: 52px; font-size: 15.5px; border-radius: 14px; }
.w100 { width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13px; }
.chip:hover { border-color: var(--border-2); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip b { font-weight: 700; opacity: .65; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; }
.seg button { height: 34px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 650; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.input, select.input, textarea.input { height: 42px; width: 100%; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); padding: 0 14px; outline: none; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 650; font-size: 13px; color: var(--text-2); }
.search { position: relative; }
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 40px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-green { background: var(--green-soft); color: var(--green); }
.p-amber { background: var(--amber-soft); color: var(--amber); }
.p-red { background: var(--red-soft); color: var(--red); }
.p-blue { background: var(--blue-soft); color: var(--blue); }
.p-violet { background: var(--violet-soft); color: var(--violet); }
.p-gray { background: var(--surface-2); color: var(--muted); }
.veg { width: 14px; height: 14px; border: 1.6px solid var(--green); border-radius: 3px; display: inline-grid; place-items: center; flex: none; }
.veg::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.veg.non { border-color: #b91c1c; }
.veg.non::after { border-radius: 0; width: 0; height: 0; background: none; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid #b91c1c; }
.switch { position: relative; width: 42px; height: 24px; border-radius: 12px; background: var(--border-2); border: 0; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(18px); }
.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .emoji { font-size: 40px; }
.bar { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #fb923c, #ea580c); }
.bar.g > i { background: var(--green); } .bar.a > i { background: #f59e0b; } .bar.r > i { background: var(--red); }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t td.r, table.t th.r { text-align: right; }
.cell-main { font-weight: 650; }
.cell-sub { color: var(--muted); font-size: 12.5px; }

/* ---------- KPIs and charts ---------- */
.kpi { position: relative; overflow: hidden; }
.kpi .lbl { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 650; font-size: 13px; }
.kpi .lbl .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi .val { font: 750 28px/1.1 var(--display); letter-spacing: -.02em; margin-top: 14px; }
.kpi .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.delta { font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
.spark { width: 110px; height: 34px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 11px var(--font); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-wrap svg { width: 150px; height: 150px; flex: none; }
.mix { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.mix-row { display: flex; align-items: center; gap: 10px; }
.mix-row .sw { width: 10px; height: 10px; border-radius: 3px; }
.mix-row b { margin-left: auto; }
.top-dish { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.top-dish .tile { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); border: 1px solid var(--border); }
.top-dish .grow { flex: 1; min-width: 0; }
.top-dish .grow b { display: block; font-size: 13.5px; }
.kq { display: flex; flex-direction: column; gap: 14px; }
.kq-row { display: flex; align-items: center; gap: 12px; }
.kq-row .n { font: 750 22px var(--display); width: 36px; }
.kq-row .grow { flex: 1; }
.kq-row .grow span { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.res-mini { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.res-mini:last-child { border-bottom: 0; }
.time-badge { width: 58px; text-align: center; padding: 7px 0; border-radius: 10px; background: var(--primary-soft); color: var(--primary-2); font: 750 13px var(--font); flex: none; }
.time-badge small { display: block; font-size: 10.5px; font-weight: 650; opacity: .8; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 22px; align-items: start; }
.pos-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.pos-tools .search { flex: 1; min-width: 220px; }
.toggle-line { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 13px; color: var(--text-2); background: none; border: 0; padding: 0; }
.dishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-top: 16px; }
.dish { position: relative; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.dish:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.dish .tile { height: 104px; border-radius: 12px; display: grid; place-items: center; font-size: 52px; }
.dish .meta { display: flex; align-items: flex-start; gap: 7px; padding: 0 2px; }
.dish .meta b { font-size: 14px; line-height: 1.25; }
.dish .price { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 2px; }
.dish .price strong { font: 750 15px var(--display); }
.dish .add { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-2); }
.dish .hot { position: absolute; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #c2410c; font: 700 11px var(--font); box-shadow: var(--shadow-sm); }
.dish .inq { position: absolute; top: 14px; right: 14px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--primary); color: #fff; font: 750 12.5px/26px var(--font); text-align: center; box-shadow: 0 4px 10px rgba(234, 88, 12, .4); }
.dish.out { opacity: .5; }
.dish.out .tile { filter: grayscale(1); }
.dish.out .sold { position: absolute; top: 46px; left: 50%; transform: translateX(-50%) rotate(-8deg); background: var(--text); color: var(--bg); font: 750 12px var(--font); padding: 4px 10px; border-radius: 6px; }
.t-Starters { background: linear-gradient(135deg, #fff3d6, #ffe1b8); }
.t-Mains { background: linear-gradient(135deg, #ffe4d6, #ffc9b0); }
.t-Breads { background: linear-gradient(135deg, #f6ecd9, #ead8b8); }
.t-Desserts { background: linear-gradient(135deg, #ffe4ef, #fbcfe0); }
.t-Drinks { background: linear-gradient(135deg, #dcf5ef, #bfe9df); }
[data-theme="dark"] .t-Starters { background: linear-gradient(135deg, #3a2a12, #2a1f10); }
[data-theme="dark"] .t-Mains { background: linear-gradient(135deg, #3b2216, #2b1810); }
[data-theme="dark"] .t-Breads { background: linear-gradient(135deg, #342b1d, #261f15); }
[data-theme="dark"] .t-Desserts { background: linear-gradient(135deg, #3a1c2a, #2a141f); }
[data-theme="dark"] .t-Drinks { background: linear-gradient(135deg, #15322b, #10251f); }
.ticket { position: sticky; top: 90px; display: flex; flex-direction: column; max-height: calc(100vh - 112px); padding: 0; overflow: hidden; }
.ticket-h { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.ticket-h .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ticket-h h3 { font: 750 17px var(--display); }
.ticket-h .seg { width: 100%; }
.ticket-h .seg button { flex: 1; justify-content: center; }
.ticket-opts { display: grid; grid-template-columns: 1fr 132px; gap: 10px; }
.stepper { display: flex; align-items: center; justify-content: space-between; height: 42px; border: 1px solid var(--border); border-radius: 12px; padding: 0 5px; background: var(--surface); }
.stepper button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); }
.stepper b { font-size: 14px; }
.open-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); font-size: 12.5px; font-weight: 600; }
.lines { flex: 1; overflow-y: auto; padding: 6px 18px; min-height: 120px; }
.line { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.line:last-child { border-bottom: 0; }
.line .tile { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; }
.line b { display: block; font-size: 13.5px; line-height: 1.25; }
.line .sub { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 3px; }
.line .sub button { border: 0; background: none; padding: 0; color: var(--primary-2); font-weight: 650; font-size: 12px; }
.line .note { color: var(--amber); font-style: italic; }
.line .qty { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.line .qty .stepper { height: 32px; gap: 6px; padding: 0 3px; border-radius: 10px; }
.line .qty .stepper button { width: 24px; height: 24px; }
.line .qty strong { font-size: 13.5px; }
.ticket-f { border-top: 1px solid var(--border); padding: 14px 18px 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.sum { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13.5px; }
.sum.total { font: 750 20px var(--display); color: var(--text); padding-top: 6px; border-top: 1px dashed var(--border-2); margin-top: 2px; }
.disc-chips { display: flex; gap: 6px; align-items: center; }
.disc-chips span { font-size: 12.5px; color: var(--muted); font-weight: 650; margin-right: auto; }
.disc-chips button { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 12px; color: var(--text-2); }
.disc-chips button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ticket-btns { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; margin-top: 4px; }
.ticket-toggle, .ticket-x, .ticket-backdrop { display: none; }

/* ---------- tables ---------- */
.floor-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.floor-scroll { overflow-x: auto; border-radius: 18px; }
.floor { position: relative; height: 560px; border-radius: 18px; border: 1px solid var(--border); background-color: var(--floor); background-image: radial-gradient(var(--border-2) 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; box-shadow: var(--shadow); }
.floor .deco { position: absolute; display: grid; place-items: center; border-radius: 12px; border: 1.5px dashed var(--border-2); color: var(--faint); font: 700 11px var(--font); letter-spacing: .12em; text-transform: uppercase; }
.tb { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 2px solid var(--border-2); background: var(--surface); color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; padding: 0; }
.tb:hover { transform: translate(-50%, -50%) scale(1.04); }
.tb.sel { box-shadow: 0 0 0 4px var(--primary-ring), var(--shadow); border-color: var(--primary); }
.tb b { font: 750 15px var(--display); }
.tb small { font-size: 11px; color: var(--muted); font-weight: 600; }
.tb em { font-style: normal; font: 700 11px var(--font); }
.tb.sz2 { width: 82px; height: 82px; border-radius: 50%; }
.tb.sz4 { width: 102px; height: 102px; border-radius: 18px; }
.tb.sz6 { width: 156px; height: 100px; border-radius: 18px; }
.tb.sz8 { width: 186px; height: 112px; border-radius: 20px; }
.ch { position: absolute; width: 26px; height: 8px; border-radius: 6px; background: var(--chair); transform: translateX(-50%); }
.ch.v { width: 8px; height: 26px; transform: translateY(-50%); }
.st-free { border-color: var(--border-2); }
.st-occupied { background: var(--primary-soft); border-color: #fb923c; }
.st-occupied em { color: var(--primary-2); }
.st-billing { background: var(--violet-soft); border-color: #a78bfa; }
.st-billing em { color: var(--violet); }
.st-reserved { background: var(--blue-soft); border-color: #93b4ff; border-style: dashed; }
.st-reserved small { color: var(--blue); }
.floor-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.fs { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); font-weight: 650; font-size: 13px; }
.fs i { width: 10px; height: 10px; border-radius: 3px; }
.tpanel .big { font: 750 30px var(--display); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.kv div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.kv small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kv b { font-size: 15px; }
.olist { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; }
.olist .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- kitchen ---------- */
.kds { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(250px, 1fr)); gap: 16px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 12px; min-height: 420px; transition: background .15s, border-color .15s; }
.col.over { background: var(--primary-soft); border-color: var(--primary); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; font: 750 14px var(--display); }
.col-h .cnt { margin-left: auto; min-width: 26px; height: 24px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font: 700 12px/22px var(--font); text-align: center; }
.col-h i.c { width: 10px; height: 10px; border-radius: 50%; }
.tk { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 12px 13px; margin-bottom: 10px; cursor: grab; border-top: 4px solid var(--green); }
.tk.lv-1 { border-top-color: #f59e0b; } .tk.lv-2 { border-top-color: var(--red); }
.tk.dragging { opacity: .45; }
.tk-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tk-h b { font: 750 15px var(--display); }
.tk-t { font: 750 13px var(--font); padding: 3px 8px; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.tk.lv-1 .tk-t { background: var(--amber-soft); color: var(--amber); }
.tk.lv-2 .tk-t { background: var(--red-soft); color: var(--red); }
.tk-m { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; margin: 4px 0 10px; }
.tk ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tk li { display: flex; gap: 8px; font-size: 13.5px; }
.tk li .q { font-weight: 800; min-width: 22px; color: var(--primary-2); }
.tk li .nt { display: block; color: var(--amber); font-style: italic; font-size: 12px; }
.tk .sla { margin: 12px 0 10px; }
.tk .act { display: flex; gap: 8px; }
.tk .act .btn { flex: 1; }
.kds-stats { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- reservations ---------- */
.tl { overflow-x: auto; }
.tl-grid { min-width: 860px; }
.tl-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--border); min-height: 54px; }
.tl-row .lab { font-weight: 700; font-size: 13px; padding-left: 6px; }
.tl-row .lab small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.tl-track { position: relative; height: 54px; background-image: linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: calc(100% / 13) 100%; }
.tl-head .tl-track { height: 30px; background: none; }
.tl-head span { position: absolute; top: 6px; transform: translateX(-50%); font-size: 11.5px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.rb { position: absolute; top: 8px; bottom: 8px; border-radius: 10px; padding: 5px 10px; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(29, 78, 216, .25); text-align: left; }
.rb b { display: block; font-size: 12.5px; color: var(--text); }
.rb.seated { background: var(--primary-soft); color: var(--primary-2); border-color: rgba(234, 88, 12, .3); }
.rb.noshow, .rb.cancelled { background: var(--surface-2); color: var(--faint); border-style: dashed; text-decoration: line-through; }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 2; }
.tl-row:not(.tl-head) .now-line::before { display: none; }
.ticket-toggle[hidden] { display: none !important; }
.now-line::before { content: "Now"; position: absolute; top: -2px; left: 50%; transform: translate(-50%, -100%); background: var(--red); color: #fff; font: 700 10px var(--font); padding: 2px 6px; border-radius: 6px; }
.res-card { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.res-card:last-child { border-bottom: 0; }
.res-card .grow { flex: 1; min-width: 0; }
.res-card .grow b { display: block; }

/* ---------- reports ---------- */
.heat { display: grid; grid-template-columns: 44px repeat(13, minmax(0, 1fr)); gap: 4px; font-size: 11px; color: var(--muted); }
.heat span { text-align: center; }
.heat i { display: block; height: 28px; border-radius: 6px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(20, 16, 12, .42); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { width: min(720px, 100%); }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 8px; }
.modal-h h2 { font: 750 20px var(--display); letter-spacing: -.01em; }
.modal-h p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.modal-b { padding: 14px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 14px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; }
.overlay.side-panel { place-items: stretch end; padding: 0; }
.overlay.side-panel .modal { width: min(480px, 100%); max-height: none; height: 100vh; border-radius: 22px 0 0 22px; animation: slide .2s ease-out; }
.overlay.top-panel { place-items: start center; padding-top: 12vh; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.pay-amt { text-align: center; padding: 6px 0 2px; }
.pay-amt small { color: var(--muted); font-weight: 650; }
.pay-amt div { font: 800 40px var(--display); letter-spacing: -.02em; }
.pay-panel { border: 1px solid var(--border); border-radius: 16px; padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr { width: 176px; height: 176px; padding: 10px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.change { font: 750 18px var(--display); color: var(--green); }
.card-art { width: 230px; height: 140px; border-radius: 16px; background: linear-gradient(135deg, #1c1917, #57534e); color: #fff; padding: 16px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); }
.card-art .chip-art { width: 34px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, #fcd34d, #b45309); }
.receipt { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; background: #fffdf8; color: #1c1917; border: 1px dashed #d6cfc2; border-radius: 12px; padding: 18px; }
.receipt h3 { text-align: center; font: 800 16px ui-monospace, Consolas, monospace; }
.receipt .c { text-align: center; color: #57534e; font-size: 12px; }
.receipt hr { border: 0; border-top: 1px dashed #c9c1b3; margin: 10px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 10px; }
.receipt .tot { font-weight: 800; font-size: 15px; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.pal-in input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; height: 34px; }
.pal-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.pal-g { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 10px 10px 6px; }
.pal-i { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; border: 0; background: none; text-align: left; }
.pal-i.on { background: var(--primary-soft); }
.pal-i .k { margin-left: auto; color: var(--muted); font-size: 12px; }
.pal-i .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 16px; }
.pop { position: absolute; top: 52px; right: 0; width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; animation: pop .15s ease-out; }
.pop-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.pop-h b { font: 750 15px var(--display); }
.ntf { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ntf:last-child { border-bottom: 0; }
.ntf .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.ntf.unread .ico { background: var(--primary-soft); color: var(--primary); }
.ntf small { color: var(--muted); }
.emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.emoji-grid button { height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 20px; }
.emoji-grid button.on { border-color: var(--primary); background: var(--primary-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: #1c1917; color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .18s ease-out; max-width: 360px; }
.toast .i { color: #4ade80; }
.toast.warn .i { color: #fbbf24; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .3s; }
[data-theme="dark"] .toast { background: #f4f1ec; color: #1c1917; }
.timeline { display: flex; flex-direction: column; gap: 0; margin-top: 6px; }
.tl-i { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl-i::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.tl-i:last-child::before { display: none; }
.tl-i i { width: 14px; height: 14px; border-radius: 50%; background: var(--border-2); margin-top: 3px; flex: none; }
.tl-i.done i { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.tl-i small { display: block; color: var(--muted); }
.settings { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row b { display: block; }
.set-row small { color: var(--muted); }
.sc { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; font-size: 13.5px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { position: relative; overflow: hidden; background: #140f0b; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before { content: ""; position: absolute; width: 640px; height: 640px; right: -200px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(249, 115, 22, .55), rgba(249, 115, 22, 0) 68%); }
.login-art::after { content: ""; position: absolute; width: 520px; height: 520px; left: -180px; bottom: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(251, 191, 36, .28), rgba(251, 191, 36, 0) 70%); }
.login-art > * { position: relative; z-index: 1; }
.login-art .brand b { font-size: 20px; }
.login-art h2 { font: 750 44px/1.08 var(--display); letter-spacing: -.03em; max-width: 520px; }
.login-art h2 em { font-style: normal; background: linear-gradient(90deg, #fdba74, #fb923c, #fbbf24); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-art p.lead { color: #d6cfc6; font-size: 16px; max-width: 460px; margin-top: 16px; }
.feat { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.feat div { display: flex; align-items: center; gap: 12px; color: #e7e1d9; font-weight: 600; }
.feat .i { color: #fb923c; }
.floaters { position: relative; height: 170px; margin-top: 30px; }
.fl { position: absolute; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px); border-radius: 16px; padding: 14px 16px; box-shadow: 0 20px 40px rgba(0, 0, 0, .3); }
.fl small { color: #bdb4aa; font-size: 12px; }
.fl b { display: block; font: 750 22px var(--display); }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-box h1 { font: 750 30px var(--display); letter-spacing: -.02em; }
.login-box > p { color: var(--muted); margin-top: -8px; }
.role-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-chips button { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; color: var(--text-2); }
.role-chips button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-ring); }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; font-weight: 650; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-note { font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos { grid-template-columns: minmax(0, 1fr) 350px; }
  .kds { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
  .kds[style] { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
}
@media (max-width: 1080px) {
  .g2-1, .g3, .floor-wrap, .settings { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { padding: 0 16px; height: 62px; gap: 10px; }
  .top-brand { display: flex; }
  .search-trigger { display: none; }
  .clock, .top .btn-primary span { display: none; }
  .top .btn-primary { width: 42px; padding: 0; }
  .page { padding: 18px 16px 170px; }
  .ph h1 { font-size: 22px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 16px; }
  .kpi .val { font-size: 22px; }
  .spark { display: none; }
  .pos { grid-template-columns: minmax(0, 1fr); }
  .dishes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dish .tile { height: 86px; font-size: 42px; }
  .ticket { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 70; max-height: 82vh; border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .25s; }
  .ticket.open { transform: none; }
  .ticket-x { display: grid; width: 36px; height: 36px; }
  .ticket-backdrop { display: block; position: fixed; inset: 0; z-index: 66; background: rgba(20, 16, 12, .4); }
  .ticket-toggle { display: flex; position: fixed; left: 16px; right: 16px; bottom: 84px; z-index: 65; height: 54px; border-radius: 16px; align-items: center; justify-content: space-between; padding: 0 18px; border: 0; background: var(--text); color: var(--bg); font-weight: 700; box-shadow: var(--shadow-lg); }
  .kds, .kds[style] { grid-template-columns: repeat(var(--cols, 4), 82vw); overflow-x: auto; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .floor { height: 520px; min-width: 780px; }
  .pop { position: fixed; top: 70px; left: 12px; right: 12px; width: auto; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; color: var(--muted); border: 0; background: none; padding: 4px 0; }
  .tabbar .on { color: var(--primary); }
  .hide-m { display: none !important; }
  table.t td, table.t th { padding: 11px 8px; }
  .heat { grid-template-columns: 34px repeat(13, minmax(0, 1fr)); gap: 2px; }
  .heat i { height: 22px; }
  .two { grid-template-columns: 1fr; }
  #toasts { left: 16px; right: 16px; bottom: 150px; align-items: stretch; }
}
@media print {
  body * { visibility: hidden !important; }
  .receipt, .receipt * { visibility: visible !important; }
  .receipt { position: fixed; left: 0; top: 0; width: 80mm; border: 0; }
}
