@font-face { font-family: "Noto Georgian"; src: url("/fonts/NotoSansGeorgian-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Georgian"; src: url("/fonts/NotoSansGeorgian-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  /* Lost Hut: calm garden venue. Warm stone neutrals tinted toward the greenery,
     one deep forest accent for selection and primary actions. Built for daylight. */
  --bg: oklch(0.955 0.008 125);
  --bg-2: oklch(0.925 0.011 125);
  --surface: oklch(0.993 0.003 110);
  --surface-2: oklch(0.963 0.007 120);
  --surface-3: oklch(0.932 0.01 120);
  --line: oklch(0.895 0.01 120);
  --line-2: oklch(0.82 0.013 120);

  --ink: oklch(0.21 0.014 150);
  --ink-mid: oklch(0.34 0.014 150);
  --ink-dim: oklch(0.45 0.013 150);

  /* deep forest carries primary actions & selection */
  --accent: oklch(0.33 0.055 158);
  --accent-strong: oklch(0.27 0.05 158);
  --accent-ink: oklch(0.985 0.006 120);
  --accent-soft: oklch(0.94 0.02 155);
  --accent-line: oklch(0.8 0.03 155);

  --ok: oklch(0.52 0.13 148);
  --ok-soft: oklch(0.94 0.04 148);
  --warn: oklch(0.55 0.12 75);
  --warn-soft: oklch(0.95 0.04 85);
  --bad: oklch(0.53 0.18 28);
  --bad-soft: oklch(0.94 0.035 28);
  --info: oklch(0.48 0.09 250);
  --info-soft: oklch(0.94 0.025 250);

  --display: "Noto Georgian", system-ui, sans-serif;

  --r-sm: 8px;
  --r: 11px;
  --r-lg: 14px;
  --r-xl: 18px;
  --tap: 54px;

  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
  --shadow: 0 4px 14px -6px rgba(17, 24, 39, .12);
  --shadow-lg: 0 18px 44px -16px rgba(17, 24, 39, .24);
  --ring: 0 0 0 3px rgba(35, 40, 48, .16);
  --hair: none;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .16s;

  --z-sticky: 20;
  --z-modal-back: 50;
  --z-modal: 51;
  --z-toast: 60;
}

/* formal dark — cool graphite; the near-monochrome language inverts cleanly,
   so "occupied / selected" becomes a light fill instead of a dark one */
:root[data-theme="dark"] {
  --bg: #14171c;
  --bg-2: #0f1216;
  --surface: #1c2028;
  --surface-2: #242932;
  --surface-3: #2f353f;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .17);

  --ink: #eef1f5;
  --ink-mid: #aeb6c2;
  --ink-dim: #828a97;

  --accent: #eef1f6;
  --accent-strong: #ffffff;
  --accent-ink: #171a20;
  --accent-soft: rgba(255, 255, 255, .09);
  --accent-line: rgba(255, 255, 255, .24);

  --ok: #35d399;
  --ok-soft: rgba(53, 211, 153, .16);
  --warn: #f5c451;
  --warn-soft: rgba(245, 196, 81, .16);
  --bad: #fb7185;
  --bad-soft: rgba(251, 113, 133, .16);
  --info: #7cb0ff;
  --info-soft: rgba(124, 176, 255, .16);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 6px 20px -8px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -16px rgba(0, 0, 0, .82);
  --ring: 0 0 0 3px rgba(238, 241, 246, .22);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Noto Georgian", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.45;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }

:focus-visible { outline: none; box-shadow: var(--ring); }
button, .chip, .tab, input, select, .table-card, .product, .map-pin { transition:
  background-color var(--dur) var(--ease),
  border-color var(--dur) var(--ease),
  color var(--dur) var(--ease),
  box-shadow var(--dur) var(--ease),
  transform .12s var(--ease); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px max(12px, env(safe-area-inset-left)) 8px 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--r-sm); color: var(--ink-dim);
  font-weight: 600; white-space: nowrap; min-height: 42px;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.is-on { background: var(--accent); color: var(--accent-ink); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm);
  color: var(--ink-mid); background: var(--surface-2); border: 1px solid var(--line);
}
.icon-btn:hover { color: var(--ink); background: var(--surface-3); }
.icon-btn .ic { width: 19px; height: 19px; }
/* icons sit inline in buttons/labels */
.btn .ic, .chip .ic, .back .ic, .note-btn .ic { width: 17px; height: 17px; }
@media (max-width: 640px) { .tab span { display: none; } .tab { padding: 9px 13px; } }
.topbar-right { display: flex; align-items: center; gap: 10px; padding-right: 4px; }
.clock { color: var(--ink-dim); font-variant-numeric: tabular-nums; font-size: 15px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }

main { padding: 18px; padding-bottom: 44px; max-width: 1320px; margin: 0 auto; }

/* ---------- floor ---------- */
.hall-title { color: var(--ink-mid); font-size: 15px; font-weight: 700; margin: 22px 2px 12px; }
.hall-title:first-child { margin-top: 4px; }
.table-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
}
.table-card {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 122px; padding: 15px; border-radius: var(--r); text-align: left;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.table-card:active { transform: scale(.985); }
.table-card .num { font-size: 32px; font-weight: 700; line-height: .95; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.table-card .seats { color: var(--ink-dim); font-size: 14px; margin-top: 4px; }
.table-card .sum { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.table-card .meta { color: var(--ink-dim); font-size: 13.5px; margin-top: 2px; }
/* occupied tables are filled dark — instantly legible across the room */
.table-card.busy { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.table-card.busy .num, .table-card.busy .sum { color: var(--accent-ink); }
.table-card.busy .seats, .table-card.busy .meta { color: color-mix(in srgb, var(--accent-ink) 60%, transparent); }
.table-card .flag {
  position: absolute; top: 12px; right: 12px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft);
}
.table-card.busy .flag { background: #f6b73c; box-shadow: 0 0 0 3px rgba(246, 183, 60, .25); }

/* ---------- order screen ---------- */
.order { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .order { grid-template-columns: minmax(340px, 420px) 1fr; align-items: start; } }
.order > *, .line > *, .lines, .panel { min-width: 0; }
.line .nm, .line .sub { overflow-wrap: break-word; }
@media (max-width: 560px) {
  .line {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "nm nm nm" "qty amt del";
    row-gap: 10px;
  }
  .line > :first-child { grid-area: nm; }
  .line .qty { grid-area: qty; }
  .line .amt { grid-area: amt; align-self: center; }
  .line .del { grid-area: del; }
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 16px; }
.panel-body { padding: 14px 16px; }

.order-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.back { display: inline-flex; align-items: center; gap: 4px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); font-weight: 600; box-shadow: var(--shadow-sm); }
.back:hover { background: var(--surface-2); }
.order-head .table-name { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.guests-chip { display: flex; align-items: center; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; font-weight: 700; box-shadow: var(--shadow-sm); }
.guests-chip span { padding: 0 8px; font-variant-numeric: tabular-nums; }
.guests-chip button { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); font-size: 20px; font-weight: 700; color: var(--ink-mid); }
.guests-chip button:hover { background: var(--accent); color: var(--accent-ink); }

.lines { display: flex; flex-direction: column; }
.line { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.line:first-child { padding-top: 2px; }
.line:last-child { border-bottom: 0; padding-bottom: 2px; }
.line .nm { font-weight: 600; }
.line .sub { color: var(--ink-dim); font-size: 14px; margin-top: 2px; }
.line .sub .sent { color: var(--ok); }
.line .sub .new { color: var(--warn); }
.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.qty button { width: 42px; height: 42px; border-radius: 50%; background: transparent; font-size: 20px; font-weight: 700; color: var(--ink-mid); }
.qty button:hover { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.qty span { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.line .amt { min-width: 74px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.line .del { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-dim); }
.line .del:hover { background: var(--bad); color: #fff; }
.empty { color: var(--ink-dim); text-align: center; padding: 30px 0; }

.totals { padding: 14px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.totals .row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-dim); }
.totals .row span:last-child { font-variant-numeric: tabular-nums; color: var(--ink-mid); }
.totals .row.big { color: var(--ink); font-size: 24px; font-weight: 700; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line-2); letter-spacing: -.02em; }
.totals .row.big span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px 16px; }
.btn {
  min-height: var(--tap); padding: 8px 16px; border-radius: var(--r); font-weight: 600;
  background: var(--surface); border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-align: center; line-height: 1.25; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-dim); }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 2px 6px rgba(17, 24, 39, .18); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.pay { background: var(--ok); color: #fff; border-color: var(--ok); box-shadow: 0 2px 6px rgba(23, 121, 76, .22); }
.btn.pay:hover { filter: brightness(1.06); }
.btn.wide { grid-column: 1 / -1; }
.btn[disabled] { opacity: .45; pointer-events: none; box-shadow: none; }
.btn .badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent-ink) 20%, transparent); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.btn:not(.primary):not(.pay) .badge { background: var(--accent); color: var(--accent-ink); }

.cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { padding: 10px 15px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid transparent; color: var(--ink-mid); font-weight: 600; white-space: nowrap; min-height: 44px; }
.cats button:hover { background: var(--surface-3); color: var(--ink); }
.cats button.is-on { background: var(--accent); color: var(--accent-ink); }
.products { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(154px, 1fr)); margin-top: 14px; }
.product {
  position: relative; min-height: 86px; padding: 13px; border-radius: var(--r); text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; box-shadow: var(--shadow-sm);
}
.product:hover { border-color: var(--ink-dim); box-shadow: var(--shadow); }
.product:active { transform: scale(.985); }
.product .nm { font-weight: 700; font-size: 16.5px; line-height: 1.25; overflow-wrap: anywhere; }
.product .pr { color: var(--ink-mid); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; }
.product.bar::after { content: ""; position: absolute; top: 12px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--info); }

/* ---------- toolbars, chips, tables ---------- */
.bar-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip { padding: 9px 15px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-mid); font-weight: 600; min-height: 44px; box-shadow: var(--shadow-sm); }
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
input[type="date"], input[type="text"], input[type="number"], input[type="password"], select, textarea {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 11px 13px; min-height: 46px; color: var(--ink);
}
input::placeholder { color: var(--ink-dim); }
input:hover, select:hover { border-color: var(--ink-dim); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.grid th { color: var(--ink-dim); font-size: 13px; font-weight: 700; }
table.grid td { color: var(--ink-mid); }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tr:hover td { background: var(--surface-2); }
table.grid tr:last-child td { border-bottom: 0; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-sm); }
.kpi .k { color: var(--ink-dim); font-size: 14px; font-weight: 600; }
.kpi .v { font-size: 27px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 6px; }
.status-ok { color: var(--ok); font-weight: 700; }
.status-failed { color: var(--bad); font-weight: 700; }
.status-pending, .status-printing { color: var(--warn); font-weight: 700; }

