:root {
    --primary: #b91c1c;
    --primary-light: #ef4444;
    --primary-dark: #450a0a;
    --accent: #f59e0b;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #991b1b;
    --bg: #f1f5f9;
    --bg-subtle: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --heading: #450a0a;
    --link: #b91c1c;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.12);
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #0f172a;
    --bg-subtle: #253449;
    --surface: #1e293b;
    --border: #3c4d68;
    --text: #e6ebf3;
    --text-muted: #a8b6c9;
    --heading: #f8fafc;
    --link: #f87171;
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
    --shadow-lg: 0 10px 28px rgba(0,0,0,.55);
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--heading); line-height: 1.25; }
h1 { font-size: 1.35em; }
h2 { font-size: 1.15em; }
h3 { font-size: 1.05em; }
h4 { font-size: 1em; }

/* ---------- Layout: admin ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: relative;
    width: 250px;
    flex-shrink: 0;
    background: linear-gradient(190deg, var(--primary-dark) 0%, #2a0404 55%, #1a0202 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    transition: width .22s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.35);
}
.sidebar::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(circle at 12% 0%, rgba(239,68,68,.35), transparent 45%),
        radial-gradient(circle at 90% 100%, rgba(239,68,68,.18), transparent 50%);
}
.sidebar > .brand, .sidebar > nav, .sidebar-toggle { position: relative; }

.sidebar-toggle {
    position: absolute; top: 22px; right: -13px; z-index: 5;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--primary-light); color: #fff;
    border: 2px solid var(--surface);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; box-shadow: var(--shadow);
}
.sidebar-toggle:hover { background: var(--primary); }
.sidebar-toggle svg { transition: transform .22s ease; }
html.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.nav-icon { flex-shrink: 0; }

.sidebar .brand {
    display: block;
    padding: 18px 20px;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar a.brand:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.sidebar .brand small { display: block; font-weight: 400; font-size: 12px; color: #94a3b8; }
.sidebar .brand-row { display: flex; align-items: center; gap: 10px; }
.sidebar .brand-logo { width: 38px; height: 38px; object-fit: cover; border-radius: 8px; background: #fff; flex-shrink: 0; }
.sidebar .brand-text { min-width: 0; }

.sidebar nav { flex: 1; padding: 10px 0; overflow-y: auto; overflow-x: hidden; }
.nav-text { min-width: 0; overflow-wrap: break-word; }
.sidebar .nav-section { padding: 10px 20px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.sidebar a.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: #cbd5e1; font-size: 14px;
    border-left: 3px solid transparent;
    transition: background .15s ease, transform .15s ease, color .15s ease, border-color .15s ease;
}
.sidebar a.nav-link:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; transform: translateX(3px); }
.sidebar a.nav-link.active {
    background: linear-gradient(90deg, rgba(239,68,68,.9), rgba(239,68,68,.15));
    color: #fff; font-weight: 600;
    border-left: 3px solid #fde68a;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 10px rgba(0,0,0,.25);
}
/* ---------- Sidebar colapsado ---------- */
html.sidebar-collapsed .sidebar { width: 68px; }
html.sidebar-collapsed .sidebar .nav-text,
html.sidebar-collapsed .sidebar .brand-text,
html.sidebar-collapsed .sidebar .nav-section { display: none; }
html.sidebar-collapsed .sidebar .brand { padding: 18px 8px; }
html.sidebar-collapsed .sidebar .brand-row { justify-content: center; }
html.sidebar-collapsed .sidebar a.nav-link { justify-content: center; padding: 12px 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 14px 24px; display: flex; justify-content: space-between; align-items: center;
}
.topbar h1 { font-size: 20px; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-institucion {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 18px 8px 14px; border-radius: 999px;
    background: linear-gradient(120deg, var(--primary-dark), var(--primary-light) 60%, #f87171);
    color: #fff; font-size: 13px; font-weight: 700;
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(239,68,68,.18);
    max-width: 300px; position: relative; overflow: hidden;
}
.topbar-institucion::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
    background-size: 220% 100%;
    animation: institucion-shine 3.2s ease-in-out infinite;
}
.topbar-institucion .institucion-icon,
.topbar-institucion .institucion-text { position: relative; z-index: 1; }
.topbar-institucion .institucion-icon { flex-shrink: 0; }
.topbar-institucion .institucion-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes institucion-shine { 0% { background-position: 220% 0; } 60%, 100% { background-position: -20% 0; } }
.content {
    padding: 24px; flex: 1;
    background:
        radial-gradient(900px 400px at 100% 0%, color-mix(in srgb, var(--primary-light) 7%, transparent), transparent 70%),
        radial-gradient(700px 360px at 0% 100%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%);
}

.app-footer {
    position: relative; overflow: hidden;
    padding: 16px 24px;
    text-align: center;
    background: linear-gradient(120deg, var(--primary-dark), var(--primary-light) 55%, #f87171);
    box-shadow: 0 -6px 18px rgba(0,0,0,.18);
}
.app-footer::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.3) 50%, transparent 65%);
    background-size: 220% 100%;
    animation: institucion-shine 4.5s ease-in-out infinite;
}
.app-footer-inner {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
    color: #fff; font-size: 13.5px; font-weight: 700; letter-spacing: .03em;
}
.app-footer-inner strong { color: #fde68a; font-weight: 800; }
.footer-spark { display: inline-block; color: #fde68a; animation: spark-pulse 1.8s ease-in-out infinite; }
.footer-spark:last-child { animation-delay: .9s; }
@keyframes spark-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }

@media (max-width: 640px) { .topbar-institucion { display: none; } }

.theme-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: var(--bg-subtle); color: var(--text); border: 1px solid var(--border);
    cursor: pointer; padding: 0;
}
.theme-toggle:hover { background: var(--border); }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.theme-toggle .icon-compress { display: none; }
html.fullscreen-active .theme-toggle .icon-expand { display: none; }
html.fullscreen-active .theme-toggle .icon-compress { display: block; }

