/* BASE */
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; background: #f4f7f6; color: #333; }

/* CABECERA (Ya la tenías, mantenemos consistencia) */
.main-header { background: #2c3e50; color: white; padding: 15px; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.header-top { 
    display: flex; 
    flex-direction: column; /* Apila elementos verticalmente */
    align-items: center;    /* Centra horizontalmente */
    gap: 15px;              /* Espacio entre logo, títulos y usuario */
    padding: 20px 15px; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
}
.header-left {display: flex;align-items: center;gap: 15px;}
/* Sección de usuario centrada */
.header-right {
    text-align: center;
    width: 100%;
}

/* Títulos centrados */
.system-title {
    text-align: center;
}
.logo-img { height: 50px; width: auto; border-radius: 4px; }
.main-title { font-size: 1.1rem; font-weight: bold; display: block; }
.school-name { 
    font-size: 1rem; 
    color: #bdc3c7; 
    display: block;
}
/* NAVEGACIÓN */
.main-nav ul { list-style: none; padding: 10px 0 0 0; margin: 0; display: flex; gap: 20px; }
.main-nav a { color: #ecf0f1; text-decoration: none; font-weight: 500; font-size: 0.9rem; transition: 0.3s; }
.main-nav a:hover { color: #f1c40f; }

/* Estilos para el botón hamburguesa (oculto por defecto) */
.menu-toggle {
    display: none;
    color: white;
    font-size: 1.5rem;
    padding: 15px;
    cursor: pointer;
}

/* Contenedor del desplegable de informes */
.subgrupos-informes {
    min-width: 260px;
    padding: 0 !important;
}

/* Estilo de cada subgrupo (el título) */
.subgrupos-informes summary {
    padding: 12px 15px;
    cursor: pointer;
    font-weight: bold;
    background-color: #2c3e50;
    border-bottom: 1px solid #eee;
    list-style: none; /* Quita la flecha por defecto */
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    outline: none;
}

/* Flecha personalizada a la derecha */
.subgrupos-informes summary::after {
    content: '\f0da'; /* Icono caret-right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 10px; /* <--- Esto añade el espacio deseado */
    transition: transform 0.2s ease; /* Opcional: para que el cambio sea suave */
}

.subgrupos-informes details[open] summary::after {
    content: '\f0d7'; /* Icono caret-down */
    margin-left: 10px; /* Mantener el mismo espacio cuando esté abierto */
}

/* Hover sobre el título del grupo */
.subgrupos-informes summary:hover {
    background-color: #3498db;
    color: white;
}

/* Contenedor de los enlaces internos */
.submenu-items {
    background-color: #0b0834;
    padding: 5px 0;
}

/* Enlaces finales */
.submenu-items a {
    padding: 10px 25px !important;
    font-size: 0.9rem;
    border-bottom: none !important;
}

.submenu-items a:hover {
    background-color: #ecf0f1 !important;
    color: #2c3e50 !important;
}

/* --- RESPONSIVE: Móviles --- */
@media screen and (max-width: 1024px) {
    .menu-toggle {
        display: block !important;
        cursor: pointer;
        position: relative;
        z-index: 1010; /* Por encima de la lista desplegada */
    }

    /* Estilo para el menú móvil con animación */
    .nav .nav-list {
        display: none; /* Se mantiene para navegadores antiguos */
        flex-direction: column;
        width: 100%;
        background-color: #2c3e50;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 999;
        padding: 0;
        margin: 0;
        
        /* Animación de deslizamiento */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }

    /* Cuando está activo, permitimos que crezca */
    .nav .nav-list.active {
        display: flex !important;
        max-height: 100vh; /* Altura suficiente para mostrar todo */
    }

    .nav .nav-list li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-list {
        z-index: 1000;
    }    

    /* Ajuste de dropdown en móvil para que no flote */
    .dropdown-content {
        position: static; 
        width: 100%;
        background-color: #34495e;
        display: none;
    }
    
    .dropdown:hover .dropdown-content {
        display: block;
    }

    .perfil-grid {
        grid-template-columns: 1fr !important; 
        display: flex !important;
        flex-direction: column !important;
    }

    .card-perfil-fijo {
        position: static !important; /* Quitamos el sticky para que no flote sobre la tabla */
        width: 100% !important;
        box-sizing: border-box;
    }
}

.nav-list li a {
    display: block; /* O flex si necesitas centrar iconos */
    position: relative;
    z-index: 5; /* Prioridad para el puntero */
}
/* Estilos para el menú desplegable */
/* Contenedor principal de la navegación */
.nav {
    background-color: #2c3e50;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Lista de primer nivel */
.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* Alineación horizontal */
    align-items: center;
    flex-wrap: wrap; /* Para que sea responsive */
}

/* Elementos de la lista */
.nav ul li {
    position: relative; /* Crítico para que el dropdown se posicione respecto al padre */
}

/* Enlaces principales */
.nav ul li a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    font-weight: 500;
    transition: background 0.3s;
}

.nav ul li a:hover {
    background-color: #34495e;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #2c3e50; /* Color oscuro como tu cabecera */
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 0 0 5px 5px;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dropdown-content a:hover {
    background-color: #34495e;
}

/* Mostrar el menú al pasar el ratón */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Estilo para el botón padre cuando el menú está abierto */
.dropdown:hover .dropbtn {
    background-color: #34495e;
}

.dropbtn i {
    margin-left: 5px;
    font-size: 0.8rem;
}

/* CONTENEDORES UNIFICADOS */
.admin-container { max-width: 1100px; margin: 30px auto; padding: 0 20px; }

.card { 
    background: white; 
    padding: 25px; 
    border-radius: 8px; 
    margin-bottom: 25px; 
    box-shadow: 0 2px 15px rgba(0,0,0,0.05); 
    border: 1px solid #e1e4e8;
}

h2 { text-align: left;color: #2c3e50; margin-left: 15px;margin-top: 0; border-bottom: 2px solid #f1c40f; display: inline-block; padding-bottom: 5px; margin-bottom: 25px; }
h3 { text-align: left;margin-left: 15px;margin-top: 0; color: #34495e; font-size: 1.1rem; margin-bottom: 15px; }
h4 { text-align: left;margin-left: 15px;margin-top: 0; color: #34495e; font-size: 1.1rem; margin-bottom: 15px; }
h5 { text-align: left;margin-left: 15px;margin-top: 0; color: #f44f08; font-size: 1.1rem; margin-bottom: 15px; }

/* TABLAS UNIFICADAS */
.tabla-admin { width: 100%; border-collapse: collapse; margin-top: 10px; }
.tabla-admin th { background: #f8f9fa; color: #7f8c8d; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; padding: 12px; text-align: left; border-bottom: 2px solid #eee; }
.tabla-admin td { padding: 15px 12px; border-bottom: 1px solid #f1f1f1; vertical-align: middle; }
.tabla-admin tr:hover { background-color: #fcfcfc; }

/* FORMULARIOS UNIFICADOS */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
    width: 100%; padding: 10px; border: 1px solid #dcdde1; border-radius: 5px; box-sizing: border-box; font-size: 0.95rem; transition: 0.3s;
}
input:focus, select:focus { border-color: #3498db; outline: none; box-shadow: 0 0 5px rgba(52,152,219,0.2); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-row { display: flex; gap: 10px; margin-bottom: 10px; }

/* BOTONES */
/* BOTONES UNIFICADOS */
.btn-save, .btn-add, .btn-del, .btn-vaciar { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none; 
    padding: 10px 20px; 
    border-radius: 5px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 0.8rem;
    transition: 0.3s; 
    text-decoration: none; /* Por si se usan en enlaces <a> */
    height: 30px; /* Altura fija para que coincidan siempre */
    min-width: 80px;
    box-sizing: border-box;
}

/* Colores específicos manteniendo el tamaño */
.btn-save, .btn-add { 
    background: #27ae60; 
    color: white; 
}
.btn-save:hover, .btn-add:hover { 
    background: #219150; 
}

.btn-vaciar { 
    background: #33764f; 
    color: white; 
}
.btn-vaciar:hover { 
    background: #219150; 
}

.btn-del { 
    background: #e74c3c; /* Rojo para acciones de eliminar */
    color: white; 
}
.btn-del:hover { 
    background: #c0392b; 
}

/* BADGES Y ESTADOS */
.badge-count { background: #3498db; color: white; padding: 4px 10px; border-radius: 20px; font-size: 0.85rem; }
.badge-enabled { background: #3498db; color: white; padding: 4px 10px; border-radius: 20px; font-size: 0.85rem; }
.badge-disabled { background: #080e12; color: white; padding: 4px 10px; border-radius: 20px; font-size: 0.85rem; }
.tag-familia { background: #f1f2f6; color: #57606f; padding: 3px 8px; border-radius: 4px; font-size: 0.75rem; }
.status-disponible { color: #27ae60; font-weight: bold; }
.status-nodisponible { color: #e74c3c; font-weight: bold; }

.perfil-grid {
        display: grid;
        grid-template-columns: 350px 1fr;
        gap: 25px;
        align-items: start;
}

