/* GENERAL */
* {
    margin: 0;
    padding: 0;
    box-shadow: none;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}
body, html {
    width: 100%;
    min-height: 100vh;
    background-color: #f4f6f9;
}
.login {
    display: flex;
    width: 100%;
    min-height: 100vh;
}
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}




/* LOGIN */
/* PANEL IZQUIERDO */
.login-izquierda {
    background: linear-gradient(135deg, #03255c 0%, #02173a 100%);
    width: 45%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
/* Detalle decorativo*/
.login-izquierda::before {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: #ff6600;
    opacity: 0.1;
    border-radius: 50%;
}
.contenido-izquierda {
    width: 100%;
    max-width: 320px;
}
.contenido-izquierda .logo {
    max-width: 180px;
    width: 100%;
    height: auto;
    margin-bottom: 25px;
    filter: drop-shadow(0px 8px 16px rgba(0,0,0,0.3));
}
.contenido-izquierda h1 {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.2;
    margin-bottom: 10px;
}
.contenido-izquierda p {
    color: #a2b6d4;
    font-size: 1rem;
    font-weight: 400;
}
/* PANEL DERECHO (FORMULARIO) */
.login-derecha {
    width: 55%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background-color: #f4f6f9;
}
/* Tarjeta contenedora */
.login-card {
    background-color: #ffffff;
    width: 100%;
    max-width: 440px;
    padding: 45px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 37, 92, 0.05);
}
.login-card h2 {
    color: #03255c;
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.login-card .subtitle {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 35px;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.input-group label {
    color: #03255c;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 1px;
}
.input-group input, 
.input-group select {
    width: 100%;
    height: 48px;
    background-color: #ffffff; 
    border: 1.5px solid #e1e5ee;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 0.95rem;
    color: #333;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
}
/* Efecto Focus */
.input-group input:focus, 
.input-group select:focus {
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}
/* Flecha del Select */
.select-wrapper {
    position: relative;
    width: 100%;
}
.select-wrapper::after {
    content: '▼';
    font-size: 0.8rem;
    color: #ff6600;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
/* Botón de Login */
.btn-login {
    background-color: #ff6600;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    height: 48px;
    margin-top: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%; 
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.2);
}
.btn-login:hover {
    background-color: #e05a00;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 102, 0, 0.3);
}


/* Admin */
.barra-lateral {
    width: 280px;
    background-color: #002350;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 20px 15px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

/* Estilo moderno de la barra de desplazamiento interna */
.barra-lateral::-webkit-scrollbar {
    width: 5px;
}
.barra-lateral::-webkit-scrollbar-track {
    background: transparent;
}
.barra-lateral::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.barra-lateral:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Ocultar la barra en PC */
.barra-lateral.colapsada {
    transform: translateX(-280px);
}

/* Encabezado del logo */
.contenedor-logo-barra {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 15px;
    gap: 12px;
}

.logo-barra {
    max-width: 100px;
    height: auto;
    object-fit: contain;
}

.titulo-institucion {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
    text-align: center;
}

/* Info del usuario */
.caja-usuario-barra {
    padding: 5px 10px 15px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 15px;
}

.nombre-usuario {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rol-usuario {
    font-size: 11px;
    color: #38bdf8;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 2px;
    display: block;
}

/* ==========================================
   3. ELEMENTOS DEL MENÚ INTERNO
   ========================================== */
.categoria-menu {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 1px;
    padding: 12px 10px 6px 10px;
    text-transform: uppercase;
}

.lista-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.enlace-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.enlace-menu i {
    width: 16px;
    font-size: 14px;
    text-align: center;
}

.enlace-menu:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.04);
}

.enlace-menu.activo {
    color: #ffffff !important;
    background-color: #ff6600;
    font-weight: 600;
}

.contenedor-salir {
    margin-top: auto;
    padding-top: 20px;
    padding-bottom: 20px;
}

.enlace-salir:hover {
    color: #f87171;
}

.btn-cerrar-barra {
    display: none; 
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
}

.btn-alternar-menu {
    background-color: #002350;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-alternar-menu:hover {
    background-color: #ff6600;
}

.acciones-superiores-globales {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.contenido-principal {
    margin-left: 280px;
    flex-grow: 1;
    padding: 40px;
    width: calc(100% - 280px);
    transition: all 0.3s ease;
}

.contenido-principal.expandido {
    margin-left: 0;
    width: 100%;
}

/* Componentes de las vistas secundarias */
.encabezado-pagina {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.encabezado-pagina h1 {
    font-size: 22px;
    color: #0f172a;
    font-weight: 700;
}

.btn-primario {
    background-color: #ff6600;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.barra-filtros form{
    width:100%;
}

.campo-busqueda{
    width:100%;
    padding:8px 12px;
    border:1px solid #cbd5e1;
    border-radius:6px;
    font-family:'Montserrat', sans-serif;
    font-size:13px;
    outline:none;
}

.seleccion-filtro {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    background-color: #ffffff;
    color: #475569;
    outline: none;
}

.contenedor-tabla {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    /* DESLIZAMIENTO EN MÓVILES */
    overflow-x: auto;
    width: 100%;
    /* Evita que se pegue en los bordes de pantallas táctiles */
    -webkit-overflow-scrolling: touch;
}

.tabla-datos {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.tabla-datos th {
    background-color: #f1f5f9;
    color: #475569;
    padding: 14px 18px;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.tabla-datos td {
    padding: 14px 18px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.celda-acciones {
    display: flex;
    align-items: center;
    gap: 12px;
}

.enlace-accion.editar { color: #3498db; }
.enlace-accion.eliminar { color: #ef4444; }

/* ADAPTACIÓN MÓVIL */
@media (max-width: 850px) {
    .login {
        flex-direction: column; /* Apila las columnas verticalmente */
    }
    .login-izquierda {
        width: 100%;
        padding: 50px 20px;
        min-height: auto; /* Permite que se ajuste al tamaño del escudo y título */
    }
    .contenido-izquierda .logo {
        max-width: 130px; /* Reducimos ligeramente el logo en móviles */
        margin-bottom: 15px;
    }
    .contenido-izquierda h1 {
        font-size: 1.5rem;
    }
    .login-derecha {
        width: 100%;
        padding: 30px 20px 50px 20px;
        background-color: #f4f6f9; /* Mantiene la consistencia del color */
        align-items: flex-start; /* Evita que la tarjeta quede flotando de forma extraña */
    }
    .login-card {
        padding: 30px 25px;
        box-shadow: 0 4px 20px rgba(0, 37, 92, 0.03);
        background-color: #ffffff; /* Fondo blanco de la tarjeta */
    }
    .login-card h2 {
        font-size: 1.5rem;
    }
    .login-card .subtitle {
        margin-bottom: 25px;
    }
    .barra-lateral {
        transform: translateX(-280px);
    }
    
    .barra-lateral.activa {
        transform: translateX(0);
    }

    .btn-cerrar-barra {
        display: block;
    }

    .contenido-principal {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
    
    .barra-filtros {
        flex-direction: column;
    }
    
    .campo-busqueda, .seleccion-filtro {
        width: 100%;
    }
    
    .encabezado-pagina {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* ==========================================================================
    APLICACIÓN REAL DE TEMAS (AGREGAR AL FINAL DE TU ARCHIVO DE ESTILOS)
   ========================================================================== */

/* ---------- MODO OSCURO ---------- */
body.modo-oscuro {
    background-color: #0a1424 !important;
    color: #dde4ee !important;
}
body.modo-oscuro .barra-lateral {
    background-color: #020b1c !important;
}
 
body.modo-oscuro h1,
body.modo-oscuro h2,
body.modo-oscuro h3,
body.modo-oscuro .encabezado-pagina h1 {
    color: #ffffff !important;
}
 
/* Tabla: gris-azulado en vez de blanco, para no chocar contra el fondo negro */
body.modo-oscuro .contenedor-tabla {
    background-color: #131f33 !important;
    border: 1px solid #233553 !important;
}
body.modo-oscuro .tabla-datos th {
    background-color: #182842 !important;
    color: #8fa3c4 !important;
    border-bottom: 1px solid #233553 !important;
}
body.modo-oscuro .tabla-datos td {
    background-color: #131f33 !important;
    color: #d4dceb !important;
    border-bottom: 1px solid #1d2c47 !important;
}
body.modo-oscuro .tabla-datos tbody tr:hover td {
    background-color: #182842 !important;
}
 
/* Buscador y filtro (antes blancos por defecto) */
body.modo-oscuro .campo-busqueda,
body.modo-oscuro .seleccion-filtro {
    background-color: #0f1c30 !important;
    color: #ffffff !important;
    border: 1px solid #233553 !important;
}
body.modo-oscuro .seleccion-filtro {
    color: #b9c4d6 !important;
}
body.modo-oscuro .card {
    background-color: #131f33 !important;
    border-color: #233553 !important;
}

/* Números grandes y títulos de gráficos: tenían color inline (#1e293b), hay que ganarles con !important */
body.modo-oscuro .card h2,
body.modo-oscuro .card h5 {
    color: #ffffff !important;
}

/* Etiquetas pequeñas tipo "ALUMNOS INSCRITOS" (h6.text-muted) */
body.modo-oscuro .card h6,
body.modo-oscuro .card .text-muted {
    color: #8fa3c4 !important;
}

/* Subtítulo bajo "Panel de Control" (tenía color inline #64748b) */
body.modo-oscuro .encabezado-pagina p {
    color: #8fa3c4 !important;
}
 
/* La barra lateral NO se toca: ya es azul oscuro por defecto y se ve bien */
 
 
/* ---------- ESTILO MINIMALISTA ---------- */
body.modo-aesthetic {
    background-color: #f4f4f5 !important;
    color: #18181b !important;
}
 
/* Esta sí necesita cambiar: pasa de azul marino a grafito neutro */
body.modo-aesthetic .barra-lateral {
    background-color: #18181b !important;
}
body.modo-aesthetic .rol-usuario {
    color: #a1a1aa !important;
}
/* El naranja de "activo" puede chocar con lo neutro del tema.
   Descomenta esta regla si prefieres grafito en vez de naranja: */
/*
body.modo-aesthetic .enlace-menu.activo {
    background-color: #3f3f46 !important;
}
*/
 
body.modo-aesthetic .contenedor-tabla {
    background-color: #ffffff !important;
    border: 1px solid #e4e4e7 !important;
}
body.modo-aesthetic .tabla-datos th {
    background-color: #fafafa !important;
    color: #71717a !important;
}
body.modo-aesthetic .tabla-datos td {
    color: #3f3f46 !important;
    border-bottom: 1px solid #f4f4f5 !important;
}
body.modo-aesthetic .campo-busqueda,
body.modo-aesthetic .seleccion-filtro {
    border: 1px solid #d4d4d8 !important;
}
body.modo-aesthetic .btn-primario {
    background-color: #18181b !important;
}

.whatsapp-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #ffffff !important;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Efecto Hover al pasar el mouse */
.whatsapp-btn:hover {
    background-color: #128c7e;
    transform: scale(1.1);
    color: #ffffff;
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.4);
}