:root {
  --bg: #06110b;
  --surface: #0c1d14;
  --surface-2: #12281c;
  --line: rgba(233, 245, 226, 0.09);
  --line-strong: rgba(233, 245, 226, 0.18);
  --text: #eef5ea;
  --muted: #8ea597;
  --accent: #b8f23e;
  --accent-ink: #0b1a04;
  --red: #ef5a5f;
  --amber: #f4b942;
  --blue: #6cc4ff;
  --radius: 16px;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(184, 242, 62, 0.13), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.014) 0 90px, transparent 90px 180px),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1180px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand svg { flex: none; }
.brand span {
  font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top .link { color: var(--muted); font-size: 14px; text-decoration: none; white-space: nowrap; }
.top .link:hover { color: var(--text); }

.top-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.top-actions .btn { white-space: nowrap; }
@media (max-width: 520px) { .top-actions .link { display: none; } }

/* ---------- toasts & my bookings ---------- */
.toasts { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 50; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; cursor: pointer; width: 100%; max-width: 440px; padding: 12px 16px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); animation: drop 0.3s ease;
}
.toast strong { display: block; font-family: var(--display); font-size: 20px; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.2; }
.toast span { display: block; font-size: 14px; font-weight: 500; }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }
.mine-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.mine-head .code { font-size: 28px; }
#view-mine > h2 { margin-top: 4px; }

/* ---------- hero ---------- */
.hero { padding: 26px 0 30px; }
.eyebrow {
  margin: 0 0 10px; color: var(--accent); font-family: var(--display); font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; font-size: 14px;
}
h1 {
  margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(46px, 11vw, 92px); line-height: 0.92; letter-spacing: 0.005em;
}
h1 em { font-style: normal; color: var(--accent); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px;
  font-size: 14px; color: var(--muted); background: rgba(255, 255, 255, 0.02);
}
.chip b { color: var(--text); font-weight: 600; }