/* ---------- modal ---------- */
.modal-root {
  position: fixed; inset: 0; z-index: var(--z-modal-back); display: grid; place-items: center;
  background: rgba(17, 24, 39, .32); backdrop-filter: blur(3px); padding: 16px;
  animation: fade .18s var(--ease);
}
.modal-root[hidden] { display: none; }
.modal {
  width: min(520px, 100%); max-height: 88vh; overflow: auto; z-index: var(--z-modal);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); animation: pop .22s var(--ease);
}
.modal h3 { padding: 20px 20px 0; font-size: 20px; letter-spacing: -.01em; }
.modal .body { padding: 16px 20px; display: grid; gap: 13px; }
.modal .foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 20px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.field { display: grid; gap: 6px; }
.field label { color: var(--ink-mid); font-size: 13px; font-weight: 600; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad button { min-height: 58px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 22px; font-weight: 600; }
.pad button:hover { background: var(--surface-3); }
.pad button:active { transform: scale(.96); background: var(--accent); color: var(--accent-ink); }
.pad-value { font-size: 38px; font-weight: 700; text-align: center; padding: 8px 0; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px; background: var(--surface-2); border-radius: var(--r); }
.seg button { min-height: 50px; border-radius: var(--r-sm); background: transparent; font-weight: 600; color: var(--ink-mid); }
.seg button:hover { color: var(--ink); }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.hint { color: var(--ink-dim); font-size: 14px; line-height: 1.55; }
.receipt-preview { width: 100%; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: 20px; display: grid; gap: 8px; justify-items: center; pointer-events: none; z-index: var(--z-toast); padding: 0 16px; }
.toast { padding: 12px 20px; border-radius: 999px; font-weight: 600; max-width: 92vw; background: #23272e; color: #fff; box-shadow: var(--shadow-lg); animation: toast-in .26s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.toast.ok { background: var(--ok); }
.toast.bad { background: var(--bad); }

/* ---------- printer stations ---------- */
.station { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); }
.station:hover { border-color: var(--line-2); }
.station-name { font-weight: 700; font-size: 16px; }
.station-where { color: var(--bad); font-weight: 600; margin-top: 3px; font-size: 13.5px; }
.station-where.set { color: var(--ok); }
.station .hint { margin-top: 3px; }
.station-actions { display: flex; gap: 8px; }

/* ---------- login ---------- */
.login { min-height: 80vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(384px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 32px 28px; display: grid; gap: 15px; box-shadow: var(--shadow-lg); animation: pop .26s var(--ease); }
.login-card h1 { font-size: 27px; letter-spacing: -.02em; }
.login-card > .hint { margin: -8px 0 6px; }
.login-card input { width: 100%; font-size: 17px; }
.login-card .btn { margin-top: 6px; }
.login-err { color: var(--bad); font-weight: 600; margin: 0; font-size: 14px; }

/* ---------- current user ---------- */
.user-chip { padding: 8px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); font-weight: 600; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: var(--shadow-sm); }
.user-chip:hover { background: var(--surface-2); }

/* ---------- per-line note ---------- */
.note-btn { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 7px 12px; min-height: 36px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-dim); font-size: 13.5px; font-weight: 600; max-width: 100%; }
.note-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-btn:hover { color: var(--ink); border-color: var(--line-2); }
.note-btn.has { color: var(--warn); background: var(--warn-soft); border-color: transparent; }

