/* ===== RESET Y ESTILOS BASE ===== */
@import url("components/menu.css");
@import url("components/module-menu.css");
@import url("components/cards.css");
@import url("components/forms.css");
@import url("components/buttons.css");
@import url("modules/sistema.css");
@import url("responsive/responsive.css");

:root {

    /* ===== IDENTIDAD REDI =====
       --header-height: la recalcula el script al final de
       includes/footer.php en cuanto carga cada pagina, midiendo el
       <header> real (11-oct-2026) -- asi el menu lateral nunca
       se cruza con el header, tenga el header 5 o 6 lineas (con
       Subarea). Este 156px es solo el valor de respaldo para el
       primer instante, antes de que corra ese script. */

    --header-height: 156px;

    --color-primario: #004C8C;
    --color-secundario: #1A535C;
    --color-acento: #00838F;
    --color-claro: #81D4FA;

    /* ===== Neutros ===== */

    --color-fondo: #F4F8FB;
    --color-superficie: #FFFFFF;
    --color-texto: #243447;
    --color-texto-secundario: #607D8B;
    --color-borde: #D9E2EC;

    /* ===== Estados ===== */

    --color-exito: #2E7D32;
    --color-advertencia: #F9A825;
    --color-error: #C62828;

    /* ===== Menú ===== */

    --menu-fondo: var(--color-primario);
    --menu-hover: #003A6A;

    /* ===== Botones ===== */

    --btn-primario: var(--color-primario);
    --btn-primario-hover: #003A6A;

    --btn-secundario: var(--color-secundario);
    --btn-secundario-hover: #133E45;

    /* ===== Tabs ===== */

    --tab-active: var(--color-acento);
    --tab-hover: var(--color-claro);
    --tab-border: var(--color-acento);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    height: 100%;
}

body {
    width: 100%;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background-color: var(--color-primario);
    color: #333;
    margin: 0;
}


a {
    color: #7584a8;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
}
h2 {color:var(--color-primario);}
a:hover {
    background: #FFF;
}
.select-m {
    width: 100%;
    min-width: 120px;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    margin: 10px 0 20px;
    background-color: white;
    transition: border-color 0.3s;
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
}
/* ===== HEADER ===== */
header {
    background-color: #fff;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 10px;
    color: #113ea7;
    border-bottom:solid 1px var(--color-primario);
}

header > img {
    width: 100px;
    object-fit: cover;
}
.radio-text{
    display:none;
}
.encabezado{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.encabezado h2{
    margin: 8px 0;
    color: #2F3E58;
    font-weight: 600;
}

.logo-redi{
    display: block;
    margin: 20px auto;
}
#menu-user ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#logout-link {
    color: #b4a497;
    font-weight: normal;
}
.tabla-fija {
    table-layout: fixed;
    width: 100%;
}

.col-nombre {
    width: 60%;
}

.col-estado {
    width: 20%;
    text-align: center;
}

.col-accion {
    width: 20%;
    text-align: center;
}