/* ---------- panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
h2 {
  display: flex; align-items: center; gap: 12px; margin: 0 0 16px;
  font-family: var(--display); font-weight: 700; font-size: 24px; text-transform: uppercase; letter-spacing: 0.04em;
}
.num {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 16px; flex: none;
}
.sub { color: var(--muted); font-size: 14px; margin: -8px 0 16px; }

/* ---------- date strip ---------- */
.dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.date {
  flex: none; width: 66px; padding: 10px 0 9px; border-radius: 14px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--line); scroll-snap-align: start;
}
.date small { display: block; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.date strong { display: block; font-family: var(--display); font-size: 28px; line-height: 1.1; font-weight: 700; }
.date:hover { border-color: var(--line-strong); }
.date[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.date[aria-pressed="true"] small { color: var(--accent-ink); }

/* ---------- slots ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin: -6px 0 16px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line-strong); }
.legend .l-free { background: var(--surface-2); }
.legend .l-sel { background: var(--accent); border-color: var(--accent); }
.legend .l-taken { background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255, 255, 255, 0.16) 3px 4px); }

.group-title {
  margin: 18px 0 8px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.group-title:first-child { margin-top: 0; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.slot {
  text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--line); transition: transform 0.08s, border-color 0.15s, background 0.15s;
}
.slot .t { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; }
.slot .p { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.slot:hover:not(:disabled) { border-color: var(--accent); }
.slot:active:not(:disabled) { transform: scale(0.97); }
.slot[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slot[aria-pressed="true"] .p { color: var(--accent-ink); }
.slot:disabled {
  cursor: not-allowed; color: var(--muted); opacity: 0.55;
  background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(255, 255, 255, 0.045) 7px 8px);
}
.slot:disabled .t { text-decoration: line-through; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* ---------- sticky bar ---------- */
.bar-space { height: 96px; }
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(9, 22, 15, 0.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line-strong);
  transform: translateY(110%); transition: transform 0.25s ease;
}
.bar.show { transform: none; }
.bar-in { max-width: 848px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.bar .when { font-size: 13px; color: var(--muted); }
.bar .total { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.1; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px;
  padding: 14px 22px; background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: 0.06em; text-transform: uppercase;
  transition: filter 0.15s, transform 0.08s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 9px; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(239, 90, 95, 0.4); }
.back { background: none; border: 0; color: var(--muted); padding: 8px 0; margin: 4px 0 10px; font-size: 15px; }
.back:hover { color: var(--text); }

label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
input[type="text"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select {
  width: 100%; padding: 13px 14px; border-radius: 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); font-size: 16px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
input::placeholder { color: #5f7568; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.error {
  background: rgba(239, 90, 95, 0.1); border: 1px solid rgba(239, 90, 95, 0.4); color: #ffb3b5;
  border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 14px;
}
.ok-note {
  background: rgba(184, 242, 62, 0.08); border: 1px solid rgba(184, 242, 62, 0.35); color: var(--accent);
  border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 14px;
}

/* ---------- summary rows ---------- */
.rows { margin: 0; }
.rows div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line-strong); }
.rows div:last-child { border-bottom: 0; }
.rows dt { color: var(--muted); font-size: 14px; }
.rows dd { margin: 0; font-weight: 600; text-align: right; }
.rows .big dd { font-family: var(--display); font-size: 28px; line-height: 1; color: var(--accent); }

/* ---------- payment ---------- */
.pay-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.qr-card { background: #fff; border-radius: 18px; padding: 16px; text-align: center; color: #1a1a1a; }
.qr-card img { display: block; width: 100%; height: auto; border-radius: 8px; }
.qr-card .pp { font-weight: 700; color: #5f259f; margin-bottom: 10px; font-size: 15px; letter-spacing: 0.02em; }
.qr-card .amt { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; margin-top: 12px; }
.qr-card .amt-note { font-size: 13px; color: #555; margin-top: 4px; }
.gw-status { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); margin-bottom: 14px; font-weight: 600; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
#gatewayBox { max-width: 460px; }
#gatewayBox .btn { margin-bottom: 4px; }
.btn.phonepe { background: #5f259f; color: #fff; margin-bottom: 10px; }
#payApps .btn.ghost { margin-bottom: 10px; }
.pay-grid.on-phone .qr-card { order: 2; }
.qr-swap { background: none; border: 0; color: #5f259f; font-size: 13px; text-decoration: underline; margin-top: 10px; padding: 4px; }
.qr-missing { aspect-ratio: 1; display: grid; place-items: center; border: 2px dashed #bbb; border-radius: 10px; color: #666; font-size: 14px; padding: 18px; }
.timer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: rgba(244, 185, 66, 0.08); border: 1px solid rgba(244, 185, 66, 0.35); color: var(--amber); font-size: 14px; margin-bottom: 16px;
}
.timer b { font-family: var(--display); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.steps { margin: 0 0 18px; padding-left: 20px; color: var(--muted); font-size: 15px; }
.steps li { margin-bottom: 6px; }
.steps b { color: var(--text); }

/* ---------- ticket ---------- */
.ticket { max-width: 460px; margin: 10px auto 0; text-align: center; }
.tick {
  width: 76px; height: 76px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; margin: 0 auto 16px; animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.ticket h1 { font-size: clamp(40px, 10vw, 60px); }
.ticket .lead { color: var(--muted); margin: 10px 0 20px; }
.ticket .panel { text-align: left; position: relative; }
.code { font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent); }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0 40px; }
.foot a { color: var(--muted); }

/* ---------- admin ---------- */
.login { max-width: 400px; margin: 9vh auto 0; }
.login h1 { font-size: 52px; margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat small { display: block; color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.stat strong { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1.1; }
.stat.alert strong { color: var(--amber); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; overflow-x: auto; max-width: 100%; }
.tab { border: 0; background: none; padding: 8px 14px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.toolbar input[type="search"] { flex: 1; min-width: 180px; padding: 10px 14px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td small { display: block; color: var(--muted); font-size: 13px; }
td .mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 4px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.badge.confirmed { background: rgba(244, 185, 66, 0.14); color: var(--amber); }
.badge.verified { background: rgba(184, 242, 62, 0.14); color: var(--accent); }
.badge.cancelled { background: rgba(239, 90, 95, 0.14); color: var(--red); }
.badge.pending { background: rgba(108, 196, 255, 0.14); color: var(--blue); }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }
.qr-admin { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-admin .preview { width: 140px; height: 140px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; color: #666; font-size: 13px; text-align: center; padding: 8px; flex: none; }
.qr-admin .preview img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 760px) {
  .pay-grid { grid-template-columns: 1fr; }
  .qr-card { max-width: 320px; margin: 0 auto; width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .panel { padding: 16px; }

  /* bookings table becomes cards */
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border: 1px solid var(--line); border-radius: 14px; padding: 6px 4px; margin-bottom: 10px; background: var(--surface-2); }
  td { border: 0; padding: 7px 12px; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; text-align: left; flex: none; padding-top: 2px; }
  td.actions { justify-content: flex-end; }
  td.actions::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
