@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

/* ── TIPOGRAFÍA (solo sidebar y header) ──────────────────────────────────── */
.sidebar, .main-header {
    font-family: 'Poppins', sans-serif !important;
}

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.skin-blue .main-header .navbar {
    background: linear-gradient(135deg, #e65c00 0%, #f39c12 100%) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}
.skin-blue .main-header .logo {
    background: linear-gradient(135deg, #c0390b 0%, #e65c00 100%) !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}
.skin-blue .main-header .logo:hover {
    background: linear-gradient(135deg, #a93008 0%, #cc4e00 100%) !important;
}
.skin-blue .main-header .navbar .nav > li > a {
    color: rgba(255,255,255,0.9) !important;
}
.skin-blue .main-header .navbar .nav > li > a:hover {
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
}

/* Alinear verticalmente campana / periodo / usuario: son 2 <li> distintos
   y cada uno traía su propio padding vertical (el de campana+periodo se
   centra con flex, pero el de usuario seguía con el padding-top/bottom
   por defecto de AdminLTE), por eso se veían a distinta altura. */
.main-header .navbar-custom-menu > .navbar-nav {
    display: flex !important;
    align-items: center !important;
}
.main-header .navbar-custom-menu > .navbar-nav > li {
    float: none !important;
}
.main-header .navbar .user-menu-toggle {
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ── FILA DERECHA DEL HEADER EN MÓVIL (campana + periodo + usuario) ──────
   .navbar-custom-menu no hace wrap (son floats de ancho fijo dentro de
   una fila de 50px), así que en celulares angostos la campanita/periodo/
   usuario se salen del ancho visible y quedan cortados. Se angosta cada
   pieza para que siempre quepan en una sola línea. */
@media (max-width: 480px) {
    .main-header .navbar-custom-menu { max-width: 76vw; }
    .notificacion-container { margin-right: 4px !important; }
    .icono-campana { font-size: 18px !important; }
    .periodo-btn {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }
    .periodo-btn span { padding-left: 3px !important; }
    /* Usuario: en vez de truncar el nombre con "...", se reemplaza por un
       ícono de persona; el nombre completo queda accesible como tooltip
       (title) al mantener presionado / pasar el mouse. */
    .main-header .navbar .user-menu-toggle {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .user-menu-icon {
        display: inline-block !important;
        font-size: 16px;
    }
    /* se oculta el nombre pero se deja la flechita como pista de que es
       un menú desplegable */
    .user-menu-text { font-size: 0; }
    .user-menu-text .caret { display: inline-block !important; font-size: 4px; margin-left: 4px; }
}
@media (min-width: 481px) {
    .user-menu-icon { display: none; }
}
/* El nombre del periodo (ej. "2026-2027") es información importante y debe
   verse siempre; en celulares muy angostos se le hace campo quitando la
   flecha del botón (el usuario ya va como ícono, ver arriba). */
@media (max-width: 360px) {
    .main-header .navbar-custom-menu { max-width: 74vw; }
    .periodo-btn { padding: 4px 6px !important; font-size: 10px !important; }
    .periodo-btn .caret { display: none; }
    .main-header .navbar .user-menu-toggle { padding-left: 6px !important; padding-right: 6px !important; }
}

/* ── SIDEBAR BASE ────────────────────────────────────────────────────────── */
.skin-blue .main-sidebar {
    background: #f0f2f5 !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}
.skin-blue .sidebar {
    background: #f0f2f5 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(100vh - 50px) !important;
    padding-bottom: 20px !important;
}

/* ── SIDEBAR EN MÓVIL ────────────────────────────────────────────────────
   En pantallas <=767px el header de AdminLTE mide 100px (dos filas), no
   50px como en escritorio. Además tener overflow-y:auto a la vez en
   .main-sidebar y en .sidebar (padre e hijo) hace que el scroll táctil se
   trabe y el menú se corte antes de llegar a las últimas opciones.
   Aquí dejamos a .main-sidebar como único contenedor con scroll, con su
   alto real (100vh - 100px del header), y el hijo .sidebar sin límite
   propio para que no compita por el gesto táctil. */
@media (max-width: 767px) {
    .skin-blue .main-sidebar {
        /* top:0 lo deja AdminLTE (su propio padding-top:100px ya reserva
           el espacio del header); si aquí también ponemos top:100px se
           pierden 100px de más y el menú se corta antes de tiempo. */
        bottom: 0 !important;
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .skin-blue .sidebar {
        max-height: none !important;
        overflow: visible !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ── BUSCADOR SIDEBAR ────────────────────────────────────────────────────── */
.sidebar-search-box {
    padding: 10px 12px 6px;
    position: relative;
}
.sidebar-search-box input {
    width: 100%;
    padding: 8px 34px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 12.5px;
    background: #fff;
    color: #374151;
    outline: none;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.sidebar-search-box input:focus {
    border-color: #f39c12;
}
.sidebar-search-box input::placeholder { color: #9ca3af; }
.sidebar-search-box .search-icon {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 13px;
    pointer-events: none;
}

/* ── SIDEBAR ITEMS ───────────────────────────────────────────────────────── */
.skin-blue .sidebar-menu > li > a {
    color: #2d3748 !important;
    border-left: none !important;
    background: #ffffff !important;
    margin: 4px 10px !important;
    border-radius: 14px !important;
    padding: 10px 14px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
    transition: all 0.2s ease !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
    width: auto !important;
}
.skin-blue .sidebar-menu > li > a:hover {
    background: #fff !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.13) !important;
    color: #1a202c !important;
    border-left: none !important;
}
.skin-blue .sidebar-menu > li.active > a,
.skin-blue .sidebar-menu > li.menu-open > a {
    background: #fff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
    color: #1a202c !important;
    border-left: none !important;
    border-radius: 14px 14px 0 0 !important;
}

/* ── CAJITAS DE ÍCONOS ───────────────────────────────────────────────────── */
.skin-blue .sidebar-menu > li > a > i:first-child {
    width: 24px !important;
    height: 24px !important;
    border-radius: 6px !important;
    display: inline-block !important;
    text-align: center !important;
    line-height: 24px !important;
    margin-right: 10px !important;
    font-size: 12px !important;
    color: #fff !important;
    background: #90a4ae !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}

/* Color de cajita por sección — especificidad alta para ganar al regla general */
.skin-blue .sidebar-menu > li.nav-escuela     > a > i:first-child { background: #42a5f5 !important; }
.skin-blue .sidebar-menu > li.nav-registro    > a > i:first-child { background: #ab47bc !important; }
.skin-blue .sidebar-menu > li.nav-matricula   > a > i:first-child { background: #26c6da !important; }
.skin-blue .sidebar-menu > li.nav-recaudacion > a > i:first-child { background: #43a047 !important; }
.skin-blue .sidebar-menu > li.nav-sri         > a > i:first-child { background: #ffa726 !important; }
.skin-blue .sidebar-menu > li.nav-cobranza    > a > i:first-child { background: #ef5350 !important; }
.skin-blue .sidebar-menu > li.nav-descuentos  > a > i:first-child { background: #ec407a !important; }
.skin-blue .sidebar-menu > li.nav-financiera  > a > i:first-child { background: #7986cb !important; }
.skin-blue .sidebar-menu > li.nav-reportes    > a > i:first-child { background: #00acc1 !important; }
.skin-blue .sidebar-menu > li.nav-asignaturas > a > i:first-child { background: #ff7043 !important; }
.skin-blue .sidebar-menu > li.nav-resumen     > a > i:first-child { background: #8d6e63 !important; }
.skin-blue .sidebar-menu > li.nav-notif       > a > i:first-child { background: #f9a825 !important; }
.skin-blue .sidebar-menu > li.nav-comporta    > a > i:first-child { background: #29b6f6 !important; }
.skin-blue .sidebar-menu > li.nav-bloqueos    > a > i:first-child { background: #e53935 !important; }
.skin-blue .sidebar-menu > li.nav-config      > a > i:first-child { background: #78909c !important; }

/* Teacher / Alumno / Parent nav colors */
.skin-blue .sidebar-menu > li.nav-inicio       > a > i:first-child { background: #42a5f5 !important; }
.skin-blue .sidebar-menu > li.nav-calific      > a > i:first-child { background: #ab47bc !important; }
.skin-blue .sidebar-menu > li.nav-asistencia   > a > i:first-child { background: #43a047 !important; }
.skin-blue .sidebar-menu > li.nav-horarios     > a > i:first-child { background: #26c6da !important; }
.skin-blue .sidebar-menu > li.nav-diario       > a > i:first-child { background: #ff7043 !important; }
.skin-blue .sidebar-menu > li.nav-leccionario  > a > i:first-child { background: #8d6e63 !important; }
.skin-blue .sidebar-menu > li.nav-tareas       > a > i:first-child { background: #ef5350 !important; }
.skin-blue .sidebar-menu > li.nav-evaluacion   > a > i:first-child { background: #7986cb !important; }
.skin-blue .sidebar-menu > li.nav-reuniones    > a > i:first-child { background: #00acc1 !important; }
.skin-blue .sidebar-menu > li.nav-deuda        > a > i:first-child { background: #e53935 !important; }
.skin-blue .sidebar-menu > li.nav-inasistencia > a > i:first-child { background: #78909c !important; }
.skin-blue .sidebar-menu > li.nav-perfil       > a > i:first-child { background: #607d8b !important; }
.skin-blue .sidebar-menu > li.nav-pagos        > a > i:first-child { background: #f9a825 !important; }
.skin-blue .sidebar-menu > li.nav-boletin      > a > i:first-child { background: #66bb6a !important; }
.skin-blue .sidebar-menu > li.nav-utiles       > a > i:first-child { background: #8d6e63 !important; }
.skin-blue .sidebar-menu > li.nav-dece         > a > i:first-child { background: #00acc1 !important; }
.skin-blue .sidebar-menu > li.nav-citas        > a > i:first-child { background: #ab47bc !important; }
.skin-blue .sidebar-menu > li.nav-datos        > a > i:first-child { background: #78909c !important; }

/* ── SECCIÓN HEADERS ─────────────────────────────────────────────────────── */
.skin-blue .sidebar-menu > li.header {
    color: #94a3b8 !important;
    background: transparent !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 1.8px !important;
    padding: 16px 22px 4px !important;
    text-transform: uppercase !important;
    font-family: 'Poppins', sans-serif !important;
}

/* ── SUBMENU ─────────────────────────────────────────────────────────────── */
.skin-blue .treeview-menu {
    background: #ffffff !important;
    margin: 0 10px !important;
    border-radius: 0 0 14px 14px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08) !important;
    padding: 4px 0 8px 0 !important;
}
.skin-blue .treeview-menu > li > a {
    color: #64748b !important;
    padding: 7px 14px 7px 8px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    margin: 1px 4px !important;
    transition: color 0.15s ease, background 0.15s ease !important;
    background: transparent !important;
}
.skin-blue .treeview-menu > li > a:hover {
    color: #e67e22 !important;
    background: #fff7ed !important;
    padding-left: 8px !important;
}
.skin-blue .treeview-menu > li.active > a {
    color: #e67e22 !important;
    background: #fff7ed !important;
}

/* ── SUBITEMS NOTIFICACIONES (ícono propio por opción) ───────────────────── */
.skin-blue .nav-notif .treeview-menu > li > a > i:first-child {
    width: 20px !important;
    height: 20px !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 8px !important;
    font-size: 10px !important;
    color: #fff !important;
    background: #90a4ae !important;
    flex-shrink: 0 !important;
}
.skin-blue .nav-notif .notif-estudiantes    > a > i:first-child { background: #42a5f5 !important; }
.skin-blue .nav-notif .notif-representantes > a > i:first-child { background: #ab47bc !important; }
.skin-blue .nav-notif .notif-individual     > a > i:first-child { background: #ec407a !important; }

/* ── FLECHA DEL TREEVIEW ─────────────────────────────────────────────────── */
.skin-blue .sidebar-menu .fa-angle-left,
.skin-blue .sidebar-menu .fa-angle-down {
    color: #94a3b8 !important;
    margin-left: auto !important;
    float: none !important;
}

/* ── SPAN DEL TEXTO DEL MENÚ ─────────────────────────────────────────────── */
.skin-blue .sidebar-menu > li > a > span:first-of-type {
    flex: 1 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
}

/* ── CONTENT WRAPPER ─────────────────────────────────────────────────────── */
.skin-blue .wrapper { background: #f0f2f5 !important; }
.content-wrapper    { background: #f0f2f5 !important; }

/* En móvil el header fijo mide 100px y el content-wrapper reserva
   exactamente eso (padding-top:100px, ver AdminLTE.css), así que el
   contenido arranca pegado al borde del header sin aire. Se agrega un
   colchón extra para que títulos y tarjetas no queden "pegados". */
@media (max-width: 767px) {
    .fixed .content-wrapper > .content {
        padding-top: 26px !important;
    }
}

/* ── FORMULARIOS DE AVISOS (Notificaciones: estudiantes / representantes / individual) ── */
.aviso-form-card { border-radius: 10px; }
.aviso-field-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 18px;
}
.aviso-field { flex: 1 1 100%; min-width: 220px; }
.aviso-field-half { flex: 1 1 calc(50% - 9px); min-width: 220px; }
.aviso-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #546e7a;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px;
}
.aviso-field .form-control {
    border: 1.5px solid #e0e7ef !important;
    border-radius: 7px !important;
    background: #f4f8fd !important;
}
.aviso-field select.form-control,
.aviso-field input.form-control { height: 38px !important; }
.aviso-actions { margin-top: 4px; }

/* select2 (curso / representante): mismo lenguaje visual que los inputs del formulario */
.aviso-field .select2-container { width: 100% !important; }
.aviso-field .select2-selection--single {
    height: 38px !important;
    border: 1.5px solid #e0e7ef !important;
    border-radius: 7px !important;
    display: flex !important;
    align-items: center !important;
    background: #f4f8fd !important;
}
.aviso-field .select2-selection__rendered {
    line-height: normal !important;
    padding-left: 10px !important;
    color: #1e293b !important;
    font-size: 13px !important;
}
.aviso-field .select2-selection__arrow { height: 36px !important; }
.aviso-field .select2-container--open .select2-selection--single {
    border-color: #307ecc !important;
    box-shadow: 0 0 0 3px rgba(48,126,204,.15) !important;
}
.select2-dropdown {
    border: 1.5px solid #e0e7ef !important;
    border-radius: 7px !important;
    box-shadow: 0 6px 20px rgba(21,101,192,.14) !important;
    overflow: hidden;
}
.select2-search--dropdown { padding: 8px !important; background: #fff; }
.select2-search--dropdown .select2-search__field {
    border: 1.5px solid #e0e7ef !important;
    border-radius: 7px !important;
    padding: 6px 10px !important;
    outline: none !important;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.main-footer {
    border-top: 1px solid #e0e0e0 !important;
    background: #fff !important;
    font-size: 12px !important;
    color: #90a4ae !important;
}
