/* Event Registration & Ticketing — TicketWave. Namespaced .ev */
* { box-sizing: border-box; }
body { margin: 0; }
.ev {
    --bg: #140b23; --panel: #1e1233; --panel2: #180d2b; --line: #34244d;
    --ink: #ede9fe; --muted: #a999c9; --brand: #f43f5e; --brand2: #a855f7;
    --ok: #34d399; --warn: #fbbf24; --info: #60a5fa;
    --shadow: 0 18px 46px -26px rgba(0,0,0,.7);
    min-height: calc(100vh - 44px);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
    background: radial-gradient(900px 460px at 88% -10%, rgba(244,63,94,.2), transparent), radial-gradient(800px 420px at 0% 110%, rgba(168,85,247,.2), transparent), var(--bg);
    color: var(--ink);
}
.ev-btn { border: 0; cursor: pointer; border-radius: .6rem; padding: .65rem 1.1rem; font: 700 .88rem inherit; background: var(--brand); color: #fff; transition: transform .1s; white-space: nowrap; }
.ev-btn:hover { transform: translateY(-1px); }
.ev-btn.ghost { background: rgba(255,255,255,.06); color: var(--ink); border: 1px solid var(--line); }
.ev-btn.sm { padding: .42rem .8rem; font-size: .8rem; }
.ev-btn:disabled { opacity: .4; cursor: not-allowed; }
.ev-h2 { margin: 0 0 1.1rem; font-size: 1.3rem; }

.ev-topbar { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.5rem; background: var(--panel); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; flex-wrap: wrap; }
.ev-brand { display: flex; align-items: center; gap: .6rem; }
.ev-logo { font-size: 1.6rem; }
.ev-brand b { display: block; font-size: 1.05rem; }
.ev-brand small { color: var(--muted); font-size: .72rem; }
.ev-nav { display: flex; gap: .25rem; margin: 0 auto; flex-wrap: wrap; }
.ev-navbtn { border: 0; background: transparent; color: var(--muted); padding: .5rem .8rem; border-radius: .6rem; font: 600 .85rem inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.ev-navbtn:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.ev-navbtn.active { background: var(--brand); color: #fff; }
.ev-badge { background: rgba(0,0,0,.25); border-radius: 999px; padding: 0 .4rem; font-size: .7rem; min-width: 1.1rem; text-align: center; }
.ev-top-actions { display: flex; align-items: center; gap: .6rem; }
.ev-live-dot { color: var(--ok); font-size: .72rem; font-weight: 800; letter-spacing: .1em; display: inline-flex; align-items: center; gap: .4rem; }
.ev-live-dot::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); animation: evpulse 1.3s infinite; }
@keyframes evpulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.ev-view { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.ev-view[hidden] { display: none !important; }
.ev-card { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.3rem; box-shadow: var(--shadow); }
.ev-card h3 { margin: 0 0 1rem; font-size: .95rem; }
.ev-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: .6rem; }
.ev-card-head h3 { margin: 0; }
.ev-card-head input { font: inherit; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--panel2); color: var(--ink); }

