/* ================================================================
   Sistema de Monitoreo Electoral — styles.css
   Design: Dark Navy + Electric Blue accent · Inter font
   ================================================================ */

/* ── Reset & Variables ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0c10;
    --bg2: #11151b;
    --bg3: #171c24;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f5f7fb;
    --text-muted: #a8b0bd;
    --accent: #ffffff;
    --accent2: #d7dbe3;
    --green: #d8dde6;
    --red: #c6ccd6;
    --yellow: #bfc6d1;
    --purple: #b4bcc8;
    --orange: #aab2bf;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    --transition: 0.18s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 24%),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.03), transparent 18%),
        linear-gradient(180deg, #080a0f 0%, #10131a 100%);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ── Typography ──────────────────────────────────────────────────── */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: monospace;
    color: var(--text);
}

kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.8em;
}

/* ── Header ──────────────────────────────────────────────────────── */
.site-header {
    background: rgba(10, 12, 16, 0.84);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #000, #444);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 10px 25px rgba(22, 78, 99, 0.24);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 0.75rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.10);
    color: var(--accent);
}

.nav-logout {
    color: var(--red) !important;
}

.nav-logout:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* ── Main content ────────────────────────────────────────────────── */




/* ── Alerts ──────────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem 0.9rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left-width: 4px;
    animation: slideDown 0.3s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    position: relative;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.alert-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.alert-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
    opacity: 0.7;
}

.alert-message {
    line-height: 1.5;
}

.alert-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.45;
    font-size: 1.1rem;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: opacity 0.15s;
    margin-top: -2px;
    align-self: flex-start;
}

.alert-close:hover {
    opacity: 0.85;
}

.alert-success {
    background: rgba(16, 33, 25, 0.95);
    border-left-color: #3fb950;
    color: #aff3be;
}

.alert-success .alert-icon { color: #3fb950; }

.alert-error {
    background: rgba(33, 14, 14, 0.95);
    border-left-color: #f85149;
    color: #ffb3b0;
}

.alert-error .alert-icon { color: #f85149; }

.alert-warning {
    background: rgba(33, 28, 10, 0.95);
    border-left-color: #e3b341;
    color: #f5d67a;
}

.alert-warning .alert-icon { color: #e3b341; }

.alert-info {
    background: rgba(10, 20, 38, 0.95);
    border-left-color: #388bfd;
    color: #9ecbff;
}

.alert-info .alert-icon { color: #388bfd; }

.error-list {
    margin-top: 0.4rem;
    padding-left: 1.25rem;
}

.error-list li {
    margin-bottom: 0.2rem;
    font-size: 0.87rem;
    opacity: 0.88;
}

/* ── Page header ─────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.35rem;
    background: rgba(17, 21, 27, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.page-title {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.2rem;
    max-width: 62ch;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Role badges ─────────────────────────────────────────────────── */
.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-admin {
    background: rgba(163, 113, 247, 0.2);
    color: #c8a6ff;
}

.role-veedor {
    background: rgba(56, 139, 253, 0.2);
    color: var(--accent2);
}

.role-verificador {
    background: rgba(63, 185, 80, 0.2);
    color: #7ee787;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.btn:hover {
    opacity: 0.96;
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #f5f7fb, #cfd5df);
    color: #0b0b0b;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-success {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.btn-warning {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.btn-danger {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 0.65rem 1.4rem;
    font-size: 0.97rem;
    width: 100%;
}

.btn-sm {
    padding: 0.28rem 0.7rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* ── Forms ───────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.45rem;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 0.7rem 0.95rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.93rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.form-input::placeholder {
    color: var(--text-muted);
}

select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(245, 247, 251, 0.8) 50%),
        linear-gradient(135deg, rgba(245, 247, 251, 0.8) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.2rem;
}

select.form-input option,
select.form-input optgroup {
    background: #11151b;
    color: #f5f7fb;
}

