/* ===== ESTILOS SISTEMA CONTROL ELECTORAL ===== */
:root {
    --primary: #1a3a5c;
    --primary-light: #2c5282;
    --accent: #e8b830;
    --accent-hover: #d4a520;
    --success: #38a169;
    --danger: #e53e3e;
    --danger-hover: #c53030;
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header h1 span {
    color: var(--accent);
}

/* Botón menú hamburguesa */
.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
    line-height: 1;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.15);
}

/* ===== SIDEBAR / MENÚ LATERAL ===== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--card-bg);
    z-index: 300;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: left 0.3s ease;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.sidebar-close:hover { opacity: 1; }

.sidebar-menu {
    list-style: none;
    padding: 0.75rem 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.25rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: #ebf4ff;
    color: var(--primary);
    border-left-color: var(--accent);
}

.sidebar-icon {
    font-size: 1rem;
    width: 1.4rem;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 0.3rem 1rem;
}

.sidebar-label {
    padding: 0.3rem 1.25rem 0.15rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
}

.sidebar-user-icon {
    font-size: 1.1rem;
}

.sidebar-user-name {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout {
    color: var(--danger) !important;
}

.sidebar-logout:hover {
    background: #fff5f5 !important;
    border-left-color: var(--danger) !important;
}

.sidebar-footer {
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    transition: margin-left 0.3s ease;
}

/* ===== MENSAJES ===== */
.messages-container {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert-success {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #c6f6d5;
}

.alert-error {
    background: #fff5f5;
    color: #9b2c2c;
    border: 1px solid #fed7d7;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ===== BARRA DE ACCIONES ===== */
.acciones-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.acciones-header h2 {
    font-size: 1.75rem;
    color: var(--primary);
}

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #2f855a; transform: translateY(-1px); }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: var(--danger-hover); transform: translateY(-1px); }

.btn-warning {
    background: var(--accent);
    color: var(--primary);
}
.btn-warning:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* ===== GRID DE CANDIDATOS ===== */
.grid-candidatos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 992px) {
    .grid-candidatos { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .grid-candidatos { grid-template-columns: 1fr; }
}

/* ===== TARJETA DE CANDIDATO ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-foto {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #e2e8f0;
}

.card-foto-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(255,255,255,0.6);
}

.card-body {
    padding: 1.25rem;
}

.card-body h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.card-tipo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-partido {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ebf4ff;
    color: var(--primary-light);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-acciones {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ===== GRID DE PARROQUIAS ===== */
.grid-parroquias {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.parroquia-card .card-body {
    text-align: center;
}

.parroquia-icono {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.parroquia-card h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.parroquia-detalles {
    text-align: center;
    margin-bottom: 0.5rem;
}

.parroquia-detalles p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.parroquia-detalles p span {
    font-size: 1.1rem;
}

/* ===== GRID DE RECINTOS ===== */
.grid-recintos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.recinto-card .card-body {
    text-align: center;
}

.recinto-icono {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.recinto-card h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent);
}

.recinto-detalles {
    text-align: left;
    margin-bottom: 0.5rem;
}

.recinto-detalles p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    color: var(--text);
    font-size: 0.95rem;
}

.recinto-detalles p span {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.recinto-detalles .recinto-desc {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
    color: var(--text-light);
    font-style: italic;
    font-size: 0.9rem;
}

/* ===== INDICADOR DE CAPACIDAD ===== */
.capacidad-indicador {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
}

.capacidad-indicador.excede {
    background: #fff5f5;
    border-color: #fed7d7;
}

.capacidad-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}

.capacidad-fill {
    display: block;
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 0.3s;
}

.excede .capacidad-fill {
    background: var(--danger);
}

.capacidad-alerta {
    color: var(--danger);
    font-weight: 600;
    white-space: nowrap;
}

/* ===== FILTROS ===== */
.filtros-bar {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 200px;
}

.filtro-grupo label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.filtro-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ===== GRID DE MESAS ===== */
.grid-mesas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 992px) {
    .grid-mesas { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .grid-mesas { grid-template-columns: 1fr; }
}

.mesa-card {
    border-radius: 12px;
}

.mesa-card .card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.mesa-numero {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    line-height: 1;
    gap: 1px;
}

.mesa-numero.masculino {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

.mesa-numero.femenino {
    background: linear-gradient(135deg, #db2777, #be185d);
    box-shadow: 0 3px 10px rgba(219, 39, 119, 0.3);
}

.txt-masculino { color: #2563eb; font-weight: 600; }
.txt-femenino { color: #db2777; font-weight: 600; }

.mesa-info {
    width: 100%;
}

.mesa-info .mesa-recinto {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mesa-info .mesa-parroquia {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.mesa-info .mesa-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.mesa-info .mesa-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.mesa-card .card-acciones {
    display: flex;
    gap: 0.5rem;
    margin: 0.25rem 0 0 0;
    padding: 0.75rem 0 0 0;
    border-top: 1px solid var(--border);
    width: 100%;
    justify-content: center;
}

.mesa-card .card-acciones .btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
}

/* ===== TABLA DE MESAS DENTRO DE RECINTO ===== */
.recinto-mesas {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.recinto-mesas h4 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.mesas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.mesas-table th {
    background: var(--bg);
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
}

.mesas-table td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.sin-mesas {
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
    padding: 0.25rem 0;
}

/* ===== FORMULARIO ===== */
.form-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.form-card h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

.form-control-file {
    padding: 0.5rem 0;
}

/* ===== FOTO ACTUAL EN FORMULARIO ===== */
.foto-actual {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.foto-miniatura {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.foto-actual small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.form-acciones {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ===== CONFIRMAR ELIMINAR ===== */
.delete-card {
    max-width: 500px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: center;
}

.delete-card .icono {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.delete-card h2 {
    color: var(--danger);
    margin-bottom: 1rem;
}

.delete-card p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.delete-card .candidato-info {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.delete-card .candidato-info strong {
    color: var(--danger);
}

.delete-acciones {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ===== DASHBOARD INICIO ===== */
.home-dashboard {
    max-width: 900px;
    margin: 0 auto;
}

.welcome-card {
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.welcome-card h2 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.welcome-card p {
    opacity: 0.9;
    font-size: 1.05rem;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.home-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.home-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.home-card h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.home-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex: 1;
}

.home-card-btn {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    border: 2px solid var(--primary);
    border-radius: 6px;
    transition: all 0.2s;
}

.home-card:hover .home-card-btn {
    background: var(--primary);
    color: white;
}

/* ===== VACÍO ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state .icono {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== SECCIÓN DE VOTOS ===== */
.voto-seccion-titulo {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

/* ===== INGRESO DE VOTOS (TABLA) ===== */
.votos-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.votos-tabla th {
    background: var(--primary);
    color: white;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
}

.votos-tabla td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.votos-tabla tbody tr:hover {
    background: #f7fafc;
}

.voto-foto-cell {
    width: 44px;
}

.voto-foto-tabla {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: block;
}

.voto-foto-placeholder-tabla {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
}

.voto-input-cell {
    width: 130px;
}

.voto-input-cell input {
    width: 110px;
    text-align: center;
}

/* ===== BARRA DE TOTAL EN VIVO ===== */
.votos-total-bar {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.votos-total-info {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.votos-total-info span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.votos-progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.votos-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 5px;
    transition: width 0.3s, background 0.3s;
    min-width: 0;
}

.votos-alerta {
    margin-top: 0.75rem;
    padding: 0.6rem 1rem;
    background: #fff5f5;
    color: var(--danger);
    border: 1px solid #fed7d7;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== RESULTADOS ===== */
.resultado-parroquia {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.resultado-parroquia h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent);
}

.resultado-resumen {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.resumen-item {
    padding: 0.75rem 1.25rem;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.9rem;
}

.resumen-item strong {
    font-size: 1.1rem;
    color: var(--primary);
}

.resumen-item.ausentismo strong {
    color: var(--danger);
}

.resultados-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.resultados-tabla th {
    background: var(--primary);
    color: white;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.resultados-tabla td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.resultados-tabla tbody tr:hover {
    background: #f7fafc;
}

.recinto-fila {
    background: #f0f4f8 !important;
    border-top: 2px solid var(--primary);
}

.recinto-fila td {
    padding: 0.6rem 0.75rem !important;
}

.mesa-fila td:first-child {
    padding-left: 1.5rem !important;
    font-size: 0.82rem;
    color: var(--text-light);
}

.resultados-tabla tfoot {
    background: #ebf4ff;
    font-weight: 700;
}

.voto-num {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.voto-num.ausente {
    color: var(--danger);
}

/* ===== GANADOR BANNER ===== */
.ganador-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    box-shadow: 0 3px 12px rgba(245,158,11,0.3);
}

.ranking-tabla td {
    vertical-align: middle;
}

.ranking-ganador {
    background: #fffbeb !important;
}

.ranking-ganador td:first-child {
    color: #d97706;
    font-size: 1.1rem;
}

.ranking-foto {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
    border: 2px solid var(--border);
}

/* ===== ESCAÑOS ===== */
.escanos-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-top: 2rem;
}

.escanos-section h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.escanos-subtitulo {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.escanos-tabla th:last-child {
    min-width: 200px;
}

.escanos-num {
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    color: var(--primary) !important;
}

.electo-badge {
    display: inline-block;
    background: #f0fff4;
    color: #276749;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0.15rem 0;
    border: 1px solid #c6f6d5;
}

/* ===== GRÁFICOS EN TIEMPO REAL ===== */
.graficos-header {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.graficos-header h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    text-align: center;
}

.graficos-resumen {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.resumen-card {
    padding: 0.6rem 1.25rem;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.resumen-card strong { color: var(--primary); font-size: 1.1rem; }
.resumen-card.ausente strong { color: var(--danger); }

.progress-bar-total {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.progress-fill-total {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #48bb78);
    border-radius: 6px;
    transition: width 0.5s;
}

.graficos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .graficos-grid { grid-template-columns: 1fr; }
}

.grafico-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.grafico-titulo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.grafico-titulo > span:first-child {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.ganador-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}

.ganador-badge small {
    font-weight: 400;
    opacity: 0.9;
}

.grafico-barras {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.barra-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.barra-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.barra-foto {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.barra-foto-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    flex-shrink: 0;
}

.barra-posicion {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.barra-nombre {
    font-weight: 600;
    color: var(--text);
}

.barra-partido {
    color: var(--text-light);
    font-size: 0.8rem;
}

.barra-contenedor {
    height: 28px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
}

.barra-fill {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.75rem;
    transition: width 0.5s;
    min-width: fit-content;
}

.barra-fill.alcalde {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.barra-fill.concejal {
    background: linear-gradient(90deg, #7c3aed, #8b5cf6);
}

.barra-valor {
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.graficos-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
    color: var(--text-light);
}

/* ===== PESTAÑAS ===== */
.tabs-bar {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #f7fafc;
    color: var(--text);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--accent);
    background: #ebf4ff;
}

/* ===== CHECKBOX EN FORMULARIO ===== */
.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    margin-top: 0.3rem;
}

/* ===== PERMISOS ===== */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.rol-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.rol-card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rol-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.admin-card .rol-card-header {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.rol-card-body {
    padding: 0.75rem 1.25rem;
}

.rol-modulo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}

.rol-modulo:last-child {
    border-bottom: none;
}

.rol-modulo-nombre {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    min-width: 80px;
}

.rol-acciones {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.rol-accion {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--text-light);
    background: var(--bg);
    white-space: nowrap;
}

.rol-accion.tiene {
    color: #276749;
    background: #f0fff4;
}

.rol-sin {
    opacity: 0.5;
}

/* ===== ROL BADGE ===== */
.rol-badge {
    display: inline-block;
    background: #ebf4ff;
    color: var(--primary-light);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header h1 { font-size: 1.2rem; }
    .container { padding: 1rem; }
    .grid-candidatos { grid-template-columns: 1fr; }
    .form-card { padding: 1.5rem; }
    .acciones-header { flex-direction: column; align-items: stretch; }
    .acciones-header .btn { justify-content: center; }
}
