:root {
  /* Esports graphite, same tokens as the PC client. Azure = actions, mint = live/free time,
     amber = guests, red = trouble. Bahnschrift (in every Windows) for figures and headings. */
  --bg: #0a0b0e;
  --side: #0d0f13;
  --panel: #121419;
  --panel-2: #191c23;
  --hover: #21252e;
  --line: #262a33;
  --line-2: #323743;
  --text: #f1f3f6;
  --muted: #8c93a0;
  --accent: #1fa2ff;
  --accent-ink: #041018;
  --accent-soft: #0f2a40;
  --free: #3df2c4;
  --member: #1fa2ff;
  --guest: #ffb020;
  --low: #ff4d5e;
  --offline: #4a505c;
  --radius: 10px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --display: "Bahnschrift SemiCondensed", Bahnschrift, "DIN Alternate", "Segoe UI", sans-serif;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); font-size: 14px; min-height: 100vh; background: var(--bg); }
[hidden] { display: none !important; }
h1, h2 { margin: 0 0 12px; font-weight: 600; font-family: var(--display); letter-spacing: .2px; }
h1 { font-size: 28px; line-height: 1.1; }
h2 { font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; margin-top: 48px; }
.error { color: var(--low); min-height: 1em; margin: 0; }
b, .num, .kpi .v { font-variant-numeric: tabular-nums; }

