/* Bar orders - shared styling. Dark, high contrast, big touch targets.
   Mobile-first for the guest page; the staff board expands at >=900px. */

:root {
  --bg: #12131a;
  --surface: #1c1e29;
  --surface-2: #262938;
  --line: #343850;
  --text: #f2f3f8;
  --muted: #9aa0b8;
  --accent: #ffb347;
  --accent-ink: #2a1a00;
  --new: #ff7a59;
  --prep: #ffb347;
  --served: #5ac47d;
  --danger: #e0574f;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body { padding-bottom: env(safe-area-inset-bottom); }

h1, h2, h3 { margin: 0; font-weight: 650; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; letter-spacing: .02em; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px 14px 140px; }

header.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px;
  background: linear-gradient(var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
}

.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- menu ---------- */
.cat { margin: 22px 0 10px; color: var(--accent); text-transform: uppercase; font-size: .8rem; }

.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.item.gone { opacity: .4; }
.item .label { flex: 1; min-width: 0; }
.item .name { font-weight: 600; }
.item .price { color: var(--muted); font-size: .85rem; }

.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 44px; height: 44px; border-radius: 12px; font-size: 1.4rem; line-height: 1;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  cursor: pointer; touch-action: manipulation;
}
.stepper button:active { background: var(--accent); color: var(--accent-ink); }
.stepper .qty { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.stepper .qty.zero { color: var(--muted); font-weight: 400; }

/* ---------- cart ---------- */
.cart {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform .18s ease;
}
.cart.show { transform: none; }
.cart .row { display: flex; align-items: center; gap: 12px; }
.cart .summary { flex: 1; min-width: 0; }

input[type="text"], textarea {
  width: 100%; padding: 12px 14px; margin: 0 0 10px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; font: inherit;
}
input[type="text"]:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

button.primary {
  padding: 14px 20px; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation;
}
button.primary:disabled { opacity: .45; cursor: default; }
button.ghost {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: transparent; color: var(--text); font: inherit; cursor: pointer;
}

/* ---------- guest order status ---------- */
.orders { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.order {
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius);
}
.order.new       { border-left-color: var(--new); }
.order.preparing { border-left-color: var(--prep); }
.order.served    { border-left-color: var(--served); }
.order.cancelled { opacity: .5; }
.order .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: .06em; }
.order .what { margin-top: 4px; }

.steps { display: flex; gap: 6px; margin-top: 10px; }
.steps span {
  flex: 1; text-align: center; padding: 6px 4px; border-radius: 8px;
  background: var(--surface-2); color: var(--muted); font-size: .78rem;
}
.steps span.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.notice {
  margin: 40px 0; padding: 28px 20px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.notice .big { font-size: 1.5rem; margin-bottom: 6px; }

/* ---------- staff board ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 24px; text-align: center; background: var(--bg);
}
.gate button { font-size: 1.2rem; padding: 22px 34px; }

.board { display: grid; gap: 12px; padding: 0 12px 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .board { grid-template-columns: repeat(3, 1fr); } }

.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.col h2 { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }
.col .count {
  min-width: 26px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: .8rem; text-align: center;
}
.col[data-col="new"] .count.hot { background: var(--new); color: #2a0a00; font-weight: 700; }

.ticket { padding: 12px; margin-bottom: 10px; background: var(--surface-2); border-radius: 12px; border-left: 4px solid var(--line); }
.ticket.new       { border-left-color: var(--new); }
.ticket.preparing { border-left-color: var(--prep); }
.ticket.served    { border-left-color: var(--served); }
.ticket .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ticket .who { font-weight: 700; font-size: 1.05rem; }
.ticket .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-size: .85rem; }
.ticket ul { margin: 8px 0 0; padding-left: 18px; }
.ticket li { margin: 2px 0; }
.ticket .note { margin-top: 8px; padding: 6px 8px; background: rgba(255,179,71,.14); border-radius: 8px; font-size: .9rem; }
.ticket .actions { display: flex; gap: 8px; margin-top: 10px; }
.ticket .actions button { flex: 1; padding: 12px 8px; font-size: .95rem; }
.ticket .ago { color: var(--muted); font-size: .8rem; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 12px 12px; }
.pill { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: .85rem; }
.pill.live { color: var(--served); }
.pill.down { color: var(--danger); }
.pill.closed { background: var(--danger); color: #fff; font-weight: 700; }

dialog {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); max-width: 420px; width: calc(100% - 32px);
}
dialog::backdrop { background: rgba(0,0,0,.6); }
