/* ==========================================================================
   PICK A POT · Queue System Design System
   Theme: Hot-pot Red & Gold — warm cream surfaces, chili-red primary,
          golden accents, deep espresso ink. All surfaces light.
   All class names / ids are kept stable for the existing JS contracts.
   ========================================================================== */

:root {
  /* Brand primitives — hot pot red & gold */
  --chili: oklch(56% 0.20 27);          /* chili red — signature */
  --chili-deep: oklch(47% 0.19 27);
  --chili-soft: oklch(96% 0.028 40);
  --chili-tint: oklch(93% 0.045 35);
  --gold: oklch(83% 0.15 85);           /* golden accent */
  --gold-deep: oklch(73% 0.15 80);
  --gold-soft: oklch(96% 0.055 85);
  --ink: oklch(27% 0.035 45);           /* deep espresso brown */
  --ink-2: oklch(42% 0.03 50);

  /* Semantic tokens */
  --brand: var(--chili);
  --brand-dark: var(--chili-deep);
  --accent: var(--gold);
  --ok: oklch(53% 0.13 150);
  --warn: oklch(64% 0.15 65);
  --danger: oklch(55% 0.20 27);

  /* Warm cream neutrals (hue ~75) */
  --bg: oklch(97.5% 0.014 82);
  --surface: #ffffff;
  --surface-2: oklch(96.5% 0.02 80);
  --muted: oklch(54% 0.025 65);
  --line: oklch(90% 0.025 75);

  --shadow-sm: 0 1px 2px rgba(120, 45, 20, .05), 0 2px 8px rgba(120, 45, 20, .05);
  --shadow: 0 4px 6px rgba(120, 45, 20, .05), 0 14px 34px rgba(120, 45, 20, .10);
  --radius: 16px;
  --radius-sm: 10px;

  /* Type scale */
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Fraunces", "Plus Jakarta Sans", Georgia, serif;
}

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; }
a { color: var(--chili-deep); }
button, input, select { font: inherit; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}
.topbar h1 { font-size: 19px; margin: 0; font-weight: 700; color: var(--ink); }
.topbar .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.lang-btn, .ghost-btn, .link-btn {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.lang-btn:hover, .ghost-btn:hover, .link-btn:hover {
  background: var(--chili-soft);
  border-color: var(--brand);
  color: var(--chili-deep);
}
.ghost-btn:active, .lang-btn:active { transform: translateY(1px); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 22px 16px 48px; }
.wrap.wide { max-width: 1180px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.card .hint { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }

/* --------------------------------------------------------------------------
   Form controls
   -------------------------------------------------------------------------- */
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; color: var(--ink-2); }
input[type=text], input[type=tel], input[type=number], input[type=password], select {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  font-size: 15px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input::placeholder { color: oklch(68% 0.025 65); }
input:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px oklch(56% 0.20 27 / .13);
}

.checkline { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin: 6px 0 20px; line-height: 1.5; }
.checkline input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; border: none;
  border-radius: 12px; padding: 13px 20px; font-weight: 700; font-size: 15px;
  cursor: pointer; width: 100%;
  box-shadow: 0 4px 12px oklch(56% 0.20 27 / .28);
  transition: background .18s ease, transform .15s ease, box-shadow .18s ease;
}
.btn:hover { background: var(--brand-dark); box-shadow: 0 6px 18px oklch(47% 0.19 27 / .34); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.secondary { background: var(--surface-2); color: var(--ink-2); border: 1.5px solid var(--line); box-shadow: none; }
.btn.secondary:hover { background: var(--chili-soft); border-color: var(--brand); color: var(--chili-deep); }
.btn.ok { background: var(--ok); box-shadow: 0 4px 12px oklch(53% 0.13 150 / .25); }
.btn.warn { background: var(--warn); }
.btn.sm { width: auto; padding: 8px 15px; font-size: 13px; border-radius: 9px; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* --------------------------------------------------------------------------
   Alerts & pills
   -------------------------------------------------------------------------- */
.alert { padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; display: none; }
.alert.show { display: block; }
.alert.err { background: oklch(96% 0.025 27); color: var(--danger); border: 1px solid oklch(89% 0.05 27); }
.alert.ok { background: oklch(96% 0.02 150); color: var(--ok); border: 1px solid oklch(89% 0.05 150); }
.alert.info { background: var(--gold-soft); color: oklch(40% 0.09 75); border: 1px solid oklch(88% 0.08 85); }

.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.waiting { background: var(--gold-soft); color: oklch(45% 0.11 70); }
.pill.called { background: oklch(94% 0.05 150); color: oklch(45% 0.12 150); }
.pill.seated { background: var(--surface-2); color: var(--ink-2); }
.pill.cancelled, .pill.expired { background: oklch(95% 0.03 27); color: var(--danger); }

/* --------------------------------------------------------------------------
   Ticket display
   -------------------------------------------------------------------------- */
.ticket-number {
  font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 88px); font-weight: 700; letter-spacing: 1px;
  color: var(--brand); text-align: center; line-height: 1.05; margin: 10px 0;
  font-variant-numeric: tabular-nums;
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 15px; text-align: center; }
.stat .v { font-size: 27px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11.5px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.qr-box { text-align: center; padding: 8px; }
.qr-box canvas { image-rendering: pixelated; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* --------------------------------------------------------------------------
   Tables (staff back office)
   -------------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
tbody tr:hover { background: var(--surface-2); }
td.num { font-weight: 800; font-size: 16px; color: var(--chili-deep); font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login-card { max-width: 400px; margin: 10vh auto; }
.login-card::before {
  content: ""; display: block; width: 46px; height: 5px; border-radius: 99px;
  background: var(--brand); margin: 0 auto 20px;
}
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 560px) {
  .card { padding: 20px; }
  .row { flex-direction: column; }
}
