/* =========================================================================
   VESA E-Voting 2026 — design system
   ========================================================================= */

:root {
    --brand-950: #022c22;
    --brand-900: #053b2e;
    --brand-800: #064e3b;
    --brand-700: #047857;
    --brand-600: #059669;
    --brand-500: #10b981;
    --brand-400: #34d399;
    --brand-200: #a7f3d0;
    --brand-100: #d1fae5;
    --brand-50: #ecfdf5;
    --gold-500: #f59e0b;
    --gold-400: #fbbf24;
    --gold-100: #fef3c7;

    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-soft: #eef2f0;
    --surface: #ffffff;
    --bg: #f3f7f5;

    --danger: #dc2626;
    --danger-50: #fef2f2;
    --warn: #d97706;
    --warn-50: #fffbeb;
    --info: #2563eb;
    --info-50: #eff6ff;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow: 0 10px 30px -12px rgba(6, 78, 59, .25), 0 4px 10px -6px rgba(15, 23, 42, .08);
    --shadow-lg: 0 30px 60px -20px rgba(6, 78, 59, .35), 0 10px 25px -10px rgba(15, 23, 42, .12);

    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-head: 'Plus Jakarta Sans', 'Inter', system-ui, 'Segoe UI', Arial, sans-serif;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --topbar-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--brand-700); text-decoration: none; font-weight: 600; transition: color .2s; }
a:hover { color: var(--brand-600); }
img { max-width: 100%; display: block; }
code { font-size: .9em; background: var(--brand-50); color: var(--brand-800); padding: .1em .4em; border-radius: 6px; }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.note .text-danger { display: block; margin-top: 8px; }
.text-center { text-align: center; }

/* ---------- Ambient background ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; animation: float 22s ease-in-out infinite; }
.bg-orbs span:nth-child(1) { width: 520px; height: 520px; background: var(--brand-200); top: -160px; left: -120px; }
.bg-orbs span:nth-child(2) { width: 420px; height: 420px; background: var(--gold-100); bottom: -140px; right: -80px; animation-delay: -7s; }
.bg-orbs span:nth-child(3) { width: 300px; height: 300px; background: #cffafe; top: 40%; left: 55%; animation-delay: -14s; opacity: .35; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(40px, -30px) scale(1.05); } 66% { transform: translate(-30px, 25px) scale(.96); } }

.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-500), var(--gold-400)); box-shadow: 0 0 12px rgba(16, 185, 129, .6); }

/* ---------- Preloader ---------- */
.preloader { display: none; }
.js .preloader {
    display: grid; place-items: center; position: fixed; inset: 0; z-index: 200;
    background: radial-gradient(circle at 50% 40%, var(--brand-800), var(--brand-950));
    transition: opacity .6s var(--ease), visibility .6s;
}
.js .preloader > div { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.js .preloader .brand-mark { display: block; width: 96px; height: 96px; padding: 6px; margin: 0 auto; animation: pulse 1.2s ease-in-out infinite; }
.js .preloader p { margin: 18px 0 0; padding-left: .3em; color: var(--brand-200); font-family: var(--font-head); font-weight: 700; letter-spacing: .3em; text-transform: uppercase; font-size: .75rem; text-align: center; }
.is-ready .preloader { opacity: 0; visibility: hidden; }
@keyframes pulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(52, 211, 153, 0)); } 50% { transform: scale(1.08); filter: drop-shadow(0 0 24px rgba(52, 211, 153, .6)); } }

/* ---------- Motion: intro and scroll reveal ---------- */
.js [data-intro] { opacity: 0; transform: translateY(18px); }
.is-ready [data-intro] { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms + 150ms); }