/* ---------- floor-plan map ---------- */
.map-wrap { position: relative; display: block; width: 100%; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); line-height: 0; box-shadow: var(--shadow); }
.map-wrap.editor { touch-action: none; }
.map-wrap.editor::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 0 2px var(--accent); border-radius: inherit; opacity: .35; }
.map-img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.map-pin {
  position: absolute; transform: translate(-50%, -50%); z-index: 2;
  display: grid; justify-items: center; gap: 0;
  min-width: 40px; padding: 6px 11px; border-radius: var(--r-sm);
  font-weight: 700; line-height: 1.1; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(17, 24, 39, .28);
}
.map-pin:hover { transform: translate(-50%, -50%) scale(1.06); z-index: 3; }
.map-pin.free { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.map-pin.busy { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.map-pin .pin-name { font-size: 15px; font-variant-numeric: tabular-nums; }
.map-pin .pin-sub { font-size: 10.5px; font-variant-numeric: tabular-nums; opacity: .82; }
.map-pin .pin-flag { position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--warn); border: 2px solid var(--surface); }
.map-wrap.editor .map-pin { cursor: grab; }
.map-wrap.editor .map-pin:active { cursor: grabbing; transform: translate(-50%, -50%) scale(1.1); }
.map-unplaced { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 14px; }
.map-unplaced .chip.pick.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.map-unplaced .chip.busy-chip { color: var(--accent); }
.map-legend { display: flex; gap: 16px; align-items: center; margin: 10px 2px 0; color: var(--ink-dim); font-size: 13px; font-weight: 600; }
.map-legend b { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.map-legend .swatch { width: 12px; height: 12px; border-radius: 4px; }
.map-legend .swatch.free { background: var(--surface); border: 1px solid var(--line-2); }
.map-legend .swatch.busy { background: var(--accent); }

/* ---------- refined scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-dim); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- entrance motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.table-grid .table-card:nth-child(2), .products .product:nth-child(2) { animation-delay: .03s; }
.table-grid .table-card:nth-child(3), .products .product:nth-child(3) { animation-delay: .06s; }
.table-grid .table-card:nth-child(4), .products .product:nth-child(4) { animation-delay: .09s; }
.table-grid .table-card:nth-child(5), .products .product:nth-child(5) { animation-delay: .12s; }
.table-grid .table-card:nth-child(6), .products .product:nth-child(6) { animation-delay: .15s; }
.table-grid .table-card:nth-child(n+7) { animation-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- icons in labels ---------- */
.tab .ic { opacity: .92; }
.btn .ic, .chip .ic, .back .ic { opacity: .95; }

/* ---------- illustrated empty states ---------- */
.empty-box { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 16px; }
.empty-ill { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-dim); margin-bottom: 4px; }
.empty-ill .ic { width: 28px; height: 28px; stroke-width: 1.6; }
.empty-t { font-weight: 700; font-size: 16px; color: var(--ink); }
.empty-box .hint { max-width: 32ch; }

/* ---------- login brand mark ---------- */
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); margin-bottom: 2px; }
.brand-mark .ic { width: 26px; height: 26px; stroke-width: 1.8; }

