body {
    background-color: #e9e9e9;
    font-family: 'Segoe UI', sans-serif;
    overflow-x: hidden;
}


/* --- ESTRUCTURA PRINCIPAL --- */
.card-alargada {
    width: 95%;
    max-width: 1800px;
    background-color: #fff;
    border-radius: 70px;
    padding: 40px 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .4);
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-img {
    width: 170px;
    margin-bottom: 10px;
}

.titulo-sistema {
    color: #8ba2b9;
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: center;
}

/* --- FILTROS --- */
.filtros-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    width: 100%;
}

.filtro-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 190px;
}

.label-pill {
    background-color: #91be33;
    color: white;
    border-radius: 20px;
    padding: 3px 25px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: -12px;
    z-index: 10;
    white-space: nowrap;
}

.select-custom {
    border-radius: 25px !important;
    border: 1px solid #e0e0e0;
    padding: 12px 20px !important;
    background-color: #fcfcfc;
    color: #2c5e97;
    font-weight: bold;
    width: 100%;
    text-align: center;
}

/* Forzar que el select de entidad abra hacia abajo con scroll */
#filtro-entidad {
    position: relative;
}

/* Select expandido con scroll (size > 1) */
#filtro-entidad[size]:not([size="1"]) {
    border-radius: 15px !important;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 9999;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 2px solid #91be33 !important;
    max-height: 220px;
    overflow-y: auto;
    background: white;
    margin-top: 5px;
}

#bloque-entidad {
    position: relative;
    z-index: 200;
}

/* Select con scroll visible */
select.select-custom option {
    text-align: center;
    padding: 8px 10px;
    color: #2c5e97;
    font-weight: bold;
    background: white;
}

select.select-custom option:hover,
select.select-custom option:checked {
    background: #91be33;
    color: white;
}

.btn-consultar {
    background-color: #91be33 !important;
    color: white !important;
    border-radius: 25px !important;
    padding: 12px 45px !important;
    font-weight: bold !important;
    height: 52px;
    border: none !important;
}

/* --- TABS --- */
.nav-pills .nav-link {
    border-radius: 30px;
    color: #2c5e97;
    font-weight: bold;
    margin: 0 5px;
    background: white;
    border: 1px solid #dee2e6;
}

.nav-pills .nav-link.active {
    background-color: #91be33 !important;
    color: white;
    border-color: #91be33;
}

/* --- DASHBOARDS Y CARDS --- */
.card-seccion {
    border-radius: 25px;
    border: none;
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.titulo-seccion {
    color: #2c5e97;
    font-weight: bold;
    border-bottom: 2px solid #91be33;
    padding-bottom: 10px;
    margin-bottom: 25px;
    text-align: center;
}

.titulo-fuera {
    text-align: center;
    margin: 40px 0 20px;
}

.titulo-fuera h1 {
    color: #2c5e97;
    font-weight: bold;
    font-size: 2.2rem;
    text-transform: uppercase;
}

.titulo-fuera hr {
    border: 2px solid #91be33;
    width: 60px;
    margin: 10px auto;
    opacity: 1;
}

/* Estilo Campaña */
.lider-porcentaje {
    font-size: 4rem;
    font-weight: 900;
    color: #2c5e97;
}

.lider-diferencia {
    font-size: 2.5rem;
    font-weight: bold;
    color: #91be33;
}

.foto-lider-main {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid #f8f9fa;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-aspirante-grid {
    border-radius: 20px;
    background: #fff;
    padding: 15px;
    border-bottom: 5px solid #ccc;
    text-align: center;
}

.foto-aspirante-grid {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

/* Estilo Preelectoral (Barras) */
.progress-fidelidad {
    height: 20px !important;
    border-radius: 10px;
}

.progress-aspirantes-bar {
    height: 35px !important;
    border-radius: 18px;
    position: relative;
    background-color: #f0f0f0;
}

.oculto {
    visibility: hidden;
    pointer-events: none;
}

.btn-toggle {
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.75rem;
    padding: 5px 12px;
    border: 2px solid transparent;
}

.btn-toggle.inactive {
    background-color: transparent !important;
    color: #666 !important;
    border-color: #ccc !important;
    text-decoration: line-through;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .card-alargada {
        border-radius: 35px;
        padding: 25px 15px;
        margin: 20px auto;
    }

    .logo-img {
        width: 130px;
    }

    .lider-porcentaje {
        font-size: 2.8rem;
    }

    .border-end {
        border-right: none !important;
        border-bottom: 1px solid #dee2e6;
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
}
/* Estilos específicos para el PDF */
@media print {
    .card-seccion {
        page-break-inside: avoid;
        margin-bottom: 30px;
    }
    
    .titulo-fuera {
        page-break-after: avoid;
    }
    
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Mejorar la visualización de las gráficas */
.card-seccion {
    background: white;
    border-radius: 15px;
    padding: 20px;
}

.titulo-seccion {
    color: #2c5e97;
    font-weight: bold;
    padding-bottom: 15px;
    border-bottom: 3px solid #f0f0f0;
    margin-bottom: 20px;
}
/* --- CONTROL DE PESTAÑAS DESHABILITADAS --- */
.nav-link.disabled,
.nav-link:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #f5f5f5 !important;
    color: #999 !important;
}

/* Pestaña activa normal */
.nav-link:not(.disabled):not(:disabled) {
    opacity: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-link:not(.disabled):not(:disabled):hover {
    background-color: #e9ecef;
}

.nav-link.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}