.form-inline {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.form-inline-catalogo .fila-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.campo-corto {
    max-width: 220px;
}

.campo-largo {
    min-width: 300px;
    flex: 1;
}

.check-asistencia {
    white-space: nowrap;
    font-size: 0.9em;
}

.btn-pequeno {
    padding: 6px 10px;
}

.input-inline {
    flex: 1;
}

.btn-inline {
    width: auto !important;
    display: inline-block !important;
    white-space: nowrap;
    min-width: auto !important;
}
.btn-verde {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-verde:hover {
    background-color: #218838;
}

.btn-rojo {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-activar {
    background-color: #2e7d32;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-eliminar {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-guardar {
    background-color: #1565c0;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
}
.btn-guardar-a {
    background-color: #1565c0;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    width: 60%;
}

.btn-rojo:hover {
    background-color: #c82333;
}


.estado-activo { color: #28a745; font-weight: bold; }
.estado-inactivo { color: #dc3545; font-weight: bold; }
.titulo-modulo {
    margin-bottom: 20px;
}

.exportar-container {
    margin-top: 20px;
    text-align: right;
}

.btn-exportar {
    padding: 8px 18px;
    background-color: #182951;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-exportar:hover {
    background-color: #1f3470;
}

.subtitulo {
    color: #666;
    margin-bottom: 20px;
}

.form-comunicado .campo {
    margin-bottom: 18px;
}

.form-comunicado label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.form-comunicado input,
.form-comunicado textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
}

.form-comunicado textarea {
    resize: vertical;
}

.info-envio {
    background: #f0f7ff;
    padding: 10px;
    border-left: 4px solid #007bff;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
}

.btn-enviar {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-enviar:hover {
    background: #218838;
}
/* FILTROS */
.form-filtros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    align-items: end;
}

.campo label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
}

.btn-principal {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-principal:hover {
    background: #45a049;
}

/* MÉTRICAS */
.grid-metricas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.metrica h3 {
    font-size: 14px;
    margin-bottom: 5px;
}

.metrica .valor {
    font-size: 24px;
    font-weight: bold;
}

/* TABLA */
.tabla-reporte {
    width: 100%;
    border-collapse: collapse;
}

.tabla-reporte th,
.tabla-reporte td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: center;
}
/* ===== LAYOUT PRINCIPAL ===== */
main {
    display: flex;
    width: 100%;
    min-height: calc(80vh - 140px);
    flex: 1;
}
.lateral {
    position: fixed;
    left: 0;
    top: var(--header-height); /* altura real del header, medida por JS -- ver header-height.js */
    background: var(--color-primario);
    z-index: 100;
    overflow-y: auto;
    transition: all 0.3s ease;

    margin-left: 0; /* Elimina el margen del contenedor */
    box-sizing: border-box;
    width: max(15%, 200px);
    padding-top: 30px;
    height: calc(100vh - var(--header-height));

}
.lateral a, .lateral li, .lateral .menu-item {
    color: white;
    padding: 10px 15px;
    transition: background-color 0.3s ease;
}
.lateral a:hover, 
.lateral li:hover, 
.lateral .menu-item:hover {
    background-color: #071433; /* Un 20-30% m谩s oscuro que el fondo original */
    color: white !important; /* Asegura que el texto se mantenga legible */
box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    background: #f8f9fa;
}
.tabs::-webkit-scrollbar {
    height: 6px;
}
  .tabs-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tabs::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}
.tab-button {
    padding: 12px 20px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}
.tab-button:hover {
    background: var(--tab-hover) !important;
}

.tab-button.active {
    background: var(--tab-active) !important;
    color: white !important;
    position: relative;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-primario);
}


.tab-content {
    padding: 20px;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
}
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-warning {
    color: #8a6d3b;
    background-color: #fcf8e3;
    border-color: #faebcc;
}
.observacion-truncada {
    cursor: pointer;
    color: #0066cc;
    text-decoration: underline;
    display: inline-block;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.observacion-truncada:hover {
    color: #0066cc;
    text-decoration: underline;
}
/* Separador entre form y resumen */
.separador {
    width: 100%;
    margin: 20px 0;
    border: none;
    border-top: 2px solid #ddd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ocultar radios */
.tabs input[type="radio"] {
    display: none;
}

/* botones */
.tabs label {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    background: #06d0ff;
    color: #333;
    border-radius: 8px 8px 0 0;
    transition: all 0.25s ease;
}

/* hover alegre */
.tabs label:hover {
    background: #94abce;
}

/* ACTIVO */
.tabs input[type="radio"]:checked + label {
    background: var(--color-primario);
    color: white;
}

/* CONTENIDO */
.tab-contenido {
    display: none;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* mostrar contenido activo */
.tabs input[type="radio"]:checked + label + .tab-contenido {
    display: block;
}
.total-seccion {
    margin: 10px 0 15px 0;
    padding: 10px 14px;
    background: #f0f7ff;
    border-left: 5px solid #0d6efd;
    font-weight: 600;
    max-width: 300px;
}
.con-lecciones {
    background-color: #e6f4ea;
    border-color: #2e7d32;
    font-weight: 600;
}
/* Mostrar contenido activo */


/* Tabla resumen */
.tabla-resumen {
    width: 100%;
    border-collapse: collapse;
}

.tabla-resumen th,
.tabla-resumen td {
    padding: 8px;
    vertical-align: middle;
}

.tabla-resumen th:nth-last-child(1),
.tabla-resumen td:nth-last-child(1) {
    width: 120px;
    text-align: center;
}

.tabla-resumen th:nth-last-child(2),
.tabla-resumen td:nth-last-child(2) {
    width: 100px;
    text-align: center;
}

.fila-ausencia:hover {
    background: #f8fafc;
}

.input-obs {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.btn-justificar {
    background: #16a34a;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-justificar:hover {
    background: #15803d;
}
.titulo-tabs {
    margin-top: 10px;
}
/* ==========================================================
   MÓDULO COMEDOR
   ========================================================== */
#btnAutorizar{
    background:#28a745 !important;
    border-color:#28a745 !important;
    color:#fff !important;
}
#btnAutorizar:hover{
    background:#218838;
}

#btnCancelar{
    background:#dc3545 !important;
    border-color:#dc3545 !important;
    color:#fff !important;
}
#btnCancelar:hover{
    background:#c82333;
}

#mensaje-comedor{

    min-height:70px;
    text-align:center;
    font-size:22px;
    font-weight:bold;

}
.comedor-card{

    width:850px;
    margin:30px auto;
    border:2px solid #dcdcdc;
    border-radius:10px;
    background:#fff;
    padding:25px;

    display:flex;
    justify-content:space-between;
    align-items:flex-start;

    box-shadow:0 2px 8px rgba(0,0,0,.15);

}