input, select, button {
  font: inherit; color: inherit; background: #0d0f13;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-height: 36px;
}
input:hover, select:hover { border-color: var(--line-2); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,162,255,.2); }
input[type=checkbox] { min-height: 0; accent-color: var(--accent); width: 16px; height: 16px; }
input[type=color] { padding: 2px; width: 40px; height: 36px; cursor: pointer; }
button {
  cursor: pointer; background: var(--panel-2);
  transition: border-color .15s ease, background-color .15s ease, transform .12s var(--ease-out);
}
button:hover { border-color: var(--line-2); background: var(--hover); }
button:active:not(:disabled) { transform: scale(0.97); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { background: #46b3ff; border-color: #46b3ff; }
button.danger { color: var(--low); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--panel-2); }
button:disabled { opacity: .45; cursor: default; }
label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
label.inline { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }

/* ---------- brand mark: a slanted azure bar, like a scoreboard tab ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: .3px; }
.mark { width: 10px; height: 22px; background: var(--accent); transform: skewX(-14deg); border-radius: 2px; box-shadow: 6px 0 0 -2px var(--free); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(900px 600px at 15% -10%, #0f2233, transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); display: grid; gap: 16px; padding: 32px; }
.login-card h1 { margin: 8px 0 4px; font-size: 26px; }
.login-card button { min-height: 44px; }

/* ---------- shell: sidebar + content ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; background: var(--side); border-right: 1px solid var(--line);
}
.side .brand { padding: 2px 8px 6px; }
#tabs { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-group { color: var(--muted); font-size: 12px; padding: 14px 10px 6px; }
#tabs button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 10px; min-height: 40px;
  background: transparent; border: 0; border-radius: 8px; color: var(--muted); font-size: 14px; position: relative;
}
#tabs button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tabs button:hover { color: var(--text); background: var(--panel-2); }
#tabs button.active { color: var(--text); background: var(--accent-soft); font-weight: 600; }
#tabs button.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
#tabs .badge { margin-left: auto; }
.side-foot { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.me > span:last-child { display: grid; }
.me b { font-weight: 600; }
.side-foot button { justify-content: flex-start; text-align: left; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--low); display: inline-block; flex: none; }
.dot.on { background: var(--free); box-shadow: 0 0 0 3px rgba(61,242,196,.15); }

main { padding: 26px 32px 48px; max-width: 1640px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 6px; }
.page-head p { margin: 0; max-width: 640px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 200px; max-width: 420px; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); }
.stats b { font-family: var(--display); font-size: 22px; font-weight: 500; margin-right: 5px; color: var(--text); }
.legend { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.chip { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.chip.free::before { background: var(--free); } .chip.member::before { background: var(--member); }
.chip.guest::before { background: var(--guest); } .chip.low::before { background: var(--low); }
.chip.offline::before { background: var(--offline); }

/* ---------- PC grid: number big, state as a coloured top edge ---------- */
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
.pc {
  text-align: left; display: grid; gap: 3px; align-content: start; padding: 12px 14px 13px; min-height: 112px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 0 3px 0 var(--free);
}
.pc:hover { background: var(--panel-2); border-color: var(--line-2); }
.pc .top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pc .num { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1; }
.pc .zone { font-size: 11px; color: var(--muted); }
.pc .who { font-size: 12px; color: var(--muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .time { font-family: var(--display); font-variant-numeric: tabular-nums; font-size: 19px; color: var(--free); }
.pc.member { box-shadow: inset 0 3px 0 var(--member); }
.pc.member .time { color: var(--text); }
.pc.guest { box-shadow: inset 0 3px 0 var(--guest); }
.pc.guest .time { color: var(--text); }
.pc.low { box-shadow: inset 0 3px 0 var(--low); }
.pc.low .time { color: var(--low); }
.pc.offline { box-shadow: inset 0 3px 0 var(--offline); opacity: .6; }
.pc.offline .num::after { content: " offline"; font-family: inherit; font-size: 11px; font-weight: 400; color: var(--muted); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.table tr:last-child td { border-bottom: 0; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--panel-2); }
.table tbody tr:hover td { background: rgba(255,255,255,.025); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions button { padding: 4px 10px; min-height: 30px; font-size: 12px; }
.neg { color: var(--low); } .pos { color: var(--free); }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.tag.live { color: var(--free); border-color: rgba(61,242,196,.3); }

.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); min-height: 30px; padding: 5px 12px; }
.seg button:hover { color: var(--text); background: var(--panel-2); }
.seg button.active { background: var(--hover); color: var(--text); font-weight: 600; }

/* ---------- reports ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.kpi .v { font-family: var(--display); font-size: 30px; font-weight: 500; }
.kpi .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.lead { border-color: rgba(31,162,255,.4); background: linear-gradient(180deg, rgba(31,162,255,.08), transparent 70%), var(--panel); }
.kpi-group { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.kpi.wide { grid-column: 1 / -1; }
.kpi.wide .table { margin-top: 8px; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.row-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.row-form input { flex: 1; min-width: 100px; }
.stack { display: grid; gap: 8px; }
body:not(.is-admin) .admin-only { display: none !important; }

/* ---------- pricing & rewards ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pricing-grid .wide { grid-column: 1 / -1; }
.pricing-grid .card > p { margin: 4px 0 14px; }
.rows { display: grid; gap: 8px; }
.rule { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #0f1115; }
.rule label { flex: 1 1 110px; min-width: 90px; }
.rule label.narrow { flex: 0 1 96px; }
.rule label.check { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-height: 36px; color: var(--text); font-size: 13px; }
.rule .days { display: flex; gap: 4px; flex-wrap: wrap; flex: 2 1 260px; }
.rule .days span { width: 100%; color: var(--muted); font-size: 12px; }
.rule .days label { flex: 0 0 auto; min-width: 0; display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); font-size: 12px; cursor: pointer; }
.rule .days label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rule .days input { display: none; }
.rule .remove { color: var(--muted); padding: 6px 10px; }
.rule .remove:hover { color: var(--low); }
.rule .share { font-family: var(--display); font-size: 20px; min-width: 64px; text-align: right; align-self: center; }
.rule .swatch { width: 6px; align-self: stretch; border-radius: 3px; flex: none; }
.add { margin-top: 10px; color: var(--accent); padding-left: 4px; }
.case-top { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.case-top label { flex: 0 1 220px; }
.case-ev { margin-left: auto; color: var(--muted); font-size: 13px; text-align: right; }
.case-ev b { color: var(--text); font-family: var(--display); font-size: 18px; font-weight: 500; }
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.case-log { display: flex; flex-wrap: wrap; gap: 6px; }
.drop { font-size: 12px; padding: 5px 9px; border-radius: 7px; background: var(--panel-2); border-bottom: 2px solid var(--muted); }
.btn-row.tight { flex: none; } .btn-row.tight button { white-space: nowrap; }
.dirty-note { color: var(--guest); font-size: 12px; align-self: center; }

/* ---------- dialog ---------- */
dialog {
  border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel); color: var(--text);
  box-shadow: 0 24px 60px rgba(0,0,0,.55); padding: 0; width: min(460px, calc(100vw - 32px));
}
dialog[open] { animation: dlg-in .2s var(--ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(5,6,8,.72); }
#dialog-form { padding: 20px; display: grid; gap: 14px; }
.dlg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dlg-head h2 { margin: 0; font-size: 20px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row button { flex: 1; min-width: 80px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.section-label { color: var(--muted); font-size: 12px; margin-top: 6px; }
.bonus-note { color: var(--free); font-size: 13px; min-height: 1.2em; }
.choice { display: grid; gap: 6px; }
.choice label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); font-size: 14px; cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice label span { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 20; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 10px;
  padding: 12px 14px; box-shadow: 0 12px 32px rgba(0,0,0,.45); animation: toast-in .25s var(--ease-out);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.warn { border-left-color: var(--guest); } .toast.error { border-left-color: var(--low); }
.toast.ok { border-left-color: var(--free); }

/* ---------- floor plan ---------- */
.floor-tools { margin-bottom: 8px; }
.floor-tools .floor-save { margin-left: auto; display: inline-flex; gap: 8px; }
.floor-tools .edit-only { display: inline-flex; gap: 8px; flex-wrap: wrap; }
body:not(.floor-editing) .edit-only { display: none !important; }
body.floor-editing .view-only { display: none !important; }
.floor-help { margin: 0 0 10px; max-width: 980px; }
.floor-wrap { display: flex; gap: 10px; align-items: flex-start; }
.tray {
  width: 136px; flex: none; max-height: 70vh; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px;
}
.tray-head { width: 100%; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.chip-pc {
  width: 46px; padding: 6px 0; text-align: center; font-weight: 700; border-radius: 6px; cursor: grab;
  background: var(--panel-2); border: 1px solid var(--line); user-select: none; touch-action: none;
}
.plan-outer {
  flex: 1; min-width: 0; position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
}
.plan { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; touch-action: none; }
body.floor-editing .plan { background-image: radial-gradient(circle, #2c313b 2px, transparent 2px); background-size: 32px 32px; }
.area { position: absolute; border: 2px dashed #323743; border-radius: 12px; background: rgba(31,162,255,.04); }
.area-label {
  position: absolute; left: 10px; top: -14px; padding: 2px 10px; border-radius: 6px; font-size: 16px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap;
}
.area-label span { color: var(--guest); font-weight: 500; font-size: 13px; }
body.floor-editing .area-label { cursor: move; }
.area-resize { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border-radius: 4px; cursor: nwse-resize; background: var(--accent); }
.seat {
  position: absolute; width: 72px; height: 56px; border-radius: 8px; display: grid; place-content: center; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line); border-top: 4px solid var(--free); cursor: pointer; line-height: 1.15;
}
.seat b { font-family: var(--display); font-size: 22px; font-weight: 600; }
.seat span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.seat.member { border-top-color: var(--member); }
.seat.guest { border-top-color: var(--guest); }
.seat.low { border-top-color: var(--low); } .seat.low span { color: var(--low); }
.seat.offline { border-top-color: var(--offline); opacity: .55; }
body.floor-editing .seat { cursor: grab; }
.seat.selected { outline: 3px solid var(--accent); outline-offset: 2px; }
.seat.ghost { position: fixed; z-index: 50; pointer-events: none; transform-origin: 0 0; opacity: .85; }
#band { position: absolute; border: 1px solid var(--accent); background: rgba(31,162,255,.15); pointer-events: none; }

/* ---------- shop (POS) ---------- */
.pos-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.pos-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pos-cats button { border-radius: 99px; min-height: 32px; padding: 5px 14px; }
.pos-cats button.active { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pos-item { display: grid; gap: 4px; text-align: left; padding: 14px; min-height: 96px; background: var(--panel); border-radius: 12px; align-content: start; }
.pos-item:hover:not(:disabled) { background: var(--panel-2); }
.pos-name { font-weight: 600; }
.pos-price { font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; }
.pos-stock { font-size: 11px; color: var(--muted); }
.pos-cart { display: grid; gap: 12px; position: sticky; top: 20px; }
.pos-cart h2 { margin: 0; }
.cart-lines { display: grid; gap: 6px; max-height: 40vh; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: 1fr auto 80px; gap: 8px; align-items: center; }
.cart-qty { display: inline-flex; align-items: center; gap: 6px; }
.cart-qty button { padding: 2px 9px; min-height: 28px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 10px; }
.cart-total b { font-family: var(--display); font-size: 28px; font-weight: 500; }
.pay-seg { display: flex; } .pay-seg button { flex: 1; }

/* ---------- orders from PCs, staff calls ---------- */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--low); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.badge[hidden] { display: none; }
.toast.order { border-left-color: var(--free); font-weight: 600; font-size: 15px; }
.toast.call { border-left-color: var(--guest); font-weight: 600; font-size: 15px; }
.table.orders .big { font-size: 18px; }
.table.orders tr.late td:first-child { color: var(--low); }
.table .actions .primary { margin-right: 6px; }
tr.dim td { opacity: .55; }

/* ---------- games (PC menu tiles) ---------- */
.mono { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.game-thumb { width: 64px; }
.game-thumb img, .thumb-none { display: block; width: 54px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--panel-2); }
.thumb-none { display: grid; place-items: center; color: var(--muted); font-weight: 700; }

/* ---------- narrow screens: sidebar becomes a top bar ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 5; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  #tabs { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; gap: 4px; }
  #tabs button { width: auto; flex: none; padding: 8px 10px; }
  #tabs button.active::before { display: none; }
  .nav-group { display: none; }
  .side-foot { border: 0; padding: 0; margin-left: auto; display: flex; align-items: center; }
  main { padding: 16px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pos-wrap { grid-template-columns: 1fr; } .pos-cart { position: static; }
}
@media (max-width: 640px) {
  .legend { margin-left: 0; }
  .pc-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  dialog[open], .toast { animation: none; }
  button:active:not(:disabled) { transform: none; }
}

/* ---------------------------------------------------------------- payments */
:root { --cash: #3df2c4; --card: #1fa2ff; --bank: #ffb020; --qpay: #b48cff; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; background: var(--muted); }
.dot.m-cash { background: var(--cash); } .dot.m-card { background: var(--card); } .dot.m-bank { background: var(--bank); } .dot.m-qpay { background: var(--qpay); }
.meth { white-space: nowrap; font-size: 13px; }
.warnc { color: var(--guest); }
.tag.neg { color: var(--low); border-color: rgba(255,77,94,.35); }
.tag.warn { color: var(--guest); border-color: rgba(255,176,32,.35); }
.tag.disc { color: var(--qpay); border-color: rgba(180,140,255,.35); }
.badge.warn { background: var(--guest); color: #1a1205; }

.method-strip { display: grid; grid-template-columns: 1.4fr repeat(7, 1fr); gap: 8px; margin-bottom: 14px; }
.method-strip .m { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.method-strip .m span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.method-strip .m b { font-family: var(--display); font-size: 20px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.method-strip .m small { color: var(--muted); font-size: 11px; }
.method-strip .m.lead { border-color: rgba(31,162,255,.4); background: linear-gradient(180deg, rgba(31,162,255,.08), transparent 70%), var(--panel); }
.method-strip .m.lead b { font-size: 24px; }
@media (max-width: 1200px) { .method-strip { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .method-strip { grid-template-columns: repeat(2, 1fr); } }

.pay-table tr.clickable { cursor: pointer; }
.pay-table tr.refunded td { color: var(--muted); }
.pay-table tr.refunded td b { text-decoration: line-through; }
.code { font-family: Consolas, "Cascadia Mono", monospace; color: var(--muted); }
.code a { color: var(--accent); text-decoration: none; }
.table td.empty { text-align: center; padding: 28px 12px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.pager span { margin-right: auto; }

/* Payment block inside dialogs */
.pay { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel-2); display: grid; gap: 10px; }
.pay-due { display: flex; justify-content: space-between; align-items: baseline; }
.pay-due span { color: var(--muted); }
.pay-due b { font-family: var(--display); font-size: 28px; font-weight: 500; color: var(--free); }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pay-method { position: relative; display: block; margin: 0; }
.pay-method input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pay-method span { display: block; text-align: center; padding: 10px 6px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel); font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease, transform .12s var(--ease-out); }
.pay-method input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.pay-method input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-method:active span { transform: scale(.97); }
.pay-more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.pay-more[open] summary { margin-bottom: 8px; }
.pay-split { display: grid; gap: 6px; margin-bottom: 8px; }
.pay-split-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pay-split-row label { min-width: 0; margin: 0; } .pay-split-row input { width: 100%; min-width: 0; }
.pay-breakdown { min-height: 1em; } .pay-breakdown.neg { color: var(--low); }
.pay-what { margin: 0 0 4px; color: var(--muted); }
.pay-head { margin-bottom: 10px; }
.pay-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.pay-detail .card { padding: 12px; }
.table.compact th, .table.compact td { padding: 6px 8px; }
.table.compact select { padding: 2px 6px; min-height: 28px; }
.kv.tight { margin-top: 10px; gap: 4px 12px; }
.btn-row.start { justify-content: flex-start; } .btn-row.start button { flex: none; }
@media (max-width: 720px) { .pay-detail { grid-template-columns: 1fr; } }
dialog:has(.pay-detail) { width: min(780px, calc(100vw - 32px)); }
dialog:has(.pay) { width: min(540px, calc(100vw - 32px)); }
@media (max-width: 520px) { .pay-split-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- shift */
.shift-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.shift-head h1 { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.shift-head p { margin: 0; }
.shift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.shift-grid .card { padding: 16px; min-width: 0; }
.shift-total .big { font-family: var(--display); font-size: 40px; font-weight: 500; color: var(--free); margin: 4px 0; }
.goal { margin-top: 12px; display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 10px; padding: 5px 0; }
.bar-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row b { font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }
.bar { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s var(--ease-out); }
.bar i.m-cash { background: var(--cash); } .bar i.m-card { background: var(--card); } .bar i.m-bank { background: var(--bank); } .bar i.m-qpay { background: var(--qpay); }
.bar i.k-topup { background: #8b7bff; } .bar i.k-session { background: var(--free); } .bar i.k-sale { background: var(--guest); }
.bar i.k-package { background: var(--accent); } .bar i.k-other { background: #ff7ab6; } .bar i.k-debt_repayment { background: var(--muted); }
.bar i.k-goal { background: linear-gradient(90deg, var(--accent), var(--free)); }
.refund-row { padding: 8px 0; border-bottom: 1px solid var(--line); } .refund-row:last-child { border-bottom: 0; }
.shift-open { max-width: 760px; margin-bottom: 24px; }
.shift-open .row-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.history-title { margin: 28px 0 12px; }
tr.clickable { cursor: pointer; }
.count-table input { width: 100%; min-width: 0; }
.shift-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--free); margin-left: auto; box-shadow: 0 0 0 3px rgba(61,242,196,.15); }
@media (max-width: 1100px) { .shift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .shift-grid { grid-template-columns: 1fr; } .shift-open .row-form { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-grid .card { padding: 16px; min-width: 0; }
.span-2 { grid-column: span 2; } .span-4 { grid-column: 1 / -1; }
.dash-lead { border-color: rgba(31,162,255,.35); background: linear-gradient(180deg, rgba(31,162,255,.07), transparent 60%), var(--panel); }
.dash-lead .big, .ov-takings .big, .ov-machines .big { font-family: var(--display); font-size: 44px; font-weight: 500; line-height: 1.1; margin: 4px 0; }
.mid { font-family: var(--display); font-size: 28px; font-weight: 500; margin: 2px 0; }
.dash-sub, .ov-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.dash-sub div, .ov-stats div { display: grid; gap: 2px; min-width: 0; }
.dash-sub b, .ov-stats b { font-family: var(--display); font-size: 20px; font-weight: 500; }
.chart-head { display: flex; justify-content: space-between; align-items: center; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.sw { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--muted); }
.sw.line { background: var(--accent); } .sw.prev { background: var(--muted); opacity: .6; }
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .prev { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 5; opacity: .7; }
.chart .area { fill: var(--accent); opacity: .08; }
.chart .hit { fill: transparent; } .chart .hit:hover { fill: rgba(31,162,255,.25); }
.donut-wrap { display: grid; gap: 12px; justify-items: center; }
.donut-wrap .donut-legend { width: 100%; }
.donut { width: 120px; height: 120px; }
.donut-legend, .kind-list { display: grid; gap: 6px; }
.donut-legend div, .kind-list div { display: grid; grid-template-columns: 1fr auto 44px; gap: 8px; align-items: baseline; }
.donut-legend div > span:last-child, .kind-list div > span:last-child { text-align: right; }
.kind-list .sw { width: 10px; height: 10px; vertical-align: -1px; }
.stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--panel-2); margin: 6px 0 12px; }
.stack i { display: block; height: 100%; }
.aging { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.aging div { display: grid; gap: 2px; background: var(--panel-2); border-radius: 9px; padding: 8px; min-width: 0; }
.wd-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 170px; }
.wd { display: grid; grid-template-rows: 1fr auto auto; height: 100%; text-align: center; gap: 4px; }
.wd .col { display: flex; align-items: flex-end; background: var(--panel-2); border-radius: 7px; overflow: hidden; }
.wd .col i { display: block; width: 100%; background: linear-gradient(180deg, var(--accent), rgba(31,162,255,.45)); border-radius: 7px 7px 0 0; transition: height .4s var(--ease-out); }
.wd b { font-size: 12px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .dash-grid { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

/* ---------------------------------------------------------------- today overview */
.ov-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.ov-head p { margin: 4px 0 0; }
.ov-grid { display: grid; grid-template-columns: 1.1fr 1fr 1.4fr 1.2fr; gap: 12px; align-items: start; }
.ov-grid .card { padding: 16px; min-width: 0; }
.ov-ring { display: flex; gap: 14px; align-items: center; }
.ring { width: 110px; height: 110px; flex: none; }
.ov-legend { display: grid; gap: 4px; margin-top: 12px; font-size: 13px; }
.ov-legend div { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.ov-legend .sw { width: 10px; height: 10px; margin: 0; }
.ov-attention { display: grid; gap: 8px; }
.att { display: flex; align-items: baseline; gap: 10px; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 0; }
.att b { font-family: var(--display); font-size: 22px; font-weight: 500; min-width: 28px; }
.att span { color: var(--muted); font-size: 13px; }
.att.warn { border-color: rgba(255,176,32,.45); } .att.warn b { color: var(--guest); }
.att.bad { border-color: rgba(255,77,94,.5); } .att.bad b { color: var(--low); }
.ov-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 12px; font-size: 13px; }
.ov-methods div { display: flex; justify-content: space-between; }
.ov-shift-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.ov-shift .ov-stats { grid-template-columns: 1fr 1fr; margin: 6px 0 12px; }
.ov-staff { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.ov-shift button { margin-top: 10px; width: 100%; }
@media (max-width: 1250px) { .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .ov-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- account page */
.acc-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.acc-title { flex: 1; min-width: 220px; }
.acc-title h1 { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.acc-title p { margin: 0; }
.icon-btn { font-size: 22px; line-height: 1; min-width: 40px; padding: 6px 0; }
.banner { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; background: var(--panel); border: 1px solid var(--line); }
.banner.neg { border-color: rgba(255,77,94,.45); background: rgba(255,77,94,.07); color: var(--text); }
.acc-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; margin: 0 0 22px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.acc-fields dt { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.acc-fields dd { margin: 0; overflow-wrap: anywhere; }
.disc-c { color: var(--qpay); }
.acc-hist-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.acc-hist-head h2 { margin: 0 auto 0 0; }
.acc-sums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.acc-sums .card { display: grid; gap: 2px; padding: 14px 16px; }
.acc-sums b { font-family: var(--display); font-size: 26px; font-weight: 500; }
.acc-link { color: var(--text); text-decoration: none; } .acc-link:hover b { color: var(--accent); }
@media (max-width: 900px) { .acc-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .acc-sums { grid-template-columns: 1fr; } }
.acc-head .btn-row button, .shift-head .btn-row button { flex: none; padding-inline: 14px; }

/* ---------------------------------------------------------------- inventory */
.grow { flex: 1; }
.inv-strip { grid-template-columns: 1.4fr repeat(3, 1fr); }
.lines { display: grid; gap: 6px; margin-bottom: 6px; }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 110px 34px; gap: 6px; align-items: center; }
.line-row:not(:has([name=cost])) { grid-template-columns: minmax(0, 1fr) 110px 34px; }
.line-row select, .line-row input { min-width: 0; width: 100%; }
.line-row button { min-height: 34px; padding: 0; }
.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sup { display: grid; gap: 6px; padding: 14px; }
.sup-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sup button { justify-self: start; }
dialog:has(.lines) { width: min(620px, calc(100vw - 32px)); }

/* ---------------------------------------------------------------- news, memos, feedback */
.news-list, .memo-list { display: grid; gap: 10px; max-width: 860px; }
.news { padding: 16px; display: grid; gap: 8px; }
.news h2 { margin: 0; }
.news p { margin: 0; line-height: 1.5; }
.news-head, .fb-head { display: flex; align-items: center; gap: 8px; }
.news-head h2 { flex: 1; }
textarea { font: inherit; color: inherit; background: #0d0f13; border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; width: 100%; resize: vertical; }
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.memo-new { max-width: 860px; display: grid; gap: 8px; padding: 12px; margin-bottom: 14px; }
.memo-new-row { display: flex; align-items: center; gap: 12px; }
.memo { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.memo.pinned { border-color: rgba(31,162,255,.4); }
.memo.done .memo-body > div:first-child { color: var(--muted); text-decoration: line-through; }
.memo-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--free); }
.memo-body { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.memo button { min-height: 28px; padding: 0 10px; }
.fb { padding: 14px 16px; display: grid; gap: 6px; }
.fb p { margin: 0; line-height: 1.5; }
.fb.new { border-color: rgba(255,176,32,.45); }
.stars { color: var(--guest); letter-spacing: 1px; }
/* More pages now: keep the menu compact and its scrollbar quiet. */
@media (min-width: 761px) {
  #tabs button { min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
  .nav-group { padding: 10px 10px 4px; }
  #tabs { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
}

/* PC bookings */
.pc.held { box-shadow: inset 0 3px 0 #a78bfa; }
.pc.held .time { color: #a78bfa; }
.pc .booked-tag { margin-top: 6px; font-size: 11px; color: #a78bfa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin: 10px 0; }
.bk-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.bk-grid label.check { flex-direction: row; align-items: center; align-self: end; color: var(--text); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.b-booked { background: rgba(167,139,250,.15); color: #a78bfa; }
.pill.b-ok { background: rgba(61,242,196,.12); color: #3df2c4; }
.pill.b-bad { background: rgba(255,93,108,.14); color: #ff5d6c; }
.pill.b-muted { background: var(--panel-2); color: var(--muted); }

/* Dashboard topic tabs */
.dash-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; }
.dash-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.dash-tabs button i { width: 7px; height: 7px; border-radius: 50%; }
.dash-tabs button.active { background: var(--panel-2); border-color: var(--line); color: var(--text); font-weight: 600; }
.card-sub { margin: -4px 0 10px; }
.section-label.sm { margin-top: 14px; font-size: 11px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 8px; }
.tiles > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tiles b { font-size: 22px; font-variant-numeric: tabular-nums; }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.split-legend b { color: var(--text); margin-left: 4px; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.vbars { display: flex; align-items: stretch; gap: 3px; }
.vb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.vb .col { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.vb .col i { display: block; width: 100%; border-radius: 4px 4px 0 0; min-height: 0; }
.vb .col.stacked { flex-direction: column-reverse; justify-content: flex-start; }
.vb .col.stacked i { border-radius: 0; }
.vb span { font-size: 10px; height: 12px; }
.hbars { display: grid; gap: 12px; }
.hb { display: flex; gap: 10px; align-items: flex-start; }
.hb .rank { color: var(--muted); width: 16px; text-align: right; font-size: 13px; padding-top: 2px; }
.hb-main { flex: 1; min-width: 0; }
.hb-top { display: flex; justify-content: space-between; gap: 8px; }
.hb-track { height: 6px; background: var(--panel-2); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: var(--free); border-radius: 99px; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.heat i { display: block; aspect-ratio: 1; border-radius: 3px; background: #ffb020; }
.heat span { font-size: 10px; text-align: center; }
.meter { display: inline-block; width: 60px; height: 6px; background: var(--panel-2); border-radius: 99px; vertical-align: middle; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.zone-list, .age-list { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.zone-list b, .age-list b { color: var(--text); }
.empty-note { padding: 24px 0; text-align: center; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .span-2, .span-4 { grid-column: auto; } }
