/* ═══════════════════════════════════════════════════════════════
   Cartaset Floorboard — hospitality-grade UI system
   One accent, tinted neutrals, one radius, one elevation, 4-step type.
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Cartaset identity — warm cream daylight, espresso ink, tangerine accent (matches the landing) */
  --bg: #faf3ea;          /* --ld-cream */
  --bg-2: #f3e8d9;        /* --ld-cream-2 */
  --panel: #fffaf3;
  --panel-2: #f7efe4;
  --line: #eadfce;
  --line-2: #dccdb8;
  --txt: #2a1e14;         /* --ld-ink */
  --muted: #8a7259;
  --muted-2: #b7a894;
  --brand: #e85d28;       /* tangerine, slightly deepened for text/buttons on cream */
  --brand-2: #d1451b;
  --brand-soft: #ffe9dd;
  --brand-ink: #b83d16;
  --free: #22a86e;  --free-soft: #e2f5ea;      /* mint family */
  --occupied: #e0334f; --occupied-soft: #ffe3e8; /* ember family */
  --clearing: #d9950f; --clearing-soft: #fff0cf; /* saffron family */
  --stage: #fdf8f1;
  --grid: #efe4d4;
  --wall: #d6c5ad;
  --r: 10px; --r-sm: 6px;
  --elev: 0 18px 44px rgba(42, 30, 20, .14), 0 2px 6px rgba(42, 30, 20, .06);
  --shadow: var(--elev); --shadow-sm: none;
  --serif: "Secular One", "Heebo", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
