        html, body {
        margin: 0;
        padding: 0;
        }

        html.dark-mode,
        html.dark-mode body {
            background-color: #1a1a2e;
            color: #e0e0e0;
        }
        
        main {
        flex: 1;
        display: flex;
        flex-direction: column;
        }
        /* --------------------------------------------------------SIDEBAR------------------------------------------------ */
.sidebar {
    height: 100dvh;
    width: 0;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    overflow-x: hidden;
    overflow-y: auto;
    transition: 0.3s;
    padding-top: 60px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.sidebar.active {
    width: 280px;
}

/* Header del sidebar */
.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.sidebar-profile {
    background: rgba(255,255,255,0.15);
    padding: 20px 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.sidebar-profile i {
    font-size: 60px;
    color: #ffffff;
    margin-bottom: 15px;
    display: block;
    text-shadow: 0 2px 10px rgba(255,255,255,0.3);
}

.sidebar-profile p {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.sidebar-profile .user-name {
    font-size: 16px;
    font-weight: 500;
    
}

.sidebar-profile .user-role {
    color: #e0c8f5;
    font-size: 14px;
    font-weight: 400;
    margin-top: 5px;
    text-transform: capitalize;
}

/* Lista de enlaces */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar li a {
    padding: 16px 25px;
    text-decoration: none;
    font-size: 15px;
    color: #e0c8f5;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    margin: 4px 15px;
    border-radius: 10px;
    font-weight: 500;
}

.sidebar li a i {
    width: 25px;
    margin-right: 15px;
    font-size: 18px;
    text-align: center;
    color: #b38fd9;
}

.sidebar li a:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: #a855f7;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.sidebar li a:hover i {
    color: #ffffff;
}

.sidebar li a.active {
    background: rgba(168, 85, 247, 0.25);
    color: white;
    border-left-color: #a855f7;
}

.sidebar li a.active i {
    color: #ffffff;
}

/* Botón de cerrar sesión */
.sidebar-logout {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
    margin-top: auto;
}

.sidebar-logout form {
    width: 100%;
    
}

.sidebar-logout button {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.sidebar-logout button:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.sidebar-logout button:active {
    transform: translateY(0);
}

.sidebar-logout button i {
    font-size: 16px;
}

/* Scrollbar personalizado */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar.active {
        width: 260px;
    }
    
    .sidebar-profile i {
        font-size: 50px;
    }
    
    .sidebar li a {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* Efecto de overlay cuando el sidebar está abierto */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}
/* --------------------------------------------------------SIDEBAR------------------------------------------------ */

        .social-links {
            position: absolute;
            bottom: 20px;
            width: 100%;
            text-align: center;
        }
        .social-links a {
            color: #ffffff;
            font-size: 24px;
            margin: 0 10px;
            transition: color 0.3s;
        }
        .social-links a:hover {
            color: #fff;
        }
        .menu-toggle {
            cursor: pointer;
            font-size: 24px;
            color: #c6d4df;
            padding: 10px 15px;
            z-index: 2;
        }
        .main-content {
            margin-left: 0;
            transition: margin-left 0.3s;
        }
        .main-content.active {
            margin-left: 250px;
        }
        header {
            background-color: #171a21;
            padding: 10px 0;
            text-align: center;
        }
        nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 20px;
        }
        .nav2 {
            display: flex; /* Convierte a flexbox */
            justify-content: center; /* Centra horizontalmente */
            align-items: center;
        }
        nav .nav-links {
            display: flex;
            list-style: none;
            padding: 0;
            margin: 0;
            color: #ffffff;
            
        }
        nav .nav-links li {
            margin: 0 15px;
        }
        nav .nav-links a {
            text-decoration: none;
            color: #ffffff;
            font-size: 16px;
        }
        nav .nav-links a:hover {
            color: rgb(221, 219, 219);
        }
        nav .social-icons {
            display: flex;
        }
        nav .social-icons a {
            color: #ffffff;
            font-size: 24px;
            margin: 0 10px;
            transition: color 0.3s;
        }
        nav .social-icons a:hover {
            color: #7fe3fc;
        }

        .section-title {
            color: #fff;
            font-size: 24px;
            margin-bottom: 20px;
        }

        footer {
            margin-top: 20px;
            padding: 16px; 
            text-align: center;
        }
        section {
            padding: 20px;
            border-radius: 10px;
            max-width: 1600px;
            margin: 30px auto;
        }


#floating-menu {
    position: fixed;
    top: -100px;
    left: 0;
    width: 100%;
    background-color: rgb(34, 59, 135);
    color: white;
    opacity: 0;
    z-index: 9;
    transition: top 0.5s ease-in-out, opacity 0.5s ease-in-out;
    display: none; /* Oculto por defecto, JavaScript lo controla */
}


#floating-menu .sidebar {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    background-color: #223b87;
    overflow-x: hidden;
    transition: 0.3s;
    padding-top: 60px;
}

#floating-menu nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
#floating-menu .main-content{
    width: 100%;
    z-index: 9999;
}
#floating-menu .nav2{
    display: flex; /* Convierte a flexbox */
    justify-content: center; /* Centra horizontalmente */
    align-items: center;
}



