/* ===== Event Ticketing — shared styles ===== */
:root {
  --brand: #4338ca;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, #ffffff);
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e7ef;
  --text: #0f172a;
  --muted: #64748b;
  --ok: #15803d;   --ok-bg: #dcfce7;
  --warn: #b45309; --warn-bg: #fef3c7;
  --bad: #b91c1c;  --bad-bg: #fee2e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .07);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- form controls ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #94a3b8; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.input.invalid { border-color: var(--bad); }
select.input { padding-right: 32px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, filter .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand); filter: brightness(1.1); }
.btn-block { width: 100%; padding: 14px 16px; font-size: 15px; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(15, 23, 42, .05); }
.btn-danger { color: var(--bad); }
.btn svg { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.form-error { color: var(--bad); font-size: 14px; margin: 12px 0 0; min-height: 1.3em; }
.form-ok { color: var(--ok); font-size: 14px; margin: 10px 0 0; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-neutral { background: #eef2f7; color: #475569; }
.badge-brand { background: var(--brand-soft); color: var(--brand); }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.eyebrow-light { color: rgba(255, 255, 255, .82); }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- registration page ---------- */
.reg-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 0% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
    radial-gradient(700px 400px at 100% 0%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%),
    var(--bg);
}
.reg-wrap { max-width: 1080px; margin: 0 auto; padding: 64px 16px 40px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.reg-hero { padding-top: 12px; }
.reg-hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.06; margin: 12px 0 14px; letter-spacing: -.025em; }
.tagline { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.ev-meta { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 14px; }
.ev-meta li { display: flex; gap: 14px; align-items: center; }
.ico { flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--brand); box-shadow: var(--shadow); }
.ico svg { width: 20px; height: 20px; }
.ev-meta .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ev-meta .v { font-weight: 600; }
.ev-meta a { font-size: 14px; font-weight: 600; }
.seats { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 600; margin-bottom: 28px; }
.seats .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.seats.low .dot { background: var(--warn); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 520px; }
.step { padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border); }
.step b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; margin-bottom: 8px; }
.step span { font-size: 13px; color: var(--muted); line-height: 1.4; display: block; }
.reg-card { padding: 32px; }
.reg-card h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; }
.reg-card .sub { margin: 0 0 24px; color: var(--muted); font-size: 15px; }
.reg-divider { border: 0; border-top: 1px solid var(--border); margin: 24px 0 18px; }
.resend-row { display: flex; gap: 8px; margin-top: 12px; }
.resend-row .input { flex: 1; min-width: 0; }
.closed-box { text-align: center; padding: 12px 0; }
.closed-box h2 { margin-bottom: 8px; }
.reg-foot { grid-column: 1 / -1; text-align: center; font-size: 13px; color: var(--muted); padding-top: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: -4px 0 18px; padding: 12px 14px; border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 10px; font-size: 14px; color: #14532d; cursor: pointer; line-height: 1.45; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #16a34a; flex: none; cursor: pointer; }
.wa-ico { width: 16px; height: 16px; color: #16a34a; vertical-align: -3px; margin-right: 2px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 880px) {
  .reg-wrap { grid-template-columns: 1fr; gap: 28px; padding: 32px 16px; }
  .reg-hero { padding-top: 0; }
  .tagline { margin-bottom: 20px; }
  .steps { display: none; }
  .reg-card { padding: 24px 20px; }
}

/* ---------- ticket page ---------- */
.ticket-body { min-height: 100vh; background: radial-gradient(800px 420px at 50% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%), var(--bg); }
.ticket-wrap { max-width: 440px; margin: 0 auto; padding: 32px 16px 48px; display: grid; gap: 16px; }
.ticket { background: var(--surface); border-radius: 22px; box-shadow: 0 20px 50px rgba(15, 23, 42, .14); overflow: hidden; }
.ticket-head { background: var(--brand); color: #fff; padding: 26px 26px 24px; }
.ticket-head h1 { margin: 8px 0 0; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
.ticket-head p { margin: 6px 0 0; opacity: .88; font-size: 14px; }
.ticket-qr { padding: 26px 24px 6px; text-align: center; }
.qr-wrap { position: relative; display: inline-block; }
.qr-wrap img { display: block; width: 100%; max-width: 280px; height: auto; border: 1px solid var(--border); border-radius: 16px; }
.stamp { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .86); border-radius: 16px; font-size: 26px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--bad); }
.ticket-code { font-family: var(--mono); font-weight: 700; font-size: 22px; letter-spacing: .14em; margin: 14px 0 4px; }
.ticket-cut { position: relative; border-top: 2px dashed var(--border); margin: 22px 0 18px; }
.ticket-cut::before, .ticket-cut::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); }
.ticket-cut::before { left: -12px; }
.ticket-cut::after { right: -12px; }
.ticket-info { padding: 0 26px 22px; display: grid; gap: 14px; }
.info-row { display: flex; gap: 12px; align-items: flex-start; }
.info-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.info-ico svg { width: 17px; height: 17px; }
.info-row .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.info-row .v { font-weight: 600; }
.info-row .v a { font-size: 13px; margin-left: 4px; }
.ticket-actions { padding: 0 26px 26px; display: grid; gap: 8px; }
.ticket-actions p { margin: 4px 0 0; }
.ticket-foot { text-align: center; font-size: 13px; color: var(--muted); margin: 0; }
.notice { border-radius: 12px; padding: 13px 15px; font-size: 14px; line-height: 1.5; }
.notice-ok { background: var(--ok-bg); color: #14532d; }
.notice-warn { background: var(--warn-bg); color: #78350f; }
.notice-bad { background: var(--bad-bg); color: #7f1d1d; }
.notfound { padding: 32px 24px; text-align: center; }
.notfound h1 { margin: 0 0 8px; font-size: 22px; }
@media print {
  body { background: #fff !important; }
  .ticket { box-shadow: none; border: 1px solid #ccc; }
  .ticket-actions, .notice { display: none; }
}

/* ---------- auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(800px 400px at 50% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; padding: 32px 28px; }
.auth-card h1 { font-size: 22px; margin: 16px 0 2px; }
.auth-card .sub { margin: 0 0 24px; }
.logo { width: 42px; height: 42px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.logo svg { width: 22px; height: 22px; }

/* ---------- admin ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: var(--muted); }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px 16px 56px; display: grid; gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat .s { font-size: 13px; color: var(--muted); }
.bar { height: 6px; background: #eef2f7; border-radius: 99px; margin-top: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 99px; transition: width .4s; }
.stat.alert .v { color: var(--bad); }
.share { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.share .k { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.share code { font-family: var(--mono); font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; word-break: break-all; display: inline-block; }
.share .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.panel-head { display: flex; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: center; }
.panel-head .input { flex: 1 1 240px; min-width: 0; padding: 10px 12px; font-size: 15px; }
.panel-head select.input { flex: 0 0 auto; width: auto; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: #fafbfd; }
.table tr:last-child td { border-bottom: 0; }
.person .n { font-weight: 600; }
.person .e { font-size: 13px; color: var(--muted); }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dlv { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.dlv + .dlv { margin-top: 4px; }
.dlv-k { font-size: 12px; color: var(--muted); width: 64px; }
.badge[title] { cursor: help; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); gap: 12px; }
.pager .btns { display: flex; gap: 6px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); z-index: 50; max-width: calc(100% - 32px); }
@media (max-width: 880px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat .v { font-size: 26px; }
  .hide-sm { display: none; }
}

/* ---------- scanner ---------- */
.scan-body { background: #0b1020; color: #e2e8f0; min-height: 100vh; }
.scan-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); position: sticky; top: 0; background: #0b1020; z-index: 5; }
.scan-title { font-weight: 700; }
.scan-sub { font-size: 12px; color: #94a3b8; }
.scan-count { text-align: right; line-height: 1.2; }
.scan-count strong { font-size: 24px; color: #fff; }
.scan-count span { color: #94a3b8; font-size: 13px; }
.scan-main { max-width: 520px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
.cam-box { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 1 / 1; border: 1px solid #1f2937; }
#reader { width: 100%; height: 100%; }
#reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 28px; color: #cbd5e1; font-size: 15px; line-height: 1.5; }
.cam-msg .btn { margin-top: 14px; }
.scan-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-dark { background: #1e293b; border-color: #334155; color: #e2e8f0; }
.btn-dark:hover { background: #273449; }
.manual { display: flex; gap: 8px; }
.manual .input { background: #111827; border-color: #334155; color: #fff; text-transform: uppercase; font-family: var(--mono); letter-spacing: .06em; min-width: 0; }
.recent h3 { font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; margin: 8px 0 8px; }
.recent ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.recent li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #111827; border: 1px solid #1f2937; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.recent li .t { color: #94a3b8; font-size: 12px; white-space: nowrap; }
.recent .who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.recent .who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rdot.VALID { background: #22c55e; } .rdot.USED { background: #f97316; } .rdot.INVALID, .rdot.CANCELLED { background: #ef4444; } .rdot.ERROR { background: #64748b; }
.recent .none { color: #64748b; font-size: 14px; }
.scan-links { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 2px 16px; }
.scan-links a, .scan-links .link { color: #a5b4fc; }
.result { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; color: #fff; cursor: pointer; animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.result.VALID { background: #15803d; }
.result.USED { background: #c2410c; }
.result.INVALID, .result.CANCELLED { background: #b91c1c; }
.result.LOADING, .result.ERROR { background: #1e293b; }
.result-inner { width: 100%; max-width: 440px; text-align: center; }
.result-icon { width: 104px; height: 104px; margin: 0 auto 18px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.result-icon svg { width: 56px; height: 56px; }
.result-icon .spinner { width: 44px; height: 44px; border-width: 4px; }
.result-title { font-size: 32px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; line-height: 1.1; }
.result-name { font-size: 26px; font-weight: 700; margin-top: 18px; word-break: break-word; }
.result-detail { font-size: 15px; opacity: .92; margin-top: 8px; white-space: pre-line; line-height: 1.6; word-break: break-word; }
.btn-light { background: #fff; color: #0f172a; border-color: #fff; margin-top: 32px; }
.btn-light:hover { background: #f1f5f9; }

/* ===================== v3: Live pass, OTP, anti-sharing ===================== */
.otp-input { text-align: center; font-family: var(--mono); font-size: 28px; letter-spacing: .5em; padding: 14px 10px 14px calc(10px + .5em); margin: 4px 0 14px; }
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; }
#otp-form h2 { margin: 0 0 4px; font-size: 22px; }

/* Live QR */
.live-wrap { position: relative; width: 100%; max-width: 280px; margin: 0 auto; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; border: 3px solid var(--brand); background: #fff; }
.live-qr { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; color: var(--brand); }
.live-qr svg { width: 100%; height: 100%; display: block; }
.live-qr.flash { animation: qrflash .5s ease-out; }
@keyframes qrflash { from { opacity: .25; } to { opacity: 1; } }
.live-sweep { position: absolute; inset: -40% -10%; pointer-events: none; background: linear-gradient(115deg, transparent 42%, color-mix(in srgb, var(--brand) 22%, transparent) 50%, transparent 58%); animation: sweep 2.6s linear infinite; mix-blend-mode: multiply; }
@keyframes sweep { from { transform: translateX(-60%); } to { transform: translateX(60%); } }
.live-meta { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-weight: 700; font-size: 13px; letter-spacing: .12em; color: var(--brand); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .2; transform: scale(.8); } }
.live-clock { font-family: var(--mono); font-size: 18px; letter-spacing: .06em; color: var(--text); padding-left: 6px; }
.live-bar { height: 5px; max-width: 280px; margin: 10px auto 0; border-radius: 99px; background: #e8ebf3; overflow: hidden; }
.live-bar i { display: block; height: 100%; width: 100%; background: var(--brand); border-radius: 99px; transition: width .25s linear; }
.live-hint { font-size: 13px; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }
.live-offline { font-size: 13px; color: var(--bad); font-weight: 600; margin: 6px 0 0; }
.pass-done { width: 100%; max-width: 280px; margin: 0 auto; aspect-ratio: 1 / 1; border-radius: 18px; background: var(--ok-bg); color: var(--ok); display: grid; place-content: center; justify-items: center; gap: 6px; font-size: 26px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pass-done svg { width: 72px; height: 72px; }
.pass-done small { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.pass-cancelled { background: var(--bad-bg); color: var(--bad); }

/* Locked pass */
.locked { padding: 26px 24px 28px; text-align: center; }
.locked-ico { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--bad-bg); color: var(--bad); display: grid; place-items: center; }
.locked-ico svg { width: 30px; height: 30px; }
.locked h2 { margin: 0 0 8px; font-size: 20px; }
.locked-move { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); text-align: left; display: grid; gap: 10px; }
.locked-move p { margin: 0; font-size: 14px; }
.locked-move .otp-input { margin: 0; }
.admin-facts { font-size: 14px; gap: 6px; }
.admin-facts .k { display: inline-block; width: 96px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* Scanner: owner verification */
.result.VERIFY { background: #1e3a8a; cursor: default; }
.rdot.VERIFY { background: #60a5fa; }
.verify { margin-top: 22px; display: grid; gap: 10px; text-align: center; }
.verify form { display: grid; gap: 10px; }
.otp-dark { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; margin: 0; }
.otp-dark::placeholder { color: rgba(255, 255, 255, .5); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); }
.v-msg { margin: 0; font-size: 14px; min-height: 1.2em; color: #dbeafe; }
.verify + #r-next { margin-top: 14px; }
.result.VERIFY #r-next { background: transparent; color: #fff; border-color: transparent; text-decoration: underline; font-weight: 500; }

/* WhatsApp link in admin */
.wa-link { gap: 6px; }
.wa-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
.wa-link.wa-off .wa-dot { background: #ef4444; animation: pulse 1.2s infinite; }
.wa-logo { background: #16a34a; }
.wa-page { max-width: 720px; }
.wa-card { padding: 24px; }
.wa-card h2 { margin: 12px 0 6px; font-size: 22px; }
.wa-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #eef2f7; font-size: 13px; font-weight: 600; }
.wa-status .wa-dot { background: #94a3b8; }
.wa-status.st-open { background: var(--ok-bg); color: var(--ok); } .wa-status.st-open .wa-dot { background: #16a34a; }
.wa-status.st-qr { background: var(--warn-bg); color: var(--warn); } .wa-status.st-qr .wa-dot { background: #f59e0b; animation: pulse 1s infinite; }
.wa-status.st-disconnected, .wa-status.st-logged_out { background: var(--bad-bg); color: var(--bad); } .wa-status.st-disconnected .wa-dot, .wa-status.st-logged_out .wa-dot { background: #ef4444; }
.wa-steps { padding-left: 20px; line-height: 1.7; font-size: 15px; }
.wa-qr { display: grid; place-items: center; margin: 12px 0 6px; }
.wa-qr img { width: 100%; max-width: 300px; height: auto; border: 1px solid var(--border); border-radius: 14px; padding: 8px; background: #fff; }
.wa-pair { margin-top: 14px; font-size: 14px; }
.wa-pair summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.wa-pair form { margin-top: 10px; }
.pair-code { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: .15em; text-align: center; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 12px; }
.wa-note { padding: 18px 22px; font-size: 14px; }
.wa-note h3 { margin: 0 0 8px; font-size: 15px; }
.wa-note ul { margin: 0; padding-left: 18px; line-height: 1.7; color: #334155; }
.table td.mono { white-space: nowrap; }

/* ===================== v4: installer + settings ===================== */
.install { max-width: 720px; margin: 0 auto; padding: 32px 16px 56px; }
.install-card { padding: 32px 28px; }
.install-card h1 { font-size: 24px; margin: 14px 0 4px; }
.install-card h2 { font-size: 16px; margin: 26px 0 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.install-card code, .settings code { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.checks li.ok { color: var(--ok); }
.checks li.bad { color: var(--bad); font-weight: 600; }
.checks li .small { color: var(--muted); font-weight: 400; margin-left: 18px; }
.next { line-height: 1.9; padding-left: 20px; }
.settings { max-width: 900px; }
.set-card { padding: 22px 24px; }
.set-card h2 { margin: 0 0 4px; font-size: 18px; }
.set-card > p { margin: 0 0 16px; }
.switch { display: flex; gap: 10px; align-items: center; font-size: 15px; margin: 4px 0 14px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.input.color { padding: 4px; height: 46px; }
.adv { margin: 6px 0 14px; font-size: 14px; }
.adv summary { cursor: pointer; color: var(--brand); font-weight: 600; margin-bottom: 12px; }
.hint-box { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; padding: 12px 14px; font-size: 14px; display: grid; gap: 6px; margin-bottom: 14px; }
.test-row { display: flex; gap: 8px; flex-wrap: wrap; }
.test-row .input { flex: 1 1 220px; min-width: 0; }
.test-out { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: #f1f5f9; font-size: 13px; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; font-family: var(--mono); }
.test-out.ok { background: var(--ok-bg); color: #14532d; }
.test-out.bad { background: var(--bad-bg); color: #7f1d1d; }
.cron { display: block; padding: 10px 12px; }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-off { background: #eef2f7; color: #475569; }
.pill-off .wa-dot { background: #94a3b8; }
.save-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.save-bar .btn { padding: 12px 28px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } .install-card { padding: 24px 18px; } }

/* Live QR: QR ke upar kuch nahi (scanning hamesha saaf) — "live" chamak sirf border par */
.live-sweep { display: none; }
.live-wrap { animation: liveglow 1.6s ease-in-out infinite; }
@keyframes liveglow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 0%, transparent); }
}

/* =====================================================================
   v5: GOLDUST ROYAL THEME (dark + gold) — invite card jaisa
   ===================================================================== */
@font-face { font-family: "Cinzel"; src: url("/assets/fonts/cinzel-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("/assets/fonts/cinzel-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("/assets/fonts/cinzel-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/assets/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/assets/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/assets/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }

/* Common new components (both themes) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--brand); color: var(--brand); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.brand-logo { display: block; width: 210px; max-width: 70%; height: auto; margin: 0 0 22px; }
.ev-desc { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0 0 18px; max-width: 36em; }
.poster { margin: 8px 0 0; max-width: 340px; }
.poster img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: var(--shadow); }
.reg-bg { display: none; }
.invite-box { border: 1px solid var(--brand); border-radius: 14px; padding: 16px 18px; margin: 0 0 20px; background: var(--brand-soft); }
.invite-box p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.invite-name { font-size: 22px; font-weight: 700; margin-top: 4px; }
.invite-phone { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; margin: 0 0 16px; }
.closed-ico { font-size: 34px; color: var(--brand); line-height: 1; margin-bottom: 8px; }
.ticket-logo { display: block; width: 150px; height: auto; margin: 0 0 14px; }
.ticket-chips { padding: 0 26px; margin: 0 0 16px; justify-content: center; }

/* ---------------- ROYAL ---------------- */
html[data-theme="royal"] {
  --brand: #d4a94c;
  --brand-ink: #1a1007;
  --brand-soft: rgba(212, 169, 76, .08);
  --bg: #0c0806;
  --surface: #16100b;
  --surface-2: #1d150e;
  --border: rgba(212, 169, 76, .22);
  --text: #f4e8cc;
  --muted: #bba987;
  --ok: #7ddc9a; --ok-bg: rgba(46, 160, 87, .14);
  --warn: #f0c36d; --warn-bg: rgba(240, 195, 109, .12);
  --bad: #ff8f80; --bad-bg: rgba(255, 110, 90, .12);
  --shadow: 0 1px 0 rgba(255, 220, 150, .04) inset, 0 20px 50px rgba(0, 0, 0, .55);
  --gold-grad: linear-gradient(180deg, #f6e3a1 0%, #d4a94c 48%, #a3782b 100%);
  color-scheme: dark;
}
html[data-theme="royal"] body { background: var(--bg); color: var(--text); }
html[data-theme="royal"] h1, html[data-theme="royal"] h2, html[data-theme="royal"] .invite-name, html[data-theme="royal"] .ticket-code {
  font-family: "Cinzel", "Trajan Pro", Georgia, serif; font-weight: 600; letter-spacing: .02em;
}
html[data-theme="royal"] .ev-desc, html[data-theme="royal"] .tagline, html[data-theme="royal"] .invite-box p {
  font-family: "Cormorant", Georgia, serif; font-size: 20px; line-height: 1.5;
}
html[data-theme="royal"] .tagline { font-style: italic; color: var(--text); }
html[data-theme="royal"] .eyebrow { color: var(--muted); letter-spacing: .35em; font-weight: 500; }
html[data-theme="royal"] .presents { margin-bottom: 4px; }
html[data-theme="royal"] a { color: var(--brand); }

/* Background: poster blurred + dark vignette */
html[data-theme="royal"] .reg-bg {
  display: block; position: fixed; inset: -40px; z-index: 0; background-size: cover; background-position: center;
  filter: blur(26px) brightness(.32) saturate(1.2); transform: scale(1.08);
}
html[data-theme="royal"] .reg-body { background: #070403; }
html[data-theme="royal"] .reg-body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(900px 600px at 50% 10%, rgba(212, 169, 76, .14), transparent 60%), radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .65) 100%);
}
html[data-theme="royal"] .reg-wrap { position: relative; z-index: 1; }
html[data-theme="royal"] .reg-hero h1 {
  font-size: clamp(36px, 6vw, 60px); line-height: 1.05; margin: 6px 0 12px;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 30px rgba(212, 169, 76, .18);
}
html[data-theme="royal"] .ico { background: var(--surface); border-color: var(--border); color: var(--brand); box-shadow: none; }
html[data-theme="royal"] .ev-meta .v { color: var(--text); }
html[data-theme="royal"] .seats { background: var(--surface); border-color: var(--border); }
html[data-theme="royal"] .poster img { border: 1px solid var(--border); }

/* Cards, forms */
html[data-theme="royal"] .card { background: rgba(22, 16, 11, .86); border-color: var(--border); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
html[data-theme="royal"] .reg-card { border-top: 2px solid var(--brand); }
html[data-theme="royal"] .input { background: rgba(0, 0, 0, .35); border-color: rgba(212, 169, 76, .28); color: var(--text); }
html[data-theme="royal"] .input::placeholder { color: #8d7c5e; }
html[data-theme="royal"] .input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(212, 169, 76, .22); }
html[data-theme="royal"] .btn { background: var(--surface-2); border-color: var(--border); color: var(--text); }
html[data-theme="royal"] .btn:hover { background: #251a10; }
html[data-theme="royal"] .btn-primary { background: var(--gold-grad); border-color: #c99a3c; color: var(--brand-ink); font-weight: 700; letter-spacing: .03em; box-shadow: 0 6px 20px rgba(212, 169, 76, .22); }
html[data-theme="royal"] .btn-primary:hover { background: var(--gold-grad); filter: brightness(1.08); }
html[data-theme="royal"] .check { background: rgba(46, 160, 87, .08); border-color: rgba(125, 220, 154, .25); color: var(--text); }
html[data-theme="royal"] .reg-divider { border-top-color: var(--border); }
html[data-theme="royal"] .form-ok { color: var(--ok); }
html[data-theme="royal"] .notice-ok { background: rgba(46, 160, 87, .14); color: #c9f2d6; border: 1px solid rgba(125, 220, 154, .25); }
html[data-theme="royal"] .notice-warn { background: rgba(240, 195, 109, .1); color: #f6dfae; border: 1px solid rgba(240, 195, 109, .25); }
html[data-theme="royal"] .notice-bad { background: rgba(255, 110, 90, .1); color: #ffc9c0; border: 1px solid rgba(255, 110, 90, .25); }
html[data-theme="royal"] .reg-foot { color: var(--muted); }

/* Live pass / ticket */
html[data-theme="royal"] .ticket-body {
  background: radial-gradient(800px 500px at 50% -5%, rgba(212, 169, 76, .16), transparent 65%), #0a0605;
}
html[data-theme="royal"] .ticket { background: #140e09; border: 1px solid var(--border); box-shadow: 0 30px 70px rgba(0, 0, 0, .6); }
html[data-theme="royal"] .ticket-head {
  background: radial-gradient(420px 220px at 50% 0%, rgba(212, 169, 76, .18), transparent 70%), #0f0a06;
  border-bottom: 1px solid var(--border); text-align: center; padding: 28px 24px 24px;
}
html[data-theme="royal"] .ticket-logo { margin: 0 auto 14px; }
html[data-theme="royal"] .ticket-head h1 { font-size: 28px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-top: 6px; }
html[data-theme="royal"] .ticket-head p { color: var(--text); font-family: "Cormorant", Georgia, serif; font-style: italic; font-size: 18px; opacity: .9; }
html[data-theme="royal"] .eyebrow-light { color: var(--muted); }
html[data-theme="royal"] .live-wrap { border-color: var(--brand); background: #fff; }
html[data-theme="royal"] .live-qr { color: var(--brand-ink); }
html[data-theme="royal"] .live-meta { color: var(--brand); }
html[data-theme="royal"] .live-clock { color: var(--text); }
html[data-theme="royal"] .live-bar { background: rgba(212, 169, 76, .15); }
html[data-theme="royal"] .live-bar i { background: var(--gold-grad); }
html[data-theme="royal"] .ticket-cut { border-top-color: rgba(212, 169, 76, .3); }
html[data-theme="royal"] .ticket-cut::before, html[data-theme="royal"] .ticket-cut::after { background: #0a0605; }
html[data-theme="royal"] .info-ico { background: rgba(212, 169, 76, .1); color: var(--brand); }
html[data-theme="royal"] .info-row .v { color: var(--text); }
html[data-theme="royal"] .qr-wrap img { border-color: var(--brand); background: #fff; }
html[data-theme="royal"] .pass-done { background: rgba(46, 160, 87, .14); color: var(--ok); border: 1px solid rgba(125, 220, 154, .3); }
html[data-theme="royal"] .pass-cancelled { background: var(--bad-bg); color: var(--bad); border-color: rgba(255, 110, 90, .3); }
html[data-theme="royal"] .locked-ico { background: var(--bad-bg); color: var(--bad); }
html[data-theme="royal"] .locked-move { border-top-color: var(--border); }
html[data-theme="royal"] .ticket-foot { color: var(--muted); }
html[data-theme="royal"] .stamp { background: rgba(20, 14, 9, .85); }

/* Royal login */
html[data-theme="royal"] .auth-body { background: radial-gradient(800px 400px at 50% -10%, rgba(212, 169, 76, .16), transparent 70%), #0a0605; }
html[data-theme="royal"] .logo { background: var(--gold-grad); color: var(--brand-ink); }

@media (max-width: 880px) {
  .brand-logo { width: 170px; margin-bottom: 16px; }
  html[data-theme="royal"] .reg-hero { text-align: center; }
  html[data-theme="royal"] .brand-logo { margin-left: auto; margin-right: auto; }
  html[data-theme="royal"] .chips { justify-content: center; }
  html[data-theme="royal"] .ev-meta { justify-items: center; }
  html[data-theme="royal"] .ev-meta li { text-align: left; }
  .poster { display: none; }
}

/* ---------------- Scanner: guest dikhao -> "Confirm entry" ---------------- */
.result.READY { background: #1d1407; cursor: default; }
.result.READY .result-icon { background: rgba(212, 169, 76, .2); color: #f2d68c; }
.result.READY .result-title { color: #f2d68c; }
.rdot.READY { background: #d4a94c; }
.btn-confirm { background: linear-gradient(180deg, #4ade80, #16a34a); color: #052e14; border: 0; font-size: 20px; font-weight: 800; padding: 18px; margin-top: 26px; letter-spacing: .02em; box-shadow: 0 10px 30px rgba(22, 163, 74, .35); }
.btn-confirm:hover { filter: brightness(1.05); background: linear-gradient(180deg, #4ade80, #16a34a); }
.result.READY #r-next { background: transparent; color: #f2d68c; border-color: transparent; text-decoration: underline; font-weight: 500; margin-top: 12px; }

/* Admin: guests page */
.admin-logo { height: 34px; width: auto; display: block; }
.guest-top { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.guest-add { padding: 18px 20px; }
.guest-add h3 { margin: 0 0 10px; font-size: 16px; }
.guest-add .row3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 8px; align-items: end; }
.guest-add .row3 .field { margin: 0; }
.guest-add textarea.input { min-height: 112px; font-family: var(--mono); font-size: 13px; resize: vertical; }
.bulk-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.send-all { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.progress { height: 8px; border-radius: 99px; background: #eef2f7; overflow: hidden; margin-top: 8px; width: 100%; max-width: 360px; }
.progress i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }
.link-cell { max-width: 220px; }
.link-cell code { font-family: var(--mono); font-size: 12px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 880px) { .guest-top { grid-template-columns: 1fr; } .guest-add .row3 { grid-template-columns: 1fr 1fr; } }
.btn-arrive { color: var(--ok); border-color: #bbf7d0; } .btn-arrive:hover { background: #f0fdf4; }
.span2 { grid-column: 1 / -1; }
textarea.input { resize: vertical; min-height: 70px; line-height: 1.5; }
.brand-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.brand-item { display: grid; gap: 8px; justify-items: start; }
.brand-prev { width: 100%; height: 140px; border-radius: 12px; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); }
.brand-prev.dark { background: #0c0806; }
.brand-prev img { max-width: 80%; max-height: 80%; }
.brand-prev.poster-prev { height: 240px; background: #0c0806; }
.brand-prev.poster-prev img { max-height: 100%; max-width: 100%; }
@media (max-width: 700px) { .brand-grid { grid-template-columns: 1fr; } }
@media (max-width: 880px) {
  html[data-theme="royal"] .ev-meta { display: inline-grid; justify-items: start; text-align: left; margin-left: auto; margin-right: auto; }
}
html[data-theme="royal"] .ticket-code { font-family: var(--mono); letter-spacing: .18em; color: var(--text); }