/* ---------- floor plan (Lost Hut seating plan) ---------- */
.plan-wrap { border-radius: var(--r-lg); overflow: auto; border: 1px solid var(--line-2); box-shadow: var(--shadow); background: #96aa7d; line-height: 0; -webkit-overflow-scrolling: touch; }
.plan { display: block; width: 100%; min-width: 720px; height: auto; font-family: Inter, Arial, sans-serif; user-select: none; }
.ptable { cursor: pointer; outline: none; }
.ptable .hit { fill: transparent; }
.ptable .shape > * { fill: var(--tc); transition: fill .15s; }
.ptable:hover .shape, .ptable:focus-visible .shape { filter: drop-shadow(0 0 3px rgba(0, 0, 0, .55)); }
.ptable:focus-visible .hit { stroke: #111; stroke-width: 2; stroke-dasharray: 4 3; }
.ptable.busy .shape { filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .45)); }
.ptable .pnum { font-size: 13px; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.ptable .psum { font-size: 11px; font-weight: 700; text-anchor: middle; dominant-baseline: hanging; fill: #111; paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; }
.ptable .pflag { fill: #f6b73c; stroke: #fff; stroke-width: 1.5; }

.pquick { cursor: pointer; outline: none; }
.pquick .hit { fill: transparent; stroke: transparent; stroke-width: 2; }
.pquick:hover .hit, .pquick:focus-visible .hit { fill: rgba(255, 255, 255, .18); stroke: #111; stroke-dasharray: 5 4; }
.pquick .qb { fill: #111827; stroke: #fff; stroke-width: 2; }
.pquick.has .qb { fill: #f6b73c; }
.pquick .qt { font-size: 12px; font-weight: 700; fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pquick.has .qt { fill: #111; }
.quick-list { display: grid; gap: 8px; }
.quick-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; }

/* order screen: search + category tiles */
.psearch { width: 100%; min-height: 46px; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.psearch:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.cat-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cat-tile { display: grid; gap: 4px; align-content: center; min-height: 84px; padding: 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink); text-align: left; }
.cat-tile:hover { background: var(--surface-3); }
.cat-tile .nm { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.cat-tile .cnt { font-size: 14px; color: var(--ink-dim); }
.cat-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.product .cat-of { font-size: 13px; color: var(--ink-dim); }


/* ---------- UI pass 1 (2026-10-15): phone-first speed ---------- */
/* quick counters (bar / pool / reception) on the list view */
.quick-row { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); margin-bottom: 6px; }
.quick-btn { position: relative; display: grid; gap: 2px; justify-items: start; padding: 12px 14px; min-height: 72px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); text-align: left; }
.quick-btn .nm { font-size: 17px; font-weight: 700; }
.quick-btn .sub { font-size: 13.5px; color: var(--ink-mid); }
.quick-btn .count { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: #f6b73c; color: #1d1a12; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.quick-btn:active { transform: scale(.985); }

@media (max-width: 699px) {
  main { padding: 12px; padding-bottom: 96px; }
  .table-grid { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); }
  .table-card { min-height: 92px; padding: 11px 12px; }
  .table-card .num { font-size: 30px; }
  .table-card .sum { font-size: 17px; }
  .table-card .free-meta { display: none; }
  .quick-btn { min-height: 64px; padding: 10px 12px; }
  /* two dishes per row on phones: fewer scrolls between taps */
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product { min-height: 78px; padding: 11px 12px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cat-tile { min-height: 72px; padding: 12px; }
  .panel-body { padding: 12px; }
}

/* order screen on phones: the menu comes first, the bill lives in a sticky dock */
.order-dock { display: none; }
@media (max-width: 899px) {
  .order > .panel:first-child { order: 2; scroll-margin-top: 70px; }
  .order-head .hint { display: none; }
  .order-head .table-name { font-size: 22px; }
  .order-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
    display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line-2); box-shadow: 0 -8px 24px -12px rgba(20, 30, 20, .28);
  }
  .order-dock .dock-total { display: grid; line-height: 1.15; padding: 0 4px; }
  .order-dock .dock-total { min-width: 0; }
  .order-dock .dock-total b { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
  .order-dock .dock-total span { font-size: 13px; color: var(--ink-dim); white-space: nowrap; }
  .order-dock .btn { min-height: 52px; padding: 8px 14px; white-space: nowrap; }
}
@media (max-width: 420px) {
  .order-dock .btn .ic { display: none; }
  .order-dock .btn { padding: 8px 12px; }
}