select.form-input:invalid {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-section {
    margin-bottom: 1.5rem;
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* ── Input with icon ─────────────────────────────────────────────── */
.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

.input-wrapper .form-input {
    padding-left: 2.4rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    color: var(--text-muted);
}

/* ── Radio cards ──────────────────────────────────────────────────── */
.radio-group {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    min-width: 120px;
}

.radio-card:hover {
    border-color: var(--accent);
}

.radio-card input {
    cursor: pointer;
}

.radio-selected {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.radio-label {
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
}

/* ── Toggle checkbox ─────────────────────────────────────────────── */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-checkbox {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    transition: var(--transition);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle-checkbox:checked+.toggle-slider {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.18);
}

.toggle-checkbox:checked+.toggle-slider::after {
    transform: translateX(20px);
    background: #fff;
}

.toggle-text {
    font-size: 0.93rem;
    font-weight: 500;
}

/* ── Login ───────────────────────────────────────────────────────── */
.login-wrapper {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: rgba(17, 21, 27, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2.75rem 2.25rem 2rem;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    animation: fadeIn 0.45s cubic-bezier(.22,.68,0,1.2);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255,255,255,0.045) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.25rem;
}

.login-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1a1f2e, #2a3040);
    border: 1px solid rgba(255,255,255,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06) inset;
}

.login-logo svg {
    width: 30px;
    height: 30px;
    color: #e0e6f0;
}

.login-title {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.35rem;
}

.login-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    margin: 1.5rem 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-form .form-group {
    margin-bottom: 0.85rem;
}

.login-form .form-input {
    background: rgba(255,255,255,0.035);
    border-color: rgba(255,255,255,0.1);
    padding: 0.75rem 1rem;
    font-size: 0.94rem;
    border-radius: 10px;
}

.login-form .form-input:focus {
    border-color: rgba(255,255,255,0.35);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.07);
}

.login-form .form-label {
    font-size: 0.84rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.btn-login {
    margin-top: 0.5rem;
    padding: 0.8rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, #f0f2f7, #c8cdd8);
    color: #0b0d12;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.4) inset;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.4) inset;
    opacity: 1;
}

.btn-login:active {
    transform: translateY(0);
}

.login-actions-secondary {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.login-footer {
    text-align: center;
    color: rgba(168,176,189,0.5);
    font-size: 0.75rem;
    margin-top: 1.75rem;
    letter-spacing: 0.01em;
}

/* Eye-icon toggle */
.toggle-password {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.toggle-password:hover {
    color: var(--text);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* ── Search panel ────────────────────────────────────────────────── */
.search-panel {
    background: rgba(17, 21, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.search-btn {
    padding: 0.7rem 1.4rem;
    font-size: 0.97rem;
}

.search-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 0.6rem;
}
.footer-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ── Result cards ────────────────────────────────────────────────── */
.result-area {
    animation: slideDown 0.3s ease;
}

.result-card {
    background: rgba(17, 21, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.result-error {
    border-color: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.result-found {
    border-color: rgba(255, 255, 255, 0.12);
}

.result-icon {
    font-size: 1.3rem;
}

.result-person {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.person-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    color: #fff;
}

.person-avatar-lg {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.person-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.person-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 0.6rem;
}

.status-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Status & badges ─────────────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

.status-ok {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.status-pending {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.status-no {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.status-ns {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.status-info {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-ok {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.badge-no {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.badge-ns {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.badge-pending {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* ── Action section ──────────────────────────────────────────────── */
.action-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.action-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.9rem;
}

.no-action {
    color: var(--text-muted);
    font-style: italic;
}

/* ── Stats grid ──────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(17, 21, 27, 0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-pct {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-blue {
    border-top: 3px solid rgba(255, 255, 255, 0.18);
}

.stat-green {
    border-top: 3px solid rgba(255, 255, 255, 0.12);
}

.stat-purple {
    border-top: 3px solid rgba(255, 255, 255, 0.12);
}

.stat-red {
    border-top: 3px solid rgba(255, 255, 255, 0.12);
}

.stat-yellow {
    border-top: 3px solid rgba(255, 255, 255, 0.12);
}

/* ── Progress bars ───────────────────────────────────────────────── */
.progress-section {
    margin-bottom: 2rem;
    background: rgba(17, 21, 27, 0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.3rem;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.progress-bar-wrap {
    margin-bottom: 1rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 1s ease;
}

.fill-blue {
    background: linear-gradient(90deg, #111, #666);
}

.fill-green {
    background: linear-gradient(90deg, #333, #888);
}

/* ── Dashboard actions ───────────────────────────────────────────── */
.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Table ───────────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    background: rgba(17, 21, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.data-table th {
    background: rgba(255, 255, 255, 0.04);
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
}

.actions-cell {
    display: flex;
    gap: 0.4rem;
}

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    background: rgba(17, 21, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

/* ── Upload / dropzone ───────────────────────────────────────────── */
.upload-section {
    max-width: 100vm;
}

.dropzone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.04);
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
}

.dropzone.has-file {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.06);
}

.dropzone-text {
    font-weight: 600;
    font-size: 1rem;
}

.dropzone-sub {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.3rem;
}

.dropzone-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-name {
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--green);
    font-size: 0.9rem;
}

.info-box {
    background: rgba(17, 21, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.info-box h3 {
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

.columns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.4rem;
    margin: 0.75rem 0;
}

.col-item {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.col-item.required {
    background: rgba(255, 255, 255, 0.06);
}

.col-item.optional {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.info-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ── Edit card ───────────────────────────────────────────────────── */
.edit-card {
    background: rgba(17, 21, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 800px;
}

.person-summary {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.person-summary h2 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.person-summary p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ── Election management ────────────────────────────────────────── */
.election-form-card {
    background: rgba(17, 21, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow);
}

.color-chip {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.35);
    display: inline-block;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.inline-form {
    margin: 0;
}

.select-sm {
    min-width: 170px;
    padding: 0.35rem 0.5rem;
    font-size: 0.84rem;
}

.text-center {
    text-align: center;
}

.thumb-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
}

.entity-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.thumb-placeholder {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.75rem;
}

.thumb-upload-form {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.thumb-upload-form input[type="file"] {
    max-width: 180px;
    font-size: 0.75rem;
}

/* ── Public election view ───────────────────────────────────────── */
.party-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1rem;
}

.party-card {
    background: rgba(17, 21, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.party-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.7rem;
    margin-bottom: 0.75rem;
}

.party-name-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.party-name {
    font-size: 1.05rem;
}

.candidate-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed var(--border);
}

.candidate-row:last-child {
    border-bottom: none;
}

/* ── Flow enhancements (buscar ciudadano) ───────────────────────── */
.flow-mini-status {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.flow-chip {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.flow-line-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.flow-step {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
}

.flow-step.active {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.flow-step.done {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.flow-divider {
    width: 24px;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
}

/* ── External voting board ──────────────────────────────────────── */
.site-main.public-board-shell {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

.public-board {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 5%, rgba(120, 157, 212, 0.18) 0%, rgba(0, 0, 0, 0) 40%),
        radial-gradient(circle at 90% 20%, rgba(91, 227, 127, 0.1) 0%, rgba(0, 0, 0, 0) 35%),
        linear-gradient(145deg, #070c15 0%, #0b1526 55%, #0a111f 100%);
    padding: 2rem 2.5rem;
}

.public-board-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.public-board-title {
    font-size: 2.1rem;
    letter-spacing: 0.11em;
    color: #ffffff;
    font-weight: 800;
}

.public-board-subtitle {
    color: #8ea9cc;
    margin-top: 0.25rem;
}

.live-updated {
    margin-top: 0.45rem;
    color: #9fb5d7;
    font-size: 0.82rem;
}

.board-insights {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.insight-card {
    background: rgba(7, 16, 33, 0.78);
    border: 1px solid rgba(120, 157, 212, 0.24);
    border-radius: 14px;
    padding: 0.95rem 1rem;
}

.participacion-ring {
    --pct: 0;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0.65rem auto;
    background: conic-gradient(#4ea1ff calc(var(--pct) * 1%), rgba(255, 255, 255, 0.08) 0);
    display: grid;
    place-items: center;
}

.ring-center {
    width: 102px;
    height: 102px;
    border-radius: 50%;
    background: #0b1526;
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    font-weight: 700;
}

.insight-sub {
    color: #9fb5d7;
    font-size: 0.82rem;
    text-align: center;
}

.distribution-item + .distribution-item {
    margin-top: 0.7rem;
}

.distribution-top {
    display: flex;
    justify-content: space-between;
    color: #d5e2f3;
    font-size: 0.84rem;
    margin-bottom: 0.3rem;
}

.distribution-bar {
    height: 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.distribution-fill {
    height: 100%;
    border-radius: 999px;
}

.distribution-ok {
    background: linear-gradient(90deg, #4ea1ff, #6bd3ff);
}

.distribution-pending {
    background: linear-gradient(90deg, #f85149, #ffa657);
}

.board-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.board-stat-card {
    background: rgba(7, 16, 33, 0.8);
    border: 1px solid rgba(120, 157, 212, 0.25);
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.board-stat-label {
    color: #9fb5d7;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.board-stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: #ffffff;
}

.stat-pending-large {
    border-color: rgba(248, 81, 73, 0.45);
    background: rgba(62, 16, 19, 0.6);
}

.progress-board-wrap {
    background: rgba(7, 16, 33, 0.8);
    border: 1px solid rgba(120, 157, 212, 0.25);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 1.25rem;
}

.progress-board-top {
    display: flex;
    justify-content: space-between;
    color: #d5e2f3;
    margin-bottom: 0.45rem;
}

.progress-board-bar {
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-board-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #34c759, #5be37f);
}

.race-card {
    background: rgba(7, 16, 33, 0.82);
    border: 1px solid rgba(120, 157, 212, 0.25);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 1.1rem;
}

.race-title {
    font-size: 1rem;
    margin-bottom: 0.7rem;
    color: #dce8f8;
    font-weight: 600;
}

.race-pro-chart {
    position: relative;
    height: 300px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    padding: 10px 10px 8px 52px;
}

.race-grid {
    position: absolute;
    inset: 10px 10px 64px 52px;
    pointer-events: none;
}

.race-grid-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(159, 181, 215, 0.25);
}

.race-grid-label {
    position: absolute;
    left: -48px;
    top: -8px;
    color: #9fb5d7;
    font-size: 0.7rem;
}

.race-bars-wrap {
    position: absolute;
    inset: 10px 10px 8px 52px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
    align-items: end;
}

.race-bar-col {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 6px;
}

.race-bar-value {
    color: #dce8f8;
    font-size: 0.72rem;
    text-align: center;
    font-weight: 700;
}

.race-bar-track {
    position: relative;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    min-height: 170px;
}

.race-bar-fill {
    width: 100%;
    min-height: 4px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bar-color), white 14%) 0%, var(--bar-color) 100%);
    box-shadow: 0 -4px 14px color-mix(in srgb, var(--bar-color), transparent 70%);
    transition: height 0.45s ease;
}

.race-bar-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.race-bar-logo,
.race-bar-logo-placeholder {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.race-bar-logo {
    object-fit: cover;
}

.race-bar-logo-placeholder {
    background: rgba(255, 255, 255, 0.08);
}

.race-bar-label {
    color: #d5e2f3;
    font-size: 0.72rem;
    line-height: 1.1;
    max-width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.race-bar-pct {
    color: #9fb5d7;
    font-size: 0.7rem;
}

.race-empty {
    color: #9fb5d7;
    font-size: 0.88rem;
}

.race-canvas-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.35rem 0.4rem 0.4rem;
    border: 1px solid rgba(159, 181, 215, 0.18);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%);
    max-width: 100%;
}

#raceCanvas {
    display: block;
}

.clean-empty {
    padding: 2.2rem 1.5rem;
}

.single-race-chart.vertical {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
    gap: 0.5rem;
    align-items: end;
    min-height: 310px;
    max-height: 70vh;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.3rem 0.2rem 0.1rem;
}

.single-race-col {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 0.35rem 0.35rem 0.4rem;
    display: grid;
    grid-template-rows: auto 1fr auto auto auto;
    gap: 0.25rem;
    height: 100%;
    min-width: 74px;
}

.single-race-col-votes {
    font-size: 0.68rem;
    color: #dce8f8;
    text-align: center;
    font-weight: 700;
}

.single-race-col-track {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    min-height: 180px;
}

.single-race-col-fill {
    width: 100%;
    min-height: 2px;
    transition: height 0.35s ease;
    border-radius: 6px 6px 0 0;
}

.single-race-col-id {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}

.single-race-col-name {
    font-size: 0.66rem;
    color: #d5e2f3;
    text-align: center;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.single-race-col-pct {
    font-size: 0.64rem;
    color: #9fb5d7;
    text-align: center;
}

.race-candidate-photo,
.race-candidate-photo-placeholder,
.race-party-photo,
.race-party-photo-placeholder {
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.race-candidate-photo,
.race-candidate-photo-placeholder {
    width: 24px;
    height: 24px;
}

.race-party-photo,
.race-party-photo-placeholder {
    width: 16px;
    height: 16px;
}

.race-candidate-photo,
.race-party-photo {
    object-fit: cover;
}

.race-candidate-photo-placeholder,
.race-party-photo-placeholder {
    background: rgba(255, 255, 255, 0.08);
    display: inline-block;
}

@media (max-width: 768px) {
    .single-race-chart.vertical {
        grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
        min-height: 270px;
    }

    .single-race-col-track {
        min-height: 145px;
    }
}

.board-party-grid {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 0.9rem;
}

.board-party-card {
    background: rgba(7, 16, 33, 0.86);
    border: 1px solid rgba(120, 157, 212, 0.25);
}

.board-party-head {
    border-bottom-color: rgba(120, 157, 212, 0.2);
}

.board-party-name-wrap {
    gap: 0.55rem;
}

.board-party-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.board-candidate-row {
    border-bottom-color: rgba(120, 157, 212, 0.2);
    align-items: center;
}

.board-candidate-id {
    width: 42px;
    flex-shrink: 0;
}

.board-candidate-media {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 86px;
    flex-shrink: 0;
}

.board-party-mini-id {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.board-candidate-photo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.board-candidate-content {
    flex: 1;
}

.board-candidate-photo-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

.board-party-mini-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.board-party-mini-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

.party-pct-line {
    margin: 0.2rem 0 0.45rem;
    display: flex;
    justify-content: space-between;
    color: #b8c9e2;
    font-size: 0.82rem;
}

.party-votes-meter {
    margin-bottom: 0.75rem;
}

.candidate-votes-meter {
    height: 7px;
    margin-top: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.candidate-votes-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4ea1ff, #6bd3ff);
}

/* ── Confirmation modal ─────────────────────────────────────────── */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}

.confirm-backdrop.is-open {
    display: flex;
}

.confirm-dialog {
    width: min(100%, 460px);
    padding: 1.35rem;
    border-radius: 24px;
    color: var(--text);
    background: linear-gradient(180deg, rgba(19, 24, 31, 0.98), rgba(12, 15, 20, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
    animation: confirmPop 0.18s ease;
}

@keyframes confirmPop {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.confirm-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.confirm-message {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.confirm-actions .btn {
    min-width: 110px;
}

.alert-close {
    margin-left: auto;
    align-self: flex-start;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bg3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .main-nav {
        justify-content: center;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-header {
        flex-direction: column;
    }

    .public-board {
        padding: 1.2rem 0.9rem;
    }

    .public-board-title {
        font-size: 1.3rem;
    }

    .board-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .board-insights {
        grid-template-columns: 1fr;
    }

    .board-party-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Theme toggle button ─────────────────────────────────────────── */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    flex-shrink: 0;
    line-height: 1;
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.10);
    color: var(--text);
}

/* ── Light mode overrides ────────────────────────────────────────── */
[data-theme="light"] {
    --bg:           #f0f2f5;
    --bg2:          #ffffff;
    --bg3:          #e8eaed;
    --border:       rgba(0,0,0,0.10);
    --text:         #111827;
    --text-muted:   #6b7280;
    --accent:       #111827;
    --accent2:      #374151;
    --shadow:       0 4px 16px rgba(0,0,0,0.08);
    /* Fix colores que eran para texto sobre fondo oscuro */
    --green:        #15803d;
    --red:          #b91c1c;
    --yellow:       #92400e;
    --purple:       #7c3aed;
    --orange:       #c2410c;
}

[data-theme="light"] body {
    background: linear-gradient(180deg, #e8edf3 0%, #f0f2f5 100%);
    color: #111827;
}

[data-theme="light"] .site-header {
    background: rgba(255,255,255,0.92);
    border-bottom-color: rgba(0,0,0,0.09);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

[data-theme="light"] .nav-link:hover {
    background: rgba(0,0,0,0.06);
    color: #111827;
}
[data-theme="light"] .nav-link.active {
    background: rgba(0,0,0,0.08);
    color: #111827;
}

[data-theme="light"] .page-header,
[data-theme="light"] .stat-card,
[data-theme="light"] .progress-section,
[data-theme="light"] .table-wrapper,
[data-theme="light"] .empty-state,
[data-theme="light"] .edit-card,
[data-theme="light"] .search-panel,
[data-theme="light"] .result-card,
[data-theme="light"] .info-box,
[data-theme="light"] .election-form-card,
[data-theme="light"] .party-card {
    background: #ffffff;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

[data-theme="light"] .login-card {
    background: #ffffff;
    border-color: rgba(0,0,0,0.10);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

[data-theme="light"] .form-input,
[data-theme="light"] .search-input {
    background: #f8f9fa;
    border-color: rgba(0,0,0,0.12);
    color: #111827;
}
[data-theme="light"] .form-input:focus,
[data-theme="light"] .search-input:focus {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
[data-theme="light"] .form-input::placeholder,
[data-theme="light"] .search-input::placeholder {
    color: #9ca3af;
}
[data-theme="light"] select.form-input {
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(17,24,39,0.6) 50%),
        linear-gradient(135deg, rgba(17,24,39,0.6) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}
[data-theme="light"] select.form-input option,
[data-theme="light"] select.form-input optgroup {
    background: #ffffff;
    color: #111827;
}

[data-theme="light"] .data-table th {
    background: rgba(0,0,0,0.03);
    color: #6b7280;
    border-bottom-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .data-table td {
    border-bottom-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(0,0,0,0.025);
}
[data-theme="light"] .data-table tr:last-child td {
    border-bottom: none;
}

[data-theme="light"] .dropzone {
    background: #f8f9fa;
    border-color: rgba(0,0,0,0.15);
}
[data-theme="light"] .dropzone:hover,
[data-theme="light"] .dropzone.drag-over {
    background: #f0f2f5;
    border-color: #111827;
}
[data-theme="light"] .dropzone.has-file {
    background: #eef4ff;
    border-color: rgba(0,0,0,0.25);
}

[data-theme="light"] .alert-success { background: rgba(220,252,231,0.97); color: #166534; }
[data-theme="light"] .alert-error   { background: rgba(254,226,226,0.97); color: #991b1b; }
[data-theme="light"] .alert-warning { background: rgba(254,249,195,0.97); color: #854d0e; }
[data-theme="light"] .alert-info    { background: rgba(219,234,254,0.97); color: #1e40af; }

[data-theme="light"] .radio-card {
    background: #f8f9fa;
    border-color: rgba(0,0,0,0.10);
}
[data-theme="light"] .radio-card:hover { border-color: #111827; }
[data-theme="light"] .radio-selected   { background: #eef4ff; border-color: #111827; }

[data-theme="light"] .flow-chip {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.10);
    color: #374151;
}
[data-theme="light"] .flow-step        { background: rgba(0,0,0,0.03); color: #6b7280; }
[data-theme="light"] .flow-step.active { background: rgba(0,0,0,0.08); color: #111827; border-color: rgba(0,0,0,0.20); }
[data-theme="light"] .flow-step.done   { background: rgba(0,0,0,0.05); color: #111827; border-color: rgba(0,0,0,0.14); }

[data-theme="light"] .status-ok      { background: rgba(0,0,0,0.07); color: #111827; }
[data-theme="light"] .status-pending { background: rgba(0,0,0,0.04); color: #6b7280; }
[data-theme="light"] .status-no      { background: rgba(185,28,28,0.10); color: #991b1b; }
[data-theme="light"] .status-ns      { background: rgba(0,0,0,0.05); color: #6b7280; }
[data-theme="light"] .status-info    { background: #dbeafe; color: #1e40af; }
[data-theme="light"] .badge-ok       { background: rgba(21,128,61,0.12); color: #15803d; }
[data-theme="light"] .badge-no       { background: rgba(185,28,28,0.10); color: #991b1b; }
[data-theme="light"] .badge-ns       { background: rgba(0,0,0,0.05); color: #6b7280; }
[data-theme="light"] .badge-pending  { background: rgba(0,0,0,0.04); color: #6b7280; }
[data-theme="light"] .badge-info     { background: #dbeafe; color: #1e40af; }

/* Textos del contenido sobre fondos claros */
[data-theme="light"] .section-title,
[data-theme="light"] .action-title,
[data-theme="light"] .page-title,
[data-theme="light"] .person-name,
[data-theme="light"] .stat-value,
[data-theme="light"] .form-label,
[data-theme="light"] .dropzone-text { color: #111827; }

[data-theme="light"] .page-subtitle,
[data-theme="light"] .stat-label,
[data-theme="light"] .stat-pct,
[data-theme="light"] .search-hint,
[data-theme="light"] .info-note,
[data-theme="light"] .no-action,
[data-theme="light"] .dropzone-sub,
[data-theme="light"] .person-meta { color: #6b7280; }

/* File-name usa --green que es claro en dark mode — ya corregido con la var */
[data-theme="light"] .file-name { color: #15803d; }

[data-theme="light"] .col-item.required { background: rgba(0,0,0,0.05); color: #111827; }
[data-theme="light"] .col-item.optional { background: rgba(0,0,0,0.03); color: #6b7280; }

[data-theme="light"] kbd,
[data-theme="light"] code {
    background: rgba(0,0,0,0.07);
    border-color: rgba(0,0,0,0.10);
    color: #111827;
}

[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #1e2736, #374151);
    color: #ffffff;
    border: none;
}
[data-theme="light"] .btn-secondary {
    background: #f1f5f9;
    border: 1px solid rgba(0,0,0,0.15);
    color: #374151;
}
[data-theme="light"] .btn-secondary:hover {
    background: #e2e8f0;
}
[data-theme="light"] .btn-danger  {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}
[data-theme="light"] .btn-danger:hover  { background: #fecaca; }
[data-theme="light"] .btn-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}
[data-theme="light"] .btn-success:hover { background: #bbf7d0; }
[data-theme="light"] .btn-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}
[data-theme="light"] .btn-warning:hover { background: #fde68a; }

[data-theme="light"] .toggle-slider {
    background: rgba(0,0,0,0.08);
    border-color: rgba(0,0,0,0.15);
}
[data-theme="light"] .toggle-slider::after { background: #6b7280; }
[data-theme="light"] .toggle-checkbox:checked + .toggle-slider { background: #374151; border-color: #374151; }
[data-theme="light"] .toggle-checkbox:checked + .toggle-slider::after { background: #fff; }

[data-theme="light"] .thumb-placeholder { background: rgba(0,0,0,0.06); color: #6b7280; }
[data-theme="light"] .entity-thumb      { border-color: rgba(0,0,0,0.10); }

[data-theme="light"] .progress-bar   { background: rgba(0,0,0,0.06); }
[data-theme="light"] .fill-blue      { background: linear-gradient(90deg, #374151, #6b7280); }
[data-theme="light"] .fill-green     { background: linear-gradient(90deg, #1f2937, #4b5563); }

[data-theme="light"] .brand-mark { background: linear-gradient(135deg, #1e2736, #374151); }

/* public board always stays dark regardless of theme */
[data-theme="light"] .public-board { filter: none; }

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 2rem 1.25rem;
    }
}