/* ─── RESET & TOKENS ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:        #1e1548;
    --navy-dark:   #0d0924;
    --navy-mid:    #2a1f6b;
    --navy-soft:   #332a6e;
    --red:         #ed1c24;
    --red-2:       #ff3b43;
    --white:       #ffffff;
    --bg:          #eef0f7;
    --bg-2:        #f7f8fc;
    --ink:         #0f0a2b;
    --muted:       #6b7280;
    --muted-2:     #9aa0ad;
    --border:      #e5e7eb;
    --border-soft: #eef0f4;
    --green:       #16a34a;
    --green-d:     #0f3d24;
    --amber:       #d97706;
    --amber-d:     #5a2a08;
    --danger:      #dc2626;
    --danger-d:    #5e1313;
    --info:        #2563eb;
    --mono:        'JetBrains Mono', ui-monospace, monospace;
    --radius:      16px;
    --card:        #ffffff;
}

html, body {
    height: 100%; width: 100%;
    overflow: hidden;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
    color: var(--ink);
    background: #000;
}

#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

/* ─── SHARED SCREEN SHELL ─────────────────────────────────────────────────── */
.screen { display: flex; flex-direction: column; height: 100%; background: var(--bg); overflow: hidden; }

/* ─── HEADER ──────────────────────────────────────────────────────────────── */
.app-header {
    background: var(--navy);
    padding: max(14px, env(safe-area-inset-top)) 16px 14px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-shrink: 0;
}
.header-logo  { height: 22px; width: auto; display: block; }
.header-title { color: #fff; font-weight: 700; font-size: 15px; text-align: center; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.01em; }
.header-sub   { color: rgba(255,255,255,0.55); font-size: 11px; font-weight: 500; text-align: center; letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 2px; }
.header-live  { color: #4ade80; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; background: rgba(74,222,128,0.18); border: 1px solid rgba(74,222,128,0.4); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }

.btn-icon-header {
    width: 36px; height: 36px; border-radius: 12px;
    background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.06);
    color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: background 0.15s;
}
.btn-icon-header:active { background: rgba(255,255,255,0.18); }

/* ─── SPINNER ─────────────────────────────────────────────────────────────── */
.spinner { width: 32px; height: 32px; border: 3px solid rgba(30,21,72,0.15); border-top-color: var(--navy); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 64px 24px; color: var(--muted); font-size: 14px; font-weight: 500; }

/* ─── LOGIN SCREEN ────────────────────────────────────────────────────────── */
.login-screen {
    height: 100%; display: flex; flex-direction: column; color: #fff; position: relative; overflow: hidden;
    background:
        radial-gradient(800px 400px at 50% -10%, rgba(237,28,36,0.18), transparent 60%),
        radial-gradient(600px 300px at 100% 100%, rgba(42,31,107,0.6), transparent 60%),
        linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
}
.login-screen::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 18px 18px;
    mask: linear-gradient(180deg, transparent 0%, #000 25%, #000 70%, transparent 100%);
    -webkit-mask: linear-gradient(180deg, transparent 0%, #000 25%, #000 70%, transparent 100%);
}

.login-top { padding: max(48px, calc(env(safe-area-inset-top) + 24px)) 24px 0; text-align: center; position: relative; }

.ops-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
    padding: 6px 12px 6px 8px; border-radius: 99px;
    font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.85); letter-spacing: 0.4px;
    margin-bottom: 20px;
}
.ops-badge-pulse {
    width: 6px; height: 6px; border-radius: 50%; background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74,222,128,0.25);
}

