/* =========================================================
   VARIABLES
========================================================= */

:root{
    --burdeo:#6d1b2b;
    --burdeo-oscuro:#4f1020;
    --burdeo-claro:#8a2336;
    --dorado:#c9a24a;
    --fondo:#f5f6fa;
    --texto:#1f2937;
    --gris:#6b7280;
    --borde:#e5e7eb;
    --blanco:#ffffff;
    --sombra:0 12px 30px rgba(31,41,55,.10);
    --radio:18px;
}

/* =========================================================
   BASE
========================================================= */

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:'Segoe UI',Roboto,Arial,sans-serif;
    background:linear-gradient(180deg,#fafafa 0%,var(--fondo) 100%);
    color:var(--texto);
}

a{
    color:inherit;
}

.hidden{
    display:none!important;
}

/* =========================================================
   HEADER
========================================================= */

.app-header{
    background:linear-gradient(135deg,var(--burdeo-oscuro),var(--burdeo));
    color:white;
    padding:14px 26px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:12px;
    box-shadow:0 8px 22px rgba(79,16,32,.22);
    position:sticky;
    top:0;
    z-index:30;
}

.app-brand{
    display:flex;
    align-items:center;
    gap:12px;
}

.app-brand strong{
    display:block;
    font-size:19px;
}

.app-brand small{
    display:block;
    opacity:.85;
}

.app-logo{
    width:42px;
    height:42px;
    border-radius:12px;
    background:rgba(255,255,255,.14);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.18);
}

.app-logo img{
    width:100%;
    height:100%;
    object-fit:contain;
    padding:4px;
}

.app-userbar{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    font-size:14px;
}

.app-userbar span,
.app-userbar a{
    background:rgba(255,255,255,.13);
    color:white;
    text-decoration:none;
    padding:8px 12px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.14);
    font-weight:600;
}

.app-userbar a:hover{
    background:rgba(255,255,255,.22);
}

/* =========================================================
   MENU
========================================================= */

.app-menu{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    align-items:center;
    padding:12px 26px;
    background:white;
    border-bottom:1px solid var(--borde);
    box-shadow:0 6px 18px rgba(31,41,55,.06);
    position:sticky;
    top:70px;
    z-index:25;
}

.app-menu a{
    text-decoration:none;
    padding:9px 12px;
    border-radius:999px;
    color:#374151;
    font-weight:700;
}

.app-menu a:hover,
.app-menu a.active{
    background:#fff4f5;
    color:var(--burdeo);
}

/* =========================================================
   CONTENEDORES
========================================================= */

.container,
.wrap,
.contenido,
.main{
    width:min(1180px,calc(100% - 32px));
    margin:0 auto;
    padding:28px 0;
}

/* =========================================================
   HERO
========================================================= */

.page-hero{
    background:linear-gradient(135deg,#fff 0%,#fff7f4 100%);
    border:1px solid #f0e4e5;
    border-radius:24px;
    padding:26px;
    margin-bottom:22px;
    box-shadow:var(--sombra);
}

.page-hero h1,
.page-hero h2{
    margin:0 0 8px;
    color:var(--burdeo-oscuro);
}

.page-hero p{
    margin:0;
    color:var(--gris);
}

/* =========================================================
   PANELES / CARDS
========================================================= */

.panel,
.box,
.card{
    background:var(--blanco);
    border:1px solid var(--borde);
    border-radius:var(--radio);
    box-shadow:var(--sombra);
}

.panel{
    padding:24px;
    margin-bottom:24px;
}

.grid,
.module-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:22px;
    margin-top:24px;
}

.card{
    padding:28px;
    min-height:190px;
    transition:.2s ease;
    text-align:left;
    position:relative;
    overflow:hidden;
    text-decoration:none!important;
    color:var(--texto)!important;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;
}

.card::before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:5px;
    background:var(--burdeo);
}

.card:hover{
    transform:translateY(-3px);
    box-shadow:0 16px 34px rgba(31,41,55,.14);
}

.card,
.card *{
    text-decoration:none!important;
}

.icon{
    font-size:42px;
    margin-bottom:14px;
    line-height:1;
}

.card h3{
    margin:0 0 10px;
    color:var(--burdeo-oscuro);
    font-size:22px;
    font-weight:800;
}

.card p{
    margin:0;
    color:var(--gris);
    line-height:1.5;
    font-size:15px;
}
.note-box{
    background:#fff8e6;
    border:1px solid #ffe2ad;
    color:#7a4a00;
    padding:14px 16px;
    border-radius:14px;
    margin-bottom:20px;
    font-weight:700;
}

.reserva-dia-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:20px;
    flex-wrap:wrap;
    margin-bottom:22px;
}

.reserva-dia-title{
    margin:0 0 6px;
    color:var(--burdeo-oscuro);
}

.reserva-dia-subtitle{
    margin:0;
    color:var(--gris);
}

.reserva-leyenda{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:20px;
}

.legend-item{
    background:#f3f4f6;
    border-radius:999px;
    padding:8px 14px;
    font-size:14px;
    font-weight:700;
}