.form-container {
    width: 90%;
    max-width: 90em;
    margin: 40px auto;
    padding: 2em;
    border-radius: 10px;
}
        .form-container h1 {
        text-align: center;
        color: #fff;
        }
        /* notification styles moved to end of file */

        .form-container h2 {
            text-align: center;
            margin-bottom: 20px;
            color: #fff;
        }
        .form-container label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
            
        }
        .form-container input[type="text"],
        .form-container input[type="email"],
        .form-container input[type="password"],
        .form-container input[type="date"],
        .form-container select,
        .form-container textarea {
            width: 100%;
            padding: 10px;
            margin-bottom: 15px;
            border-radius: 5px;
            font-size: 0.8em;
        }
        .form-container textarea {
            height: 100px;
        }
        .form-container input[type="submit"] {
            width: 100%;
            padding: 10px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
        }
        .form-container input[type="submit"]:hover {
            background-color: #45a049;
        }

        .password-field {
            position: relative;
            margin-bottom: 15px;
        }

        .password-field input {
            width: 100%;
            margin-bottom: 0 !important;
            padding-right: 38px;
        }

        .password-peek-btn {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            width: 28px;
            height: 28px;
            border: none;
            border-radius: 4px;
            background: transparent;
            color: #666;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }

        .password-peek-btn:hover {
            color: #3f3f3f;
        }

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgb(34, 59, 135);
    color: #fff;
    padding: 15px 25px;
    border: 0.1em solid white; /* 🔥 BORDE BLANCO visible */
    border-radius:0.5em;
    box-shadow: 1 4px 8px rgba(255, 255, 255, 1);
    display: none;
    z-index: 1000;
    animation: slideIn 0.5s ease-out, fadeOut 0.5s ease-out 2.5s;
}


@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}






table {
    width: 100%;
    padding: 0%;
    border-collapse: collapse;
}

table thead {
    width: 90%;
    color: white;
}

table th, table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid var(--card-border); /* bordes individuales */
}

/* Evitar hover en thead */
table thead tr:hover {
    background-color: rgb(34, 59, 135) !important;
}

.btn.btn-primary.mb-3{
    color: white;
}


















/* ESTILOS PARA LA PÁGINA PRINCIPAL - MODO CLARO */

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(167, 39, 252, 0.1) 0%, rgba(1, 158, 198, 0.1) 100%);
    border-radius: 15px;
    margin-bottom: 40px;
    border: 1px solid #e0e0e0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(167, 39, 252, 0.2);
}

.hero-subtitle {
    font-size: 1.3rem;
    color: #4a5568;
    margin-bottom: 30px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 20px;
}

.stat-item i {
    font-size: 2.5rem;
    color: #a727fc;
    margin-bottom: 10px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
}

.stat-label {
    font-size: 0.9rem;
    color: #718096;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.action-card {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 30px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(167, 39, 252, 0.1), transparent);
    transition: left 0.5s;
}

.action-card:hover::before {
    left: 100%;
}

.action-card:hover {
    transform: translateY(-8px);
    border-color: #a727fc;
    box-shadow: 0 15px 30px rgba(167, 39, 252, 0.2);
}

