:root {
  --bg: #f5f1ea;
  --card: #ffffff;
  --text: #161616;
  --muted: #74706a;
  --line: #e5ded4;
  --accent: #111111;
  --yellow: #ffe7a3;
  --yellow-strong: #f5b736;
  --green: #dff6df;
  --green-strong: #1d8a35;
  --red: #ffe0dc;
  --shadow: 0 18px 60px rgba(0,0,0,.10);
  --radius: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.guest-page {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 20px;
  transition: background .25s ease;
}

.guest-card {
  width: min(100%, 480px);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 24px 24px;
  text-align: center;
}

.brand {
  font-weight: 950;
  letter-spacing: .08em;
  font-size: 24px;
}

.kicker {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--muted);
  font-weight: 850;
}

h1 {
  margin: 26px 0 10px;
  font-size: clamp(32px, 9vw, 44px);
  line-height: 1.02;
}

h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  margin: 0 auto 24px;
}

.party-box {
  margin: 26px 0 20px;
  padding: 18px;
  background: #faf8f4;
  border: 1px solid var(--line);
  border-radius: 22px;
}

.party-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.party-grid button,
.primary-btn,
.action-btn,
.sound-btn {
  border: 0;
  border-radius: 18px;
  font-weight: 850;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.party-grid button {
  height: 56px;
  background: white;
  border: 1px solid var(--line);
  font-size: 21px;
}

.party-grid button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.primary-btn {
  width: 100%;
  height: 62px;
  background: var(--accent);
  color: white;
  font-size: 18px;
}

.primary-btn:disabled,
.sound-btn:disabled { opacity: .55; }

.sound-btn {
  margin-top: 16px;
  min-height: 44px;
  padding: 0 16px;
  background: #f2eee8;
  color: var(--text);
  border: 1px solid var(--line);
}

.small-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 16px 0 0;
}

.ticket-code {
  margin: 24px auto 14px;
  width: min(78vw, 250px);
  height: 138px;
  display: grid;
  place-items: center;
  border-radius: 32px;
  background: var(--accent);
  color: white;
  font-size: clamp(58px, 17vw, 78px);
  font-weight: 950;
  letter-spacing: .05em;
}

.status-badge {
  width: fit-content;
  margin: 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f2eee8;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .12em;
  font-weight: 950;
}

.ticket-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.ticket-meta div {
  background: #faf8f4;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
}

.ticket-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

.ticket-meta strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.return-panel {
  display: none;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  border-radius: 24px;
  background: #111;
  color: #fff;
  text-align: left;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}

.return-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  font-size: 34px;
  font-weight: 950;
}

.return-panel strong {
  display: block;
  font-size: 22px;
  line-height: 1.05;
}

.return-panel span {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,.78);
  font-size: 15px;
}

body.status-called_15 { background: var(--yellow); }
body.status-called_now { background: var(--green); }
body.status-no_show,
body.status-cancelled,
body.status-expired,
body.status-seated { background: #e6e2db; }
body.status-called_now .ticket-code { background: var(--green-strong); }
body.status-called_15 .ticket-code { background: #a96e00; }
body.status-called_now .status-badge { background: var(--green-strong); color: white; }
body.status-called_15 .status-badge { background: var(--yellow-strong); color: #111; }
body.status-called_now h1,
body.status-called_15 h1 { font-size: clamp(34px, 10vw, 50px); }
body.status-called_now .guest-card,
body.status-called_15 .guest-card { outline: 8px solid rgba(255,255,255,.55); }

.admin-page {
  min-height: 100svh;
  padding: 18px;
}

.admin-header {
  max-width: 1180px;
  margin: 0 auto 14px;
  background: white;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-brand { font-size: 22px; }
.admin-stats { display: flex; gap: 12px; }
.admin-stats div {
  min-width: 98px;
  padding: 12px 14px;
  background: #faf8f4;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
}
.admin-stats span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.admin-stats strong { font-size: 22px; }

.admin-main { max-width: 1180px; margin: 0 auto; }
.admin-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px;
  padding: 0 6px;
}
.tickets-list { display: grid; gap: 12px; }

.ticket-row {
  background: white;
  border-radius: 24px;
  box-shadow: 0 8px 28px rgba(0,0,0,.08);
  padding: 14px;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 16px;
  align-items: center;
  border-left: 10px solid transparent;
}

.ticket-row.called_15 { border-left-color: #d99100; background: #fff8e1; }
.ticket-row.called_now { border-left-color: #168030; background: #f1fff1; }

.row-code { font-size: 34px; font-weight: 950; letter-spacing: .04em; }
.row-info { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-weight: 750; }
.row-info strong { color: var(--text); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.action-btn {
  min-height: 44px;
  padding: 0 14px;
  background: #f2eee8;
  color: var(--text);
  font-size: 14px;
}
.action-btn.primary { background: #111; color: #fff; }
.action-btn.good { background: #dff6df; }
.action-btn.warn { background: #ffe7a3; }
.action-btn.bad { background: #ffe0dc; }

.empty-state {
  display: none;
  background: white;
  border-radius: 24px;
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 22px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

@media (max-width: 760px) {
  .admin-header { align-items: stretch; flex-direction: column; }
  .admin-stats { width: 100%; }
  .admin-stats div { flex: 1; }
  .ticket-row { grid-template-columns: 1fr; }
  .row-actions { justify-content: stretch; }
  .action-btn { flex: 1 1 46%; }
}

/* v4 Web Push */
.notify-box {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #faf8f4;
  text-align: left;
}

.notify-title {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -.02em;
}

.notify-box p {
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.notify-btn {
  height: 52px;
  font-size: 16px;
}

.notify-state {
  display: none;
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.notify-state.ok {
  display: block;
  background: var(--green);
  color: var(--green-strong);
}

.notify-state.warn {
  display: block;
  background: var(--yellow);
  color: #6d4a00;
}

.notify-state.bad {
  display: block;
  background: var(--red);
  color: #8b1b10;
}