.js [data-reveal] { opacity: 0; transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--delay, 0ms); }
.js [data-reveal="up"], .js [data-reveal=""] { transform: translateY(32px); }
.js [data-reveal="left"] { transform: translateX(-36px); }
.js [data-reveal="right"] { transform: translateX(36px); }
.js [data-reveal="zoom"] { transform: scale(.94); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
    .js [data-intro], .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, .7);
    transition: box-shadow .3s;
}
.topbar.is-scrolled { box-shadow: 0 8px 30px -18px rgba(6, 78, 59, .4); }
.topbar-inner { max-width: 1200px; margin: 0 auto; height: var(--topbar-h); padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 44px; height: 44px; padding: 3px; border-radius: 14px; object-fit: contain; background: #fff; box-shadow: 0 6px 14px -4px rgba(4, 120, 87, .35), 0 0 0 1px rgba(4, 120, 87, .12); transition: transform .4s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.admin-login-card .brand-mark { width: 56px; height: 56px; }
.brand-text { font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; line-height: 1; }
.brand-text strong { font-weight: 800; color: var(--brand-800); }
.brand-text small { display: inline-block; margin-left: 8px; padding: 3px 8px; border-radius: 99px; font-size: .7rem; font-weight: 700; color: var(--brand-800); background: var(--gold-100); vertical-align: 2px; }
.brand--light, .brand--light:hover { color: #fff; }
.brand--light .brand-text strong { color: #fff; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .nav-logout button {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: 99px;
    font: 600 .92rem var(--font-body); color: var(--ink-2);
    background: none; border: 0; cursor: pointer;
    transition: background .2s, color .2s;
}
.nav a:hover, .nav-logout button:hover { background: var(--brand-50); color: var(--brand-800); }
.nav a.is-active { background: var(--brand-800); color: #fff; }
.nav-logout { margin: 0; }
.nav-logout button:hover { background: var(--danger-50); color: var(--danger); }

.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle .icon { width: 22px; height: 22px; }

.nav a, .nav-logout button, .brand-text { white-space: nowrap; }

@media (max-width: 1024px) {
    .nav-toggle { display: inline-flex; }
    .nav {
        position: absolute; top: calc(var(--topbar-h) - 6px); left: 12px; right: 12px;
        flex-direction: column; align-items: stretch; gap: 4px; padding: 10px;
        background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
        opacity: 0; transform: translateY(-10px) scale(.98); pointer-events: none;
        transition: opacity .25s var(--ease), transform .25s var(--ease);
    }
    .nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
    .nav a, .nav-logout button { width: 100%; padding: 12px 16px; border-radius: 12px; }
}

/* ---------- Page shell ---------- */
.page { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 20px 48px; }
.page--narrow { max-width: 760px; margin: 0 auto; }

.site-footer { text-align: center; padding: 28px 20px 36px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line-soft); background: rgba(255, 255, 255, .5); }
.site-footer p { max-width: 640px; margin: 0 auto 6px; }
.site-footer a { color: var(--brand-800); }
.footer-links { font-size: .85rem; margin-top: 8px !important; }

/* ---------- Announcement banner (set in Election Control) ---------- */
.announcement { position: relative; z-index: 40; border-bottom: 1px solid; animation: slide-down .6s var(--ease); }
.announcement-inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 12px; align-items: flex-start; }
.announcement-inner .icon { width: 22px; height: 22px; margin-top: 1px; }
.announcement p { margin: 0; font-weight: 600; font-size: .95rem; }
.announcement--info { background: var(--info-50); border-color: #bfdbfe; color: #1e3a8a; }
.announcement--warn { background: var(--gold-100); border-color: #fcd34d; color: #78350f; }
.announcement--success { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-900); }
@keyframes slide-down { from { opacity: 0; transform: translateY(-100%); } }

/* ---------- Help and privacy pages ---------- */
.doc { display: grid; gap: 18px; }
.doc-section { padding: 26px; border-radius: 22px; background: #fff; border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); }
.doc-section h2 { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; }
.doc-section h2 .icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--brand-50); color: var(--brand-700); }
.doc-section p, .doc-section li { color: var(--ink-2); }
.doc-section ol, .doc-section ul { padding-left: 1.3em; display: grid; gap: 8px; margin: 0 0 1em; }
.faq details { border-top: 1px solid var(--line-soft); padding: 14px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 800 1.3rem/1 var(--font-head); color: var(--brand-600); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 10px 0 0; }
.timeline-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.timeline-mini div { padding: 14px 16px; border-radius: 16px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.timeline-mini b { display: block; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-700); }
.timeline-mini span { font-weight: 700; color: var(--ink); }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 99px;
    font: 700 .74rem var(--font-body); letter-spacing: .12em; text-transform: uppercase;
    color: var(--brand-100); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
}
.eyebrow--dark { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-100); }
.lead { font-size: 1.08rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--surface); --btn-fg: var(--ink);
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 22px; min-height: 48px;
    border-radius: 14px; border: 1px solid transparent;
    font: 700 .95rem var(--font-body); letter-spacing: .01em;
    color: var(--btn-fg); background: var(--btn-bg);
    cursor: pointer; text-decoration: none;
    transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s, opacity .2s;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: 3px solid var(--brand-200); outline-offset: 2px; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { --btn-bg: linear-gradient(135deg, var(--brand-600), var(--brand-800)); --btn-fg: #fff; background: var(--btn-bg); box-shadow: 0 10px 24px -10px rgba(4, 120, 87, .7); }
.btn-primary:hover { box-shadow: 0 16px 30px -12px rgba(4, 120, 87, .8); }
.btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-gold { --btn-bg: linear-gradient(135deg, var(--gold-400), var(--gold-500)); --btn-fg: var(--brand-950); background: var(--btn-bg); box-shadow: 0 10px 24px -10px rgba(245, 158, 11, .7); }
.btn-ghost { --btn-bg: #fff; --btn-fg: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand-200); --btn-fg: var(--brand-800); }
.btn-ghost-light { --btn-bg: rgba(255, 255, 255, .08); --btn-fg: #fff; border-color: rgba(255, 255, 255, .18); }
.btn-ghost-light:hover { --btn-bg: rgba(255, 255, 255, .16); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; box-shadow: 0 10px 24px -12px rgba(220, 38, 38, .7); }
.btn-soft-danger { --btn-bg: var(--danger-50); --btn-fg: var(--danger); border-color: #fecaca; }
.btn-soft-brand { --btn-bg: var(--brand-50); --btn-fg: var(--brand-800); border-color: var(--brand-200); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 1.02rem; border-radius: 16px; }
.btn-sm { min-height: 36px; padding: 7px 14px; font-size: .84rem; border-radius: 10px; gap: 6px; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading .icon { opacity: 0; }
.btn.is-loading::before { content: ''; position: absolute; width: 22px; height: 22px; left: calc(50% - 11px); top: calc(50% - 11px); border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-ghost.is-loading::before, .btn-soft-danger.is-loading::before { border-color: var(--line); border-top-color: var(--brand-700); }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--brand-700); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn[disabled] { color: var(--muted); cursor: default; text-decoration: none; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; }
.form-grid--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form-grid--2 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 7px; }
.field > label, .label { font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.field-wrap { position: relative; }
.field-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: flex; transition: color .2s; }
.field-wrap:focus-within .field-icon { color: var(--brand-600); }

/* Every text-like field, including inputs written without a type attribute. */
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"],
input[type="number"], input[type="search"], input[type="datetime-local"], input[type="date"], input[type="time"],
input[type="file"], select, textarea {
    display: block; width: 100%; min-height: 52px; margin: 0; padding: 13px 16px;
    font: 500 .98rem/1.4 var(--font-body); color: var(--ink);
    background-color: #f8fafb; border: 1.5px solid var(--line); border-radius: 14px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
    outline: none; transition: border-color .2s, box-shadow .2s, background-color .2s;
    -webkit-appearance: none; appearance: none;
}
input:not([type]):hover, input[type="text"]:hover, input[type="email"]:hover, input[type="password"]:hover, input[type="tel"]:hover,
input[type="number"]:hover, input[type="search"]:hover, input[type="datetime-local"]:hover, select:hover, textarea:hover {
    border-color: #c5d3cc; background-color: #fff;
}
input:not([type]):focus, input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="tel"]:focus,
input[type="number"]:focus, input[type="search"]:focus, input[type="datetime-local"]:focus, input[type="file"]:focus, select:focus, textarea:focus {
    border-color: var(--brand-500); background-color: #fff; box-shadow: 0 0 0 4px rgba(16, 185, 129, .16);
}
input::placeholder, textarea::placeholder { color: #94a3b8; font-weight: 400; }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; background-color: var(--line-soft); }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 40px #fff inset; transition: background-color 9999s;
}
textarea { min-height: 110px; resize: vertical; }
.field-wrap input, .field-wrap select { padding-left: 46px; }
.field-wrap--action input { padding-right: 52px; }
select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 46px; }
select:invalid { color: #94a3b8; }
select option { color: var(--ink); }
input[type="file"] { padding: 12px; border-style: dashed; cursor: pointer; background-color: var(--brand-50); }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 10px; background: var(--brand-800); color: #fff; font-weight: 700; cursor: pointer; }

.field-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.field-action:hover { background: var(--brand-50); color: var(--brand-700); }
.field-action .when-shown, .field-action.is-shown .when-hidden { display: none; }
.field-action.is-shown .when-shown { display: block; }

.strength { display: grid; gap: 6px; }
.strength span { height: 6px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.strength span::after { content: ''; position: absolute; inset: 0; width: var(--w, 0%); background: var(--c, var(--danger)); border-radius: inherit; transition: width .4s var(--ease), background .3s; }
.strength small { color: var(--muted); font-size: .8rem; }

.note { font-size: .88rem; color: var(--ink-2); background: var(--brand-50); border: 1px solid var(--brand-100); border-left: 4px solid var(--brand-500); padding: 12px 14px; border-radius: 12px; }
.hint { font-size: .8rem; color: var(--muted); }
p.hint { margin: 8px 0 0; }
.form-row-end { display: flex; justify-content: flex-end; font-size: .88rem; margin-top: -6px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand-600); flex-shrink: 0; }

/* ---------- Alerts and toasts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: .92rem; border: 1px solid; }
.alert .icon { margin-top: 2px; }
.alert--error { background: var(--danger-50); border-color: #fecaca; color: #991b1b; }
.alert--success { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.alert--info { background: var(--info-50); border-color: #bfdbfe; color: #1e40af; }
.alert--warn { background: var(--warn-50); border-color: #fde68a; color: #92400e; }

.toasts { position: fixed; top: calc(var(--topbar-h) + 14px); right: 16px; z-index: 120; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); border: 1px solid var(--line); font-size: .92rem; font-weight: 500; animation: toast-in .5s var(--ease); }
.toast > .icon { margin-top: 2px; width: 20px; height: 20px; }
.toast span { flex: 1; }
.toast--success > .icon { color: var(--brand-600); }
.toast--error > .icon { color: var(--danger); }
.toast--info > .icon { color: var(--info); }
.toast--success { border-left: 4px solid var(--brand-500); }
.toast--error { border-left: 4px solid var(--danger); }
.toast--info { border-left: 4px solid var(--info); }
.toast.is-leaving { animation: toast-out .4s var(--ease) forwards; }
.toast-close { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 8px; display: flex; }
.toast-close:hover { color: var(--ink); background: var(--line-soft); }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) scale(.96); } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(2, 44, 34, .55); backdrop-filter: blur(6px); animation: fade-in .25s; }
.modal[hidden] { display: none; }
.modal-card { width: min(440px, 100%); background: #fff; border-radius: var(--radius-lg); padding: 30px 28px 24px; text-align: center; box-shadow: var(--shadow-lg); animation: pop-in .4s var(--ease); }
.modal-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-50); color: var(--warn); }
.modal-icon .icon { width: 28px; height: 28px; }
.modal-card p { color: var(--muted); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(20px) scale(.95); } }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid rgba(226, 232, 240, .8); padding: 32px; }
.card-head { margin-bottom: 24px; }
.card-head p { color: var(--muted); margin: 0; }
.glass { background: rgba(255, 255, 255, .78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

/* ---------- Auth pages (login / register / recovery) ---------- */
.auth-shell { display: grid; grid-template-columns: 1.05fr 1fr; gap: 0; border-radius: 30px; overflow: hidden; box-shadow: var(--shadow-lg); background: #fff; min-height: 640px; }
.auth-hero {
    position: relative; color: #fff; padding: 48px 44px;
    background:
        radial-gradient(circle at 15% 15%, rgba(52, 211, 153, .35), transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(251, 191, 36, .22), transparent 40%),
        linear-gradient(150deg, var(--brand-800), var(--brand-950));
    overflow: hidden;
}
.auth-hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent 85%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); }
.auth-hero-inner { position: relative; display: grid; gap: 20px; align-content: start; }
.auth-hero h1 { color: #fff; margin: 0; font-size: clamp(2rem, 3.6vw, 2.75rem); }
.hero-logo { width: 88px; height: 88px; padding: 6px; border-radius: 24px; object-fit: contain; background: #fff; box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .55), 0 0 0 4px rgba(255, 255, 255, .12); }
.hero-logo--center { display: block; margin: 0 auto 6px; }
@media (max-width: 920px) { .auth-hero .hero-logo { width: 64px; height: 64px; border-radius: 18px; } }
.auth-hero .lead { color: rgba(236, 253, 245, .82); margin: 0; }
.auth-panel { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-panel-head h2 { margin-bottom: 6px; }
.auth-panel-head p { color: var(--muted); margin: 0; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: .92rem; color: var(--muted); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.trust-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 14px; }
.trust-list li { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: rgba(236, 253, 245, .82); }
.trust-list strong { color: #fff; }
.trust-list .icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: var(--brand-400); }

@media (max-width: 920px) {
    .auth-shell { grid-template-columns: 1fr; border-radius: 24px; min-height: 0; }
    .auth-hero { padding: 34px 26px; }
    .auth-hero .trust-list { display: none; }
    .auth-panel { padding: 32px 24px; }
}
@media (max-width: 480px) { .page { padding: 18px 12px 36px; } .card { padding: 24px 18px; } }

/* ---------- Status card and countdown ---------- */
.status-card { border-radius: 20px; padding: 20px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); display: grid; gap: 12px; }
.status-card p { margin: 0; color: rgba(236, 253, 245, .85); font-size: .92rem; }
.status-card small { color: rgba(236, 253, 245, .7); font-size: .8rem; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; width: max-content; padding: 6px 12px; border-radius: 99px; font: 700 .78rem var(--font-body); letter-spacing: .04em; text-transform: uppercase; background: rgba(255, 255, 255, .14); color: #fff; }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-card--live .status-pill i, .status-pill--live i { background: var(--brand-400); box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: live 1.8s infinite; }
.status-card--soon .status-pill i, .status-pill--soon i { background: var(--gold-400); }
.status-card--warn .status-pill i, .status-pill--warn i { background: #fb923c; }
.status-card--done .status-pill i, .status-pill--done i { background: #93c5fd; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.status-pill--live, .status-pill--soon, .status-pill--warn, .status-pill--done, .status-pill--idle { background: var(--brand-50); color: var(--brand-800); border: 1px solid var(--brand-100); }
.status-pill--soon { background: var(--gold-100); color: #92400e; border-color: #fde68a; }
.status-pill--warn { background: var(--warn-50); color: #9a3412; border-color: #fed7aa; }
.status-pill--done { background: var(--info-50); color: #1e40af; border-color: #bfdbfe; }
.status-pill--idle { background: var(--line-soft); color: var(--muted); border-color: var(--line); }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.countdown-unit { text-align: center; padding: 12px 6px; border-radius: 14px; background: rgba(2, 44, 34, .35); border: 1px solid rgba(255, 255, 255, .1); }
.countdown-unit b { display: block; font: 800 1.7rem/1 var(--font-head); color: #fff; font-variant-numeric: tabular-nums; }
.countdown-unit b.tick { animation: tick .45s var(--ease); }
.countdown-unit span { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-200); }
@keyframes tick { from { transform: translateY(-6px); opacity: .3; } }
.countdown--light .countdown-unit { background: var(--brand-50); border-color: var(--brand-100); }
.countdown--light .countdown-unit b { color: var(--brand-800); }
.countdown--light .countdown-unit span { color: var(--brand-700); }

.reg-timer { display: grid; gap: 8px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, var(--brand-50), #fff); border: 1px solid var(--brand-100); }
.reg-timer .label { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-700); text-align: center; }
.state-inline { display: grid; gap: 14px; }

/* ---------- OTP ---------- */
.otp-form { display: grid; gap: 20px; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.otp-boxes input { min-height: 62px; padding: 0; text-align: center; font: 800 1.6rem var(--font-head); border-radius: 14px; caret-color: var(--brand-600); }
.otp-boxes input.is-filled { border-color: var(--brand-500); background: var(--brand-50); animation: pop .25s var(--ease); }
.otp-boxes.is-error input { border-color: var(--danger); animation: shake .4s; }
@keyframes pop { 50% { transform: scale(1.08); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.resend-form { text-align: center; font-size: .88rem; color: var(--muted); margin: 0; }
.dev-note { display: flex; gap: 8px; align-items: center; font-size: .8rem; color: #92400e; background: var(--warn-50); border: 1px dashed #fcd34d; padding: 10px 12px; border-radius: 12px; margin: 0; }
.mail-badge { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.mail-badge .icon { width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }
.mail-badge strong { display: block; color: var(--brand-800); }
.mail-badge span { font-size: .85rem; color: var(--muted); }

/* ---------- State screens (not started, already voted, success) ---------- */
.state-screen { max-width: 640px; margin: 4vh auto; text-align: center; background: #fff; border-radius: 30px; padding: 48px 36px; box-shadow: var(--shadow-lg); border: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.state-screen::before { content: ''; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--brand-500), var(--gold-400)); }
.state-screen h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.state-screen p { color: var(--muted); font-size: 1.05rem; }
.state-screen .countdown { margin: 26px 0 10px; }
.state-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 26px; }
.state-icon { width: 96px; height: 96px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); position: relative; }
.state-icon::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid currentColor; opacity: .18; animation: ring 2.4s var(--ease) infinite; }
.state-icon .icon { width: 44px; height: 44px; }
.state-icon--danger { background: var(--danger-50); color: var(--danger); }
.state-icon--warn { background: var(--warn-50); color: var(--warn); }
.state-icon--info { background: var(--info-50); color: var(--info); }
@keyframes ring { from { transform: scale(.9); opacity: .35; } to { transform: scale(1.25); opacity: 0; } }

.success-check { width: 110px; height: 110px; margin: 0 auto 24px; }
.success-check circle { fill: none; stroke: var(--brand-500); stroke-width: 4; stroke-dasharray: 320; stroke-dashoffset: 320; animation: draw 1s var(--ease) .3s forwards; }
.success-check path { fill: none; stroke: var(--brand-600); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .6s var(--ease) 1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: confetti 3.2s var(--ease) forwards; }
@keyframes confetti { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); opacity: .9; } }

/* ---------- Ballot ---------- */
.ballot-hero {
    position: relative; overflow: hidden; border-radius: 30px; padding: 44px 40px; color: #fff; text-align: center;
    background:
        radial-gradient(circle at 10% 20%, rgba(52, 211, 153, .35), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(251, 191, 36, .25), transparent 40%),
        linear-gradient(140deg, var(--brand-800), var(--brand-950));
    box-shadow: var(--shadow-lg);
}
.ballot-hero h1 { color: #fff; margin: 14px 0 8px; letter-spacing: .02em; }
.ballot-hero p { color: var(--gold-400); font-weight: 700; font-size: 1.15rem; margin: 0 0 6px; }
.ballot-hero small { color: var(--brand-200); }
.ballot-hero .voter-chip { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 8px 16px 8px 8px; border-radius: 99px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); font-size: .9rem; }
.voter-chip .avatar { width: 32px; height: 32px; font-size: .78rem; }
.ballot-hero-timer { max-width: 420px; margin: 22px auto 0; display: grid; gap: 8px; }
.ballot-hero-timer small { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.ballot-hero .countdown-unit b { font-size: 1.4rem; }
.scroll-cue { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 22px; color: var(--brand-200); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.scroll-cue .icon { animation: bob 1.6s ease-in-out infinite; }
.scroll-cue:hover { color: #fff; }
@keyframes bob { 50% { transform: translateY(6px); } }

.ballot-bar { position: sticky; top: calc(var(--topbar-h) + 10px); z-index: 30; margin: 26px 0 8px; padding: 14px 18px; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid rgba(226, 232, 240, .9); display: grid; gap: 12px; }
.ballot-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .92rem; }
.ballot-bar-top strong { font-family: var(--font-head); }
.ballot-bar-top .count { font-weight: 800; color: var(--brand-700); }
.progress { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand-500), var(--gold-400)); transition: width .6s var(--ease); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; scroll-behavior: smooth; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font: 600 .8rem var(--font-body); cursor: pointer; transition: all .25s var(--ease); }
.chip b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line-soft); font-size: .7rem; }
.chip:hover { border-color: var(--brand-200); color: var(--brand-800); }
.chip.is-current { border-color: var(--brand-600); color: var(--brand-800); box-shadow: 0 0 0 3px rgba(16, 185, 129, .15); }
.chip.is-done { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.chip.is-done b { background: var(--brand-600); color: #fff; }

.position-section { scroll-margin-top: calc(var(--topbar-h) + 150px); padding: 30px 0 10px; }
.position-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.position-num { flex-shrink: 0; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; font: 800 1.2rem var(--font-head); color: var(--brand-800); background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); border: 1px solid var(--brand-200); transition: all .4s var(--ease); }
.position-section.is-done .position-num { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; border-color: transparent; box-shadow: 0 10px 20px -10px rgba(4, 120, 87, .8); }
.position-head h2 { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.55rem); text-transform: uppercase; letter-spacing: .02em; }
.position-head p { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.position-state { margin-left: auto; flex-shrink: 0; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 99px; background: var(--line-soft); color: var(--muted); transition: all .3s; }
.position-section.is-done .position-state { background: var(--brand-50); color: var(--brand-700); }

.candidate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.candidate-card { position: relative; display: block; cursor: pointer; border-radius: 22px; -webkit-tap-highlight-color: transparent; }
.candidate-card input { position: absolute; opacity: 0; pointer-events: none; }
.candidate-inner {
    position: relative; height: 100%; padding: 26px 18px 22px; text-align: center;
    background: #fff; border: 2px solid var(--line-soft); border-radius: 22px; box-shadow: var(--shadow-sm);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .25s, background .25s;
}
.candidate-card:hover .candidate-inner { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--brand-200); }
.candidate-card input:focus-visible + .candidate-inner { outline: 3px solid var(--brand-400); outline-offset: 3px; }
.candidate-card input:checked + .candidate-inner { border-color: var(--brand-500); background: linear-gradient(180deg, var(--brand-50), #fff 70%); box-shadow: 0 18px 36px -16px rgba(4, 120, 87, .55); transform: translateY(-4px); }
.candidate-photo { position: relative; width: 128px; height: 128px; margin: 0 auto 16px; border-radius: 50%; padding: 4px; background: linear-gradient(135deg, var(--brand-200), var(--gold-100)); transition: background .3s; }
.candidate-card input:checked + .candidate-inner .candidate-photo { background: linear-gradient(135deg, var(--brand-500), var(--gold-400)); }
.candidate-photo img, .candidate-initials { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid #fff; background: var(--brand-50); }
.candidate-initials { display: grid; place-items: center; font: 800 2.2rem var(--font-head); color: var(--brand-700); }
.candidate-photo img.is-broken { display: none; }
.candidate-photo img:not(.is-broken) + .candidate-initials { display: none; }
.candidate-name { display: block; font: 700 1.08rem var(--font-head); color: var(--ink); }
.candidate-dept { display: block; margin-top: 4px; font-size: .84rem; color: var(--muted); font-style: italic; }
.candidate-select { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 7px 14px; border-radius: 99px; font-size: .8rem; font-weight: 700; color: var(--brand-700); background: var(--brand-50); transition: all .25s; }
.candidate-card input:checked + .candidate-inner .candidate-select { background: var(--brand-600); color: #fff; }
.candidate-select .when-on, .candidate-card input:checked + .candidate-inner .when-off { display: none; }
.candidate-card input:checked + .candidate-inner .when-on { display: inline; }
.candidate-tick { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--brand-600); transform: scale(0) rotate(-90deg); transition: transform .4s var(--ease); box-shadow: 0 6px 14px -4px rgba(4, 120, 87, .6); }
.candidate-card input:checked + .candidate-inner .candidate-tick { transform: scale(1) rotate(0); }

.ballot-submit { margin: 40px 0 0; padding: 28px; border-radius: 26px; text-align: center; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line-soft); }
.ballot-submit p { color: var(--muted); }

/* ---------- Review ---------- */
.review-list { display: grid; gap: 12px; margin: 24px 0; }
.review-item { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.review-item .candidate-photo { width: 62px; height: 62px; margin: 0; padding: 3px; flex-shrink: 0; }
.review-item .candidate-initials { font-size: 1.1rem; border-width: 3px; }
.review-item .candidate-photo img { border-width: 3px; }
.review-item small { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-700); }
.review-item strong { font-family: var(--font-head); font-size: 1.05rem; }
.review-item .muted { font-size: .84rem; }
.review-item--skip { background: var(--line-soft); border-style: dashed; }
.review-item--skip small { color: var(--muted); }
.review-skip-icon { width: 62px; height: 62px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--muted); }
.review-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
@media (max-width: 520px) { .review-actions { grid-template-columns: 1fr; } }

/* ---------- Results ---------- */
.page-hero { text-align: center; margin: 10px auto 34px; max-width: 760px; }
.page-hero p { color: var(--muted); font-size: 1.05rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat { padding: 22px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--line-soft); }
.stat span { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; margin-top: 6px; font: 800 2rem/1.1 var(--font-head); color: var(--brand-800); font-variant-numeric: tabular-nums; }
.result-position { padding: 26px; margin-bottom: 18px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--line-soft); }
.result-position-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.result-position-head h3 { margin: 0; text-transform: uppercase; letter-spacing: .03em; }
.result-position-head span { font-size: .85rem; color: var(--muted); }
.result-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.result-row:first-of-type { border-top: 0; }
.result-row .candidate-photo { width: 52px; height: 52px; margin: 0; padding: 2px; }
.result-row .candidate-initials { font-size: 1rem; border-width: 2px; }
.result-row .candidate-photo img { border-width: 2px; }
.result-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; }
.result-votes { text-align: right; font: 800 1.15rem var(--font-head); color: var(--ink); font-variant-numeric: tabular-nums; }
.result-votes small { display: block; font: 600 .78rem var(--font-body); color: var(--muted); }
.bar { height: 10px; margin-top: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #94a3b8, #cbd5e1); transition: width 1.4s var(--ease); }
.result-row--winner .bar-fill { background: linear-gradient(90deg, var(--brand-500), var(--gold-400)); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font: 700 .7rem var(--font-body); letter-spacing: .06em; text-transform: uppercase; background: var(--line-soft); color: var(--muted); }
.badge .icon { width: 13px; height: 13px; }
.badge--winner { background: var(--gold-100); color: #92400e; }
.badge--tie { background: var(--info-50); color: #1e40af; }
.badge--green { background: var(--brand-50); color: var(--brand-700); }
.badge--red { background: var(--danger-50); color: var(--danger); }
.badge--amber { background: var(--warn-50); color: #92400e; }

/* ---------- Admin console ---------- */
.admin-body .page { max-width: none; padding: 0; }
.admin-body .site-footer { display: none; }
.admin-shell { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }
.admin-sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 26px; padding: 26px 18px;
    color: #fff; background: radial-gradient(circle at 0 0, rgba(52, 211, 153, .25), transparent 40%), linear-gradient(180deg, var(--brand-900), var(--brand-950));
    overflow-y: auto;
}
.admin-nav { display: grid; gap: 4px; }
.admin-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: rgba(236, 253, 245, .75); font-weight: 600; font-size: .92rem; transition: all .2s; }
.admin-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-nav a.is-active { background: rgba(52, 211, 153, .18); color: #fff; box-shadow: inset 3px 0 0 var(--brand-400); }
.admin-sidebar-foot { margin-top: auto; display: grid; gap: 14px; }
.admin-user { display: flex; align-items: center; gap: 12px; }
.admin-user strong { display: block; font-size: .95rem; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font: 800 .9rem var(--font-head); color: var(--brand-950); background: linear-gradient(135deg, var(--brand-400), var(--gold-400)); flex-shrink: 0; }
.role-badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.role-badge--super { background: var(--gold-400); color: var(--brand-950); }
.role-badge--editor { background: rgba(255, 255, 255, .18); color: #fff; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; padding: 18px 32px; background: rgba(243, 247, 245, .85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.admin-topbar h1 { font-size: 1.5rem; margin: 6px 0 0; }
.admin-topbar .status-pill { margin-left: auto; }
.admin-content { padding: 28px 32px 48px; display: grid; gap: 24px; align-content: start; }
.nav-toggle--dark { display: none; }

@media (max-width: 1000px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 80; transform: translateX(-100%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); }
    .admin-sidebar.is-open { transform: none; }
    .nav-toggle--dark { display: inline-flex; }
    .admin-topbar { padding: 14px 18px; }
    .admin-topbar h1 { font-size: 1.2rem; }
    .admin-content { padding: 20px 16px 40px; }
}
@media (max-width: 560px) { .admin-topbar .status-pill { display: none; } }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.stat-card { position: relative; overflow: hidden; padding: 22px; border-radius: 20px; background: #fff; border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); }
.stat-card .icon { position: absolute; right: 18px; top: 18px; width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: var(--brand-50); color: var(--brand-700); }
.stat-card h3 { margin: 0; font: 700 .76rem var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat-card p { margin: 10px 0 0; font: 800 2.1rem/1 var(--font-head); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-card small { display: block; margin-top: 8px; color: var(--muted); font-size: .82rem; }
.stat-card--gold .icon { background: var(--gold-100); color: #b45309; }
.stat-card--blue .icon { background: var(--info-50); color: var(--info); }
.stat-card--red .icon { background: var(--danger-50); color: var(--danger); }

.panel { background: #fff; border-radius: 22px; border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); padding: 24px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.panel-head h2 .icon { color: var(--brand-600); }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.panel--danger { border-top: 4px solid var(--danger); }
.panel--danger .panel-head h2, .panel--danger .panel-head h2 .icon { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.grid-2--even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .grid-2, .grid-2--even { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 24px; }

.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; padding: 10px 12px; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: #f8fbf9; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--brand-700); font-size: 1.05rem; }
.table .mono { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: var(--ink-2); }
.person { display: flex; align-items: center; gap: 12px; }
.person .candidate-photo { width: 44px; height: 44px; margin: 0; padding: 2px; flex-shrink: 0; }
.person .candidate-initials { font-size: .85rem; border-width: 2px; }
.person .candidate-photo img { border-width: 2px; }
.person small { display: block; color: var(--muted); font-size: .8rem; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: var(--brand-200); margin-bottom: 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 42px; min-height: 42px; border-radius: 12px; }
.inline-form { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.toggle-row:first-of-type { border-top: 0; padding-top: 0; }
.toggle-row h4 { margin: 0 0 2px; font-size: .98rem; }
.toggle-row p { margin: 0; font-size: .84rem; color: var(--muted); }
.mini-bars { display: grid; gap: 14px; }
.mini-bar-head { display: flex; justify-content: space-between; font-size: .88rem; gap: 10px; }
.mini-bar-head b { font-variant-numeric: tabular-nums; color: var(--brand-700); }
.lock-banner { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 16px; background: var(--warn-50); border: 1px solid #fde68a; color: #92400e; font-size: .92rem; }
.preview-img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid var(--brand-100); display: none; }
.preview-img.is-set { display: block; margin: 0 auto; }
.actions--end { justify-content: flex-end; flex-wrap: nowrap; }
.table tbody tr.is-editing, .table tbody tr.is-editing:hover { background: var(--brand-50); }
#candidate-form { scroll-margin-top: 110px; }
.reg-groups { display: grid; gap: 12px; }
.reg-group { border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 14px; background: #fcfdfc; }
.reg-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .86rem; margin-bottom: 8px; }
.reg-group-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.reg-group-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .86rem; padding-top: 6px; border-top: 1px dashed var(--line-soft); }
.reg-group .mono { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: var(--ink-2); }
.panel--editing { border-color: var(--brand-200); box-shadow: 0 0 0 4px var(--brand-50), var(--shadow-sm); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.form-actions .btn { flex: 1 1 140px; }
.danger-zone { display: grid; gap: 14px; padding: 18px; border-radius: 16px; background: var(--danger-50); border: 1px dashed #fca5a5; }
.danger-zone h4 { margin: 0; color: #991b1b; }
.danger-zone p { margin: 0; font-size: .86rem; color: #7f1d1d; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: .88rem; }
.pager span { background: var(--brand-800); color: #fff; border-color: var(--brand-800); }

.admin-login { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 20px 0; }
.admin-login-card { width: min(460px, 100%); display: grid; gap: 20px; padding: 36px 32px; border-radius: 28px; background: #fff; box-shadow: var(--shadow-lg); border: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.admin-login-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--brand-500), var(--gold-400)); }
.admin-login-card .auth-links { justify-content: center; }
.auth-shell--compact { min-height: 0; }
.mini-position { display: grid; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.mini-position:first-child { border-top: 0; padding-top: 0; }
.mini-position h4 { margin: 0; font-size: .95rem; text-transform: uppercase; letter-spacing: .03em; }
.mini-position .bar { margin-top: 6px; height: 8px; }
.bar-fill--lead { background: linear-gradient(90deg, var(--brand-500), var(--gold-400)); }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.activity li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; transition: background .2s; }
.activity li:hover { background: var(--line-soft); }
.activity strong { font-size: .9rem; text-transform: capitalize; }
.activity span { font-size: .8rem; color: var(--muted); }
.group-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 6px; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-800); }
.group-title:first-of-type { margin-top: 0; }
.actions-cell { text-align: right; width: 1%; white-space: nowrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a { padding: 7px 14px; border-radius: 99px; font-size: .85rem; color: var(--ink-2); background: var(--line-soft); }
.tabs a:hover { color: var(--brand-800); background: var(--brand-50); }
.tabs a.is-active { background: var(--brand-800); color: #fff; }
.block { display: block; }
small.block { font-size: .8rem; }
.mt { margin-top: 14px; }
.role-badge--onlight.role-badge--editor { background: var(--line-soft); color: var(--ink-2); }
.result-row { transition: background .6s; border-radius: 12px; }
.result-row.is-bumped { animation: bump 1.6s var(--ease); }
@keyframes bump { 0% { background: rgba(251, 191, 36, .28); } 100% { background: transparent; } }

/* ---------- Ballot (step-by-step, one position per step) ---------- */
.btn[hidden] { display: none !important; }
.btn.is-invisible { visibility: hidden; }
.btn-soft { --btn-bg: #e9edf1; --btn-fg: var(--ink-2); }
.btn-soft:hover { --btn-bg: #dfe5ea; }

.ballot-shell { max-width: 980px; margin: 0 auto; padding: 28px; border-radius: 24px; background: #fff; border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.ballot-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.ballot-heading h1 { margin: 8px 0 2px; font-size: clamp(1.5rem, 3vw, 2rem); }
.ballot-heading p { margin: 0; color: var(--muted); }
.ballot-closes { display: grid; gap: 6px; min-width: 260px; }
.ballot-closes small { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ballot-closes .countdown { gap: 6px; }
.ballot-closes .countdown-unit { padding: 8px 4px; border-radius: 10px; }
.ballot-closes .countdown-unit b { font-size: 1.1rem; }
.ballot-closes .countdown-unit span { font-size: .6rem; }

.voter-bar { display: flex; align-items: center; gap: 22px; padding: 16px 22px; border-radius: 18px; background: #e8f5ec; margin-bottom: 26px; }
.voter-bar-item { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.voter-bar-item strong { display: block; font: 700 1.05rem var(--font-head); color: var(--ink); }
.voter-bar-item div > span { display: block; color: var(--ink-2); font-size: .95rem; overflow-wrap: anywhere; }
.voter-bar-icon { flex-shrink: 0; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #cfe9d8; color: var(--brand-700); }
.voter-bar-icon .icon { width: 26px; height: 26px; }
.voter-bar-icon--plain { background: none; width: 40px; }
.voter-bar-icon--plain .icon { width: 32px; height: 32px; }
.voter-bar-divider { width: 1px; align-self: stretch; background: #b9dcc6; }

.step-meter { display: flex; justify-content: space-between; gap: 12px; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.step-meter b { color: var(--brand-700); }

.vote-step { padding-top: 22px; }
.vote-title { margin: 0 0 4px; font: 700 clamp(1.35rem, 2.6vw, 1.75rem) var(--font-head); color: var(--ink); }
.vote-hint { margin: 0 0 18px; color: var(--muted); font-size: .92rem; transition: color .3s; }

/* Wizard mode (JavaScript on): only the current step is shown. */
.is-wizard .vote-step { display: none; }
.is-wizard .vote-step.is-current { display: block; }
.vote-step.is-entering { animation: step-in .45s var(--ease); }
@keyframes step-in { from { opacity: 0; transform: translateX(24px); } }
.vote-step.is-missing .vote-hint { color: var(--danger); font-weight: 700; }
.vote-step.is-missing .cand-grid, .vote-step.is-missing .yn-choice { animation: shake .4s; }

.cand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 270px)); justify-content: center; gap: 16px; }
.cand-grid--single { grid-template-columns: minmax(220px, 300px); justify-content: center; }
.cand { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cand input { position: absolute; opacity: 0; pointer-events: none; }
.cand-body { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 16px 18px; text-align: center; background: #fff; border: 2px solid #e3e8ed; border-radius: 16px; transition: border-color .2s, background .2s, box-shadow .25s, transform .25s var(--ease); }
.cand:hover .cand-body { border-color: #b6dcc4; transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.cand input:focus-visible + .cand-body { outline: 3px solid var(--brand-400); outline-offset: 3px; }
.cand input:checked + .cand-body { border-color: #15803d; background: #ecf8f0; box-shadow: 0 12px 26px -14px rgba(21, 128, 61, .55); }
.cand .candidate-photo { width: 112px; height: 112px; margin: 0; padding: 0; background: #eef2f5; }
.cand .candidate-photo img, .cand .candidate-initials { border: 0; }
.cand input:checked + .cand-body .candidate-photo { box-shadow: 0 0 0 3px #15803d; }
.cand-text { display: grid; gap: 2px; }
.cand-name { font: 700 1.1rem var(--font-head); color: var(--ink); }
.cand-dept { font-size: .82rem; color: var(--muted); }
.cand-radio { display: inline-flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 1rem; color: var(--ink-2); }
.cand-radio .when-on, .cand input:checked + .cand-body .cand-radio .when-off { display: none; }
.cand input:checked + .cand-body .cand-radio .when-on { display: inline; }
.cand input:checked + .cand-body .cand-radio { color: #15803d; font-weight: 600; }
.radio-dot { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #7b8794; background: #fff; flex-shrink: 0; transition: border-color .2s; }
.radio-dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #15803d; transform: scale(0); transition: transform .25s var(--ease); }
.cand input:checked + .cand-body .radio-dot, .yn-pill input:checked + span .radio-dot { border-color: #15803d; }
.cand input:checked + .cand-body .radio-dot::after, .yn-pill input:checked + span .radio-dot::after { transform: scale(1); }
.cand--static { cursor: default; }
.cand--static .cand-body:hover { transform: none; }

.yn-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 200px)); justify-content: center; gap: 14px; margin-top: 16px; }
.yn-pill { position: relative; cursor: pointer; }
.yn-pill input { position: absolute; opacity: 0; pointer-events: none; }
.yn-pill span { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; border-radius: 14px; border: 2px solid #e3e8ed; background: #fff; font: 700 1.05rem var(--font-head); color: var(--ink-2); transition: all .2s; }
.yn-pill:hover span { border-color: #b6dcc4; }
.yn-pill--yes input:checked + span { border-color: #15803d; background: #ecf8f0; color: #15803d; }
.yn-pill--no input:checked + span { border-color: var(--danger); background: var(--danger-50); color: var(--danger); }
.yn-pill--no input:checked + span .radio-dot { border-color: var(--danger); }
.yn-pill--no .radio-dot::after { background: var(--danger); }

.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.wizard-nav .btn { min-width: 150px; }
.wizard-nav [data-review] { margin-left: auto; }
form:not(.is-wizard) .wizard-nav [data-prev], form:not(.is-wizard) .wizard-nav [data-next] { display: none; }

/* Phones: candidates become full-width rows and Back / Next stay at the bottom of the screen. */
@media (max-width: 640px) {
    .ballot-page .page { padding-bottom: 110px; }
    .ballot-shell { padding: 18px 14px; border-radius: 20px; }
    .ballot-closes { min-width: 0; width: 100%; }
    .voter-bar { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
    .voter-bar-divider { width: auto; height: 1px; }
    .voter-bar-icon { width: 44px; height: 44px; }
    .voter-bar-icon--plain { width: 44px; }
    .voter-bar-item strong { font-size: .98rem; }
    .cand-grid, .cand-grid--single { grid-template-columns: 1fr; gap: 12px; }
    .cand-body { flex-direction: row; text-align: left; padding: 12px 14px; gap: 14px; }
    .cand:hover .cand-body { transform: none; }
    .cand .candidate-photo { width: 64px; height: 64px; flex-shrink: 0; }
    .cand .candidate-initials { font-size: 1.3rem; }
    .cand-text { flex: 1; min-width: 0; }
    .cand-radio { margin: 0; flex-direction: column; gap: 4px; font-size: .78rem; }
    .yn-choice { grid-template-columns: 1fr 1fr; }
    .wizard-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -18px rgba(15, 23, 42, .35); }
    .wizard-nav .btn { min-width: 0; min-height: 52px; padding: 12px 14px; font-size: .95rem; }
    .wizard-nav [data-prev] { flex: 0 0 auto; }
    .wizard-nav .btn.is-invisible { display: none; }
    .wizard-nav [data-next], .wizard-nav [data-review] { flex: 1; }
}

/* ---------- Unopposed Yes/No ballot ---------- */
.unopposed { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: center; padding: 22px; border-radius: 22px; background: #fff; border: 2px solid var(--line-soft); box-shadow: var(--shadow-sm); }
.unopposed-card { display: flex; align-items: center; gap: 18px; }
.unopposed-card .candidate-photo { width: 96px; height: 96px; margin: 0; flex-shrink: 0; }
.unopposed-card .candidate-initials { font-size: 1.6rem; }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yesno-option { position: relative; cursor: pointer; }
.yesno-option input { position: absolute; opacity: 0; pointer-events: none; }
.yesno-option span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; border-radius: 16px; border: 2px solid var(--line); background: #f8fafb; font: 800 1.1rem var(--font-head); color: var(--ink-2); transition: all .25s var(--ease); }
.yesno-option:hover span { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.yesno-option input:focus-visible + span { outline: 3px solid var(--brand-400); outline-offset: 3px; }
.yesno-option--yes input:checked + span { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); border-color: transparent; color: #fff; box-shadow: 0 12px 24px -12px rgba(4, 120, 87, .8); }
.yesno-option--no input:checked + span { background: linear-gradient(135deg, #f87171, var(--danger)); border-color: transparent; color: #fff; box-shadow: 0 12px 24px -12px rgba(220, 38, 38, .7); }
@media (max-width: 640px) { .unopposed { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .actions-cell .btn-label { display: none; }
    .actions-cell .btn-sm { padding: 7px 10px; }
}
.position-section.is-missing .position-head, .position-section.is-missing .unopposed { animation: missing 1.2s var(--ease) 2; }
@keyframes missing { 50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, .25); border-radius: 18px; } }

.registered-as { display: inline-grid; gap: 2px; margin: 4px auto 18px; padding: 16px 26px; border-radius: 18px; background: var(--brand-50); border: 1px solid var(--brand-200); }
.registered-as span { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-700); }
.registered-as strong { font: 800 1.4rem var(--font-head); color: var(--brand-900); }
.registered-as small { color: var(--muted); font-weight: 600; }

.yn-line { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; margin-top: 6px; font-size: .85rem; }
.yn-line span { font-weight: 700; color: var(--brand-700); }
.yn-line--no span { color: var(--danger); }
.yn-line .bar { margin: 0; }
.yn-line b { font-variant-numeric: tabular-nums; }
.bar-fill--no { background: linear-gradient(90deg, #fca5a5, var(--danger)) !important; }
.stat b.stat-time { font-size: 1.4rem; }
.state-screen--inline { margin: 10px auto 30px; }
.stack-sm { display: grid; gap: 10px; }
.review-item--no { border-color: #fecaca; background: var(--danger-50); }
.review-choice { margin-left: auto; font-size: .85rem; padding: 6px 14px; }
code.hash { word-break: break-all; font-size: .78rem; }
.btn.is-disabled { opacity: .6; }

/* ---------- Admin: counts toggle, phases, checks, approvals ---------- */
.panel--highlight { border: 2px solid var(--brand-200); background: linear-gradient(135deg, #fff, var(--brand-50)); }
.counts-toggle { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.counts-toggle h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 1.15rem; }
.counts-toggle h2 .icon { color: var(--brand-600); }
.counts-toggle p { margin: 0; max-width: 640px; color: var(--muted); font-size: .9rem; }
.switch { display: inline-flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: 700 .9rem var(--font-body); color: var(--ink-2); transition: all .25s; }
.switch:hover { box-shadow: var(--shadow-sm); }
.switch[disabled] { opacity: .6; cursor: not-allowed; }
.switch-track { position: relative; width: 56px; height: 32px; border-radius: 99px; background: #cbd5e1; transition: background .3s var(--ease); flex-shrink: 0; }
.switch-thumb { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .25); transition: transform .35s var(--ease); }
.switch.is-on { border-color: var(--brand-200); color: var(--brand-800); }
.switch.is-on .switch-track { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); }
.switch.is-on .switch-thumb { transform: translateX(24px); }

.check-list { display: grid; gap: 10px; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.check-item > .icon { margin-top: 2px; }
.check-item strong { display: block; font-size: .92rem; }
.check-item span { font-size: .84rem; color: var(--muted); }
.check-item.is-ok { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.check-item.is-bad { background: var(--danger-50); border-color: #fecaca; color: var(--danger); }
.check-item.is-warn { background: var(--warn-50); border-color: #fde68a; color: var(--warn); }

.phase-track { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.phase-track li { position: relative; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: #f8fafb; display: grid; gap: 4px; }
.phase-track b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--line); font-size: .8rem; color: var(--ink-2); }
.phase-track strong { font-family: var(--font-head); }
.phase-track span { font-size: .78rem; color: var(--muted); }
.phase-track li.is-done { background: var(--brand-50); border-color: var(--brand-100); }
.phase-track li.is-done b { background: var(--brand-600); color: #fff; }
.phase-track li.is-current { background: #fff; border: 2px solid var(--brand-500); box-shadow: 0 10px 24px -14px rgba(4, 120, 87, .6); }
.phase-track li.is-current b { background: var(--gold-400); color: var(--brand-950); }
@media (max-width: 900px) { .phase-track { grid-template-columns: 1fr; } }
.go-back { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--info-50); border: 1px dashed #93c5fd; display: grid; gap: 10px; }
.go-back h4 { margin: 0; display: flex; align-items: center; gap: 8px; color: #1e3a8a; }
.go-back p { margin: 0; font-size: .86rem; color: #1e40af; }
.go-back select { max-width: 200px; min-height: 40px; padding: 8px 40px 8px 12px; border-radius: 10px; font-size: .88rem; }
.advance-form, .inline-approve { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.advance-form input, .inline-approve input { flex: 1; min-width: 150px; min-height: 40px; padding: 8px 12px; border-radius: 10px; font-size: .88rem; }
.advance-form input { max-width: 260px; }
.request-card { display: grid; gap: 12px; padding: 16px; margin-bottom: 14px; border-radius: 16px; border: 1px solid var(--line); background: #fbfdfc; }
.request-card header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.request-card header small { color: var(--muted); }
.role-badge--electoral_chair { background: var(--gold-400); color: var(--brand-950); }
.role-badge--admin { background: var(--brand-400); color: var(--brand-950); }
.role-badge--election_official { background: #93c5fd; color: #1e3a8a; }
.role-badge--observer { background: rgba(255, 255, 255, .25); color: #fff; }
.role-badge--onlight.role-badge--observer { background: var(--line-soft); color: var(--ink-2); }
.actions .inline-approve { width: 100%; }
.admin-title { display: block; font-size: .76rem; color: rgba(236, 253, 245, .7); margin: 2px 0 4px; }
.mt-sm { margin-top: 8px; }
.switch--sm { padding: 4px 12px 4px 4px; font-size: .8rem; gap: 8px; }
.switch--sm .switch-track { width: 44px; height: 26px; }
.switch--sm .switch-thumb { width: 20px; height: 20px; top: 3px; left: 3px; }
.switch--sm.is-on .switch-thumb { transform: translateX(18px); }

/* ---------- Print ---------- */
@media print {
    .topbar, .site-footer, .scroll-progress, .bg-orbs, .toasts, .admin-sidebar, .admin-topbar, .no-print, .preloader { display: none !important; }
    body { background: #fff; }
    .js [data-reveal], .js [data-intro] { opacity: 1 !important; transform: none !important; }
    .admin-shell { display: block; }
    .panel, .stat-card, .result-position { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