.action-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #a727fc 0%, #019ec6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.action-card h3 {
    color: #2d3748;
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.action-card p {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.action-badge {
    display: inline-block;
    background: linear-gradient(135deg, #a727fc 0%, #019ec6 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Info Section */
.info-section {
    background: linear-gradient(135deg, rgba(167, 39, 252, 0.05) 0%, rgba(1, 158, 198, 0.05) 100%);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

.info-section h2 {
    text-align: center;
    color: #2d3748;
    font-size: 2rem;
    margin-bottom: 40px;
    font-weight: 600;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    text-align: center;
    padding: 25px;
}

.feature-item i {
    font-size: 3rem;
    color: #a727fc;
    margin-bottom: 20px;
}

.feature-item h4 {
    color: #2d3748;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-item p {
    color: #4a5568;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .info-section {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-item {
        padding: 15px;
    }
}
















/* ESTILOS PARA EL PERFIL - COMPATIBLES CON AMBOS MODOS */

.profile-header {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #a727fc 0%, #019ec6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.profile-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.profile-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.profile-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--card-border, #e2e8f0);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ---- Badges de estado en perfil ---- */
.perfil-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.perfil-badge-activo {
    background: #dcfce7;
    color: #166534;
}
.perfil-badge-inactivo {
    background: #fee2e2;
    color: #991b1b;
}

/* ---- Modal de perfil (editar datos / cambiar contraseña) ---- */
.perfil-modal {
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}
.perfil-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
}
.perfil-modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--card-border, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: perfilSlideIn 0.22s ease-out;
}
@keyframes perfilSlideIn {
    from { opacity: 0; transform: translateY(-24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.perfil-modal-header {
    background: linear-gradient(135deg, #a727fc 0%, #019ec6 100%);
    color: #ffffff;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.perfil-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.perfil-modal-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.perfil-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}
.perfil-modal-body {
    padding: 22px 22px 10px;
}
.perfil-form-group {
    margin-bottom: 18px;
}
.perfil-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary, #4a5568);
}
.perfil-form-group input[type="text"],
.perfil-form-group input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--card-border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--input-bg, #ffffff);
    color: var(--input-text, #000000);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.perfil-form-group input:focus {
    outline: none;
    border-color: #a727fc;
    box-shadow: 0 0 0 3px rgba(167, 39, 252, 0.15);
}
.perfil-modal-footer {
    padding: 14px 22px 22px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Dark mode overrides */
body.dark-mode .perfil-badge-activo {
    background: #14532d;
    color: #86efac;
}
body.dark-mode .perfil-badge-inactivo {
    background: #450a0a;
    color: #fca5a5;
}
body.dark-mode .perfil-modal-content {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
body.dark-mode .perfil-form-group label {
    color: var(--text-secondary, #b19cd9);
}
body.dark-mode .perfil-form-group input[type="text"],
body.dark-mode .perfil-form-group input[type="password"] {
    border-color: #2d2d4d;
}
body.dark-mode .perfil-form-group input:focus {
    border-color: #7a1bc2;
    box-shadow: 0 0 0 3px rgba(122, 27, 194, 0.25);
}

@media (max-width: 480px) {
    .perfil-modal-footer {
        flex-direction: column;
    }
    .perfil-modal-footer .btn-primary,
    .perfil-modal-footer .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

.card-header {
    background: linear-gradient(135deg, #a727fc 0%, #019ec6 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.card-header i {
    font-size: 1.5rem;
}

.card-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary, #4a5568);
}

.info-value {
    font-weight: 500;
    color: var(--text-primary, #2d3748);
    text-align: right;
}

.blood-type {
    background: #fee2e2;
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: var(--stat-bg, #f7fafc);
    border-radius: 10px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #a727fc;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary, #718096);
}

.profile-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #a727fc 0%, #019ec6 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(167, 39, 252, 0.3);
}

.btn-secondary {
    background: var(--btn-secondary-bg, #e2e8f0);
    color: var(--btn-secondary-color, #4a5568);
    border: 1px solid var(--btn-secondary-border, #cbd5e0);
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover, #cbd5e0);
    transform: translateY(-2px);
}

.alert {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
}

.alert-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-title {
        font-size: 2rem;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .stat-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
    
    .profile-title {
        font-size: 1.8rem;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-value {
        text-align: left;
    }
}

/* --------------------------------------------------------------------------
   Notification modal (Light theme)
   Uses project primary colors: #a727fc9a and #019ec69c with gradient
   -------------------------------------------------------------------------- */
.notif-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: rgba(0,0,0,0.28);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.notif-modal[aria-hidden="true"] {
    display: none !important;
}

.notif-modal[aria-hidden="false"] {
    display: flex !important;
    pointer-events: auto;
}

.notif-modal-content {
    width: 92%;
    max-width: 520px;
    background: linear-gradient(135deg, #a727fc9a 0%, #019ec69c 100%);
    color: #ffffff;
    padding: 20px 22px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(2, 22, 28, 0.35);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(6px);

    margin: 0 auto !important;
    position: relative !important;
    overflow: visible;
    flex-shrink: 0;
}

.notif-modal-content-expired {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 70%, #7f1d1d 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 16px 44px rgba(153, 27, 27, 0.45);
}

.notif-modal-content h3 {
    margin: 0 0 10px;
    font-size: 18px;
    letter-spacing: 0.2px;
}

.notif-modal-content p {
    margin: 6px 0;
    font-size: 15px;
}

.notif-close {
    float: right;
    font-size: 20px;
    cursor: pointer;
    color: rgba(255,255,255,0.9);
}

.notif-modal .btn {
    display: inline-block;
    margin-top: 12px;
    background: rgba(255,255,255,0.14);
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    pointer-events: auto;
}

.notif-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.notif-modal-content-wide {
    max-width: 760px;
}

.notif-modal-copy {
    line-height: 1.65;
}

.notif-modal-copy strong {
    color: #ffffff;
}

.notif-modal-list {
    margin: 14px 0;
    padding-left: 20px;
}

.notif-modal-list li {
    margin-bottom: 8px;
}

.notif-modal-example {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
}

.notif-modal-example p {
    margin: 0 0 10px;
    font-weight: 700;
}

.notif-modal-example pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.55;
    color: #ffffff;
}

/* Small screens adjustments */
@media (max-width: 480px) {
    .notif-modal {
        align-items: flex-start !important;
        padding: 12px;
    }

    .notif-modal-content {
        width: 100%;
        padding: 16px;
        margin: 0 !important;
    }

    .notif-modal-content h3 { font-size: 16px; }
}

/* Animation / show state for modal (fail-safe visible by default) */
.notif-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
    transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .28s ease;
}
.notif-modal.show .notif-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Filtros de fichas médicas */
.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.filter-buttons .btn {
    width: auto;
    display: inline-flex;
    white-space: nowrap;
}

.filter-divider {
    border-left: 2px solid #e5e7eb;
    height: 30px;
    margin: 0 5px;
}

.filter-select {
    width: auto !important;
    display: inline-block;
    min-width: 200px;
}

/* ========================================
    RESPONSIVE - MÓVILES
   ======================================== */

@media (max-width: 768px) {
    /* Ajustar navegación */
    nav {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        padding: 8px 10px;
        gap: 8px;
    }
    
    nav h1 {
        font-size: 0.8rem;
        font-weight: 600;
        letter-spacing: 0.2px;
        margin: 0;
        flex: 1;
        min-width: 0;
        text-align: center;
        justify-self: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    nav .social-icons {
        gap: 4px;
    }

    nav .social-icons a {
        margin: 0;
    }
    
    .nav-links {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    .nav-links li {
        margin: 0 8px;
    }
    
    /* Main content responsive */
    main {
        flex: 1;
        width: 100%;
    }
    
    section {
        padding: 15px;
        margin: 15px 5px;
    }
    
    /* Form container */
    .form-container {
        width: 95%;
        padding: 15px;
        margin: 20px auto;
    }
    
    .form-container h2 {
        font-size: 1.3rem;
    }
    
    /* Tablas responsive con scroll horizontal */
    .form-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 100%;
        width: max-content;
    }
    
    table th,
    table td {
        padding: 8px 10px;
        font-size: 0.85rem;
        min-width: 100px;
    }
    
    table th:first-child,
    table td:first-child {
        min-width: 80px;
    }
    
    /* Botones en tablas */
    table .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    /* Filtros responsive */
    .filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-buttons .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .filter-divider {
        display: none;
    }
    
    .filter-select {
        width: 100% !important;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    /* Ajustes para pantallas muy pequeñas */
    nav {
        padding: 8px 5px;
    }
    
    nav h1 {
        font-size: 0.9rem;
        font-weight: 600;
        letter-spacing: 0px;
        margin: 0;
        text-align: center;
        justify-self: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    nav .social-icons {
        gap: 4px;
    }
    
    nav .social-icons a {
        font-size: 18px;
        margin: 0;
    }
    
    .nav2 .nav-links {
        justify-content: center;
    }
    
    .nav2 .nav-links li {
        margin: 0 5px;
    }
    
    .nav2 .nav-links a {
        font-size: 0.75rem;
    }
    
    .form-container {
        width: 98%;
        padding: 10px;
    }
    
    .form-container h2 {
        font-size: 1.1rem;
    }
    
    table th,
    table td {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .social-icons a {
        font-size: 18px;
        margin: 0 5px;
    }
    
    footer {
        padding: 12px;
        font-size: 0.85rem;
    }
}








/* ============================================================
   VARIABLES DE COLOR (EL SECRETO DEL MODO OSCURO)
   ============================================================ */
:root {
    /* Modo Claro (Valores de site.css) */
    --bg-main: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --sidebar-bg: linear-gradient(#7a1cb8 0%, #2f0948 100%);
    --nav-bg: #A627FC;
    --nav2-bg: #00B9E7;
    --section-bg: linear-gradient(#a727fc9a, #019ec69c);
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --table-bg: #ffffff;
    --table-text: #000000;
    --form-bg: linear-gradient(#a727fc9a, #019ec69c);
    --input-bg: #ffffff;
    --input-text: #000000;
}

body.dark-mode {
    /* Modo Oscuro (Valores de site2.css) */
    --bg-main: #1a1a2e;
    --text-primary: #e0e0e0;
    --text-secondary: #b19cd9;
    --sidebar-bg: linear-gradient(#7a1bc2 0%, #2f0948 100%);
    --nav-bg: linear-gradient(135deg, #7a1bc2 0%, #016a8a 100%);
    --nav2-bg: linear-gradient(135deg, #016a8a 0%, #7a1bc2 100%);
    --section-bg: linear-gradient(135deg, #7a1bc2 0%, #016a8a 100%);
    --card-bg: #000000;
    --card-border: #2d2d4d;
    --table-bg: #0f0f1a;
    --table-text: #e0e0e0;
    --form-bg: linear-gradient(135deg, #7a1bc2 0%, #016a8a 100%);
    --input-bg: #0f0f1a;
    --input-text: #e0e0e0;
}

/* ============================================================
   ESTILOS BASE (USANDO LAS VARIABLES)
   ============================================================ */
body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Usa min-height en lugar de height para permitir crecimiento */
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: none;
}

body.theme-ready {
    transition: background-color 0.3s, color 0.3s;
}

body.no-scroll {
    overflow: hidden;
    height: 100dvh;
    position: fixed;
    width: 100%;
}

.main-content {
    background-color: var(--bg-main);
}

/* SIDEBAR */
.sidebar {
    background: var(--sidebar-bg);
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
}

/* NAVEGACIÓN */
nav {
    background: var(--nav-bg);
}

.nav2 {
    background: var(--nav2-bg);
}

/* FORMULARIOS */
.form-container {
    background: var(--form-bg);
    color: white;
}

.form-container input, 
.form-container textarea, 
.form-container select {
    background-color: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--card-border);
}

/* TABLAS */
table {
    background-color: var(--table-bg);
    color: var(--table-text);
    border: 1px solid var(--card-border);
}

table thead {
    background: var(--nav-bg); /* Usa el gradiente del nav */
}

/* CARDS DE PERFIL */
.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.info-label { color: var(--text-secondary); }
.info-value { color: var(--text-primary); }

/* SECCIONES */
section {
    background: var(--section-bg);
    border: 1px solid var(--card-border);
}

/* FOOTER */
footer {
    background: var(--nav2-bg);
    color: var(--text-primary);
}

/* Ajuste para iconos de calendario en modo oscuro */
body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* ============================================================
   TÍTULO DEL HEADER
   ============================================================ */
nav h1 {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.4px;
}

/* ============================================================
   MODO OSCURO - OVERRIDES PARA ESTILOS NO VARIABLES
   ============================================================ */
body.dark-mode header {
    background-color: #0f0f1a;
}

body.dark-mode .menu-toggle {
    color: #e0e0e0;
}

body.dark-mode .sidebar-header {
    background: rgba(0,0,0,0.3);
}

body.dark-mode .sidebar-profile {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

body.dark-mode .sidebar-profile .user-role {
    color: #b19cd9;
}

body.dark-mode .sidebar li a {
    color: #b19cd9;
}

body.dark-mode .sidebar li a i {
    color: #b19cd9;
}

body.dark-mode .sidebar li a:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: #7a1bc2;
    box-shadow: 0 4px 12px rgba(122, 27, 194, 0.4);
}

body.dark-mode .sidebar li a.active {
    background: rgba(122, 27, 194, 0.3);
    border-left-color: #7a1bc2;
}

body.dark-mode .sidebar-logout {
    background: rgba(0,0,0,0.3);
}

body.dark-mode .sidebar-logout button {
    background: linear-gradient(135deg, #8b1a1a, #6b1414);
    box-shadow: 0 4px 15px rgba(139, 26, 26, 0.4);
}

body.dark-mode .sidebar-logout button:hover {
    background: linear-gradient(135deg, #a31f1f, #8b1a1a);
    box-shadow: 0 6px 20px rgba(139, 26, 26, 0.5);
}

body.dark-mode .sidebar-overlay {
    background: rgba(0,0,0,0.7);
}

body.dark-mode nav .nav-links a:hover {
    color: #b19cd9;
}

body.dark-mode nav .social-icons a:hover {
    color: #b19cd9;
}

body.dark-mode .social-links a:hover {
    color: #b19cd9;
}

body.dark-mode #floating-menu {
    background-color: rgba(15, 15, 26, 0.95);
    border-bottom: 1px solid #2d2d4d;
}

body.dark-mode #floating-menu .sidebar {
    background: linear-gradient(135deg, #7a1bc2 0%, #016a8a 100%);
}

body.dark-mode #floating-menu .nav2 {
    background: transparent;
}

body.dark-mode .hero-section {
    background: linear-gradient(135deg, rgba(122, 27, 194, 0.1) 0%, rgba(1, 106, 138, 0.1) 100%);
    border: 1px solid #2d2d4d;
}

body.dark-mode .hero-title {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(122, 27, 194, 0.3);
}

body.dark-mode .hero-subtitle {
    color: #b19cd9;
}

body.dark-mode .stat-item i {
    color: #7a1bc2;
}

body.dark-mode .stat-number {
    color: #ffffff;
}

body.dark-mode .stat-label {
    color: #b19cd9;
}

body.dark-mode .action-card {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
    border-color: #2d2d4d;
}

body.dark-mode .action-card:hover {
    border-color: #7a1bc2;
    box-shadow: 0 15px 30px rgba(122, 27, 194, 0.3);
}

body.dark-mode .action-icon {
    background: linear-gradient(135deg, #7a1bc2 0%, #016a8a 100%);
}

body.dark-mode .action-card h3 {
    color: #ffffff;
}

body.dark-mode .action-card p {
    color: #b19cd9;
}

body.dark-mode .action-badge {
    background: linear-gradient(135deg, #7a1bc2 0%, #016a8a 100%);
}

body.dark-mode .hero-stats .stat-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid #2d2d4d;
    border-radius: 12px;
}

body.dark-mode .info-section {
    background: linear-gradient(135deg, rgba(122, 27, 194, 0.05) 0%, rgba(1, 106, 138, 0.05) 100%);
    border: 1px solid #2d2d4d;
}

body.dark-mode .info-section h2 {
    color: #ffffff;
}

body.dark-mode .feature-item i {
    color: #7a1bc2;
}

body.dark-mode .feature-item h4 {
    color: #ffffff;
}

body.dark-mode .feature-item p {
    color: #b19cd9;
}

body.dark-mode table tbody tr:hover {
    background-color: rgba(122, 27, 194, 0.1);
}

body.dark-mode .btn.btn-primary.mb-3 {
    background: linear-gradient(135deg, #7a1bc2 0%, #016a8a 100%);
    border: 1px solid #2d2d4d;
}

body.dark-mode .btn.btn-primary.mb-3:hover {
    background: linear-gradient(135deg, #65179e 0%, #015570 100%);
    box-shadow: 0 4px 12px rgba(122, 27, 194, 0.4);
}

/* Botones Bootstrap en modo oscuro */
body.dark-mode .btn.btn-primary {
    background: linear-gradient(135deg, #7a1bc2 0%, #016a8a 100%);
    border: 1px solid #2d2d4d;
    color: #ffffff;
}

body.dark-mode .btn.btn-primary:hover {
    background: linear-gradient(135deg, #65179e 0%, #015570 100%);
}

body.dark-mode .btn.btn-secondary {
    background: #2d2d4d;
    border: 1px solid #3b3b5f;
    color: #e0e0e0;
}

body.dark-mode .btn.btn-secondary:hover {
    background: #3b3b5f;
}

/* Dark Mode para Control de Registros y Dashboard */
body.dark-mode .records-page {
    background: linear-gradient(135deg, #4a2d6b 0%, #2d5a8c 100%);
}

body.dark-mode .records-header {
    background: linear-gradient(135deg, #5c3b9e 0%, #1f5b8a 100%);
    color: #f0f0f0;
}

body.dark-mode .records-table-card {
    background: #1e1e2e;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .records-table thead {
    background: linear-gradient(135deg, #5c3b9e 0%, #1f5b8a 100%);
    color: #f0f0f0;
}

body.dark-mode .records-table th,
body.dark-mode .records-table td {
    color: #e0e0e0;
    border-bottom-color: #2d2d3d;
}

body.dark-mode .records-table tbody tr:nth-child(even) {
    background: #252535;
}

body.dark-mode .records-table tbody tr:hover {
    background: #2d3d4d;
}

body.dark-mode .records-table td a,
body.dark-mode .file-existing a {
    color: #e2e8f0;
}

body.dark-mode .records-table td a:hover,
body.dark-mode .file-existing a:hover {
    color: #7dd3fc;
    background-color: rgba(56, 189, 248, 0.18);
}

body.dark-mode .records-expandable-text__toggle {
    color: #38bdf8;
}

body.dark-mode .records-expandable-text__toggle:hover,
body.dark-mode .records-expandable-text__toggle:focus-visible {
    color: #7dd3fc;
}

body.dark-mode .btn-view {
    background: linear-gradient(135deg, #5c3b9e 0%, #1f5b8a 100%);
    color: #f0f0f0;
}

body.dark-mode .status-indicator {
    background: #2d2d3d;
    color: #9ca3af;
}

body.dark-mode .status-ok {
    background: #1b4620;
    color: #4ade80;
}

body.dark-mode .status-pending {
    background: #4b1414;
    color: #f87171;
}

body.dark-mode .icon-btn {
    background: #2d2d3d;
    color: #e0e0e0;
}

body.dark-mode .icon-success {
    background: #1b4620;
    color: #4ade80;
}

body.dark-mode .icon-danger {
    background: #4b1414;
    color: #f87171;
}

body.dark-mode .summary-card {
    background: #1e1e2e;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .summary-card p {
    color: #9ca3af;
}

body.dark-mode .summary-card h3 {
    color: #f0f0f0;
}

body.dark-mode .record-modal {
    background: #1e1e2e;
}

body.dark-mode .modal-close {
    background: #2d2d3d;
    color: #e0e0e0;
}

body.dark-mode .modal-header h3 {
    color: #f0f0f0;
}

body.dark-mode .modal-subtitle {
    color: #9ca3af;
}

body.dark-mode .modal-info {
    background: #252535;
}

body.dark-mode .modal-info span {
    color: #9ca3af;
}

body.dark-mode .modal-info strong {
    color: #f0f0f0;
}

body.dark-mode .modal-section h4 {
    color: #f0f0f0;
}

body.dark-mode .modal-photo {
    background: #252535;
}

body.dark-mode .modal-photo p {
    color: #9ca3af;
}

body.dark-mode .vote-card {
    border-color: #2d2d3d;
    background: #252535;
}

body.dark-mode .vote-card-header {
    color: #f0f0f0;
}

body.dark-mode .vote-card-value {
    color: #e0e0e0;
}

body.dark-mode .vote-card-name {
    color: #9ca3af;
}

/* Dark Mode para Dashboard de Votos Totales */
body.dark-mode .dashboard-votos {
    background: linear-gradient(135deg, #4a2d6b 0%, #2d4a6b 50%, #1a1a3a 100%);
}

body.dark-mode .dashboard-header {
    color: #f0f0f0;
}

body.dark-mode .dashboard-back {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
}

body.dark-mode .dashboard-back:hover {
    background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .stat-card {
    background: #1e1e2e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .stat-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .stat-label {
    color: #9ca3af;
}

body.dark-mode .stat-value {
    color: #f0f0f0;
}

body.dark-mode .stat-percentage {
    color: #a78bfa;
}

body.dark-mode .chart-card {
    background: #1e1e2e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .chart-title {
    color: #f0f0f0;
}

body.dark-mode .chart-legend {
    border-top-color: #2d2d3d;
}

body.dark-mode .legend-item {
    color: #c0c0c0;
}

body.dark-mode .results-detail {
    background: #1e1e2e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .results-title {
    color: #f0f0f0;
}

body.dark-mode .result-item {
    background: #252535;
}

body.dark-mode .result-item:hover {
    background: #2d3d4d;
}

body.dark-mode .result-rank {
    color: #6b7280;
}

body.dark-mode .result-acronym {
    color: #f0f0f0;
}

body.dark-mode .result-progress-bar {
    background: #2d2d3d;
}

body.dark-mode .result-votes {
    color: #f0f0f0;
}

body.dark-mode .result-percentage {
    color: #9ca3af;
}

/* Dark Mode - Gráficos */
body.dark-mode canvas {
    filter: brightness(0.9);
}


/* ///////////////////////////////////////////////////////////////////// */
/* Control de registros */
/* ///////////////////////////////////////////////////////////////////// */
.records-page {
    padding: 24px 20px 40px;
    background: linear-gradient(135deg, #8a49e8 0%, #5aa6cf 100%);
    min-height: 100vh;
}

.records-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #8f3df0 0%, #39a3c9 100%);
    color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(25, 25, 45, 0.18);
    margin-bottom: 18px;
}

.records-header h2 {
    font-size: 1.4rem;
    margin: 0;
    font-weight: 700;
}

.records-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    text-decoration: none;
}

.records-table-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 24px rgba(25, 25, 45, 0.15);
    overflow: hidden;
}

.records-table-wrap {
    overflow-x: auto;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.records-table thead {
    background: linear-gradient(135deg, #8f3df0 0%, #39a3c9 100%);
    color: #ffffff;
}

.records-table th,
.records-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
    border-bottom: 1px solid #eceef6;
}

.records-table td {
    max-width: 280px;
}

.records-expandable-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 180px;
}

.records-expandable-text__content {
    width: 100%;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.records-expandable-files {
    min-width: 220px;
}

.records-file-list {
    margin: 0;
    padding-left: 16px;
    width: 100%;
}

.records-file-list__item {
    margin-bottom: 8px;
}

.records-file-list__item:last-child {
    margin-bottom: 0;
}

.records-file-list__item a {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.records-file-list__meta {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 2px;
}

.records-expandable-text:not(.is-expanded) .records-expandable-text__content {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.records-expandable-files:not(.is-expanded) .records-expandable-text__content {
    display: block;
    max-height: 162px;
    overflow: hidden;
}

.records-expandable-text--static .records-expandable-text__content {
    display: block;
    overflow: visible;
}

.records-expandable-text__toggle {
    padding: 0;
    border: none;
    background: transparent;
    color: #0284c7;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.records-expandable-text__toggle:hover,
.records-expandable-text__toggle:focus-visible {
    color: #0369a1;
    text-decoration: underline;
}

.records-table tbody tr:nth-child(even) {
    background: #f7f8fc;
}

.records-table tbody tr:hover {
    background: #eef2ff;
}

/* Links de archivos: resaltar en celeste al pasar el mouse */
.records-table td a,
.file-existing a {
    color: #0f172a;
    text-decoration: none;
    border-radius: 6px;
    padding: 2px 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.records-table td a:hover,
.file-existing a:hover {
    color: #0284c7;
    background-color: #e0f2fe;
    text-decoration: underline;
}

.records-table td a:focus-visible,
.file-existing a:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #8f3df0 0%, #39a3c9 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.status-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #e5e7eb;
    color: #6b7280;
}

.status-ok {
    background: #dcfce7;
    color: #16a34a;
}

.status-pending {
    background: #fee2e2;
    color: #dc2626;
}

.icon-btn {
    border: none;
    background: #f3f4f6;
    color: #1f2937;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-success {
    background: #dcfce7;
    color: #16a34a;
}

.icon-danger {
    background: #fee2e2;
    color: #dc2626;
}

.records-summary {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.summary-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 10px 20px rgba(25, 25, 45, 0.12);
}

.summary-card p {
    margin: 0 0 12px 0;
    color: #6b7280;
}

.summary-card h3 {
    margin: 0;
    font-size: 1.8rem;
    color: #111827;
}

.summary-ok {
    color: #16a34a;
}

.summary-pending {
    color: #dc2626;
}

/* Modal de actas */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 999;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.record-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: min(580px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
}

.record-modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: #f3f4f6;
    color: #111827;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
}

.modal-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.2rem;
}

.modal-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.modal-info {
    margin: 16px 0 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px 16px;
}

.modal-info span {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
}

.modal-info strong {
    font-size: 0.95rem;
    color: #111827;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h4 {
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.modal-photo {
    background: #f8fafc;
    border-radius: 14px;
    padding: 12px;
    text-align: center;
}

.modal-photo img {
    max-width: 100%;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

.modal-photo p {
    margin: 0;
    color: #6b7280;
}

.votes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.vote-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    background: #ffffff;
}

.vote-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
}

.vote-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--party-color, #6d28d9);
}

.vote-card-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.vote-card-name {
    font-size: 0.75rem;
    color: #6b7280;
}

@media (max-width: 720px) {
    .records-table {
        min-width: 820px;
    }

    .records-header h2 {
        font-size: 1.1rem;
    }
}

/* ================================================== */
/* DASHBOARD DE VOTOS TOTALES */
/* ================================================== */

.dashboard-votos {
    min-height: 100vh;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 50%, #5b21b6 100%);
    padding: 20px;
    padding-bottom: max(40px, env(safe-area-inset-bottom));
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    color: white;
}

.dashboard-back {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.dashboard-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
}

.dashboard-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

/* Cards de estadísticas superiores */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.stat-percentage {
    font-size: 0.9rem;
    color: #8b5cf6;
    font-weight: 600;
    margin-top: 4px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon-purple {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.stat-icon-blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.stat-icon-gradient {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
}

/* Contenedor de gráficos */
.charts-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.chart-card-full {
    grid-column: span 1;
}

.chart-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.chart-wrapper {
    position: relative;
    height: 400px; /* Gráfico de torta */
    min-height: 400px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

.chart-wrapper-bar {
    height: 700px; /* Gráfico de barras */
    min-height: 500px;
    max-height: 800px;
    width: 100%;
    overflow: hidden;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #4b5563;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-label {
    font-weight: 500;
}

/* Canvas para gráficos */
#pieChart,
#barChart {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    display: block;
}

/* Detalle de Resultados */
.results-detail {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.results-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    transition: all 0.2s;
}

.result-item:hover {
    background: #f3f4f6;
    transform: translateX(5px);
}

.result-rank {
    font-size: 1.2rem;
    font-weight: 700;
    color: #9ca3af;
    min-width: 40px;
    text-align: center;
}

.result-info {
    flex: 1;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.result-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: var(--party-color, #6d28d9);
}

.result-acronym {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

.result-progress-bar {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
}

.result-progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
    width: calc(var(--progress-width, 0) * 1%);
    background-color: var(--party-color, #6d28d9);
}

.result-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 140px;
}

.result-votes {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.result-percentage {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-votos {
        padding: 15px;
    }

    .dashboard-header h2 {
        font-size: 1.4rem;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    .chart-wrapper {
        height: 350px;
        min-height: 350px;
        max-height: 400px;
    }

    .chart-wrapper-bar {
        height: 400px;
        min-height: 400px;
        max-height: 500px;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .result-info {
        width: 100%;
    }

    .result-stats {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .dashboard-header h2 {
        font-size: 1.2rem;
    }

    .stat-card {
        padding: 18px;
    }

    .chart-card {
        padding: 18px;
    }

    .chart-wrapper {
        height: 300px;
        min-height: 300px;
        max-height: 350px;
    }

    .chart-wrapper-bar {
        height: 350px;
        min-height: 350px;
        max-height: 400px;
    }

    .results-detail {
        padding: 18px;
    }
}
/* Botones de filtro para elecciones */
.btn-filter {
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Botones de filtro de elección - usa data attributes */
.btn-election {
    background-color: white;
    color: #374151;
}

/* Aplicar color cuando coincide */
.btn-election[data-election="Alcaldia"][data-current="Alcaldia"],
.btn-election[data-election="Gobernacion"][data-current="Gobernacion"],
.btn-election[data-election="Concejales"][data-current="Concejales"] {
    background-color: #8b5cf6;
    color: white;
    border-color: #8b5cf6 !important;
}

/* Dark mode para filtros */
body.dark-mode .btn-filter {
    color: #f0f0f0;
}

body.dark-mode .btn-election {
    background-color: #2d2d3d;
    color: #f0f0f0;
    border-color: #444 !important;
}

body.dark-mode .btn-election[data-election="Alcaldia"][data-current="Alcaldia"],
body.dark-mode .btn-election[data-election="Gobernacion"][data-current="Gobernacion"],
body.dark-mode .btn-election[data-election="Concejales"][data-current="Concejales"] {
    background-color: #8b5cf6;
    color: white;
}

/* ============================================================
   GARANTIAS POR VENCER (usa estilos compartidos del layout)
   ============================================================ */
.garantias-page-wrap {
    padding: 14px 16px 18px;
}

.garantias-page-inner {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.16);
}

.garantias-page-head {
    margin-bottom: 12px;
}

.garantias-page-head h2 {
    margin: 0;
    font-size: 1.35rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.garantias-page-head p {
    margin: 6px 0 8px;
    font-size: 0.93rem;
    color: #334155;
}

.garantias-total {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    font-size: 0.84rem;
}

.garantia-empty-card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--card-bg);
    color: #1f2937;
    padding: 12px;
}

.garantias-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 10px;
}

.garantia-card {
    border: 2px solid;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.garantia-card--red {
    border-color: #dc2626;
    background: #fef2f2;
}

.garantia-card--yellow {
    border-color: #ca8a04;
    background: #fefce8;
}

.garantia-card--green {
    border-color: #16a34a;
    background: #f0fdf4;
}

.garantia-card-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.garantia-card-top h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #0f172a;
}

.garantia-badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.garantia-badge--red {
    background: #dc2626;
    color: #fff;
}

.garantia-badge--yellow {
    background: #ca8a04;
    color: #fff;
}

.garantia-badge--green {
    background: #16a34a;
    color: #fff;
}

.garantia-message {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #111827;
    line-height: 1.38;
}

.garantia-meta {
    color: #374151;
    font-size: 0.82rem;
}

.garantia-actions {
    margin-top: 8px;
}

.garantia-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1e40af;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.84rem;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.garantia-view-btn:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

body.dark-mode .garantias-page-inner {
    background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .garantias-page-head h2,
body.dark-mode .garantia-card-top h3,
body.dark-mode .garantia-message,
body.dark-mode .garantia-meta,
body.dark-mode .garantia-empty-card {
    color: #e2e8f0;
}

body.dark-mode .garantias-page-head p {
    color: #cbd5e1;
}

body.dark-mode .garantia-empty-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .garantia-card {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

body.dark-mode .garantia-card--red {
    border-color: #f87171;
    background: #3f1d1d;
}

body.dark-mode .garantia-card--yellow {
    border-color: #facc15;
    background: #3a3414;
}

body.dark-mode .garantia-card--green {
    border-color: #4ade80;
    background: #163326;
}

body.dark-mode .garantia-view-btn {
    background: #2563eb;
}

body.dark-mode .garantia-view-btn:hover {
    background: #1d4ed8;
}

@media (max-width: 768px) {
    .garantias-page-wrap {
        padding: 10px;
    }

    .garantias-page-inner {
        padding: 10px;
    }

    .garantias-list-grid {
        grid-template-columns: 1fr;
    }

    .garantia-card-top {
        flex-direction: column;
    }

    .garantia-badge {
        align-self: flex-start;
    }
}