.reserva-dia-table{
    min-width:1000px;
}

.reserva-dia-bloque{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.reserva-dia-hora{
    font-size:13px;
    font-weight:700;
}

.reserva-dia-numero{
    font-size:12px;
    opacity:.85;
}

.slot{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;
    border-radius:12px;
    padding:12px;
    text-decoration:none!important;
    font-weight:700;
    min-height:80px;
}

.slot small{
    font-size:12px;
}

.slot-libre{
    background:#dcfce7;
    color:#166534!important;
}

.slot-mio{
    background:#dbeafe;
    color:#1d4ed8!important;
}

.slot-ocupado{
    background:#fee2e2;
    color:#991b1b!important;
}

.btn-delete{
    margin-top:8px;
    display:inline-flex;
    justify-content:center;
    width:100%;
    padding:6px 10px;
    border-radius:10px;
    background:#dc2626;
    color:white!important;
    text-decoration:none!important;
    font-size:13px;
    font-weight:700;
}

/* =========================================================
   COLORES POR MÓDULO
========================================================= */

.reservas::before{background:#2563eb}
.atrasos::before{background:#f59e0b}
.visitas::before{background:#7c3aed}
.asistencia::before{background:#16a34a}
.alumnos::before{background:#0891b2}
.usuarios::before{background:#795548}
.convivencia::before{background:#9333ea}
.tickets::before{background:#ea580c}

/* =========================================================
   BOTONES / ACCIONES
========================================================= */

.actions,
.menu,
.menu-asistencia,
.menu-visitas{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin:0 0 18px;
}

.btn,
button,
input[type=submit],
.button,
.actions a,
.actions button,
.menu a,
.menu-asistencia a,
.menu-visitas a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:10px 16px;
    background:linear-gradient(135deg,var(--burdeo),var(--burdeo-claro));
    color:white!important;
    border:none;
    border-radius:12px;
    text-decoration:none!important;
    font-weight:700;
    cursor:pointer;
    box-shadow:0 8px 16px rgba(109,27,43,.18);
}

.btn:hover,
button:hover,
input[type=submit]:hover,
.button:hover,
.actions a:hover,
.actions button:hover,
.menu a:hover{
    filter:brightness(1.06);
    transform:translateY(-1px);
}

/* =========================================================
   FORMULARIOS
========================================================= */

label{
    font-weight:700;
    color:#374151;
    font-size:14px;
}

input,
select,
textarea{
    width:100%;
    padding:11px 12px;
    border:1px solid #d7dce3;
    border-radius:12px;
    background:white;
    font-size:15px;
    outline:none;
    margin:6px 0 14px;
}

input:focus,
select:focus,
textarea:focus{
    border-color:var(--burdeo);
    box-shadow:0 0 0 4px rgba(109,27,43,.10);
}

.filters{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:12px;
    align-items:end;
    background:transparent!important;
    border:none!important;
    box-shadow:none!important;
    padding:0!important;
    margin:0 0 24px!important;
}

/* =========================================================
   TABLAS
========================================================= */

.table-responsive{
    width:100%;
    overflow-x:auto;
}

table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    background:white;
    border-radius:16px;
    overflow:hidden;
    box-shadow:var(--sombra);
    border:1px solid var(--borde);
}

th{
    background:var(--burdeo);
    color:white;
    text-align:left;
    padding:13px;
    font-size:14px;
}

td{
    padding:12px 13px;
    border-bottom:1px solid var(--borde);
    color:#374151;
}

tr:last-child td{
    border-bottom:none;
}

tr:nth-child(even) td{
    background:#fafafa;
}

/* =========================================================
   ALERTAS
========================================================= */

.alert,
.mensaje,
.error,
.success{
    border-radius:14px;
    padding:13px 15px;
    margin:14px 0;
    font-weight:600;
}

.alert,
.mensaje{
    border:1px solid #ffe2ad;
    background:#fff8e6;
    color:#7a4a00;
}

.error{
    border:1px solid #fecaca;
    background:#fff1f2;
    color:#991b1b;
}

.success{
    border:1px solid #bbf7d0;
    background:#f0fdf4;
    color:#166534;
}

/* =========================================================
   BADGES / ESTADOS
========================================================= */

.badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 12px;
    border-radius:999px;
    background:#f3f4f6;
    color:var(--burdeo);
    font-size:13px;
    font-weight:800;
}

.estado-ok{
    color:#166534;
    font-weight:700;
}

.estado-alerta{
    color:#b45309;
    font-weight:700;
}

.estado-error{
    color:#991b1b;
    font-weight:700;
}

.estado-presente{
    background:#dcfce7!important;
    color:#166534!important;
    font-weight:700;
}

.estado-ausente{
    background:#fee2e2!important;
    color:#991b1b!important;
    font-weight:700;
}

.estado-atraso{
    background:#fef3c7!important;
    color:#92400e!important;
    font-weight:700;
}

.estado-justificado{
    background:#dbeafe!important;
    color:#1d4ed8!important;
    font-weight:700;
}

/* =========================================================
   STATS
========================================================= */

.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:16px;
    margin:20px 0 24px;
}

.stat-card{
    background:white;
    border:1px solid var(--borde);
    border-radius:18px;
    padding:20px;
    box-shadow:var(--sombra);
}

.stat-card h3{
    margin:0 0 6px;
    font-size:30px;
    color:var(--burdeo);
    font-weight:900;
}

.stat-card p{
    margin:0;
    color:var(--gris);
    font-weight:600;
}

/* =========================================================
   LEYENDAS
========================================================= */

.legend{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin:14px 0 20px;
}

.legend span{
    padding:8px 12px;
    border-radius:10px;
}

/* =========================================================
   LIBRO ASISTENCIA
========================================================= */

.libro-table{
    border-collapse:separate;
    font-size:12px;
    min-width:980px;
}

.libro-table th,
.libro-table td{
    padding:7px;
    text-align:center;
    border-bottom:1px solid #e5e7eb;
}

.sticky-col{
    position:sticky;
    left:0;
    background:white!important;
    z-index:2;
    min-width:240px;
    text-align:left!important;
}

/* =========================================================
   CREDENCIALES QR
========================================================= */

.cred-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(310px,1fr));
    gap:20px;
    margin-top:20px;
}

.cred-card{
    background:white;
    border-radius:18px;
    overflow:hidden;
    border:2px solid var(--burdeo);
    box-shadow:var(--sombra);
    page-break-inside:avoid;
}

.cred-top{
    background:var(--burdeo);
    color:white;
    padding:14px;
    text-align:center;
}

.cred-logo{
    width:68px;
    height:68px;
    object-fit:contain;
    background:white;
    border-radius:12px;
    padding:6px;
    margin-bottom:8px;
}

.cred-school{
    font-weight:700;
    font-size:15px;
}

.cred-content{
    padding:20px;
    text-align:center;
}

.cred-nombre{
    font-size:20px;
    font-weight:800;
    color:#111827;
    line-height:1.25;
    text-transform:uppercase;
}

.cred-curso{
    margin-top:8px;
    color:var(--burdeo);
    font-weight:700;
    font-size:17px;
}

.cred-rut{
    margin-top:8px;
    color:#374151;
    font-size:14px;
}

.cred-qr img{
    margin-top:16px;
    width:170px;
    height:170px;
}

.cred-individual{
    margin-top:16px;
}

/* =========================================================
   PANTALLA ATRASOS
========================================================= */

.pantalla-body{
    margin:0;
    background:#111827;
    color:white;
    font-family:'Segoe UI', Arial, sans-serif;
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    text-align:center;
    overflow:hidden;
}

.pantalla-logo{
    position:absolute;
    top:24px;
    left:24px;
    width:120px;
    max-height:120px;
    object-fit:contain;
}

.pantalla-box{
    width:90%;
    max-width:1400px;
}

.pantalla-titulo{
    font-size:72px;
    font-weight:900;
    color:#22c55e;
    margin-bottom:18px;
}

.pantalla-espera{
    color:#60a5fa;
}

.pantalla-nombre{
    font-size:92px;
    font-weight:900;
    line-height:1.05;
    margin-top:20px;
}

.pantalla-curso{
    font-size:54px;
    color:#fde047;
    margin-top:24px;
    font-weight:800;
}

.pantalla-hora{
    font-size:42px;
    margin-top:24px;
    color:#d1d5db;
    font-weight:700;
}

.pantalla-footer{
    position:absolute;
    bottom:22px;
    width:100%;
    text-align:center;
    color:#9ca3af;
    font-size:20px;
    font-weight:600;
}

/* =========================================================
   UTILIDADES
========================================================= */

.mt-10{margin-top:10px}
.mt-20{margin-top:20px}
.mb-10{margin-bottom:10px}
.mb-20{margin-bottom:20px}
.text-center{text-align:center}
.w-100{width:100%}
.flex{display:flex}
.flex-wrap{flex-wrap:wrap}
.gap-10{gap:10px}
.gap-20{gap:20px}

/* =========================================================
   FOOTER
========================================================= */

.app-footer{
    text-align:center;
    color:#6b7280;
    padding:28px 16px;
    font-size:13px;
}

/* =========================================================
   IMPRESIÓN
========================================================= */

@media print{

    .app-header,
    .app-menu,
    .actions,
    .no-print{
        display:none!important;
    }

    body{
        background:white;
    }

    .container,
    .wrap,
    .contenido,
    .main{
        width:100%;
        padding:0;
    }

    .card,
    table,
    .panel{
        box-shadow:none;
    }

    .cred-individual,
    .stats-grid{
        display:none!important;
    }

    .cred-grid{
        grid-template-columns:repeat(3,1fr);
        gap:10px;
    }

    .cred-card{
        box-shadow:none;
    }

    .sticky-col{
        position:static;
    }

    .libro-table{
        font-size:10px;
    }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media(max-width:1000px){

    .pantalla-titulo{
        font-size:48px;
    }

    .pantalla-nombre{
        font-size:58px;
    }

    .pantalla-curso{
        font-size:38px;
    }

    .pantalla-hora{
        font-size:28px;
    }
}

@media(max-width:720px){

    .app-header{
        padding:12px 14px;
    }

    .app-userbar{
        width:100%;
        justify-content:flex-start;
    }

    .app-menu{
        top:auto;
        position:relative;
        padding:10px 12px;
    }

    .container,
    .wrap,
    .contenido,
    .main{
        width:calc(100% - 22px);
        padding:18px 0;
    }

    .page-hero{
        padding:18px;
    }

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

    .actions{
        flex-direction:column;
    }

    .actions a,
    .actions button{
        width:100%;
    }

    table{
        font-size:13px;
        display:block;
        overflow-x:auto;
        white-space:nowrap;
    }

    .app-userbar span,
    .app-userbar a{
        font-size:13px;
        padding:7px 10px;
    }

    .pantalla-logo{
        width:80px;
    }

    .pantalla-titulo{
        font-size:34px;
    }

    .pantalla-nombre{
        font-size:40px;
    }

    .pantalla-curso{
        font-size:28px;
    }

    .pantalla-hora{
        font-size:22px;
    }

    .pantalla-footer{
        font-size:14px;
    }
}

/* =========================================================
   ASISTENCIA COMPACTA
========================================================= */

.asis-opciones.compacta{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:8px;
    min-width:620px;
}

.asis-opciones.compacta .asis-opcion{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;

    border:1px solid #d1d5db;
    border-radius:12px;

    padding:10px 12px;

    background:white;

    font-size:13px;
    font-weight:700;

    cursor:pointer;

    transition:.18s ease;
}

.asis-opciones.compacta .asis-opcion:hover{
    transform:translateY(-1px);
}

.asis-opciones.compacta .asis-opcion input{
    display:none;
}

.asis-opcion.presente:has(input:checked){
    background:#dcfce7;
    color:#166534;
    border-color:#16a34a;
}

.asis-opcion.ausente:has(input:checked){
    background:#fee2e2;
    color:#991b1b;
    border-color:#dc2626;
}

.asis-opcion.atraso:has(input:checked){
    background:#fef3c7;
    color:#92400e;
    border-color:#f59e0b;
}

.asis-opcion.justificado:has(input:checked){
    background:#dbeafe;
    color:#1d4ed8;
    border-color:#2563eb;
}

@media(max-width:900px){

    .asis-opciones.compacta{
        grid-template-columns:repeat(2,1fr);
        min-width:auto;
    }
}
/* =========================================================
   ASISTENCIA - TOMAR
========================================================= */

.asis-registro{
    background:white;
    border-radius:22px;
    overflow:hidden;
    box-shadow:var(--sombra);
    border:1px solid var(--borde);
}

.asis-registro-head{
    background:var(--burdeo);
    color:white;
    padding:22px;
}

.asis-registro-head h2{
    margin:0;
}

.asis-info{
    display:flex;
    gap:16px;
    flex-wrap:wrap;
    margin-top:10px;
}

.asis-buscador{
    width:100%;
    max-width:360px;
}

.asis-nombre strong{
    color:#111827;
}

.asis-footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    padding:18px;
    border-top:1px solid var(--borde);
    background:#fafafa;
}

/* BOTONES COMPACTOS DE ASISTENCIA */

.asis-opciones.compacta{
    display:grid;
    grid-template-columns:repeat(4,minmax(115px,1fr));
    gap:8px;
    min-width:600px;
}

.asis-opciones.compacta .asis-opcion{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:10px 12px;
    border:1px solid #d1d5db;
    border-radius:12px;
    background:white;
    font-size:13px;
    font-weight:700;
    cursor:pointer;
    transition:.15s ease;
    user-select:none;
}

.asis-opciones.compacta input{
    display:none;
}

.asis-opcion.seleccionado.presente{
    background:#dcfce7;
    border-color:#16a34a;
    color:#166534;
}

.asis-opcion.seleccionado.ausente{
    background:#fee2e2;
    border-color:#dc2626;
    color:#991b1b;
}

.asis-opcion.seleccionado.atraso{
    background:#fef3c7;
    border-color:#f59e0b;
    color:#92400e;
}

.asis-opcion.seleccionado.justificado{
    background:#dbeafe;
    border-color:#2563eb;
    color:#1d4ed8;
}

@media(max-width:900px){

    .asis-opciones.compacta{
        grid-template-columns:repeat(2,1fr);
        min-width:auto;
    }

    .asis-footer{
        flex-direction:column;
        align-items:stretch;
    }

    .asis-footer button{
        width:100%;
    }
}
/* =====================================================
   RESERVAS
===================================================== */

.reserva-dia-table{
    width:100%;
    border-collapse:collapse;
    overflow:hidden;
    border-radius:22px;
    background:white;
}

.reserva-dia-table th{
    background:var(--primary);
    color:white;
    padding:18px 14px;
    font-size:15px;
    font-weight:800;
    text-align:center;
}

.reserva-dia-table td{
    border-bottom:1px solid #eceff3;
    padding:14px 10px;
    text-align:center;
    vertical-align:middle;
}

.reserva-dia-table tr:last-child td{
    border-bottom:none;
}

.reserva-dia-table th:first-child{
    width:210px;
}

.reserva-dia-bloque{
    display:flex;
    flex-direction:column;
    gap:4px;
    align-items:flex-start;
}

.reserva-dia-hora{
    font-size:16px;
    font-weight:800;
    color:white;
}

.reserva-dia-numero{
    font-size:13px;
    opacity:.9;
    color:#f3f4f6;
}

/* SLOT */

.slot{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    min-height:72px;
    border-radius:16px;
    text-decoration:none;
    font-weight:700;
    transition:.18s ease;
    padding:10px;
}

.slot small{
    font-size:12px;
    font-weight:600;
}

/* LIBRE */

.slot-libre{
    background:#ecfdf3;
    color:#166534;
}

.slot-libre:hover{
    background:#dcfce7;
    transform:translateY(-2px);
}

/* MIA */

.slot-mio{
    background:#dbeafe;
    color:#1d4ed8;
}

/* OCUPADO */

.slot-ocupado{
    background:#fee2e2;
    color:#991b1b;
}

/* ELIMINAR */

.btn-delete{
    display:inline-block;
    margin-top:8px;
    font-size:12px;
    font-weight:700;
    color:#b91c1c;
    text-decoration:none;
}

.btn-delete:hover{
    text-decoration:underline;
}

/* LEYENDA */

.reserva-leyenda{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:18px;
}

.legend-item{
    background:white;
    border:1px solid #e5e7eb;
    border-radius:999px;
    padding:8px 14px;
    font-size:13px;
    font-weight:700;
}

/* HEADER */

.reserva-dia-header{
    display:flex;
    justify-content:space-between;
    align-items:end;
    gap:18px;
    flex-wrap:wrap;
    margin-bottom:20px;
}

.reserva-dia-title{
    margin:0;
    color:var(--primary);
}

.reserva-dia-subtitle{
    margin-top:6px;
    color:#6b7280;
}

/* MOBILE */

@media(max-width:1100px){

    .table-responsive{
        overflow-x:auto;
    }

    .reserva-dia-table{
        min-width:1000px;
    }
}
/* =====================================================
   FIX RESERVAS TABLA DIARIA
===================================================== */

.reserva-dia-table th{
    background:var(--burdeo)!important;
    color:white!important;
}

.reserva-dia-table th:first-child{
    background:var(--burdeo)!important;
    color:white!important;
    width:220px;
}

.reserva-dia-table td:first-child,
.reserva-dia-table th:first-child{
    background:var(--burdeo)!important;
    color:white!important;
    font-weight:900;
}

.reserva-dia-bloque{
    color:white!important;
}

.reserva-dia-hora{
    color:white!important;
    font-size:17px;
    font-weight:900;
}

.reserva-dia-numero{
    color:white!important;
    opacity:.95;
    font-size:13px;
    font-weight:700;
}

.reserva-dia-table td{
    background:#ffffff!important;
    padding:14px!important;
}

.slot{
    text-decoration:none!important;
}

.slot-libre{
    background:#ecfdf3!important;
    color:#166534!important;
    border:1px solid #bbf7d0!important;
}

.slot-libre:hover{
    background:#dcfce7!important;
}
/* =========================================
   FORMULARIOS PÚBLICOS
========================================= */

.public-body{
    margin:0;
    min-height:100vh;
    background:#eef1f5;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    box-sizing:border-box;
    font-family:'Segoe UI', Arial, sans-serif;
}

.public-card{
    width:100%;
    max-width:520px;
    background:#ffffff;
    border-radius:18px;
    padding:32px;
    box-shadow:0 10px 30px rgba(0,0,0,0.08);
    box-sizing:border-box;
}

.public-logo{
    text-align:center;
    margin-bottom:18px;
}

.public-logo img{
    max-width:110px;
    height:auto;
}

.public-card h1{
    margin:0 0 10px;
    text-align:center;
    color:#1e293b;
    font-size:28px;
    font-weight:700;
}

.public-card p{
    margin:0 0 24px;
    text-align:center;
    color:#64748b;
    line-height:1.5;
}

.public-card form{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.public-card label{
    font-size:14px;
    font-weight:600;
    color:#334155;
}

.public-card input,
.public-card textarea{
    width:100%;
    padding:13px 14px;
    border:1px solid #cbd5e1;
    border-radius:12px;
    font-size:15px;
    background:#ffffff;
    transition:0.2s ease;
    box-sizing:border-box;
}

.public-card input:focus,
.public-card textarea:focus{
    outline:none;
    border-color:#6d1b2b;
    box-shadow:0 0 0 3px rgba(109,27,43,0.12);
}

.public-card textarea{
    resize:vertical;
    min-height:110px;
}

.public-helper{
    margin-top:-6px;
    font-size:13px;
    color:#64748b;
}

.public-btn{
    width:100%;
    margin-top:10px;
    padding:14px;
    border:none;
    border-radius:12px;
    background:#6d1b2b;
    color:#ffffff;
    font-size:15px;
    font-weight:700;
    cursor:pointer;
    transition:0.2s ease;
}

.public-btn:hover{
    background:#581521;
}

.public-alert{
    padding:14px;
    border-radius:12px;
    margin-bottom:20px;
    text-align:center;
    font-weight:600;
}

.public-alert.ok{
    background:#e8f5e9;
    color:#2e7d32;
}

.public-alert.error{
    background:#fdecea;
    color:#b71c1c;
}

/* RESPONSIVE */

@media(max-width:640px){

    .public-body{
        padding:14px;
    }

    .public-card{
        padding:24px;
        border-radius:16px;
    }

    .public-card h1{
        font-size:24px;
    }

}
.btn-outline-danger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:10px 16px;
    border:2px solid #7a1830;
    border-radius:10px;
    background:#ffffff;
    color:#7a1830;
    font-weight:700;
    text-decoration:none;
    white-space:nowrap;
    transition:0.2s ease;
}

.btn-outline-danger:hover{
    background:#7a1830;
    color:#ffffff;
    text-decoration:none;
}
.btn-outline-danger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:10px 16px;
    border:2px solid #7a1830;
    border-radius:10px;
    background:#ffffff;
    color:#7a1830 !important;
    font-weight:700;
    text-decoration:none !important;
    white-space:nowrap;
    transition:0.2s ease;
}

.btn-outline-danger:hover{
    background:#7a1830;
    color:#ffffff !important;
}

.btn-outline-danger:visited{
    color:#7a1830 !important;
}
/* ==============================
   USUARIOS
============================== */

.usuarios-filtros{
    margin-bottom:24px;
    max-width:100%;
}

.filter-submit{
    display:flex;
    align-items:end;
}

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

.btn-small{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    padding:8px 12px;
    border-radius:10px;
    background:#7a1830;
    color:#ffffff !important;
    font-size:14px;
    font-weight:700;
    text-decoration:none !important;
    border:1px solid #7a1830;
    transition:0.2s ease;
}

.btn-small:hover{
    background:#5d1023;
    color:#ffffff !important;
}

.btn-light{
    background:#ffffff;
    color:#7a1830 !important;
    border:1px solid #7a1830;
}

.btn-light:hover{
    background:#7a1830;
    color:#ffffff !important;
}

.badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:7px 14px;
    border-radius:999px;
    font-size:14px;
    font-weight:700;
}

.badge-role{
    background:#f4f4f5;
    color:#7a1830;
}

.badge-ok{
    background:#f4f4f5;
    color:#7a1830;
}

.badge-bad{
    background:#fdecea;
    color:#b71c1c;
}
.usuario-edit-form{
    max-width:720px;
}

.form-submit{
    display:flex;
    align-items:end;
}

.note-box{
    margin-top:20px;
    padding:14px 16px;
    border-radius:12px;
    background:#f8fafc;
    color:#475569;
    border:1px solid #e2e8f0;
}
.detail-box{
    margin:20px 0;
}

.detail-content{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:12px;
    padding:16px;
    margin-bottom:22px;
    line-height:1.6;
}

.detail-footer{
    color:#64748b;
    font-size:14px;
}
.comprobante{
    margin-top:40px;
    border-top:2px dashed #cbd5e1;
    padding-top:28px;
}

.firmas{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:50px;
    margin-top:55px;
}

.linea-firma{
    border-top:1px solid #111827;
    height:1px;
}

.firmas p{
    text-align:center;
    margin-top:8px;
    font-size:14px;
    color:#475569;
}

@media print{
    .comprobante{
        break-inside:avoid;
        page-break-inside:avoid;
    }
}
.comprobante{
    margin-top:50px;
    border-top:2px dashed #cbd5e1;
    padding-top:30px;
}

.comprobante p{
    line-height:1.7;
}

.firmas{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:70px;
    margin-top:70px;
}

.firma-box{
    text-align:center;
}

.linea-firma{
    width:100%;
    border-top:2px solid #111827;
    margin-bottom:10px;
}

.firma-box p{
    margin:0;
    font-size:14px;
    color:#475569;
    font-weight:600;
}

@media print{

    .comprobante{
        break-inside:avoid;
        page-break-inside:avoid;
    }

}
.form-sheet{
    max-width:950px;
    margin:0 auto;
}

.form-sheet-header{
    border-bottom:1px solid #e2e8f0;
    margin-bottom:24px;
    padding-bottom:16px;
}

.form-sheet-header h2{
    margin:0 0 6px;
}

.form-sheet-header p{
    margin:0;
    color:#64748b;
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:18px 22px;
}

.form-grid label{
    display:flex;
    flex-direction:column;
    gap:7px;
    font-weight:600;
}

.form-grid input,
.form-grid select,
.form-grid textarea{
    width:100%;
    box-sizing:border-box;
}

.form-grid textarea{
    min-height:130px;
    resize:vertical;
}

.form-grid .full{
    grid-column:1 / -1;
}

@media(max-width:760px){
    .form-grid{
        grid-template-columns:1fr;
    }
}
.panel-spacing{
    margin-top:24px;
}

.detail-content{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:12px;
    padding:16px;
    margin-bottom:22px;
    line-height:1.6;
}

.detail-footer{
    color:#64748b;
    font-size:14px;
}
.ficha-compacta .panel{
    padding:18px;
}

.ficha-compacta h2{
    font-size:20px;
    margin-bottom:8px;
}

.ficha-compacta h3{
    font-size:16px;
    margin:10px 0 8px;
}

.ficha-compacta .stats-grid{
    gap:10px;
    margin-top:12px;
}

.ficha-compacta .stat-card{
    padding:12px;
}

.ficha-compacta .stat-card span{
    font-size:12px;
}

.ficha-compacta .stat-card strong{
    font-size:18px;
}

.ficha-compacta table th,
.ficha-compacta table td{
    padding:7px 9px;
    font-size:13px;
}

.ficha-compacta .panel-spacing{
    margin-top:14px;
}

/* =========================================================
   MENÚ LATERAL
========================================================= */

.app-sidebar{
    position:fixed;
    top:74px;
    left:0;
    width:250px;
    height:calc(100vh - 74px);
    background:white;
    border-right:1px solid var(--borde);
    box-shadow:8px 0 24px rgba(31,41,55,.08);
    z-index:24;
    overflow-y:auto;
    padding:18px 14px;
    transition:.2s ease;
}

.sidebar-title{
    padding:12px 14px 18px;
    border-bottom:1px solid var(--borde);
    margin-bottom:12px;
}

.sidebar-title strong{
    display:block;
    color:var(--burdeo-oscuro);
    font-size:17px;
}

.sidebar-title small{
    color:var(--gris);
    font-size:13px;
}

.sidebar-menu{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.sidebar-menu a{
    display:flex;
    align-items:center;
    gap:9px;
    padding:11px 13px;
    border-radius:12px;
    color:#374151;
    text-decoration:none;
    font-weight:750;
    transition:var(--transicion);
}

.sidebar-menu a:hover,
.sidebar-menu a.active{
    background:#fff4f5;
    color:var(--burdeo);
}

.sidebar-toggle{
    position:fixed;
    top:88px;
    left:260px;
    z-index:40;
    width:42px;
    height:42px;
    border-radius:12px;
    padding:0;
    background:linear-gradient(135deg,var(--burdeo),var(--burdeo-claro));
    color:white;
    box-shadow:var(--sombra);
}

/* Ajuste del contenido cuando hay sidebar */

body:not(.sidebar-collapsed) .container,
body:not(.sidebar-collapsed) .wrap,
body:not(.sidebar-collapsed) .contenido,
body:not(.sidebar-collapsed) .main{
    margin-left:280px;
    width:calc(100% - 312px);
}

/* Sidebar cerrado */

body.sidebar-collapsed .app-sidebar{
    transform:translateX(-260px);
}

body.sidebar-collapsed .sidebar-toggle{
    left:18px;
}

body.sidebar-collapsed .container,
body.sidebar-collapsed .wrap,
body.sidebar-collapsed .contenido,
body.sidebar-collapsed .main{
    margin-left:auto;
    margin-right:auto;
    width:min(1180px,calc(100% - 32px));
}

/* Ocultar menú horizontal antiguo si aún existe */

.app-menu{
    display:none!important;
}

/* Responsive */

@media(max-width:900px){

    .app-sidebar{
        top:0;
        height:100vh;
        transform:translateX(-260px);
        z-index:60;
    }

    body:not(.sidebar-collapsed) .app-sidebar{
        transform:translateX(0);
    }

    .sidebar-toggle{
        top:86px;
        left:18px;
        z-index:70;
    }

    body:not(.sidebar-collapsed) .container,
    body:not(.sidebar-collapsed) .wrap,
    body:not(.sidebar-collapsed) .contenido,
    body:not(.sidebar-collapsed) .main,
    body.sidebar-collapsed .container,
    body.sidebar-collapsed .wrap,
    body.sidebar-collapsed .contenido,
    body.sidebar-collapsed .main{
        margin-left:auto;
        margin-right:auto;
        width:calc(100% - 22px);
    }
}
/* =========================================================
   CAMBIO CONTRASEÑA
========================================================= */

.auth-container{
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:24px;
}

.auth-card{
    width:min(420px,100%);
    background:white;
    border-radius:22px;
    padding:34px;
    box-shadow:0 20px 40px rgba(0,0,0,.08);
    border:1px solid #edf0f5;
}

.auth-card h1{
    margin:0 0 12px;
    color:var(--burdeo-oscuro);
}

.auth-card p{
    margin:0 0 24px;
    color:var(--gris);
}

.auth-card form{
    display:flex;
    flex-direction:column;
    gap:18px;
}

.auth-card label{
    display:flex;
    flex-direction:column;
    gap:8px;
    font-weight:700;
}

.auth-card input{
    width:100%;
}

.auth-card button{
    margin-top:10px;
}

.reserva-dia-table td {
    height: 220px;
    vertical-align: top;
}

.slot {
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    text-align: center;
    border-radius: 10px;
}
/* =====================================
   RESERVAS - ALTURA UNIFORME
===================================== */

.reserva-dia-table td {
    vertical-align: top;
    min-height: 180px;
    height: 180px;
}

.reserva-dia-table .slot {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.reserva-dia-table td form {
    margin-top: 8px;
}

.reserva-dia-table td small {
    display: block;
    line-height: 1.2;
}

.reserva-dia-table th,
.reserva-dia-table td {
    width: 180px;
}

/* =====================================
   USUARIOS - BOTONES ACCIONES
===================================== */

.table-actions{
    display:flex !important;
    gap:5px;
    flex-wrap:nowrap;
    justify-content:center;
}

.table-actions .btn-small{
    padding:6px 8px;
    font-size:12px;
    border-radius:6px;
}


/* ==========================
   PIE - BOTONES ACCIONES
========================== */

.pie-action-buttons{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    justify-content:center;
    align-items:center;
    gap:4px;
}

.pie-action-buttons a{
    flex:0 0 auto;
}

.btn-icon{
    width:32px;
    height:32px;
    min-width:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:6px;
    border:1px solid #d1d5db;
    background:#fff;
    text-decoration:none !important;
    font-size:16px;
    padding:0;
}

td.acciones-pie{
    min-width:170px;
    width:170px;
    white-space:nowrap;
}

.sidebar-section{
    padding:12px 16px 6px;
    margin-top:10px;
    font-size:11px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:1px;
    color:#9aa4b2;
    border-top:1px solid rgba(255,255,255,.08);
}
/* =========================================================
   JUNAEB - AJUSTE VISUAL EDUCONTROL
========================================================= */

.junaeb-stats .stat-card{
    min-height:120px;
}

.junaeb-panel-title{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:16px;
    flex-wrap:wrap;
    margin-bottom:18px;
}

.junaeb-panel-title h2{
    margin:0 0 6px;
    color:var(--burdeo-oscuro);
}

.junaeb-panel-title p{
    margin:0;
    color:var(--gris);
}

.junaeb-form-panel{
    padding:22px;
}

.junaeb-search-form{
    display:grid;
    grid-template-columns:minmax(260px,420px) minmax(180px,260px) auto;
    gap:16px;
    align-items:end;
}

.rut-junaeb{
    max-width:420px;
    font-size:22px;
    font-weight:800;
    letter-spacing:.5px;
}

.junaeb-form-actions{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
    margin-bottom:14px;
}

.junaeb-alumno-card{
    padding:24px;
}

.junaeb-alumno-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:16px;
    flex-wrap:wrap;
    margin-bottom:18px;
    padding-bottom:16px;
    border-bottom:1px solid var(--borde);
}

.junaeb-alumno-head h2{
    margin:0 0 8px;
    color:var(--burdeo-oscuro);
}

.junaeb-alumno-head p{
    margin:0;
    color:#374151;
}

.junaeb-registro-form{
    max-width:620px;
}

.junaeb-main-submit{
    font-size:18px;
    padding:14px 20px;
    margin-top:6px;
}

.estado-junaeb-presente,
.estado-junaeb-ausente,
.estado-junaeb-no-corresponde{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 12px;
    border-radius:999px;
    font-weight:800;
    font-size:13px;
    white-space:nowrap;
}

.estado-junaeb-presente{
    background:#dcfce7;
    color:#166534;
}

.estado-junaeb-ausente{
    background:#fee2e2;
    color:#991b1b;
}

.estado-junaeb-no-corresponde{
    background:#fef3c7;
    color:#92400e;
}

@media(max-width:900px){
    .junaeb-search-form{
        grid-template-columns:1fr;
    }

    .junaeb-form-actions,
    .junaeb-form-actions a,
    .junaeb-form-actions button,
    .junaeb-main-submit{
        width:100%;
    }
}

.dashboard-stat{
    font-size:38px;
    font-weight:900;
    color:var(--burdeo);
    margin:10px 0;
    line-height:1;
}

.module-card.biblioteca{
    position:relative;
}

.module-card.biblioteca::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:5px;
    background:#2563eb;
}

.portada-preview{
    margin-top:18px;
    padding:18px;
    border-radius:18px;
    background:#fff7f9;
    border:1px solid rgba(128,0,32,.16);
    display:inline-block;
}

.portada-preview h3{
    margin:0 0 12px;
    color:var(--burdeo);
}

.portada-preview img{
    max-height:260px;
    max-width:180px;
    border-radius:12px;
    box-shadow:0 10px 24px rgba(0,0,0,.22);
    background:#fff;
}