:root[data-theme="dark"] {
  /* espresso night — the landing's dark hero */
  --bg: #0c0806; --bg-2: #171009; --panel: #1f1610; --panel-2: #261b13;
  --line: #33251a; --line-2: #4a3626; --txt: #f7efe4; --muted: #b7a894; --muted-2: #7d6b58;
  --brand: #ff6b35; --brand-2: #ff8656; --brand-soft: #3a2015; --brand-ink: #ffb896;
  --free: #3ecf8e; --free-soft: #16301f; --occupied: #ff3d5e; --occupied-soft: #3a1a20; --clearing: #ffb627; --clearing-soft: #3a2f16;
  --stage: #120c08; --grid: #1e150e; --wall: #4a3626;
  --elev: 0 18px 44px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: "Heebo", "Segoe UI", system-ui, sans-serif; direction: rtl; background: var(--bg); color: var(--txt);
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.45; font-feature-settings: "tnum" 1; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── icons (inline SVG, currentColor) ── */
.ic { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }

/* ── Top bar ── */
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 20px; height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: -.1px; }
.brand .dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand); color: #fff; }
.brand .dot svg { width: 16px; height: 16px; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); letter-spacing: 0; margin-top: -1px; }
.brand.is-live small { color: var(--brand); }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); font-weight: 500; }
.pill .live { width: 7px; height: 7px; border-radius: 50%; background: var(--free); }
.pill.off .live { background: var(--occupied); }
.clock { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--bg-2); border-radius: var(--r); }
.tab { height: 32px; padding: 0 14px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; transition: background .18s var(--ease), color .18s; }
.tab:hover { color: var(--txt); }
.tab.active { background: var(--panel); color: var(--txt); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.tab.sim { color: var(--brand); }
.tab.sim.on { background: var(--brand); color: #fff; }
.tab.tab-add { color: var(--brand); border: 1px dashed var(--line-2); background: transparent; }
.iconbtn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: grid; place-items: center; font-size: 15px; transition: color .15s, border-color .15s; }
.iconbtn:hover { color: var(--txt); border-color: var(--line-2); }

/* ── Buttons ── */
.btn { height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--txt); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--panel-2); border-color: var(--muted-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--txt); background: var(--panel-2); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--occupied); }
.btn.danger:hover { background: var(--occupied-soft); border-color: var(--occupied); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Layout ── */
.layout { display: grid; grid-template-columns: 1fr 380px; height: calc(100vh - 56px); }
.layout.hostess { grid-template-columns: 520px 1fr; }
.stage { position: relative; overflow: hidden; background: radial-gradient(circle at 1px 1px, var(--grid) 1px, transparent 1.2px) 0 0 / 22px 22px, var(--stage); }
.side { border-inline-start: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
.layout.hostess .side { border-inline-start: none; border-inline-end: 1px solid var(--line); }
.zonebar { display: flex; gap: 8px; padding: 10px 16px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: var(--panel); }
.legend { display: flex; gap: 14px; margin-inline-start: auto; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
svg.floor { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.floorwrap { position: absolute; inset: 0; }

/* palette (editor) */
.palette { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 20; display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--elev); width: 200px; }
.palette .grp-title { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .3px; text-transform: uppercase; }
.palette .seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.palette .fix { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pbtn { height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--txt); font-size: 12.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: border-color .15s, background .15s; }
.pbtn:hover { border-color: var(--brand); background: var(--brand-soft); }
.pbtn small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.pbtn .em { font-size: 14px; line-height: 1; }
.seg { display: flex; background: var(--bg-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; height: 28px; border-radius: 6px; font-weight: 600; font-size: 12px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--txt); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* zoom controls */
.zoomctl { position: absolute; bottom: 14px; inset-inline-start: 14px; z-index: 20; display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; box-shadow: var(--elev); }
.zoomctl button { min-width: 38px; height: 38px; border: 0; background: transparent; border-radius: 7px; font-size: 17px; font-weight: 600; color: var(--muted); display: grid; place-items: center; transition: background .15s, color .15s; }
.zoomctl button:hover { background: var(--panel-2); color: var(--txt); }
.zoomctl .zlabel { min-width: 56px; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--txt); }
.zoomctl [data-z="fit"] { padding: 0 10px; font-size: 12.5px; }

/* ── SVG nodes: architectural, quiet ── */
.node { cursor: pointer; }
.node.dragging { opacity: .9; }
.sel-ring { display: none; } .node.selected .sel-ring { display: block; }
.sel-ring rect { fill: none; stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 4 4; }
.tbl .body { fill: var(--panel); stroke: var(--line-2); stroke-width: 1.5; transition: fill .25s, stroke .25s; }
.tbl.free .body { fill: var(--panel); stroke: var(--free); }
.tbl.occupied .body { fill: var(--occupied-soft); stroke: var(--occupied); }
.tbl.clearing .body { fill: var(--clearing-soft); stroke: var(--clearing); }
.tbl.overdue .body { stroke-width: 2.5; }
.tbl .name { fill: var(--txt); font-weight: 600; font-size: 12px; text-anchor: middle; pointer-events: none; }
.tbl .meta { fill: var(--muted); font-size: 9.5px; text-anchor: middle; pointer-events: none; }
.tbl .timer { font-weight: 600; font-size: 10.5px; text-anchor: middle; pointer-events: none; font-variant-numeric: tabular-nums; }
.tbl.bill .body { animation: billblink 1.2s var(--ease) infinite; }
@keyframes billblink { 50% { fill: var(--clearing-soft); stroke: var(--clearing); stroke-width: 3; } }
.tbl .bill-badge, .tbl .link-badge { font-size: 12px; }
.fx .fill { transition: .2s; }
.fx-wall .fill { fill: var(--wall); stroke: none; }
.fx-bar .fill { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1.5; }
.fx-kitchen .fill { fill: var(--panel-2); stroke: var(--muted-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.fx-hostess .fill { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1.5; }
.fx-door .frame { stroke: var(--brand); stroke-width: 3; fill: none; stroke-linecap: round; }
.fx-door .swing { stroke: var(--brand); stroke-width: 1.5; fill: none; stroke-dasharray: 3 3; opacity: .7; }
.fx .label { fill: var(--brand-ink); font-weight: 600; font-size: 12px; text-anchor: middle; pointer-events: none; }
.handle { fill: var(--panel); stroke: var(--brand); stroke-width: 2; cursor: nwse-resize; }
.rot-line { stroke: var(--brand); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.rot-handle { fill: var(--brand); stroke: var(--panel); stroke-width: 2; cursor: grab; }
.act-bg { fill: var(--panel); stroke: var(--line-2); stroke-width: 1.5; }
.act:hover .act-bg { stroke: var(--brand); } .act.del:hover .act-bg { stroke: var(--occupied); }
.act-ic { font-size: 12px; text-anchor: middle; pointer-events: none; }
.link-line { stroke: var(--brand); stroke-width: 3; stroke-dasharray: 1 8; stroke-linecap: round; opacity: .55; pointer-events: none; }
.link-hub { fill: var(--panel); stroke: var(--brand); stroke-width: 1.5; }
.link-hub-ic { font-size: 11px; text-anchor: middle; pointer-events: none; }
.seat-dot { fill: var(--line-2); }

/* ── Side panel: sections, not cards ── */
.side-head { padding: 16px 18px 12px; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 9px; letter-spacing: -.1px; }
.card { margin: 0 14px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.card h4 { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.muted { color: var(--muted); font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.field { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.field label { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.field input, .field select, input.inp, select.inp { height: 40px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; color: var(--txt); padding: 0 12px; font-size: 14px; }
.field input:focus, input.inp:focus, select.inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input[type=range] { height: auto; padding: 0; border: 0; box-shadow: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.sbtn { height: 44px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-weight: 600; font-size: 13px; transition: .15s; }
.sbtn.free.on { background: var(--free-soft); border-color: var(--free); color: var(--free); }
.sbtn.occupied.on { background: var(--occupied-soft); border-color: var(--occupied); color: var(--occupied); }
.sbtn.clearing.on { background: var(--clearing-soft); border-color: var(--clearing); color: var(--clearing); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.free { background: var(--free-soft); color: var(--free); }
.chip.occupied { background: var(--occupied-soft); color: var(--occupied); }
.chip.clearing, .chip.bill { background: var(--clearing-soft); color: var(--clearing); }
.chip.waiting { background: var(--brand-soft); color: var(--brand-ink); }
.chip.big { height: 28px; padding: 0 12px; font-size: 12.5px; }
.big-timer { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.ver { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; }
.ver .who { flex: 1; } .ver .who b { font-size: 13px; display: block; } .ver .who small { color: var(--muted); font-size: 11px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line-2); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--brand); }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.act-btn { flex: 1; height: 38px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--txt); font-weight: 600; font-size: 12.5px; }
.act-btn:hover { background: var(--panel-2); } .act-btn.danger { color: var(--occupied); }
.hint { padding: 12px 16px; font-size: 12px; color: var(--muted-2); text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 13px; line-height: 1.6; }

/* ── The service sheet: one table, one obvious action ── */
.sheet { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 14px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-name { font-size: 24px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.fact b { display: block; font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.fact small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.dots { display: flex; gap: 5px; }
.dot { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.dot.done { background: var(--free); } .dot.cur { background: var(--brand); }
.stage-lbl { font-size: 12px; margin-top: -8px; color: var(--muted); }
.hero { width: 100%; height: 56px; border-radius: var(--r); border: 0; font-size: 17px; font-weight: 700; letter-spacing: -.2px; color: #fff; background: var(--brand); transition: background .15s, transform .12s var(--ease); }
.hero:hover { background: var(--brand-2); }
.hero:active { transform: scale(.99); }
.hero.free { background: var(--free); } .hero.free:hover { filter: brightness(.95); }
.hero.warn { background: var(--clearing); } .hero.warn:hover { filter: brightness(.95); }
.sec { display: flex; gap: 8px; }
.sec .btn { flex: 1; height: 42px; }
.coll { border-top: 1px solid var(--line); }
.coll > summary { list-style: none; cursor: pointer; padding: 14px 2px; font-weight: 600; color: var(--muted); font-size: 13px; display: flex; align-items: center; user-select: none; }
.coll > summary::-webkit-details-marker { display: none; }
.coll > summary::after { content: ''; width: 7px; height: 7px; border-inline-end: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin-inline-start: auto; transition: transform .2s var(--ease); }
.coll[open] > summary::after { transform: rotate(45deg); }
.coll > summary:hover { color: var(--txt); }
.coll-body { padding: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.coll-body .card { margin: 0; }

/* ── Hostess ── */
.htabs { display: flex; gap: 2px; padding: 12px 14px 0; background: var(--panel); }
.htab { flex: 1; height: 40px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.htab:hover { color: var(--txt); }
.htab.on { color: var(--brand); border-bottom-color: var(--brand); }
.htab .cnt { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg-2); color: var(--muted); font-size: 11.5px; font-weight: 700; }
.htab.on .cnt { background: var(--brand-soft); color: var(--brand); }
.htabs + div, .htabs ~ .card { border-top: 1px solid var(--line); }
.res { display: flex; gap: 12px; padding: 12px 14px; align-items: center; border-bottom: 1px solid var(--line); background: var(--panel); cursor: grab; transition: background .12s; }
.res:hover { background: var(--panel-2); }
.res.dragging { opacity: .5; }
.res.picked { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.res .time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; min-width: 44px; color: var(--txt); }
.res .who { flex: 1; min-width: 0; } .res .who b { display: block; font-size: 14px; font-weight: 600; } .res .who small { color: var(--muted); font-size: 12px; }
.res .pax { min-width: 30px; height: 26px; padding: 0 8px; border-radius: 6px; background: var(--bg-2); font-weight: 700; font-size: 12.5px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.res .wait { font-weight: 600; color: var(--clearing); font-variant-numeric: tabular-nums; }
.res.overdue .wait, .res.overdue .time { color: var(--occupied); }
.res.late { background: var(--occupied-soft); }
.res.late .time { color: var(--occupied); }
.latemin { color: var(--occupied); font-weight: 600; }
.seatbtn { flex: none; min-width: 78px; height: 44px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; transition: background .15s; }
.seatbtn small { font-size: 10.5px; font-weight: 500; opacity: .9; }
.seatbtn:hover { background: var(--brand-2); }
.seatbtn.none { background: var(--bg-2); color: var(--muted-2); cursor: not-allowed; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.stat { background: var(--panel); padding: 14px 12px; text-align: center; }
.stat b { display: block; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat small { color: var(--muted); font-size: 12px; }
.availrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.availrow.now { background: var(--brand-soft); border-radius: 6px; padding: 7px 8px; }
.availrow .hr { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12.5px; min-width: 42px; color: var(--muted); }
.availrow.now .hr { color: var(--brand); }
.availrow .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.availrow .bar span { display: block; height: 100%; background: var(--brand); opacity: .75; }
.availrow .frq { min-width: 58px; text-align: end; font-size: 12px; font-weight: 600; color: var(--free); }
.availrow .frq.tight { color: var(--clearing); } .availrow .frq.full { color: var(--occupied); }

/* ── Manager ── */
.mgr { max-width: 1040px; margin: 0 auto; padding: 22px 20px 60px; }
.mtabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.mtab { height: 42px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.mtab:hover { color: var(--txt); } .mtab.on { color: var(--brand); border-bottom-color: var(--brand); }
.kpigrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kpicard { background: var(--panel); padding: 20px 18px; }
.kpicard b { display: block; font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.6px; }
.kpicard small { display: block; margin-top: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.linkgridm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.linkcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; text-align: center; }
.linkcard h4 { margin: 0 0 14px; font-size: 14px; font-weight: 700; }
.linkcard .qr { width: 176px; height: 176px; border-radius: 8px; background: #fff; padding: 8px; display: inline-block; border: 1px solid var(--line); }
.linkcard .qr-ph { height: 176px; display: grid; place-items: center; }
.linkcard .linkurl { margin: 12px 0 0; font-size: 11px; color: var(--muted); word-break: break-all; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.wgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 8px; }
.wcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.wtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wtab { font-size: 12px; font-weight: 600; height: 26px; padding: 0 10px; border-radius: 6px; background: var(--bg-2); display: inline-flex; align-items: center; }

/* ── Modal / overlay ── */
.overlay { position: fixed; inset: 0; background: rgba(27, 26, 23, .42); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { width: min(460px, 100%); background: var(--panel); border-radius: 14px; box-shadow: var(--elev); overflow: hidden; }
.modal .mh { padding: 20px 22px 4px; }
.modal .mh h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.modal .mh p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.modal .mb { padding: 14px 22px; }
.modal .mf { padding: 14px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); }
.seatpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.seatpick button { height: 48px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); font-weight: 700; font-size: 15px; color: var(--txt); }
.seatpick button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.linkgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 44vh; overflow-y: auto; }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); text-align: start; transition: .12s; }
.pick:hover { border-color: var(--brand); } .pick.on { border-color: var(--brand); background: var(--brand-soft); }
.pick b { font-size: 13.5px; } .pick small { color: var(--muted); font-size: 11px; }
#toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; z-index: 100; }
.toast { padding: 10px 14px; border-radius: 8px; background: var(--txt); color: var(--bg); font-size: 13px; font-weight: 500; display: flex; gap: 9px; align-items: center; animation: slidein .25s var(--ease); box-shadow: var(--elev); }
.toast i { width: 7px; height: 7px; border-radius: 50%; }
.toast.free i { background: var(--free); } .toast.occupied i { background: var(--occupied); } .toast.clearing i { background: var(--clearing); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }

/* ── Responsive ── */
@media (max-width: 900px) {
  .topbar { height: auto; padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
  .brand small { display: none; }
  .tabs { order: 5; width: 100%; }
  .tabs .tab { flex: 1; justify-content: center; }
  .layout, .layout.hostess { grid-template-columns: 1fr; grid-template-rows: 46vh 1fr; height: calc(100vh - 100px); }
  .stage { order: 1; } .side { order: 2; border: 0 !important; border-top: 1px solid var(--line) !important; }
  .palette { width: 150px; }
  .sbtn { height: 50px; } .btn { min-height: 44px; }
  .field input, .field select, input.inp { font-size: 16px; }
  .kpigrid { grid-template-columns: repeat(2, 1fr); } .linkgridm, .wgrid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .layout, .layout.hostess { grid-template-rows: 42vh 1fr; } .legend { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* per-table QR grid (manager → links) */
.tqgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.tqcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; text-align: center; }
.tqcard b { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.tqcard .qr { width: 110px; height: 110px; display: inline-block; background: #fff; padding: 4px; border-radius: 6px; border: 1px solid var(--line); }
.tqcard .linkurl { margin-top: 6px; font-size: 9.5px; color: var(--muted-2); word-break: break-all; font-family: ui-monospace, Menlo, monospace; line-height: 1.3; }

/* display voice (matches landing "ld-display") on the few places that carry identity */
.brand > span:last-child, .sheet-name, .kpicard b, .stat b, .fact b, .modal .mh h3 { font-family: var(--serif); font-weight: 400; letter-spacing: 0; }
.sheet-name { font-size: 26px; }
.kpicard b { font-size: 30px; }

/* live orders inside the table sheet */
.orders { display: flex; flex-direction: column; gap: 8px; }
.order { border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; background: var(--panel-2); }
.order.new { border-color: var(--brand); background: var(--brand-soft); animation: orderpulse 1.6s var(--ease) infinite; }
@keyframes orderpulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); } }
.order b { font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.olines { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 13px; }
.tbl.has-order .body { stroke-width: 2.5; }
.order-badge { fill: var(--brand); stroke: var(--panel); stroke-width: 2; }
.order-badge-n { fill: #fff; font-size: 10px; font-weight: 700; text-anchor: middle; pointer-events: none; }

/* unified sign-in modal */
.modal.auth { width: min(440px, 100%); }
.modal.auth .mh h3 { display: flex; align-items: center; gap: 8px; }
.auth-seg { margin: 0 0 4px; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--muted-2); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-soc { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }

/* hostess pick-mode: WHERE can this party sit */
.tbl.dimmed { opacity: .3; }
.tbl.fit .body { stroke: var(--free); stroke-width: 3; fill: var(--free-soft); }
.tbl.fit .fitlbl { fill: var(--free); font-weight: 700; }
.tbl.suggest .body { animation: suggestpulse 1.3s var(--ease) infinite; }
@keyframes suggestpulse { 50% { stroke-width: 5; filter: drop-shadow(0 0 10px var(--free)); } }
.seatbtn.picking { background: var(--panel); color: var(--brand); border: 1.5px solid var(--brand); }
.tbl.squeeze .body { stroke: var(--clearing); stroke-width: 3; fill: var(--clearing-soft); }
.tbl.squeeze .sqlbl { fill: var(--clearing); font-weight: 700; }
body.authlock > *:not(.overlay) { filter: blur(9px); pointer-events: none; user-select: none; }

/* ── KDS — kitchen display ── */
.kds { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; height: calc(100vh - 58px); box-sizing: border-box; }
.kds-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; }
.kds-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-family: 'Secular One'; font-size: 18px; }
.kds-head b { background: var(--accent); color: #fff; border-radius: 999px; min-width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.kds-rail { flex: 1; overflow-y: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-content: start; }
.ticket { background: var(--bg); border: 2px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ticket.warn { border-color: var(--clearing); }
.ticket.late { border-color: var(--occupied); animation: pulse 1.6s infinite; }
.tk-top { display: flex; justify-content: space-between; align-items: center; font-size: 19px; }
.tk-age { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.ticket.warn .tk-age { color: var(--clearing); } .ticket.late .tk-age { color: var(--occupied); }
.tk-items { display: flex; flex-direction: column; gap: 4px; font-size: 17px; }
.tk-line small { display: block; color: var(--muted); font-size: 13px; }
.tk-note { background: var(--saffron-soft, #fdf3d8); border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.tk-go { font-size: 17px; padding: 12px; margin-top: auto; }
.kds-empty { grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); padding: 48px 0; }
@media (max-width: 720px) { .kds { grid-template-columns: 1fr; height: auto; } }
.seatbtn.undo { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.seatbtn.undo:active { background: var(--occupied-soft, #fbe3e3); color: var(--occupied); }

/* waiter + shift stations */
.wview, .shift { padding: 14px; max-width: 1100px; margin: 0 auto; overflow-y: auto; height: calc(100vh - 58px); box-sizing: border-box; }
.wgrid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.wgrid2.dim { opacity: .65; }
.wcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.wcard.billing { border-color: var(--clearing); box-shadow: 0 0 0 2px var(--clearing-soft, #f6e7c8); }
.wcard.slim { padding: 10px 12px; }
.wstage { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.alert { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-inline-start: 4px solid var(--muted); border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px; }
.alert.occupied { border-inline-start-color: var(--occupied); }
.alert.clearing { border-inline-start-color: var(--clearing); }
.alert .atxt b { display: block; } .alert .atxt small { color: var(--muted); }
.tabs { overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
/* waiter order picker */
.modal.picker { max-height: 86vh; display: flex; flex-direction: column; }
.pick-list { overflow-y: auto; max-height: 52vh; }
.pick-cat { font-family: 'Secular One'; margin: 10px 0 4px; color: var(--muted); font-size: 13px; }
.pick-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.pick-row .pn { flex: 1; min-width: 0; } .pick-row .pp { color: var(--muted); font-variant-numeric: tabular-nums; }
.pick-row .pq { display: flex; align-items: center; gap: 8px; }
.qbtn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 18px; font-weight: 800; cursor: pointer; }
.qbtn.plus { background: var(--accent); border-color: var(--accent); color: #fff; }