.login-logo { width: 140px; height: auto; display: block; margin: 0 auto 18px; filter: drop-shadow(0 6px 24px rgba(237,28,36,0.25)); }
.login-title { font-size: 40px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; margin-bottom: 0; }
.login-title-accent {
    color: var(--red);
    background: linear-gradient(180deg, #ff4751 0%, var(--red) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { color: rgba(255,255,255,0.55); font-size: 14px; margin: 10px 0 28px; font-weight: 400; }

.login-card {
    background: #fff; border-radius: 22px; padding: 22px 22px 20px; margin: 0 20px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 24px 60px rgba(0,0,0,0.45), 0 8px 20px rgba(0,0,0,0.25);
    color: var(--ink); position: relative;
}
.card-eyebrow {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.card-eyebrow-label { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.card-eyebrow-lock {
    width: 24px; height: 24px; border-radius: 8px;
    background: rgba(30,21,72,0.06); color: var(--navy);
    display: flex; align-items: center; justify-content: center;
}

.field { margin-bottom: 14px; position: relative; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 7px; letter-spacing: 0.1px; }
.field-input {
    width: 100%; padding: 13px 14px 13px 42px;
    border: 1.5px solid var(--border-soft); border-radius: 12px;
    background: var(--bg-2); font-size: 14px; font-family: inherit; color: var(--ink);
    outline: none; transition: border-color 0.15s;
}
.field-input:focus { border-color: var(--navy); }
.field-input::placeholder { color: #9ca3af; }
.field-icon {
    position: absolute; left: 14px; top: 34px;
    width: 18px; height: 18px; color: #9aa0ad; pointer-events: none;
}
.field-row {
    display: flex; align-items: center; justify-content: space-between;
    margin: -4px 0 14px; font-size: 12px;
}
.field-remember { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.field-check {
    width: 16px; height: 16px; border-radius: 5px; background: var(--navy);
    display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.field-forgot { color: var(--navy); font-weight: 600; cursor: pointer; }

.btn-signin {
    width: 100%; padding: 15px; border: none; cursor: pointer;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 30%),
        linear-gradient(180deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: #fff; font-weight: 700; font-size: 15px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 8px 18px rgba(30,21,72,0.45);
    letter-spacing: -0.005em; font-family: inherit;
    transition: opacity 0.15s;
}
.btn-signin:disabled { opacity: 0.7; cursor: not-allowed; }

.install-wrap { text-align: center; padding: 18px 20px 0; }
.install-pill {
    display: inline-flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
    color: #fff; font-size: 13px; font-weight: 500; border-radius: 99px; padding: 10px 18px;
    cursor: pointer; backdrop-filter: blur(6px);
}
.install-pill-ic {
    width: 22px; height: 22px; border-radius: 7px;
    background: rgba(237,28,36,0.18); color: #ff8c91;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.login-footer {
    margin-top: auto; padding: 18px 22px 28px;
    display: flex; align-items: center; justify-content: space-between;
    color: rgba(255,255,255,0.35); font-size: 11px; font-weight: 500;
}
.login-footer-l { display: flex; align-items: center; gap: 8px; }
.login-footer-sep { width: 3px; height: 3px; background: currentColor; border-radius: 50%; opacity: 0.5; }

/* ─── EVENTS SCREEN ───────────────────────────────────────────────────────── */
.events-header-expanded {
    background: var(--navy); padding: max(10px, env(safe-area-inset-top)) 16px 16px; flex-shrink: 0;
}
.events-header-top { display: flex; align-items: center; justify-content: space-between; }
.events-header-welcome { margin-top: 14px; }
.events-welcome-sub { font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; }
.events-welcome-name { font-size: 22px; color: #fff; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; }
.events-welcome-name .dot { color: var(--red); }
.events-welcome-count { color: rgba(255,255,255,0.6); font-weight: 500; font-size: 14px; }

.events-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%); padding: 16px; }

.events-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.events-search {
    flex: 1; background: #fff; border: 1px solid var(--border-soft);
    border-radius: 14px; padding: 10px 14px;
    display: flex; align-items: center; gap: 10px;
    color: var(--muted-2); font-size: 13px;
    box-shadow: 0 1px 2px rgba(15,10,43,0.04);
}
.events-search input { border: none; outline: none; background: transparent; flex: 1; font-family: inherit; font-size: 13px; color: var(--ink); }
.events-filter-btn {
    width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0;
    background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(30,21,72,0.25); cursor: pointer; border: none;
}

.events-section-title { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 12px; }
.events-section-l { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.events-section-r { font-size: 11px; font-weight: 600; color: var(--navy); }

.events-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.event-card { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(15,10,43,0.04), 0 6px 18px rgba(15,10,43,0.06); border: 1px solid rgba(15,10,43,0.04); cursor: pointer; transition: transform 0.15s; }
.event-card:active { transform: scale(0.97); box-shadow: 0 0 0 2px var(--red); }
.event-card.loading-card { opacity: 0.7; pointer-events: none; }

.event-card-img {
    height: 118px; position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy) 100%);
}
.event-card-img::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 14px);
    mix-blend-mode: overlay;
}
.event-card-img::after {
    content: ""; position: absolute; inset: 0; z-index: 2;
    background: linear-gradient(180deg, transparent 35%, rgba(10,6,30,0.85) 100%);
}
.ev-bg-0 { background: radial-gradient(circle at 22% 28%, rgba(237,28,36,0.45), transparent 55%), radial-gradient(circle at 78% 70%, rgba(120,80,255,0.25), transparent 55%), linear-gradient(135deg, #2a1f6b 0%, #1e1548 100%); }
.ev-bg-1 { background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.10), transparent 55%), radial-gradient(circle at 20% 80%, rgba(237,28,36,0.30), transparent 55%), linear-gradient(135deg, #15103a 0%, #2a1f6b 100%); }
.ev-bg-2 { background: radial-gradient(circle at 30% 30%, rgba(74,222,128,0.18), transparent 55%), radial-gradient(circle at 80% 70%, rgba(237,28,36,0.18), transparent 55%), linear-gradient(135deg, #0d0924 0%, #2a1f6b 100%); }
.ev-bg-3 { background: radial-gradient(circle at 30% 70%, rgba(255,180,80,0.22), transparent 55%), radial-gradient(circle at 80% 30%, rgba(237,28,36,0.30), transparent 55%), linear-gradient(135deg, #1e1548 0%, #0d0924 100%); }

.event-card-pill {
    position: absolute; top: 9px; left: 9px; z-index: 3;
    background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: #fff; font-size: 9px; font-weight: 700;
    padding: 4px 8px; border-radius: 99px; letter-spacing: 0.4px; text-transform: uppercase;
}
.event-card-pill.live { background: rgba(74,222,128,0.22); border-color: rgba(74,222,128,0.4); color: #86efac; }
.event-card-pill.soon { background: rgba(237,28,36,0.18); border-color: rgba(237,28,36,0.35); color: #ffb1b5; }

.event-card-info { position: absolute; left: 11px; bottom: 9px; z-index: 3; color: #fff; }
.event-card-name { font-size: 12px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.event-card-date { font-size: 10px; color: rgba(255,255,255,0.78); margin-top: 3px; font-weight: 500; }

.event-card-footer {
    padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff;
}
.event-card-venue { font-size: 11px; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.event-card-arrow { width: 24px; height: 24px; border-radius: 8px; background: #f3f4f8; color: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ─── DASHBOARD ───────────────────────────────────────────────────────────── */
.dashboard-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%); padding: 16px; }

.event-banner {
    height: 170px; flex-shrink: 0; position: relative; overflow: hidden;
    background:
        radial-gradient(circle at 18% 30%, rgba(237,28,36,0.35), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(120,80,255,0.18), transparent 55%),
        repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0.04) 0 1px, transparent 1px 14px),
        var(--navy);
}
.event-banner::before {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 18px);
    mix-blend-mode: overlay;
}
.event-banner-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,6,30,0.05) 0%, rgba(10,6,30,0.92) 100%); z-index: 1; }

.live-tag {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    background: rgba(74,222,128,0.18); border: 1px solid rgba(74,222,128,0.4); color: #86efac;
    font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
    padding: 5px 10px 5px 8px; border-radius: 99px;
    display: inline-flex; align-items: center; gap: 6px; backdrop-filter: blur(8px);
}
.live-tag-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,0.25); flex-shrink: 0; }

.event-banner-content { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 2; color: #fff; }
.event-banner-eyebrow { color: rgba(255,255,255,0.55); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
.event-banner-name { font-size: 20px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.event-banner-meta { display: flex; align-items: center; gap: 14px; color: rgba(255,255,255,0.7); font-size: 12px; margin-top: 8px; flex-wrap: wrap; font-weight: 500; }
.event-banner-meta-item { display: inline-flex; align-items: center; gap: 6px; }

.stats-card { background: #fff; border-radius: 18px; padding: 14px; box-shadow: 0 1px 2px rgba(15,10,43,0.04), 0 6px 16px rgba(15,10,43,0.05); border: 1px solid rgba(15,10,43,0.04); margin-bottom: 12px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-cell { background: var(--bg-2); border-radius: 12px; padding: 12px; border: 1px solid var(--border-soft); position: relative; overflow: hidden; }
.stat-value { font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.stat-value.green { color: var(--green); }
.stat-value.amber { color: var(--amber); }
.stat-value.blue  { color: var(--info); }
.stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 700; margin-top: 6px; letter-spacing: 0.6px; }
.stat-delta { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 6px; letter-spacing: 0.2px; }
.stat-delta.up   { background: rgba(22,163,74,0.10); color: #15803d; }
.stat-delta.warn { background: rgba(217,119,6,0.10); color: #b45309; }
.stat-delta.info { background: rgba(37,99,235,0.10); color: #1d4ed8; }

.progress-card { background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 1px 2px rgba(15,10,43,0.04), 0 6px 16px rgba(15,10,43,0.05); border: 1px solid rgba(15,10,43,0.04); margin-bottom: 14px; }
.progress-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
.progress-row-l .lbl { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
.progress-row-l .val { font-size: 18px; color: var(--ink); font-weight: 800; letter-spacing: -0.02em; margin-top: 5px; line-height: 1; }
.progress-row-l .val small { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.progress-row-r { text-align: right; }
.progress-row-r .lbl { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
.progress-row-r .val { font-size: 18px; color: var(--red); font-weight: 800; letter-spacing: -0.02em; margin-top: 5px; line-height: 1; }
.progress-row-r .val small { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 2px; letter-spacing: 0; }

.progress-track { height: 10px; background: var(--bg); border-radius: 99px; overflow: visible; position: relative; }
.progress-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--navy) 0%, var(--navy-mid) 50%, var(--red) 100%);
    box-shadow: 0 0 12px rgba(237,28,36,0.3);
    position: relative; transition: width 0.5s ease;
}
.progress-fill::after {
    content: ""; position: absolute; right: -1px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 3px solid var(--red);
    box-shadow: 0 2px 6px rgba(237,28,36,0.4);
}
.progress-legend { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 11px; color: var(--muted); font-weight: 500; }
.progress-legend span { display: inline-flex; align-items: center; gap: 6px; }
.progress-swatch { width: 8px; height: 8px; border-radius: 3px; }

.btn-scan-big {
    width: 100%; padding: 16px; border: none; cursor: pointer;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 30%),
        linear-gradient(180deg, var(--red) 0%, #c81017 100%);
    color: #fff; font-weight: 800; font-size: 16px; border-radius: 16px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 10px 24px rgba(237,28,36,0.40), 0 4px 10px rgba(237,28,36,0.25);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 10px; letter-spacing: -0.01em; font-family: inherit; position: relative; overflow: hidden;
}
.btn-scan-big:active { opacity: 0.9; }
.btn-ic-wrap { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-scan-arrow { margin-left: auto; }

.btn-recent {
    width: 100%; padding: 14px 16px; background: #fff; border: 1px solid var(--border); border-radius: 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    cursor: pointer; font-family: inherit;
}
.btn-recent-l { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 600; font-size: 14px; }
.btn-recent-ic { width: 30px; height: 30px; border-radius: 9px; background: rgba(30,21,72,0.07); color: var(--navy); display: flex; align-items: center; justify-content: center; }
.btn-recent-r { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }

/* ─── SCANNER SCREEN ──────────────────────────────────────────────────────── */
.scanner-screen { background: #000; display: flex; flex-direction: column; height: 100%; }

.scanner-header {
    background: linear-gradient(180deg, rgba(20,14,55,0.95) 0%, rgba(20,14,55,0.7) 100%);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    padding: max(14px, env(safe-area-inset-top)) 16px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-shrink: 0; position: relative; z-index: 2;
}
.scanner-header-center { display: flex; flex-direction: column; align-items: center; flex: 1; overflow: hidden; }
.scanner-header-right { display: flex; gap: 8px; }

.scanner-viewport { flex: 1; background: #0a0a0a; position: relative; overflow: hidden; }

.scan-overlay { position: absolute; background: rgba(0,0,0,0.62); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.scan-overlay-top    { top: 0; left: 0; width: 100%; height: 35%; }
.scan-overlay-bottom { top: 65%; left: 0; width: 100%; height: 35%; }
.scan-overlay-left   { top: 35%; left: 0; width: 30%; height: 30%; }
.scan-overlay-right  { top: 35%; left: 70%; width: 30%; height: 30%; }

.scan-zone { position: absolute; top: 50%; left: 50%; width: 200px; height: 200px; transform: translate(-50%, -50%); }

.scan-corner { position: absolute; width: 30px; height: 30px; border: 3px solid #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,0.45)); }
.scan-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.scan-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-top-right-radius: 6px; }
.scan-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-bottom-left-radius: 6px; }
.scan-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; border-bottom-right-radius: 6px; }

.scan-line {
    position: absolute; top: 60%; left: 50%; transform: translateX(-50%);
    width: 174px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
    box-shadow: 0 0 16px rgba(237,28,36,0.7);
    animation: scanMove 2.5s ease-in-out infinite;
}
.scan-line::before {
    content: ""; position: absolute; top: -30px; left: 0; right: 0; height: 60px;
    background: linear-gradient(180deg, transparent, rgba(237,28,36,0.18), transparent);
    pointer-events: none;
}
@keyframes scanMove { 0%,100% { top: 20%; } 50% { top: 75%; } }

.scan-tag {
    position: absolute; top: calc(50% - 130px); left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12); color: #fff;
    font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
    padding: 6px 12px 6px 10px; border-radius: 99px;
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.scan-tag-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(237,28,36,0.3); flex-shrink: 0; }

.scan-hint { position: absolute; left: 0; right: 0; top: calc(50% + 115px); text-align: center; color: rgba(255,255,255,0.7); font-size: 13px; font-weight: 500; }
.scan-hint-sub { display: block; color: rgba(255,255,255,0.4); font-size: 11px; margin-top: 4px; font-weight: 400; }

.scan-stats { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 2; display: flex; justify-content: space-between; gap: 8px; }
.scan-stat-pill {
    flex: 1; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: 14px; padding: 10px 12px;
    display: flex; align-items: center; gap: 10px;
}
.scan-stat-ic { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,0.10); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.scan-stat-v { color: #fff; font-size: 14px; font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.scan-stat-l { color: rgba(255,255,255,0.55); font-size: 10px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; margin-top: 3px; }

#scanner-video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.scanner-foot {
    background: linear-gradient(180deg, #0a0a0a 0%, #000 100%);
    border-top: 1px solid #1a1a1a;
    display: flex; align-items: center; flex-shrink: 0;
    padding: 10px 10px max(14px, env(safe-area-inset-bottom)); gap: 8px;
}
.scanner-foot-wrap {
    flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; display: flex; align-items: center; padding: 0 12px; gap: 8px;
}
.scanner-foot-wrap svg { color: #666; flex-shrink: 0; }
.scanner-foot-wrap input {
    flex: 1; padding: 13px 0; background: transparent; color: #fff; border: none;
    font-size: 14px; outline: none; font-family: inherit;
}
.scanner-foot-wrap input::placeholder { color: #666; }
.scanner-foot-prefix { color: #444; font-size: 11px; font-family: var(--mono); flex-shrink: 0; }
.scanner-foot-send {
    padding: 0 18px; height: 44px; background: var(--red); border: none; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; color: #fff; cursor: pointer;
    box-shadow: 0 8px 18px rgba(237,28,36,0.35); flex-shrink: 0;
}
.scanner-foot-send:active { opacity: 0.85; }

/* ─── RESULT OVERLAY ──────────────────────────────────────────────────────── */
.result-overlay {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: 0 0 40px; border-radius: 24px 24px 0 0;
    transform: translateY(110%); transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
    text-align: center; z-index: 100; background: var(--navy); color: #fff;
    pointer-events: none;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.45);
}
.result-overlay::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    border-radius: 24px 24px 0 0;
}
.result-overlay.visible { transform: translateY(0); pointer-events: auto; }
.result-overlay.result-success { background: radial-gradient(circle at 50% 0%, rgba(74,222,128,0.25), transparent 60%), var(--green-d); }
.result-overlay.result-warning { background: radial-gradient(circle at 50% 0%, rgba(251,191,36,0.20), transparent 60%), var(--amber-d); }
.result-overlay.result-error   { background: radial-gradient(circle at 50% 0%, rgba(248,113,113,0.22), transparent 60%), var(--danger-d); }

.result-drag { width: 40px; height: 4px; background: rgba(255,255,255,0.35); border-radius: 99px; margin: 12px auto 14px; }
.result-icon-wrap { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; box-shadow: 0 0 0 6px rgba(255,255,255,0.04); }
.result-icon { font-size: 26px; font-weight: 800; line-height: 1; }
.result-overlay.result-success .result-icon { color: #86efac; }
.result-overlay.result-warning .result-icon { color: #fcd34d; }
.result-overlay.result-error   .result-icon { color: #fca5a5; }

.result-status-pill { font-size: 9px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85); display: inline-block; margin-bottom: 8px; }
.result-status-pill.granted { background: rgba(74,222,128,0.20); color: #86efac; }
.result-status-pill.repeat  { background: rgba(251,191,36,0.18); color: #fcd34d; }
.result-status-pill.denied  { background: rgba(248,113,113,0.18); color: #fca5a5; }

.result-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.01em; line-height: 1.15; }
.result-sub   { font-size: 13px; opacity: 0.75; padding: 0 24px; }

/* ─── LOG SCREEN ──────────────────────────────────────────────────────────── */
.log-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fff; }

.log-summary {
    padding: 14px 16px; background: linear-gradient(180deg, var(--bg-2) 0%, #fff 100%);
    border-bottom: 1px solid var(--border-soft);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.log-summary-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 700; letter-spacing: 0.6px; margin-bottom: 2px; }
.log-summary-val { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.log-summary-val small { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.log-live-pill { color: #16a34a; font-size: 11px; font-weight: 700; letter-spacing: 0.6px; display: flex; align-items: center; gap: 6px; background: rgba(22,163,74,0.10); border: 1px solid rgba(22,163,74,0.25); padding: 5px 10px 5px 8px; border-radius: 99px; white-space: nowrap; }
.log-live-dot { width: 7px; height: 7px; background: #16a34a; border-radius: 50%; box-shadow: 0 0 0 3px rgba(22,163,74,0.20); flex-shrink: 0; }

.log-filters { padding: 10px 16px 8px; display: flex; gap: 6px; border-bottom: 1px solid var(--border-soft); }
.log-chip { font-size: 11px; font-weight: 600; padding: 6px 10px; border-radius: 99px; background: #f3f4f8; color: var(--muted); border: 1px solid var(--border-soft); cursor: pointer; }
.log-chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.log-table { width: 100%; border-collapse: collapse; }
.log-table thead th {
    background: var(--bg-2); color: var(--muted);
    font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.7px;
    border-bottom: 1px solid var(--border-soft); padding: 10px 16px; text-align: left;
}
.log-table thead th:last-child { text-align: right; }
.log-table tbody td { border-bottom: 1px solid #f3f4f8; padding: 12px 16px; vertical-align: middle; }
.log-table tbody tr:active td { background: var(--bg-2); }

.log-name-row { display: flex; align-items: center; gap: 10px; }
.log-avatar {
    width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: #fff; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: 0.2px; box-shadow: 0 2px 6px rgba(30,21,72,0.18);
}
.log-name  { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.15; letter-spacing: -0.005em; }
.log-type-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; margin-top: 3px; font-weight: 600; padding: 2px 6px 2px 5px; border-radius: 6px; letter-spacing: 0.1px; color: var(--muted); background: #f3f4f8; }
.log-type-tag.vip   { background: rgba(237,28,36,0.08); color: #b91c1c; }
.log-type-tag.group { background: rgba(37,99,235,0.08); color: #1d4ed8; }
.log-type-tag-dot   { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.log-ticket { font-size: 11px; font-weight: 700; color: var(--navy); white-space: nowrap; letter-spacing: 0.2px; background: rgba(30,21,72,0.06); padding: 3px 7px; border-radius: 6px; font-family: var(--mono); }
.log-time   { font-size: 12px; color: var(--ink); white-space: nowrap; font-weight: 600; letter-spacing: -0.005em; text-align: right; }
.log-ago    { display: block; font-size: 10px; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* ─── MANUAL ENTRY SCREEN ─────────────────────────────────────────────────── */
.manual-screen {
    height: 100%; display: flex; flex-direction: column; color: #fff; position: relative; overflow: hidden;
    background: #000;
}
.manual-screen::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(600px 400px at 50% 20%, rgba(237,28,36,0.10), transparent 60%),
        radial-gradient(500px 300px at 50% 90%, rgba(30,21,72,0.6), transparent 60%);
}
.manual-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; gap: 20px; position: relative; z-index: 1; }
.manual-icon-circle {
    width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0;
    background: rgba(237,28,36,0.15); border: 2px solid rgba(237,28,36,0.3);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 8px rgba(237,28,36,0.04), 0 12px 30px rgba(237,28,36,0.18);
}
.manual-heading { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; text-align: center; }
.manual-sub { color: rgba(255,255,255,0.5); font-size: 14px; text-align: center; line-height: 1.4; }
.manual-big-input {
    width: 100%; padding: 18px 20px;
    background: rgba(255,255,255,0.08); border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 14px; color: #fff; font-size: 20px; font-weight: 700;
    letter-spacing: 3px; text-align: center; outline: none; font-family: var(--mono);
    transition: border-color 0.15s;
}
.manual-big-input::placeholder { color: rgba(255,255,255,0.25); letter-spacing: 0; font-weight: 400; font-size: 15px; font-family: inherit; }
.manual-big-input:focus { border-color: rgba(237,28,36,0.5); }

.btn-manual-checkin {
    width: 100%; padding: 18px; border: none; cursor: pointer;
    background: linear-gradient(180deg, #ff3b43 0%, var(--red) 60%, #c81017 100%);
    color: #fff; font-weight: 800; font-size: 17px; border-radius: 14px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 6px 20px rgba(237,28,36,0.4);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    letter-spacing: -0.005em; font-family: inherit;
}
.btn-manual-checkin:active { opacity: 0.9; }

.manual-recent-header { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.recent-label { color: rgba(255,255,255,0.4); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.recent-tap   { color: rgba(255,255,255,0.3); font-size: 11px; font-weight: 500; }
.recent-chips { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.chip { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 99px; padding: 8px 16px; color: #fff; font-size: 13px; font-weight: 600; letter-spacing: 1px; cursor: pointer; font-family: var(--mono); }
.chip:active { opacity: 0.7; }

/* ─── SHARED ELEMENTS ─────────────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 24px; color: var(--muted); font-size: 15px; }
.alert-error  { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 16px; }

/* ─── BUTTON SPINNER ─────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.btn-spinner { animation: spin 0.8s linear infinite; flex-shrink: 0; }

/* ─── TOASTS ──────────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
    width: calc(100% - 32px); max-width: 420px; pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    border-radius: 14px; font-size: 14px; font-weight: 500; line-height: 1.4;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18); pointer-events: all; cursor: pointer;
    opacity: 0; transform: translateY(-12px) scale(0.97);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast-show { opacity: 1; transform: translateY(0) scale(1); }
.toast-hide { opacity: 0; transform: translateY(-8px) scale(0.97); }
.toast-success { background: #052e16; color: #bbf7d0; border: 1px solid #166534; }
.toast-error   { background: #450a0a; color: #fecaca; border: 1px solid #7f1d1d; }
.toast-warning { background: #431407; color: #fed7aa; border: 1px solid #7c2d12; }
.toast-info    { background: #0c1a4b; color: #bfdbfe; border: 1px solid #1e3a8a; }
.toast-icon  { flex-shrink: 0; opacity: 0.9; }
.toast-msg   { flex: 1; }
.toast-close { background: none; border: none; cursor: pointer; opacity: 0.6; padding: 2px; color: inherit; display: flex; align-items: center; flex-shrink: 0; transition: opacity 0.15s; }
.toast-close:hover { opacity: 1; }

/* ─── PWA INSTALL MODAL ───────────────────────────────────────────────────── */
.pwa-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: flex; align-items: flex-end; backdrop-filter: blur(4px); }
.pwa-modal { background: #fff; border-radius: 24px 24px 0 0; width: 100%; padding: 8px 24px 40px; animation: slideUp 0.3s cubic-bezier(0.34,1.2,0.64,1); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.pwa-modal-handle { width: 40px; height: 4px; background: #e5e7eb; border-radius: 99px; margin: 12px auto 20px; }
.pwa-modal-icon   { width: 72px; height: 72px; border-radius: 18px; background: var(--navy); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.pwa-modal-icon img { width: 48px; height: auto; }
.pwa-modal h2  { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 6px; color: var(--ink); }
.pwa-modal p   { font-size: 14px; color: var(--muted); text-align: center; margin-bottom: 24px; line-height: 1.5; }
.pwa-steps     { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.pwa-step      { display: flex; align-items: center; gap: 14px; background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.pwa-step-num  { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pwa-step-text { font-size: 14px; font-weight: 500; }
.pwa-step-text strong { font-weight: 700; }
.btn-pwa-install { width: 100%; padding: 16px; background: linear-gradient(135deg, var(--navy), var(--navy-mid)); color: #fff; border: none; border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; }
.btn-pwa-dismiss { width: 100%; padding: 12px; margin-top: 10px; background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer; font-family: inherit; }

/* ─── GUEST SEARCH SCREEN ────────────────────────────────────────────────── */
.gs-body         { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.gs-search-wrap  { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 0 14px; }
.gs-search-ic    { color: var(--muted); flex-shrink: 0; display: flex; }
.gs-input        { flex: 1; background: none; border: none; outline: none; font-family: inherit; font-size: 15px; color: var(--ink); padding: 14px 0; }
.gs-input::placeholder { color: var(--muted); }
.gs-results      { display: flex; flex-direction: column; gap: 8px; }
.gs-empty        { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; color: var(--muted); font-size: 14px; text-align: center; }
.gs-empty strong { color: var(--ink); }
.gs-loading      { display: flex; justify-content: center; padding: 32px; }
.gs-count        { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 0; }
.gs-card         { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gs-card-done    { opacity: 0.7; }
.gs-card-left    { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.gs-card-info    { flex: 1; min-width: 0; }
.gs-card-name    { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-card-meta    { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.gs-already-in   { font-size: 11px; color: var(--green); font-weight: 600; display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.gs-badge-done   { width: 32px; height: 32px; border-radius: 50%; background: rgba(74,222,128,0.15); border: 1px solid rgba(74,222,128,0.3); color: var(--green); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gs-checkin-btn  { display: flex; align-items: center; gap: 6px; background: var(--danger); color: #fff; border: none; border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: opacity 0.15s; }
.gs-checkin-btn:active  { opacity: 0.8; }
.gs-checkin-btn:disabled { opacity: 0.5; pointer-events: none; }

/* ─── DASHBOARD GUEST SEARCH BUTTON ──────────────────────────────────────── */
.btn-guest-search { width: 100%; display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; cursor: pointer; transition: background 0.15s; font-family: inherit; color: var(--ink); margin-bottom: 0; }
.btn-guest-search:active { background: var(--bg); }

/* ─── GUEST SEARCH PAGINATION ────────────────────────────────────────────── */
.gs-pagination  { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 4px; gap: 8px; }
.gs-page-btn    { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 600; font-family: inherit; color: var(--ink); cursor: pointer; transition: background 0.15s; }
.gs-page-btn:disabled { opacity: 0.35; pointer-events: none; }
.gs-page-btn:active   { background: var(--bg); }
.gs-page-info   { font-size: 13px; color: var(--muted); font-weight: 500; }