/* EVENT PAGE */
.ev-hero { background: linear-gradient(150deg, #7c3aed, #c026d3, #f43f5e); border-radius: 1.3rem; padding: 2.5rem 2rem; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.ev-hero .badge { position: absolute; top: 1rem; right: 1rem; background: rgba(0,0,0,.3); font-size: .68rem; font-weight: 800; letter-spacing: .12em; padding: .2rem .7rem; border-radius: 999px; }
.ev-hero h1 { margin: 1rem 0 .3rem; font-size: 2.4rem; letter-spacing: -.02em; }
.ev-hero .tag { opacity: .95; font-size: 1.05rem; }
.ev-hero ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; font-size: .9rem; }
.ev-hero .cta { margin-top: 1.5rem; background: #fff; color: #7c3aed; }
.ev-sec { margin-top: 1.5rem; }
.ev-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; }
@media (max-width: 820px) { .ev-two { grid-template-columns: 1fr; } }
.ev-agenda .ar { display: grid; grid-template-columns: 60px 1fr auto; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.ev-agenda .ar:last-child { border-bottom: 0; }
.ev-agenda .ar .t { color: var(--brand2); font-weight: 700; font-variant-numeric: tabular-nums; }
.ev-agenda .ar .tr { color: var(--muted); font-size: .78rem; }
.ev-speakers { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .8rem; }
.ev-speaker { text-align: center; background: var(--panel2); border: 1px solid var(--line); border-radius: .8rem; padding: 1rem .6rem; }
.ev-speaker .sav { width: 3rem; height: 3rem; border-radius: 50%; background: linear-gradient(135deg, #a855f7, #f43f5e); display: grid; place-items: center; margin: 0 auto .5rem; font-weight: 800; }
.ev-speaker b { display: block; font-size: .82rem; }
.ev-speaker small { color: var(--muted); font-size: .72rem; }
.ev-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.ev-tier { background: var(--panel2); border: 1.5px solid var(--line); border-radius: 1rem; padding: 1.2rem; }
.ev-tier.pop { border-color: var(--brand); position: relative; }
.ev-tier.pop::after { content: "POPULAR"; position: absolute; top: -.6rem; right: 1rem; background: var(--brand); color: #fff; font-size: .6rem; font-weight: 800; padding: .12rem .5rem; border-radius: 999px; }
.ev-tier h4 { margin: 0; font-size: 1.05rem; }
.ev-tier .pr { font-size: 1.5rem; font-weight: 800; margin: .3rem 0; }
.ev-tier ul { list-style: none; padding: 0; margin: .6rem 0; font-size: .8rem; color: var(--muted); }
.ev-tier ul li::before { content: "✓ "; color: var(--ok); }
.ev-tier .avail { font-size: .72rem; color: var(--muted); margin-bottom: .6rem; }
.ev-tier .bar { height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: .8rem; }
.ev-tier .bar i { display: block; height: 100%; background: var(--brand); }

/* CHECKOUT */
.ev-checkout-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .ev-checkout-grid { grid-template-columns: 1fr; } }
.ev-co-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.5rem; box-shadow: var(--shadow); }
.ev-tier-row { display: flex; align-items: center; gap: 1rem; border: 1px solid var(--line); border-radius: .7rem; padding: .9rem 1rem; margin-bottom: .6rem; }
.ev-tier-row .ti { flex: 1; }
.ev-tier-row .ti b { display: block; }
.ev-tier-row .ti small { color: var(--muted); }
.ev-tier-row .qty { display: flex; align-items: center; gap: .5rem; }
.ev-tier-row .qty button { width: 1.7rem; height: 1.7rem; border: 0; border-radius: .4rem; background: var(--brand); color: #fff; cursor: pointer; font-weight: 700; }
.ev-field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.ev-field input, .ev-field select { font: 400 .9rem inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--panel2); color: var(--ink); text-transform: none; }
.ev-field-row { display: flex; gap: .6rem; }
.ev-field-row .ev-field { flex: 1; }
.ev-summary { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.3rem; box-shadow: var(--shadow); position: sticky; top: 76px; }
.ev-summary h3 { margin: 0 0 1rem; font-size: .95rem; }
.ev-summary .sr { display: flex; justify-content: space-between; font-size: .84rem; padding: .2rem 0; color: var(--muted); }
.ev-summary .sr b { color: var(--ink); }
.ev-summary .sr.grand { color: var(--ink); font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .4rem; }
.ev-promo { display: flex; gap: .5rem; margin: .8rem 0; }
.ev-promo input { flex: 1; font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--panel2); color: var(--ink); text-transform: uppercase; }
.ev-promo button { border: 0; background: #fff; color: #7c3aed; border-radius: .5rem; padding: 0 .9rem; font: 700 .82rem inherit; cursor: pointer; }
.ev-promo-msg { font-size: .78rem; margin: -.4rem 0 .6rem; }
.ev-promo-msg.ok { color: var(--ok); } .ev-promo-msg.bad { color: var(--brand); }

/* CONFIRM + TICKETS */
.ev-confirm { text-align: center; padding: 1rem 0; }
.ev-confirm .check { width: 4rem; height: 4rem; border-radius: 50%; background: var(--ok); color: #06231a; display: grid; place-items: center; font-size: 2rem; margin: 0 auto 1rem; }
.ev-ticket { display: flex; background: #fff; color: #140b23; border-radius: 1rem; overflow: hidden; max-width: 460px; margin: 1rem auto; box-shadow: var(--shadow); }
.ev-ticket .stub { background: linear-gradient(160deg, #7c3aed, #f43f5e); color: #fff; padding: 1.1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ev-ticket .qr { width: 92px; height: 92px; background: #fff; padding: 5px; border-radius: 8px; display: grid; grid-template-columns: repeat(9,1fr); gap: 1px; }
.ev-ticket .qr i { background: #140b23; border-radius: 1px; }
.ev-ticket .qr i.off { background: #fff; }
.ev-ticket .stub small { margin-top: .5rem; font-size: .68rem; letter-spacing: .1em; }
.ev-ticket .main { padding: 1.1rem 1.3rem; flex: 1; }
.ev-ticket .main .k { text-transform: uppercase; font-size: .62rem; letter-spacing: .1em; color: #a855f7; font-weight: 800; }
.ev-ticket .main h4 { margin: .1rem 0 .7rem; font-size: 1.05rem; }
.ev-ticket .main .g { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; font-size: .8rem; }
.ev-ticket .main .g b { display: block; color: #6b21a8; font-size: .64rem; text-transform: uppercase; }
.ev-ticket-actions { text-align: center; margin-top: .6rem; display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.ev-ticket-actions button { border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink); border-radius: .5rem; padding: .5rem .9rem; font: 600 .8rem inherit; cursor: pointer; }

/* GATE */
.ev-gate-grid { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .ev-gate-grid { grid-template-columns: 1fr; } }
.ev-scanwrap { display: flex; justify-content: center; }
.ev-scanner { display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.ev-scan-frame { width: 220px; height: 220px; border-radius: 1.2rem; border: 3px solid var(--brand); position: relative; overflow: hidden;
    background: repeating-linear-gradient(45deg, #140b23, #140b23 12px, #1e1233 12px, #1e1233 24px); display: grid; place-items: center; text-align: center; transition: border-color .3s; }
.ev-scan-frame.ok { border-color: var(--ok); }
.ev-scan-frame.dup { border-color: var(--warn); }
.ev-scan-frame.bad { border-color: var(--brand); }
.ev-scan-line { position: absolute; left: 0; right: 0; height: 3px; background: var(--brand); box-shadow: 0 0 12px var(--brand); animation: evscan 2s linear infinite; }
.ev-scan-result { font-size: 2.5rem; }
@keyframes evscan { 0% { top: 0; } 50% { top: calc(100% - 3px); } 100% { top: 0; } }
.ev-gate-board { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.3rem; box-shadow: var(--shadow); }
.ev-gate-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.ev-gate-stats .s { background: var(--panel2); border-radius: .6rem; padding: .8rem; text-align: center; }
.ev-gate-stats .s b { font-size: 1.5rem; font-weight: 800; display: block; color: var(--ok); }
.ev-gate-stats .s small { color: var(--muted); font-size: .72rem; }
.ev-gate-log .lr { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; font-size: .85rem; border-bottom: 1px dashed var(--line); }
.ev-gate-log .lr:last-child { border-bottom: 0; }
.ev-gate-log .lr .ic { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; background: var(--ok); color: #06231a; }
.ev-gate-log .lr.dup .ic { background: var(--warn); color: #3b2600; }
.ev-gate-log .lr small { margin-left: auto; color: var(--muted); font-size: .72rem; }

/* ORGANIZER */
.ev-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.ev-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.2rem; box-shadow: var(--shadow); }
.ev-kpi b { font-size: 1.7rem; font-weight: 800; display: block; }
.ev-kpi small { color: var(--muted); font-size: .78rem; }
.ev-kpi .delta { color: var(--ok); font-size: .74rem; font-weight: 600; }
.ev-org-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .ev-org-grid { grid-template-columns: 1fr; } }
.ev-card-wide { grid-column: 1 / -1; }
#ev-regchart { width: 100%; height: 200px; }
#ev-revdonut { width: 130px; height: 130px; display: block; margin: 0 auto; }
.ev-donut-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; justify-content: center; font-size: .76rem; color: var(--muted); margin-top: .6rem; }
.ev-donut-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.ev-donut-legend i { width: .7rem; height: .7rem; border-radius: 3px; }
.ev-tier-bar { display: flex; align-items: center; gap: .8rem; padding: .45rem 0; font-size: .83rem; }
.ev-tier-bar .n { width: 5rem; color: var(--muted); flex: none; }
.ev-tier-bar .b { flex: 1; height: 14px; background: var(--line); border-radius: 4px; overflow: hidden; }
.ev-tier-bar .b i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand2), var(--brand)); }
.ev-tier-bar .v { width: 5rem; text-align: right; }
.ev-att-table .ar { display: grid; grid-template-columns: 1fr 1fr .8rem 1fr auto; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .82rem; align-items: center; }
.ev-att-table .ar.head { font-size: .7rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ev-att-table .ar:last-child { border-bottom: 0; }
.ev-att-table .tierpill { font-size: .66rem; font-weight: 800; padding: .1rem .4rem; border-radius: 999px; background: rgba(168,85,247,.2); color: var(--brand2); text-transform: uppercase; }
.ev-att-table .ci { font-size: .72rem; }
.ev-att-table .ci.yes { color: var(--ok); font-weight: 700; }
.ev-att-table .ci.no { color: var(--muted); }
.ev-att-table .ar button { border: 1px solid var(--line); background: var(--panel2); color: var(--ink); border-radius: .4rem; padding: .25rem .55rem; font: 600 .72rem inherit; cursor: pointer; }

.ev-toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; padding: .7rem 1.1rem; border-radius: .7rem; font: 700 .88rem inherit; z-index: 200; box-shadow: 0 15px 40px -12px rgba(0,0,0,.6); max-width: 90vw; }
.ev-toast[hidden] { display: none; }
@media print { .demo-chrome, .ev-topbar, .ev-nav { display: none !important; } }

/* ==========================================================================
   Wave — light theme + dark re-assert (beats shared .ds-app fallback)
   ========================================================================== */
:root[data-demo-theme="dark"] .ev { --bg:#140b23;--panel:#1e1233;--panel2:#180d2b;--line:#34244d;--ink:#ede9fe;--muted:#a999c9; }
@media (prefers-color-scheme: dark) { :root:not([data-demo-theme="light"]) .ev { --bg:#140b23;--panel:#1e1233;--panel2:#180d2b;--line:#34244d;--ink:#ede9fe;--muted:#a999c9; } }
:root[data-demo-theme="light"] .ev { --bg:#faf7ff;--panel:#ffffff;--panel2:#f4eefc;--line:#e7ddf5;--ink:#241535;--muted:#6d5b8a; }
@media (prefers-color-scheme: light) { :root:not([data-demo-theme="dark"]) .ev { --bg:#faf7ff;--panel:#ffffff;--panel2:#f4eefc;--line:#e7ddf5;--ink:#241535;--muted:#6d5b8a; } }
