/* =========================================================
   PERMATA Vote v2 — design system
   Biru & oranye dari logo, motif berlian, mode gelap otomatis
   ========================================================= */
:root {
  --blue-950: #0B1E3F;
  --blue-900: #102B57;
  --blue-800: #163E7A;
  --blue-700: #1F5BA8;
  --blue-600: #2A6FC9;
  --blue-100: #E3EDFA;
  --blue-50:  #F2F7FD;
  --orange-600: #DB5A14;
  --orange-500: #F26B21;
  --orange-400: #FF8A47;
  --orange-100: #FFE9DC;
  --green-600: #0E9F6E;
  --green-100: #DDF6EC;
  --red-600: #DC2626;
  --red-100: #FDE4E4;
  --amber-600: #B7791F;
  --amber-100: #FDF1D8;

  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --border: #E2E7EF;
  --border-strong: #CBD3E0;
  --text: #13213A;
  --text-2: #4A5875;
  --text-3: #7A869C;
  --brand: var(--blue-700);
  --brand-ink: #FFFFFF;
  --accent: var(--orange-500);
  --focus: #F26B2166;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 43, 87, .06), 0 1px 3px rgba(16, 43, 87, .06);
  --shadow: 0 4px 12px rgba(16, 43, 87, .07), 0 12px 32px rgba(16, 43, 87, .08);
  --shadow-lg: 0 18px 50px rgba(11, 30, 63, .18);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1426;
    --surface: #111E36;
    --surface-2: #0E1A30;
    --border: #22324F;
    --border-strong: #2F4266;
    --text: #E8EEF8;
    --text-2: #A9B6CC;
    --text-3: #7F8DA6;
    --brand: #5B9BF0;
    --blue-100: #17305A;
    --blue-50: #122544;
    --orange-100: #3B2414;
    --green-100: #0F3428;
    --red-100: #3A1618;
    --amber-100: #36290F;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 6px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1426; --surface: #111E36; --surface-2: #0E1A30; --border: #22324F; --border-strong: #2F4266;
  --text: #E8EEF8; --text-2: #A9B6CC; --text-3: #7F8DA6; --brand: #5B9BF0;
  --blue-100: #17305A; --blue-50: #122544; --orange-100: #3B2414; --green-100: #0F3428; --red-100: #3A1618; --amber-100: #36290F;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 6px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 640px; }
.container-md { max-width: 860px; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.section { padding: 40px 0; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--surface); --c: var(--text); --bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px;
  background: var(--b); color: var(--c); border: 1px solid var(--bd);
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  text-decoration: none !important; white-space: nowrap; user-select: none;
}
.btn:hover { box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { --b: var(--blue-700); --c: #fff; --bd: transparent; }
.btn-primary:hover { --b: var(--blue-800); }
.btn-accent { --b: linear-gradient(135deg, var(--orange-500), var(--orange-600)); --c: #fff; --bd: transparent; background: var(--b); }
.btn-accent:hover { box-shadow: 0 8px 24px rgba(242, 107, 33, .35); }
.btn-success { --b: var(--green-600); --c: #fff; --bd: transparent; }
.btn-danger { --b: transparent; --c: var(--red-600); --bd: color-mix(in srgb, var(--red-600) 40%, transparent); }
.btn-danger:hover { --b: var(--red-100); }
.btn-ghost { --b: transparent; --bd: transparent; --c: var(--text-2); }
.btn-ghost:hover { --b: var(--surface-2); box-shadow: none; }
.btn-wa { --b: #25D366; --c: #06341B; --bd: transparent; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: 1.05rem; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; }
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.panel { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 16px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-blue { background: var(--blue-100); color: var(--brand); border-color: transparent; }
.badge-orange { background: var(--orange-100); color: var(--orange-600); border-color: transparent; }
.badge-green { background: var(--green-100); color: var(--green-600); border-color: transparent; }
.badge-red { background: var(--red-100); color: var(--red-600); border-color: transparent; }
.badge-amber { background: var(--amber-100); color: var(--amber-600); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot-live { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- forms ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 6px; }
.hint { font-size: .8rem; color: var(--text-3); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--orange-500); box-shadow: 0 0 0 4px var(--focus); }
.input-lg { min-height: 56px; font-size: 1.1rem; border-radius: 16px; padding: 12px 18px; }
.is-invalid { border-color: var(--red-600) !important; }
.error { color: var(--red-600); font-size: .82rem; margin-top: 4px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--orange-500); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }

/* ---------- alerts / toast ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: .92rem; border: 1px solid transparent; }
.alert-ok { background: var(--green-100); color: var(--green-600); }
.alert-err { background: var(--red-100); color: var(--red-600); }
.alert-info { background: var(--blue-100); color: var(--brand); }
.alert-warn { background: var(--amber-100); color: var(--amber-600); }
.toast-wrap { position: fixed; z-index: 90; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--blue-950); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; animation: toast-in .3s ease; }
@keyframes toast-in { from { transform: translateY(16px); opacity: 0; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }

/* ---------- tabs / pills ---------- */
.pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; color: var(--text-2); border: 1px solid var(--border); background: var(--surface); white-space: nowrap; text-decoration: none !important; }
.pill.is-active { background: var(--blue-700); color: #fff; border-color: transparent; }
.pill .count { font-size: .72rem; background: rgba(127,127,127,.18); padding: 1px 7px; border-radius: 999px; }

/* ---------- progress ---------- */
.bar { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue-700), var(--orange-500)); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.ring { --p: 0; --size: 140px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--orange-500) calc(var(--p) * 1%), var(--surface-2) 0); transition: --p 1s; }
.ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.ring > * { position: relative; text-align: center; }

/* ---------- dialog / sheet ---------- */
dialog.sheet {
  border: 0; padding: 0; background: var(--surface); color: var(--text);
  width: min(560px, 100vw); max-height: 92vh; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
dialog.sheet::backdrop { background: rgba(8, 18, 38, .55); backdrop-filter: blur(4px); }
dialog.sheet[open] { animation: sheet-in .28s cubic-bezier(.2,.9,.3,1.1); }
@keyframes sheet-in { from { transform: translateY(24px) scale(.98); opacity: 0; } }
.sheet-body { padding: 22px; overflow: auto; max-height: calc(92vh - 76px); }
.sheet-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h3 { margin: 0; }
@media (max-width: 600px) {
  dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; }
  dialog.sheet[open] { animation: sheet-up .3s cubic-bezier(.2,.9,.3,1); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
}
dialog.sheet-wide { width: min(860px, 100vw); }

/* =========================================================
   PUBLIC
   ========================================================= */
.topbar { position: sticky; top: 0; z-index: 40; backdrop-filter: saturate(1.4) blur(12px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--border); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none !important; }
.brand img { height: 34px; width: auto; }
.brand small { display: block; font-weight: 600; color: var(--text-3); font-size: .72rem; line-height: 1.1; }

.hero {
  position: relative; overflow: hidden; color: #fff; isolation: isolate;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(242,107,33,.35), transparent 60%),
              radial-gradient(900px 600px at -10% 120%, rgba(42,111,201,.55), transparent 60%),
              linear-gradient(160deg, var(--blue-900), var(--blue-950));
}
.hero::before { /* motif berlian */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M28 6 46 24 28 50 10 24Z' fill='none' stroke='%23fff' stroke-width='1.2'/%3E%3Cpath d='M10 24h36M20 24l8-18 8 18M20 24l8 26 8-26' fill='none' stroke='%23fff' stroke-width='.6'/%3E%3C/svg%3E");
  background-size: 56px; mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.hero .container { padding-top: 40px; padding-bottom: 56px; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .lead { color: #C9D7EE; font-size: 1.05rem; max-width: 56ch; }
.hero .badge { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.hero-grid { display: grid; gap: 28px; grid-template-columns: 1.2fr .8fr; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-logo { filter: drop-shadow(0 18px 40px rgba(0,0,0,.35)); animation: float 6s ease-in-out infinite; max-width: 360px; margin-inline: auto; }
@keyframes float { 50% { transform: translateY(-8px); } }

.glass { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius-lg); backdrop-filter: blur(10px); padding: 18px; }

/* countdown */
.countdown { display: flex; gap: 10px; }
.countdown .unit { min-width: 64px; text-align: center; padding: 10px 6px 8px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); }
.countdown .num { display: block; font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.countdown .lbl { display: block; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; opacity: .75; margin-top: 6px; }
.countdown.light .unit { background: var(--surface-2); border-color: var(--border); }
.num.tick { animation: tick .35s ease; }
@keyframes tick { 0% { transform: translateY(-30%); opacity: .2; } }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 22px 46px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .node { position: absolute; left: 4px; top: 2px; width: 24px; height: 24px; border-radius: 7px; transform: rotate(45deg); background: var(--surface); border: 2px solid var(--border-strong); }
.timeline li.is-open .node { background: var(--orange-500); border-color: var(--orange-500); box-shadow: 0 0 0 6px var(--orange-100); }
.timeline li.is-closed .node { background: var(--blue-700); border-color: var(--blue-700); }
.timeline li.is-paused .node { background: var(--amber-100); border-color: var(--amber-600); }

/* step cards */
.steps { counter-reset: step; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.step { position: relative; padding: 18px 18px 18px 64px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--blue-700), var(--orange-500)); }

/* candidate cards */
.cand-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.cand {
  --c: var(--blue-700);
  position: relative; display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg);
  transition: transform .25s cubic-bezier(.2,.9,.3,1.2), border-color .2s, box-shadow .25s;
}
.cand:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cand.is-selected { border-color: var(--c); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent), var(--shadow); transform: translateY(-4px); }
.cand.is-dimmed { opacity: .55; filter: saturate(.6); }
.cand-photo { aspect-ratio: 4 / 3.4; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 85%, #000), color-mix(in srgb, var(--c) 40%, #000)); position: relative; overflow: hidden; }
.cand-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transition: transform .6s; }
.cand:hover .cand-photo img { transform: scale(1.04); }
.cand-photo .initials { position: absolute; inset: 0; display: grid; place-items: center; font-size: 4rem; font-weight: 800; color: rgba(255,255,255,.85); }
.cand-num {
  position: absolute; left: 14px; top: 14px; width: 58px; height: 58px; display: grid; place-items: center;
  background: var(--c); color: #fff; font-weight: 800; font-size: 1.5rem; border-radius: 16px; box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.cand-check {
  position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.85); color: transparent; border: 2px solid #fff; transition: all .25s cubic-bezier(.2,.9,.3,1.4); transform: scale(.85);
}
.cand.is-selected .cand-check { background: var(--c); color: #fff; transform: scale(1); }
.cand-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cand-name { font-size: 1.25rem; font-weight: 800; }
.cand-tag { color: var(--text-2); font-size: .9rem; }
.cand-people { font-size: .82rem; color: var(--text-3); }
.cand-actions { margin-top: auto; padding-top: 10px; display: flex; gap: 8px; }
.cand-strip { height: 6px; background: var(--c); }

/* sticky vote bar */
.votebar {
  position: sticky; bottom: 0; z-index: 30; margin-top: 24px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border);
}
.votebar .container { display: flex; align-items: center; gap: 12px; }

/* ballot paper animation */
.paper-stage { display: grid; place-items: center; height: 200px; position: relative; }
.ballot-box { z-index: 2; width: 150px; height: 96px; position: absolute; bottom: 10px; border-radius: 10px 10px 14px 14px; background: linear-gradient(180deg, var(--blue-700), var(--blue-900)); box-shadow: var(--shadow); }
.ballot-box::before { content: ""; position: absolute; top: -6px; left: 30px; right: 30px; height: 10px; border-radius: 6px; background: var(--blue-950); }
.ballot-box::after { content: "PERMATA"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; letter-spacing: .2em; font-size: .78rem; opacity: .85; }
.paper { position: absolute; top: 0; width: 86px; height: 110px; border-radius: 6px; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--blue-700); font-weight: 800; font-size: 1.6rem; border: 1px solid #e5e9f0; }
.paper.drop { animation: drop 1.1s cubic-bezier(.5,0,.7,1) forwards; }
@keyframes drop { 0% { transform: translateY(-10px) rotate(-6deg); } 40% { transform: translateY(10px) rotate(0) scaleY(.6); } 100% { transform: translateY(110px) scaleY(.2); opacity: 0; } }

/* receipt / success */
.success-hero { text-align: center; padding: 34px 20px 26px; }
.success-icon { width: 86px; height: 86px; margin: 0 auto 14px; border-radius: 26px; transform: rotate(45deg); background: linear-gradient(135deg, var(--green-600), #34D399); display: grid; place-items: center; box-shadow: 0 16px 40px rgba(14,159,110,.35); animation: pop .6s cubic-bezier(.2,.9,.3,1.5); }
.success-icon svg { transform: rotate(-45deg); width: 44px; height: 44px; stroke: #fff; stroke-width: 3; }
@keyframes pop { 0% { transform: rotate(45deg) scale(.2); opacity: 0; } }
.receipt { display: inline-flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 14px; border: 2px dashed var(--border-strong); background: var(--surface-2); font-family: var(--mono); font-size: 1.3rem; font-weight: 700; letter-spacing: .12em; }

/* search list */
.results-list { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-top: 8px; background: var(--surface); }
.results-list button { display: flex; width: 100%; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.results-list button:last-child { border-bottom: 0; }
.results-list button:hover, .results-list button.is-active { background: var(--blue-50); }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--blue-700), var(--orange-500)); flex: none; font-size: .9rem; }
.avatar-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.3rem; }

/* results bars */
.result-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.result-row .rank { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); color: var(--text-2); font-size: .85rem; }
.result-row.is-top .rank { background: var(--orange-500); color: #fff; }
.result-row .votes { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.result-row .bar { margin-top: 6px; height: 12px; }

.stat { padding: 18px; }
.stat .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; }
.stat .v { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; }

.footer { padding: 30px 0 40px; color: var(--text-3); font-size: .85rem; }

/* =========================================================
   LIVE (proyektor)
   ========================================================= */
.live { min-height: 100vh; color: #fff; background: radial-gradient(1000px 600px at 90% 0%, rgba(242,107,33,.25), transparent 60%), linear-gradient(160deg, var(--blue-900), var(--blue-950) 70%); }
.live .container { max-width: 1400px; }
.live-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 22px; padding: 22px; }
.live .muted { color: #A9BBD8; }
.live .bar { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); }
.live-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.live-row:last-child { border-bottom: 0; }
.live-row .ph { width: 64px; height: 64px; border-radius: 16px; overflow: hidden; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; }
.live-row .ph img { width: 100%; height: 100%; object-fit: cover; }
.live-row .num { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.live-row .bar { height: 16px; margin-top: 8px; }
.live .ring::before { background: var(--blue-950); }
.live .ring { background: conic-gradient(var(--orange-500) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); }
.unit-row { display: grid; grid-template-columns: 26px 1fr 54px; gap: 10px; align-items: center; padding: 7px 0; font-size: .95rem; }
.unit-row .bar { height: 8px; margin-top: 4px; }
.hidden-results { text-align: center; padding: 40px 10px; }
.hidden-results .lock { font-size: 3rem; }

/* =========================================================
   DRAW STAGE
   ========================================================= */
.stage { min-height: 100vh; color: #fff; display: flex; flex-direction: column; background: radial-gradient(800px 500px at 50% 0%, rgba(242,107,33,.35), transparent 70%), linear-gradient(180deg, var(--blue-900), var(--blue-950)); }
.slot { position: relative; height: 150px; overflow: hidden; border-radius: 26px; background: rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.15); box-shadow: inset 0 0 40px rgba(0,0,0,.4); }
.slot::before, .slot::after { content: ""; position: absolute; left: 0; right: 0; height: 45px; z-index: 2; pointer-events: none; }
.slot::before { top: 0; background: linear-gradient(180deg, rgba(11,30,63,.95), transparent); }
.slot::after { bottom: 0; background: linear-gradient(0deg, rgba(11,30,63,.95), transparent); }
.slot-name { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(1.6rem, 5vw, 3.4rem); font-weight: 800; text-align: center; padding: 0 20px; }
.slot-name.blur { filter: blur(1.2px); }
.slot-name.win { animation: win-pop .6s cubic-bezier(.2,.9,.3,1.5); color: #FFD27A; text-shadow: 0 0 30px rgba(255,180,80,.6); }
@keyframes win-pop { 0% { transform: scale(.6); } }
.winner-chip { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); animation: toast-in .4s ease; }
.winner-chip .pos { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--orange-500); flex: none; }

/* =========================================================
   ADMIN
   ========================================================= */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow: auto; background: var(--blue-950); color: #C9D7EE; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brand { color: #fff; padding: 4px 8px 16px; }
.sidebar .brand small { color: #8FA3C4; }
.nav-label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #6F86AD; padding: 14px 10px 6px; font-weight: 700; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: #C9D7EE; font-weight: 600; font-size: .92rem; text-decoration: none !important; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active { background: linear-gradient(90deg, rgba(242,107,33,.22), rgba(242,107,33,.05)); color: #fff; box-shadow: inset 3px 0 0 var(--orange-500); }
.nav-link .badge { margin-left: auto; background: var(--orange-500); color: #fff; border: 0; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.main { min-width: 0; }
.main-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.main-head .inner { display: flex; align-items: center; gap: 12px; padding: 14px 24px; min-height: 64px; }
.main-head h1 { font-size: 1.25rem; margin: 0; }
.main-body { padding: 24px; max-width: 1240px; }
.menu-btn { display: none; }
.crumbs { font-size: .8rem; color: var(--text-3); }
.crumbs a { color: var(--text-3); }
@media (max-width: 960px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main-head .inner, .main-body { padding-left: 16px; padding-right: 16px; }
}
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .big { font-size: 2.6rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--text-3); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; }
.round-card { border-left: 5px solid var(--border-strong); }
.round-card.is-open { border-left-color: var(--orange-500); }
.round-card.is-closed { border-left-color: var(--blue-700); }
.round-card.is-paused { border-left-color: var(--amber-600); }
.queue-now { background: linear-gradient(135deg, var(--blue-800), var(--blue-950)); color: #fff; border-radius: var(--radius-lg); padding: 22px; }
.queue-now .muted { color: #B9C8E2; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.swatch.is-active { box-shadow: 0 0 0 3px var(--orange-500); }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: .85rem; color: var(--text-2); text-decoration: none !important; }
.pagination .is-current { background: var(--blue-700); color: #fff; border-color: transparent; }
.pagination .is-disabled { opacity: .45; }

/* confetti canvas */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .main-head, .topbar, .votebar, .btn { display: none !important; }
  .admin { display: block; }
  body { background: #fff; }
}