.datos-estudiante{

    width:55%;

}

.datos-estudiante h2{

    margin-top:0;
    margin-bottom:25px;
    font-size:34px;

}

.datos-estudiante p{

    font-size:22px;
    margin-bottom:18px;

}

.lado-derecho{

    width:35%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;

}

#foto{

    width:220px;
    height:220px;
    object-fit:cover;
    border-radius:8px;
    border:2px solid #ccc;

}

#panel-autorizacion{

    margin-top:20px;

}

#panel-autorizacion button{

    width:150px;
    margin:5px;

}
.ok{

    font-size:70px;
    color:#28a745;

}

.error{

    font-size:70px;
    color:#dc3545;

}

/* ==========================================================
   MÓDULO CONTROL DE ACCESO
   ========================================================== */
.acceso-terminal{
    text-align:center;
    margin-bottom:10px;
}

.acceso-terminal input{
    width:320px;
    max-width:90%;
    padding:8px 10px;
    font-size:16px;
    border:1px solid #ccc;
    border-radius:6px;
}

.acceso-layout{
    display:flex;
    flex-wrap:wrap;
    gap:20px;
    align-items:flex-start;
    justify-content:center;
}

.acceso-card{
    width:560px;
    max-width:100%;
    margin:10px 0;
    border:2px solid #dcdcdc;
    border-radius:10px;
    background:#fff;
    padding:25px;
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    box-shadow:0 2px 8px rgba(0,0,0,.15);
}

.datos-acceso{
    width:60%;
}

.datos-acceso h2{
    margin-top:0;
    margin-bottom:20px;
    font-size:26px;
}

.datos-acceso p{
    font-size:16px;
    margin-bottom:12px;
}

.lado-derecho-acceso{
    width:35%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
}

#foto-acceso{
    width:160px;
    height:160px;
    object-fit:cover;
    border-radius:8px;
    border:2px solid #ccc;
}

#mensaje-acceso{
    min-height:50px;
    text-align:center;
    font-size:18px;
    font-weight:bold;
    margin-top:10px;
}

#mensaje-acceso .ok.salida{
    color:#d68910;
}

.error-texto{
    color:#dc3545;
    font-size:16px;
}

.bitacora-panel{
    width:400px;
    max-width:100%;
    border:1px solid #e0e0e0;
    border-radius:10px;
    background:#fafbfc;
    padding:15px 18px;
    max-height:520px;
    overflow-y:auto;
}

.bitacora-panel h3{
    margin-top:0;
    font-size:16px;
    color:#555;
}

#bitacora-lista{
    list-style:none;
    margin:0;
    padding:0;
}

#bitacora-lista li{
    display:flex;
    align-items:center;
    gap:8px;
    padding:8px 0;
    border-bottom:1px solid #eee;
    font-size:13.5px;
}

.bitacora-nombre{
    flex:1;
}

.bitacora-nombre small{
    color:#888;
}

.bitacora-hora{
    color:#777;
    font-variant-numeric:tabular-nums;
}

.badge-tipo{
    display:inline-block;
    padding:2px 8px;
    border-radius:10px;
    font-size:11px;
    font-weight:600;
    color:#fff;
    white-space:nowrap;
}

.badge-tipo.badge-entrada{
    background:#1a7a4c;
}

.badge-tipo.badge-salida{
    background:#d68910;
}

/* Portal del encargado (18-oct-2026) */
.badge-tipo.badge-verificado{
    background:#1a7a4c;
}

.badge-tipo.badge-pendiente{
    background:#999;
}