/* ---------- Menu de usuario (topbar) ---------- */
.avatar-circle {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.avatar-circle-lg { width: 44px; height: 44px; font-size: 17px; }

.user-menu { position: relative; }
.user-menu-trigger {
    display: flex; align-items: center; gap: 9px;
    background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 999px;
    padding: 5px 12px 5px 5px; cursor: pointer; color: var(--text);
}
.user-menu-trigger:hover { background: var(--border); }
.user-menu-label { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.user-menu-label strong { font-size: 13px; }
.user-menu-label small { font-size: 11px; color: var(--text-muted); }
.user-menu-chevron { color: var(--text-muted); transition: transform .2s ease; flex-shrink: 0; }
.user-menu.open .user-menu-chevron { transform: rotate(180deg); }

.user-menu-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 50;
    width: 260px; background: var(--surface); border-radius: 14px;
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.user-menu-header {
    display: flex; align-items: center; gap: 12px; padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
}
.user-menu-header strong { display: block; font-size: 14px; }
.user-menu-header small { font-size: 12px; opacity: .85; }
.user-menu-session {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px;
    font-size: 12.5px; color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.user-menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-size: 13.5px; color: var(--text); }
.user-menu-item:hover { background: var(--bg-subtle); text-decoration: none; }
.user-menu-item.danger { color: var(--danger); border-top: 1px solid var(--border); }
.user-menu-item.danger:hover { background: rgba(153,27,27,.08); }

@media (max-width: 560px) { .user-menu-label { display: none; } }

/* ---------- Cards / grid ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    --sc: var(--primary-light); --sc2: #f87171;
    position: relative; overflow: hidden;
    background: var(--surface); border-radius: 16px; padding: 20px 22px;
    box-shadow: var(--shadow); border: 1px solid var(--border);
    transition: transform .2s ease, box-shadow .2s ease;
    animation: fadeInUp .5s ease backwards;
}
.stat-card::before {
    content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--sc), var(--sc2));
}
.stat-card::after {
    content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--sc) 22%, transparent), transparent 70%);
    pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .value { font-size: 32px; font-weight: 800; color: var(--heading); line-height: 1.1; letter-spacing: -.01em; }
.stat-card .label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.stat-card.success { --sc: #16a34a; --sc2: #4ade80; }
.stat-card.warning { --sc: #d97706; --sc2: #fbbf24; }
.stat-card.danger  { --sc: #991b1b; --sc2: #ef4444; }
.stat-card.info    { --sc: #2563eb; --sc2: #60a5fa; }
.cards-grid .stat-card:nth-child(2) { animation-delay: .06s; }
.cards-grid .stat-card:nth-child(3) { animation-delay: .12s; }
.cards-grid .stat-card:nth-child(4) { animation-delay: .18s; }
.stat-card.has-icon { display: flex; align-items: center; gap: 16px; }
.stat-card .stat-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.stat-icon {
    width: 54px; height: 54px; border-radius: 15px; flex-shrink: 0; position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--sc), var(--sc2));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--sc) 35%, transparent);
}
.stat-icon svg { width: 27px; height: 27px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat-progress { height: 6px; border-radius: 99px; background: var(--bg-subtle); margin-top: 8px; overflow: hidden; }
.stat-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sc), var(--sc2)); transition: width .8s ease; }

.card {
    background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px;
    border: 1px solid var(--border); animation: fadeInUp .5s ease backwards;
}
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.card-header h2, .card-header h3 { margin: 0; }
.card > h2, .card-header h2 { display: flex; align-items: center; gap: 10px; }
.card > h2::before, .card-header h2::before {
    content: ""; width: 5px; height: 20px; border-radius: 3px; flex-shrink: 0;
    background: linear-gradient(180deg, var(--primary-light), var(--accent));
}

/* ---------- Dashboard: grafico del padron ---------- */
.padron-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pchip {
    --c: var(--primary-light);
    padding: 12px 16px; border-radius: 12px; background: var(--bg-subtle); border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 2px; animation: fadeInUp .45s ease backwards;
}
.pchip strong { font-size: 22px; font-weight: 800; color: var(--heading); line-height: 1.1; }
.pchip span { font-size: 12px; color: var(--text-muted); }
.pchip-main { background: linear-gradient(135deg, var(--primary-dark), var(--primary-light)); border-color: transparent; }
.pchip-main strong, .pchip-main span { color: #fff; }
.pchip-main span { opacity: .85; }
.pchip-top { border-left: 4px solid var(--c); }
.pchip-top strong { color: var(--c); }

.padron-viz { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.padron-viz > div { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.viz-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 14px; }

.pcols-area { display: flex; gap: 10px; height: 260px; margin-top: 26px; }
.pcols-axis {
    display: flex; flex-direction: column; justify-content: space-between;
    font-size: 11px; color: var(--text-muted); text-align: right; min-width: 18px; padding-bottom: 30px;
}
.pcols-axis span { line-height: 0; }
.pcols {
    flex: 1; display: flex; align-items: stretch; gap: 14px; padding-bottom: 0; position: relative;
}
.pcols::before {
    /* lineas guia horizontales alineadas con el eje */
    content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 30px; pointer-events: none;
    background: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 25%);
    border-bottom: 1px solid var(--border);
}
.pcol { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.pcol-track { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.pcol-bar {
    position: relative; width: 100%; max-width: 64px; min-height: 4px; border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c));
    box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 35%, transparent);
    transform-origin: bottom; animation: pcol-grow .9s cubic-bezier(.34,1.4,.64,1) both;
    animation-delay: calc(var(--i) * 90ms);
    transition: filter .2s, transform .2s;
}
.pcol-bar::after {
    /* reflejo brillante */
    content: ""; position: absolute; top: 4px; bottom: 4px; left: 18%; width: 18%; border-radius: 6px;
    background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,0));
}
.pcol:hover .pcol-bar { filter: brightness(1.08) saturate(1.1); }
.pcol-val {
    position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -6px);
    font-size: 13px; font-weight: 800; color: #fff; background: var(--c);
    padding: 2px 9px; border-radius: 99px; white-space: nowrap;
    box-shadow: 0 3px 8px color-mix(in srgb, var(--c) 40%, transparent);
    animation: pfade .4s ease backwards; animation-delay: calc(var(--i) * 90ms + .6s);
}
.pcol-label {
    height: 30px; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes pcol-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pfade { from { opacity: 0; } to { opacity: 1; } }

.pdonut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pdonut { position: relative; width: 190px; height: 190px; }
.pdonut svg { width: 100%; height: 100%; transform: rotate(0deg); filter: drop-shadow(0 6px 14px rgba(0,0,0,.12)); }
.pdonut-bg { stroke: var(--border); stroke-width: 6; }
.pdonut-seg { fill: none; stroke-width: 6; stroke-linecap: butt; transition: stroke-dasharray 1.1s cubic-bezier(.4,0,.2,1), stroke-width .2s; }
.pdonut-seg:hover { stroke-width: 7.5; }
.pdonut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pdonut-center strong { font-size: 34px; font-weight: 800; color: var(--heading); line-height: 1; }
.pdonut-center span { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pdonut-legend { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.pdonut-legend li { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.pdonut-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pdonut-legend .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdonut-legend .num { font-weight: 800; color: var(--heading); }
.pdonut-legend .pct { font-size: 11.5px; color: var(--text-muted); min-width: 30px; text-align: right; }

@media (max-width: 900px) {
    .padron-viz { grid-template-columns: 1fr; }
    .pcols { gap: 8px; }
    .pcols-area { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
    .stat-card, .card, .pchip, .pcol-bar, .pcol-val { animation: none !important; }
    .pdonut-seg { transition: none; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
    background: var(--primary-light); color: #fff; font-size: 14px; font-weight: 600;
    cursor: pointer; line-height: 1.2;
}
.btn { transition: transform .15s ease, box-shadow .2s ease, background .2s ease, filter .2s; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.btn:hover { background: var(--primary); text-decoration: none; color:#fff; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.14); }
.btn:active { transform: translateY(0); }
.btn.btn-outline, .btn.btn-sm { box-shadow: none; }
.btn.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn.btn-secondary { background: #64748b; }
.btn.btn-secondary:hover { background: #475569; }
.btn.btn-success { background: var(--success); }
.btn.btn-success:hover { background: #15803d; }
.btn.btn-danger { background: var(--danger); }
.btn.btn-danger:hover { background: #b91c1c; }
.btn.btn-warning { background: var(--warning); }
.btn.btn-warning:hover { background: #b45309; }
.btn.btn-outline { background: transparent; color: var(--link); border-color: var(--link); }
.btn.btn-outline:hover { background: var(--link); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=file], input[type=search], select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.color-swatch { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); display:inline-block; vertical-align:middle; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { text-align: left; background: var(--bg-subtle); color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 11px 12px; border-bottom: 2px solid var(--border); font-weight: 700; }
thead th:first-child { border-top-left-radius: 10px; }
thead th:last-child { border-top-right-radius: 10px; }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: color-mix(in srgb, var(--primary-light) 6%, var(--surface)); }
.table-wrap { overflow-x: auto; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-muted { background: #e2e8f0; color: #475569; }
.badge-info { background: #dbeafe; color: #1e40af; }

.badge-estado-lg {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 9px 22px; border-radius: 999px;
    font-size: 19px; font-weight: 800; letter-spacing: .02em;
    box-shadow: var(--shadow);
}
.badge-estado-lg .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.badge-estado-lg.success { background: #dcfce7; color: #166534; }
.badge-estado-lg.success .dot { background: #16a34a; animation: pulse-dot 1.4s infinite; }
.badge-estado-lg.danger { background: #fee2e2; color: #991b1b; }
.badge-estado-lg.danger .dot { background: #dc2626; }
.badge-estado-lg.muted { background: #e2e8f0; color: #475569; }
.badge-estado-lg.muted .dot { background: #64748b; }

/* ---------- Flash / alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---------- Modal ---------- */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; }
.modal-close { cursor: pointer; font-size: 22px; color: var(--text-muted); border: none; background: none; line-height: 1; }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Bar chart (pure CSS) ---------- */
.bar-chart { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 70px; align-items: center; gap: 12px; }
.bar-row .bar-label { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--bg-subtle); border-radius: 99px; height: 22px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.08); }
.bar-fill { position: relative; height: 100%; border-radius: 99px; transition: width .8s cubic-bezier(.4,0,.2,1); overflow: hidden; }
.bar-fill::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 60%),
                repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 8px, transparent 8px 16px);
}
.bar-row .bar-value { font-size: 13px; font-weight: 700; text-align: right; }

/* ---------- Resultados: presentacion "en vivo" ---------- */
.results-hero {
    text-align: center; padding: 30px 20px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    color: #fff; margin-bottom: 24px; box-shadow: var(--shadow-lg);
    position: relative; overflow: hidden;
}
.results-hero::before {
    content: ''; position: absolute; inset: -40%; background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.12), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,.10), transparent 45%);
    pointer-events: none;
}
.results-hero .hero-logo { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: #fff; margin-bottom: 10px; box-shadow: var(--shadow); position: relative; }
.results-hero h1 { color: #fff; font-size: 22px; margin: 0 0 4px; position: relative; }
.results-hero p { margin: 0; opacity: .85; font-size: 13.5px; position: relative; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.16); padding: 5px 14px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; margin-top: 14px; position: relative; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; animation: pulse-dot 1.4s infinite; flex-shrink: 0; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(1.5); } }

.fade-in-up { animation: fadeInUp .5s ease both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 18px; margin: 20px 0 6px; flex-wrap: wrap; min-height: 210px; }
.podium-item { text-align: center; width: 150px; }
.podium-item .podium-logo { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--shadow-lg); margin-bottom: 8px; background: #f1f5f9; }
.podium-item .podium-medal { font-size: 24px; line-height: 1; }
.podium-item .podium-name { font-weight: 700; font-size: 13px; margin: 4px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-item .podium-votes { font-weight: 800; font-size: 22px; color: var(--heading); }
.podium-item .podium-pct { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.podium-bar { border-radius: 10px 10px 0 0; transition: height 1s cubic-bezier(.34,1.56,.64,1); box-shadow: var(--shadow); }
.podium-item.rank-1 { order: 2; } .podium-item.rank-2 { order: 1; } .podium-item.rank-3 { order: 3; }
.podium-item.rank-1 .podium-bar { height: 130px; }
.podium-item.rank-2 .podium-bar { height: 90px; }
.podium-item.rank-3 .podium-bar { height: 58px; }
.podium-item.rank-1 .podium-logo { width: 72px; height: 72px; border-color: #facc15; box-shadow: 0 0 0 4px rgba(250,204,21,.25), var(--shadow-lg); }

.results-panels { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 900px) { .results-panels { grid-template-columns: 1fr; } }

.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; }
.donut { width: 190px; height: 190px; border-radius: 50%; position: relative; transition: background 1s ease; flex-shrink: 0; }
.donut::before { content: ''; position: absolute; inset: 20%; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center .value { font-size: 25px; font-weight: 800; color: var(--heading); }
.donut-center .label { font-size: 10.5px; color: var(--text-muted); text-align: center; max-width: 80px; }
.donut-legend { display: flex; flex-direction: column; gap: 9px; min-width: 160px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.donut-legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend-item .pct { font-weight: 700; color: var(--text-muted); }

/* ---------- Login page ---------- */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px 16px; position: relative; overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(248,113,113,.35), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(245,158,11,.18), transparent 40%),
        linear-gradient(135deg, #2a0404 0%, var(--primary-dark) 35%, var(--primary) 100%);
}
/* Fondo con cédulas flotantes */
.login-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.login-bg::before {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 26px 26px;
}
.float-item { position: absolute; display: block; color: rgba(255,255,255,.16); animation: lg-float 14s ease-in-out infinite; }
.float-item svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.float-item.f1 { width: 64px; height: 80px; top: 8%;  left: 6%;  animation-duration: 16s; }
.float-item.f2 { width: 46px; height: 46px; top: 70%; left: 4%;  animation-duration: 12s; animation-delay: -3s; }
.float-item.f3 { width: 52px; height: 65px; top: 12%; right: 8%; animation-duration: 18s; animation-delay: -6s; }
.float-item.f4 { width: 34px; height: 34px; top: 45%; left: 46%; color: rgba(245,158,11,.25); animation-duration: 11s; }
.float-item.f5 { width: 58px; height: 58px; bottom: 6%; right: 6%; animation-duration: 15s; animation-delay: -8s; }
.float-item.f6 { width: 44px; height: 55px; bottom: 10%; left: 38%; animation-duration: 17s; animation-delay: -2s; }
.float-item.f7 { width: 26px; height: 26px; top: 6%;  left: 40%; color: rgba(245,158,11,.3); animation-duration: 10s; animation-delay: -4s; }
.float-item.f8 { width: 36px; height: 36px; top: 55%; right: 30%; animation-duration: 13s; animation-delay: -5s; }
@keyframes lg-float {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50%      { transform: translateY(-26px) rotate(8deg); }
}

.login-shell {
    position: relative; z-index: 1; width: 100%; max-width: 980px;
    display: grid; grid-template-columns: 1.1fr 1fr; border-radius: 24px; overflow: hidden;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: lg-rise .7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes lg-rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }

/* Panel ilustrado */
.login-hero { padding: 40px 38px 34px; color: #fff; display: flex; flex-direction: column; }
.hero-badge {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: lg-pulse 1.8s infinite; }
@keyframes lg-pulse { 70% { box-shadow: 0 0 0 9px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.hero-title { color: #fff; font-size: 34px; font-weight: 800; line-height: 1.12; margin: 18px 0 10px; letter-spacing: -.01em; }
.hero-title span { background: linear-gradient(90deg, #fcd34d, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: rgba(255,255,255,.78); font-size: 14.5px; line-height: 1.55; margin: 0; max-width: 380px; }

.ballot-scene { flex: 1; display: flex; align-items: center; justify-content: center; margin: 14px 0 8px; }
.ballot-svg { width: 100%; max-width: 340px; height: auto; overflow: visible; filter: drop-shadow(0 12px 22px rgba(0,0,0,.25)); }
.ballot-paper { animation: lg-drop 3.6s cubic-bezier(.55,.05,.4,1) infinite; }
@keyframes lg-drop {
    0%   { transform: translateY(-20px); opacity: 0; }
    15%  { transform: translateY(0); opacity: 1; }
    45%  { transform: translateY(0); }
    80%  { transform: translateY(112px); opacity: 1; }
    81%, 100% { transform: translateY(112px); opacity: 0; }
}
.box-label { font: 800 30px 'Segoe UI', system-ui, sans-serif; fill: #991b1b; letter-spacing: .12em; }
.box-sublabel { font: 700 10px 'Segoe UI', system-ui, sans-serif; fill: #b91c1c; letter-spacing: .2em; opacity: .75; }
.sp { fill: #fcd34d; transform-box: fill-box; transform-origin: center; animation: lg-twinkle 2.4s ease-in-out infinite; }
.sp.s2 { animation-delay: .8s; }
.sp.s3 { animation-delay: 1.6s; }
@keyframes lg-twinkle { 0%, 100% { opacity: .2; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.15); } }

.hero-features { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-features li {
    display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
    padding: 7px 12px; border-radius: 10px; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.12);
}
.hero-features svg { width: 16px; height: 16px; fill: none; stroke: #fcd34d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Tarjeta del formulario */
.login-box { background: #fff; color: #1e293b; padding: 44px 38px 30px; display: flex; flex-direction: column; justify-content: center; }
/* Tarjeta suelta (sin el panel de dos columnas), p. ej. admin/salir_confirmar.php */
.login-page > .login-box {
    position: relative; z-index: 1; width: 100%; max-width: 440px; border-radius: 22px; padding: 36px 32px 26px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.3), 0 30px 70px rgba(0,0,0,.45);
    animation: lg-rise .6s cubic-bezier(.2,.8,.2,1) both;
}
.login-page > .login-box .logo-title p { line-height: 1.5; }
.login-page > .login-box input { padding: 12px 14px; border-radius: 10px; }
.login-page > .login-box .btn-block { padding: 13px 16px; border-radius: 12px; }
.login-box .logo-title { text-align: center; margin-bottom: 24px; }
.login-box .logo-title h1 { font-size: 21px; margin-bottom: 4px; color: #450a0a; }
.login-box .logo-title p { color: #64748b; font-size: 13.5px; margin: 0; }
.login-box .login-logo {
    width: 76px; height: 76px; object-fit: cover; border-radius: 18px; margin: 0 auto 14px; display: block;
    box-shadow: 0 8px 20px rgba(185,28,28,.25), 0 0 0 4px #fee2e2;
}
.login-logo-fallback { display: flex !important; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.login-logo-fallback svg { width: 40px; height: 40px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-box label { color: #334155; }
.input-icon { position: relative; }
.input-icon > svg {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px;
    fill: none; stroke: #94a3b8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke .2s;
}
.login-box .input-icon input {
    padding: 12px 42px 12px 40px; border-radius: 10px; font-size: 14.5px;
    background: #f8fafc; color: #1e293b; border: 1.5px solid #e2e8f0; transition: border-color .2s, box-shadow .2s, background .2s;
}
.login-box .input-icon input:focus { background: #fff; border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(239,68,68,.15); }
.input-icon:focus-within > svg { stroke: var(--primary); }
.pass-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.pass-toggle:hover { background: #f1f5f9; }
.pass-toggle svg { width: 18px; height: 18px; fill: none; stroke: #64748b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pass-toggle .eye-closed, .pass-toggle.is-visible .eye-open { display: none; }
.pass-toggle.is-visible .eye-closed { display: block; }
/* Ojito agregado por app.js (initPasswordToggles) en el resto de formularios */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 44px; }
.pwd-wrap .pass-toggle:hover { background: var(--bg-subtle); }
.pwd-wrap .pass-toggle svg { stroke: var(--text-muted); }
.pwd-wrap .pass-toggle:hover svg, .pwd-wrap .pass-toggle.is-visible svg { stroke: var(--link); }

.btn-login {
    justify-content: center; gap: 10px; margin-top: 8px; padding: 14px 18px; font-size: 15px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 10px 22px rgba(185,28,28,.35); transition: transform .15s, box-shadow .2s;
    position: relative; overflow: hidden;
}
.btn-login::after {
    content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    transform: skewX(-20deg); animation: lg-shine 3.5s ease-in-out infinite;
}
@keyframes lg-shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(185,28,28,.42); background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.btn-login svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.btn-login:hover svg { transform: translateX(4px); }

.login-foot {
    margin-top: 22px; padding-top: 16px; border-top: 1px dashed #e2e8f0;
    display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: #94a3b8;
}
.login-foot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 820px) {
    .login-shell { grid-template-columns: 1fr; max-width: 440px; }
    .login-hero { padding: 26px 24px 20px; text-align: center; }
    .hero-badge { align-self: center; }
    .hero-title { font-size: 26px; margin-top: 14px; }
    .hero-sub { margin: 0 auto; font-size: 13.5px; }
    .ballot-scene { margin: 6px 0 0; }
    .ballot-svg { max-width: 190px; }
    .hero-features { display: none; }
    .login-box { padding: 30px 24px 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .login-page *, .login-page *::before, .login-page *::after { animation: none !important; transition: none !important; }
}

/* ---------- Kiosk voting UI ---------- */
.kiosk-body {
    min-height: 100vh; overflow-x: hidden;
    background: linear-gradient(160deg, #1f0303 0%, var(--primary-dark) 30%, #7f1d1d 60%, var(--primary) 100%);
}
.kiosk-topbar { display:flex; justify-content:space-between; align-items:center; padding: 16px 30px; color: #fff; position: relative; z-index: 1; }
.kiosk-body > .kiosk-wrap, .kiosk-body > .cedula-fullscreen { position: relative; z-index: 1; }

/* Fondo animado de las pantallas de votacion (includes/vote_bg.php) */
.vote-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.vote-bg::before {
    /* trama de puntos */
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.08) 1.2px, transparent 1.2px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
            mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
}
.vb-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.vb-blob.b1 { width: 520px; height: 520px; left: -140px; top: -120px; background: #ef4444; animation: vb-drift1 22s ease-in-out infinite; }
.vb-blob.b2 { width: 460px; height: 460px; right: -120px; top: 20%; background: #f59e0b; opacity: .32; animation: vb-drift2 26s ease-in-out infinite; }
.vb-blob.b3 { width: 560px; height: 560px; left: 30%; bottom: -260px; background: #dc2626; opacity: .45; animation: vb-drift1 30s ease-in-out infinite reverse; }
@keyframes vb-drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(120px,80px) scale(1.15); } }
@keyframes vb-drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-140px,60px) scale(.9); } }
.vb-rays {
    /* haces de luz girando lentamente desde arriba */
    position: absolute; left: 50%; top: -60vmax; width: 120vmax; height: 120vmax; margin-left: -60vmax;
    background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.045) 0deg 6deg, transparent 6deg 18deg);
    -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 62%);
            mask-image: radial-gradient(circle, #000 0%, transparent 62%);
    animation: vb-spin 120s linear infinite;
}
@keyframes vb-spin { to { transform: rotate(360deg); } }

.vb-item { position: absolute; display: block; color: rgba(255,255,255,.14); animation: vb-float 16s ease-in-out infinite; }
.vb-item.gold { color: rgba(251,191,36,.32); }
.vb-item svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.vb-item.i1  { width: 70px; height: 88px; top: 9%;  left: 6%;  animation-duration: 18s; }
.vb-item.i2  { width: 54px; height: 54px; top: 62%; left: 9%;  animation-duration: 13s; animation-delay: -4s; }
.vb-item.i3  { width: 58px; height: 72px; top: 14%; right: 9%; animation-duration: 20s; animation-delay: -7s; }
.vb-item.i4  { width: 34px; height: 34px; top: 36%; left: 20%; animation-duration: 11s; }
.vb-item.i5  { width: 84px; height: 77px; top: 48%; right: 7%; animation-duration: 19s; animation-delay: -3s; }
.vb-item.i6  { width: 46px; height: 58px; top: 76%; right: 24%; animation-duration: 17s; animation-delay: -9s; }
.vb-item.i7  { width: 28px; height: 28px; top: 7%;  left: 44%; animation-duration: 10s; animation-delay: -2s; }
.vb-item.i8  { width: 40px; height: 40px; top: 30%; right: 26%; animation-duration: 14s; animation-delay: -6s; }
.vb-item.i9  { width: 64px; height: 59px; top: 80%; left: 30%; animation-duration: 21s; animation-delay: -11s; }
.vb-item.i10 { width: 24px; height: 24px; top: 70%; right: 12%; animation-duration: 9s; animation-delay: -5s; }
@keyframes vb-float {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50%      { transform: translateY(-34px) rotate(8deg); }
}

.vb-waves { position: absolute; left: 0; bottom: 0; width: 200%; height: 200px; animation: vb-wave 28s linear infinite; }
.vb-waves .w1 { fill: rgba(255,255,255,.04); }
.vb-waves .w2 { fill: rgba(251,191,36,.06); }
.vb-waves .w3 { fill: rgba(0,0,0,.18); }
@keyframes vb-wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Pantalla completa de la cedula virtual */
.cedula-fullscreen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.cedula-fullscreen .kiosk-wrap { width: 100%; padding: 0; margin: 0; }
.cedula-exit { position: fixed; top: 10px; right: 14px; font-size: 11px; color: rgba(255,255,255,.22); z-index: 20; transition: color .15s ease; }
.cedula-exit:hover { color: rgba(255,255,255,.6); text-decoration: none; }

.vote-id-card { position: relative; animation: fadeInUp .6s ease .1s backwards; }
.vote-id-icon {
    width: 68px; height: 68px; border-radius: 20px; margin: -68px auto 16px; position: relative;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 0 0 6px #fff, 0 12px 26px rgba(185,28,28,.4);
}
.vote-id-icon svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vote-id-card .search-box input { border-width: 2px; border-radius: 12px; background: #f8fafc; color: #1e293b; }
.vote-id-card .search-box input:focus { background: #fff; }
.vote-id-card .search-box .btn {
    border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 8px 18px rgba(185,28,28,.35);
}
.vote-id-card .btn-outline { border-radius: 12px; border-width: 2px; }

@media (prefers-reduced-motion: reduce) {
    .vb-blob, .vb-rays, .vb-item, .vb-waves, .vote-id-card { animation: none !important; }
}
@media print { .vote-bg { display: none !important; } }
.kiosk-topbar .mesa-tag { background: rgba(255,255,255,.15); padding: 6px 14px; border-radius: 20px; font-size: 13px; }
.kiosk-topbar .topbar-logo { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; background: #fff; flex-shrink: 0; }
.kiosk-wrap { max-width: 1100px; margin: 0 auto; padding: 10px 24px 50px; }
.kiosk-card {
    background: #fff; border-radius: 22px; padding: 34px; position: relative;
    box-shadow: 0 0 0 1px rgba(255,255,255,.4), 0 0 60px rgba(251,191,36,.18), 0 30px 70px rgba(0,0,0,.45);
}
.kiosk-card::before {
    /* franja superior degradada */
    content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 4px; border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light));
}
.kiosk-title { text-align:center; margin-bottom: 26px; }
.kiosk-title h1 { color: var(--primary-dark); font-size: 26px; }
.kiosk-title p { color: var(--text-muted); }

.search-box { display: flex; gap: 10px; max-width: 480px; margin: 0 auto 10px; }
.search-box input { font-size: 18px; padding: 14px 16px; }
.search-box button { font-size: 16px; padding: 0 22px; }

.elector-card { border: 2px solid var(--border); border-radius: 14px; padding: 22px; text-align: center; max-width: 480px; margin: 20px auto 0; }
.elector-card .nombre { font-size: 22px; font-weight: 700; color: var(--primary-dark); }
.elector-card .detalle { color: var(--text-muted); margin: 6px 0 18px; }

.ballot-list-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-top: 10px; }
.ballot-columns { display: flex; gap: 16px; align-items: flex-start; }
.ballot-columns > div { flex: 1; min-width: 0; text-align: center; }
.ballot-columns > div + div { border-left: 1px dashed var(--border); padding-left: 16px; }
.ballot-option {
    border: 3px solid var(--border); border-radius: 16px; padding: 22px 16px; text-align: center;
    cursor: pointer; background: #fff; transition: transform .15s ease, box-shadow .15s ease; display:block;
}
.ballot-option:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.ballot-option .numero { width: 46px; height: 46px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; margin: 0 auto 12px; }
.ballot-option .photo-box {
    width: 100%; max-width: 170px; aspect-ratio: 1 / 1; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px; background: var(--bg-subtle); color: var(--text-muted); font-size: 13px; overflow: hidden;
}
.ballot-option .photo-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ballot-option .nombre-lista { font-weight: 700; color: var(--text); font-size: 15px; }
.ballot-option .lema { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.ballot-option.blanco { border-style: dashed; }

@media (max-width: 480px) {
    .ballot-columns { flex-direction: column; }
    .ballot-columns > div + div { border-left: none; padding-left: 0; border-top: 1px dashed var(--border); padding-top: 14px; margin-top: 10px; }
    .ballot-option .photo-box { max-width: 150px; }
}

.confirm-box { text-align: center; }
.confirm-box .selected-badge { display:inline-block; padding: 14px 26px; border-radius: 14px; color:#fff; font-size: 20px; font-weight: 700; margin: 14px 0 24px; }

/* Confirmacion: simbolo de la lista + foto del candidato a alcalde */
.confirm-visuals { --lc: var(--primary-light); display: flex; justify-content: center; align-items: flex-start; gap: 28px; flex-wrap: wrap; margin-top: 16px; }
.confirm-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 200px; animation: fadeInUp .5s ease backwards; }
.confirm-fig + .confirm-fig { animation-delay: .12s; }
.confirm-fig figcaption { font-size: 12px; color: var(--text-muted); line-height: 1.3; }
.confirm-fig figcaption strong { display: block; font-size: 15px; color: #1e293b; margin-bottom: 2px; }
/* Simbolo y foto comparten tamano y marco; solo cambia la forma */
.confirm-logo, .confirm-photo {
    width: 130px; height: 130px; object-fit: cover; background: #f1f5f9;
    border: 4px solid #fff; box-shadow: 0 0 0 4px var(--lc), 0 12px 26px rgba(0,0,0,.22);
}
.confirm-logo { border-radius: 24px; }
.confirm-photo { border-radius: 50%; }
.confirm-photo-empty { display: flex; align-items: center; justify-content: center; }
.confirm-photo-empty svg { width: 56px; height: 56px; fill: none; stroke: #94a3b8; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.confirm-actions { display:flex; gap: 14px; justify-content: center; }
.confirm-actions .btn { padding: 14px 28px; font-size: 16px; }

.thanks-box { text-align: center; padding: 40px 20px; }
.thanks-box .check-circle { width: 90px; height: 90px; border-radius: 50%; background: var(--success); color:#fff; font-size: 46px; display:flex; align-items:center; justify-content:center; margin: 0 auto 20px; }

/* ---------- Print ---------- */
@media print {
    @page { size: A4 portrait; margin: 8mm; }

    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }

    .sidebar, .topbar, .no-print { display: none !important; }
    .app-shell, .main, .content { display: block; padding: 0; margin: 0; }
    .content { background: none !important; }
    .card, .stat-card { animation: none !important; }
    body { background: #fff; font-size: 11px; }
    .card { box-shadow: none; border: 1px solid #333; padding: 8px 10px; margin-bottom: 8px; page-break-inside: avoid; }
    h1, h2, h3 { margin: 0 0 4px; }

    /* Resultados: version compacta para que quepa en una sola hoja */
    .results-hero { padding: 10px 14px; margin-bottom: 8px; }
    .results-hero .hero-logo { width: 34px; height: 34px; margin-bottom: 4px; }
    .results-hero h1 { font-size: 14px; }
    .results-hero p { font-size: 10px; }
    .live-badge { padding: 2px 10px; margin-top: 6px; font-size: 9px; }
    .live-dot { animation: none; }

    .cards-grid { gap: 6px; margin-bottom: 8px; }
    .stat-card { padding: 6px 8px; border-left-width: 3px; }
    .stat-card .value { font-size: 16px; }
    .stat-card .label { font-size: 9px; margin-top: 0; }

    .podium { min-height: auto; gap: 8px; margin: 8px 0 0; }
    .podium-item { width: 100px; }
    .podium-item .podium-logo { width: 34px; height: 34px; margin-bottom: 3px; }
    .podium-item.rank-1 .podium-logo { width: 42px; height: 42px; }
    .podium-item .podium-medal { font-size: 14px; }
    .podium-item .podium-votes { font-size: 13px; }
    .podium-item .podium-pct, .podium-item .podium-name { font-size: 9px; }
    .podium-item.rank-1 .podium-bar { height: 40px; }
    .podium-item.rank-2 .podium-bar { height: 28px; }
    .podium-item.rank-3 .podium-bar { height: 18px; }

    .results-panels { gap: 8px; }
    .bar-chart { gap: 5px; }
    .bar-track { height: 12px; }
    .bar-row .bar-label, .bar-row .bar-value { font-size: 9px; }

    .donut { width: 100px; height: 100px; }
    .donut-center .value { font-size: 13px; }
    .donut-center .label { font-size: 7px; }
    .donut-legend-item { font-size: 9px; gap: 5px; }
    .donut-legend-dot { width: 8px; height: 8px; }

    table { font-size: 9.5px; }
    thead th, tbody td { padding: 3px 5px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; }
    .sidebar nav { display: none; }
}