.btn-corregir{
    background:none;
    border:1px solid #dc3545;
    color:#dc3545;
    border-radius:4px;
    padding:2px 8px;
    font-size:11px;
    cursor:pointer;
}

.btn-corregir:hover{
    background:#dc3545;
    color:#fff;
}

/* ==========================================================
   MÓDULO NOTAS
   ========================================================== */
.toolbar-notas{
    display:flex;
    flex-wrap:wrap;
    gap:16px;
    align-items:flex-end;
    margin-bottom:14px;
}

.toolbar-notas .form-group{
    margin-bottom:0;
}

.resumen-config{
    background:#f5f7fb;
    border:1px solid #e0e0e0;
    border-radius:8px;
    padding:10px 14px;
    font-size:13.5px;
    color:#444;
    margin-bottom:18px;
}

.tarjetas-notas{
    display:flex;
    flex-wrap:wrap;
    gap:14px;
}

.tarjeta-notas{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;
    width:150px;
    height:110px;
    border:1px solid #dcdcdc;
    border-radius:10px;
    background:#fff;
    text-decoration:none;
    color:#333;
    font-weight:600;
    font-size:13.5px;
    text-align:center;
    box-shadow:0 1px 4px rgba(0,0,0,.08);
    transition:box-shadow .15s ease, transform .15s ease;
}

.tarjeta-notas:hover{
    box-shadow:0 3px 10px rgba(0,0,0,.15);
    transform:translateY(-1px);
}

.tarjeta-notas-icono{
    font-size:28px;
}

.tarjeta-notas-pendiente{
    opacity:0.55;
    cursor:default;
    pointer-events:none;
}

.tarjeta-notas-pendiente small{
    font-weight:400;
    color:#888;
}

.grid-rubros{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
    gap:14px;
    max-width:900px;
}

.suma-rubros{
    font-weight:600;
    margin:6px 0 20px;
}

.form-config-rubros{
    max-width:900px;
}

.modal-observacion {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-contenido {
    background-color: #f8f9fa;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #ddd;
    width: 60%;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
}

.cerrar-modal {
    color: #aaa;
    position: absolute;
    right: 15px;
    top: 5px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.cerrar-modal:hover {
    color: #333;
}
.alerta-confirmacion {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 6px;
    gap: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 520px;
}

.acciones-confirmacion form {
    margin: 0;
}

.btn-confirmar,
.btn-cancelar {
    width: auto;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    border: none;
}

.alerta-confirmacion p {
    margin: 0;
    font-size: 14px;
}



.btn-confirmar {
    background: #dc3545;
    color: #fff;
}

.btn-cancelar {
    background: #6c757d;
    color: #fff;
}



/* Efecto para m贸viles */
.asistencia-celda {
    text-align: center;
    vertical-align: top;
}

.lecciones-box {
    margin-top: 6px;
}

.lecciones-box select {
    width: 100%;
    padding: 3px;
    font-size: 0.9em;
}
.asistencia-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.asistencia-box select {
    margin-top: 4px;
    width: 55px;
}
.sugerencias-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-top: none;
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}



.sugerencia-item:hover {
    background-color: #f0f6f6;
}

.sugerencia-sec {
    font-size: 12px;
    color: #6c757d;
}

/* ====== ESTADOS DE ASISTENCIA ====== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    min-width: 250px;
    padding: 12px 18px;
    margin-bottom: 10px;
    border-radius: 6px;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #4CAF50;
}

.toast.error {
    background-color: #d9534f;
}

/* ===============================
   ESTADOS DE ASISTENCIA
=============================== */

.asis-presente {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.asis-a-parcial {
    background: #fff3e0;
    color: #ef6c00;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.asis-a-grave {
    background: #fdecea;
    color: #c62828;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
}

.asis-tarde {
    background: #fffde7;
    color: #8d6e00;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.asis-justificado {
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.asis-nr {
    background: #eceff1;
    color: #37474f;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}
/* =========================================================
   FORMULARIO REPORTE DE ASISTENCIA
   ========================================================= */

.form-reporte {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-sizing: border-box;
}

.form-reporte .form-row {
    display: flex;
    width: 100%;
    gap: 15px;
    margin: 0 0 16px 0;
    padding: 0;
    flex-wrap: nowrap;
}

.form-reporte .form-row > div {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
}

.form-reporte .form-row.fechas {
    max-width: 420px;
}

.form-reporte label {
    display: block;
    width: 100%;
    margin-bottom: 0;
    text-align: center;
}

.form-reporte input,
.form-reporte select {
    width: 100%;
}

