/* Paleta de Colores Moderna (Rojo) */
:root {
  --primary-color: #cc2936; /* Rojo institucional moderno */
  --accent-color: #e74c3c; /* Rojo brillante para acentos/hover */
  --text-color: #333333; /* Gris oscuro para texto */
  --light-bg: #f8f8f8; /* Gris claro para fondos alternos */
  --white: #ffffff; /* Blanco */
  --max-width: 1200px;
}

html {
  /* Habilita el desplazamiento suave al hacer clic en los enlaces de ancla */
  scroll-behavior: smooth;
  /* CLAVE: Define un "relleno" superior para el scroll, dejando espacio para el header fijo. */
  scroll-padding-top: 135px; /* Debe ser igual al padding-top del body */
}


/* === SOLUCIÓN DEFINITIVA: CABECERA FIJA === */

/* 1. Fijamos el bloque completo de la cabecera a la parte superior */
#page-header {
  position: fixed; /* Fija el elemento a la ventana del navegador */
  top: 0;          /* Lo pega a la parte superior */
  left: 0;         /* Lo pega a la izquierda */
  width: 100%;     /* Hace que ocupe todo el ancho */
  z-index: 1000;   /* Se asegura que esté por encima de todo */
}

/* 2. Empujamos TODO el contenido del body hacia abajo */
body {
  /* VALOR CLAVE: La altura de tu cabecera. AJÚSTALA si es necesario. */
  padding-top: 135px; 
}

/* Estilos Globales y Tipografía */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { /* Reglas movidas para unificar */
    font-family: 'Open Sans', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--white);
    font-weight: 400;
}

.container {
    width: 90%;
    max-width: var(--max-width);
    margin: auto;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease-in-out;
}

ul {
    list-style: none;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

/* --- BARRA SUPERIOR (Top Bar) --- */
.top-bar {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.9rem;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info span {
    margin-right: 20px;
}
.contact-info i {
    margin-right: 5px;
}
.social-media a {
    color: var(--white);
    font-weight: 600;
    margin-left: 15px;
}
.social-media a:hover {
    color: var(--light-bg);
}

/* --- Cabecera Principal (Header) --- */
.main-header {
    background: var(--white);
    padding: 15px 0;
    /* LIMPIEZA: Quitamos el 'sticky' porque ahora el contenedor padre es 'fixed' */
    /* position: sticky; */
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); /* Sombra elegante */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
}

.school-logo {
    width: 60px; 
    height: auto;
    margin-right: 15px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0;
    color: var(--text-color); 
}

.tagline-header {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: -5px;
}

/* Navegación */
.main-nav ul {
    display: flex;
    gap: 20px; 
}

.main-nav ul li a {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 5px 0;
    border-bottom: 3px solid transparent;
}

.main-nav ul li a:hover {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.nav-cta {
    /* Destacar el link de Admisión */
    color: var(--white) !important;
    background-color: var(--primary-color);
    padding: 8px 15px !important;
    border-radius: 5px;
    border: none !important;
}

.nav-cta:hover {
    background-color: var(--accent-color);
    border: none !important;
    transform: none; /* Elimina la transformación de la base */
}

/* --- Sección Principal (Hero) --- */
.hero {
    /* IMPORTANTE: Reemplaza 'hero-image.jpg' con tu imagen (alta calidad) */
    background: url('../assets/hero-image.jpg') no-repeat center center/cover;
    /* Usamos min-height para asegurar que se vea bien en pantallas pequeñas */
    min-height: 80vh; 
    position: relative;
    display: flex;
    align-items: center;
    text-align: center;
    overflow: hidden; /* CLAVE: Oculta cualquier parte del video que se desborde */
}

/* Estilos para el video de fondo */
#hero-video-background {
    position: absolute; /* Posicionamiento absoluto dentro de .hero */
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 1; /* Asegura que esté detrás del overlay y el contenido */
    transform: translate(-50%, -50%); /* Centra el video */
    object-fit: cover; /* Asegura que el video cubra todo el contenedor sin distorsión */
}

#hero-video-background.hero-video-disabled {
    display: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* El overlay ahora va POR ENCIMA del video, para oscurecerlo */
    background: rgba(0, 0, 0, 0.6); /* Negro con 60% de opacidad. Ajusta este valor para más o menos oscuridad */
    z-index: 2; /* Asegura que el overlay esté por encima del video */
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    max-width: 1000px;
    margin: 0 auto;
    /* Centrar el contenido verticalmente y añadir espacio para el header */
    padding-top: 110px; /* Ajusta este valor si es necesario */
    transform: translateY(-20px);
}

.hero-pretitle {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    margin-bottom: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.8;
}

.hero-title {
    font-size: 5rem;
    font-weight: 900;
    color: var(--white);
    line-height: 1.1;
    text-shadow: 0 5px 10px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--accent-color); /* Rojo de acento para la frase principal */
    margin-bottom: 40px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Botón CTA (Call to Action) */
.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 18px 45px;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 50px; /* Botón completamente redondeado, muy moderno */
    transition: all 0.3s ease-in-out;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.cta-button:hover {
    background: var(--accent-color); 
    transform: translateY(-3px); /* Efecto 3D sutil */
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

/* --- Secciones de Información --- */
.info-section {
    padding: 80px 0; 
    text-align: center;
    overflow-x: hidden; /* CLAVE: Aplicamos la regla aquí para no afectar los botones */
}

.info-section.light-bg {
    background-color: var(--light-bg);
}

.info-section h3 {
    font-size: 3rem; 
    margin-bottom: 40px;
    position: relative;
}

.info-section h3::after { /* Underline moderno */
    content: '';
    display: block;
    width: 80px;
    height: 5px;
    background: var(--accent-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

.info-section p {
    font-size: 1.1rem;
    max-width: 900px;
    margin: 0 auto 1.5rem;
}

/* --- Pie de Página (Footer) --- */
.main-footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 25px 0;
    font-size: 0.95rem;
}

/* --- Media Queries (Responsividad para Móviles) --- */
@media (max-width: 1050px) {
    .main-nav ul {
        gap: 15px;
    }
}

@media (max-width: 900px) {
    /* Encabezado y Barra Superior en móviles */
    .top-bar-content {
        flex-direction: column;
        text-align: center;
    }
    .contact-info {
        margin-bottom: 5px;
    }
    .contact-info span {
        display: block;
        margin: 5px 0;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .main-nav {
        margin-top: 15px;
        width: 100%;
    }
    .main-nav ul {
        justify-content: space-around;
        width: 100%;
        flex-wrap: wrap;
    }
    .main-nav ul li a {
        font-size: 0.9rem;
        padding: 5px 0;
    }
    .nav-cta {
        margin: 10px 0;
        display: block; /* Ocupa todo el ancho si hay espacio */
    }

    /* Hero en móviles */
    .hero {
        height: 60vh;
    }
    .hero-title {
        font-size: 3rem;
    }
    .hero-subtitle {
        font-size: 1.3rem;
    }
    .cta-button {
        padding: 15px 35px;
        font-size: 1.1rem;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .info-section h3 {
        font-size: 2.2rem;
    }
}

/* --- Estilos para el Carrusel Swiper.js --- */
.my-carousel {
    width: 50%;
    height: 400px; /* Aumentamos la altura para dar más espacio a las imágenes */
    border-radius: 15px;
    margin: 40px auto 0; /* Centramos el carrusel horizontalmente */
    margin-top: 40px;
}

.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}
.my-carousel .swiper-slide {
    width: 80%; /* Cada slide ocupará el 80% del contenedor del carrusel */
}

.swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Esta es la clave para que las imágenes no se distorsionen */
    object-position: center top; /* CLAVE: Alinea la imagen desde arriba para no cortar cabezas */
}

/* Personalizamos los colores de las flechas de navegación */
.swiper-button-next, .swiper-button-prev {
    color: var(--primary-color); /* Usamos el color principal de la web */
}

/* --- Estilos de Login (Diseño Corporativo y Limpio) --- */

/* Mejoras visuales del carrusel */
.my-carousel-shell {
    position: relative;
    width: min(100%, 1120px);
    margin: 48px auto 0;
    padding: 28px 28px 76px;
    border-radius: 34px;
    background:
        radial-gradient(circle at top center, rgba(231, 76, 60, 0.16), transparent 28%),
        linear-gradient(180deg, #171717 0%, #222222 100%);
    box-shadow: 0 34px 80px rgba(18, 9, 9, 0.28);
}

.my-carousel-shell::after {
    content: '';
    position: absolute;
    inset: auto 10% 20px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.34), transparent 72%);
    filter: blur(24px);
    opacity: 0.8;
    pointer-events: none;
}

.my-carousel {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 28px;
}

.my-carousel .swiper-wrapper {
    align-items: stretch;
}

.my-carousel .swiper-slide {
    width: 100%;
    height: auto;
    background: transparent;
    transition: opacity 1.1s ease;
}

.carousel-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 28px;
    background: #080808;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.carousel-card::before {
    content: '';
    position: absolute;
    inset: -5%;
    background-image: var(--slide-image);
    background-size: cover;
    background-position: center;
    filter: blur(30px) saturate(1.1);
    transform: scale(1.16);
    opacity: 0.62;
}

.carousel-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(5, 5, 5, 0.03) 0%, rgba(5, 5, 5, 0.16) 100%),
        radial-gradient(circle at center, transparent 58%, rgba(0, 0, 0, 0.24) 100%);
    pointer-events: none;
}

.carousel-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 1.6vw, 18px);
}

.my-carousel .swiper-slide .carousel-photo {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    object-fit: contain !important;
    object-position: center center !important;
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    transform: none;
    transition: filter 0.9s ease, box-shadow 0.35s ease;
}

.my-carousel .swiper-slide-active .carousel-photo {
    box-shadow: 0 22px 46px rgba(0, 0, 0, 0.34);
}

.my-carousel .swiper-button-next,
.my-carousel .swiper-button-prev {
    width: 52px;
    height: 52px;
    top: 50%;
    margin-top: 0;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.58);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(10px);
    transform: translateY(-50%);
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.my-carousel .swiper-button-next:hover,
.my-carousel .swiper-button-prev:hover {
    transform: translateY(-50%) scale(1.06);
    background: rgba(204, 41, 54, 0.9);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
}

.my-carousel .swiper-button-prev {
    left: 18px;
}

.my-carousel .swiper-button-next {
    right: 18px;
}

.my-carousel .swiper-button-next::after,
.my-carousel .swiper-button-prev::after {
    font-size: 1rem;
    font-weight: 800;
}

.my-carousel .swiper-pagination {
    bottom: 18px !important;
}

.my-carousel .swiper-pagination-bullet {
    width: 11px;
    height: 11px;
    background: rgba(255, 255, 255, 0.28);
    opacity: 1;
    transition: transform 0.25s ease, background-color 0.25s ease, width 0.25s ease;
}

.my-carousel .swiper-pagination-bullet-active {
    width: 34px;
    border-radius: 999px;
    background: #ffffff;
    transform: translateY(-1px);
}

@media (max-width: 1024px) {
    .my-carousel-shell {
        padding: 24px 24px 72px;
    }

    .my-carousel .swiper-button-prev {
        left: 16px;
    }

    .my-carousel .swiper-button-next {
        right: 16px;
    }
}

@media (max-width: 768px) {
    .my-carousel-shell {
        padding: 18px 18px 62px;
        border-radius: 24px;
    }

    .my-carousel .swiper-button-next,
    .my-carousel .swiper-button-prev {
        width: 46px;
        height: 46px;
    }
}

@media (max-width: 540px) {
    .my-carousel-shell {
        padding: 16px 12px 56px;
    }

    .carousel-card {
        aspect-ratio: 4 / 5;
        border-radius: 22px;
    }

    .my-carousel .swiper-button-next,
    .my-carousel .swiper-button-prev {
        display: none;
    }
}

.login-page-background {
    background-color: var(--light-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    padding-top: 0; /* Sobrescribimos el padding-top general del body */
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background-color: var(--white);
    padding: 30px 40px 40px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    border-top: 5px solid var(--primary-color); /* Borde superior con color institucional */
}

.login-logo {
    margin-bottom: 15px;
}

.login-logo img {
    width: 65px;
    height: auto;
}

.login-box h2 {
    margin-bottom: 10px;
    font-size: 1.8rem;
    color: var(--text-color);
}

.login-box p {
    margin-bottom: 35px;
    color: #777;
    font-size: 1rem;
}

.input-group {
    margin-bottom: 20px; /* Reducimos el margen al quitar los labels */
    text-align: left;
}

.input-group input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(204, 41, 54, 0.15);
}

.login-button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.login-button:hover {
    background-color: var(--accent-color);
}

.login-footer {
    margin-top: 25px;
    font-size: 0.9rem;
}

.login-footer a {
    color: #555;
    margin: 0 10px;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Estilo para el mensaje de error */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* --- Estilos para el Dashboard --- */

.dashboard-background {
    background-color: var(--light-bg);
    padding-top: 80px; /* Dejamos espacio para el header fijo del dashboard */
    /* **LA CORRECCIÓN**: Quitamos la posición relativa para que no interfiera con el posicionamiento fijo del chatbot. */
}

.dashboard-header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0 30px;
    height: 70px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
}

.dashboard-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.dashboard-logo {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.dashboard-logo img {
    width: 40px;
    margin-right: 10px;
}

.dashboard-user-info {
    display: flex;
    align-items: center;
}

.dashboard-user-info span {
    margin-right: 20px;
    font-weight: 600;
}

.logout-button {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.logout-button:hover {
    background-color: var(--accent-color);
}

.dashboard-main-content {
    padding: 40px;
}

.dashboard-welcome h1 {
    font-size: 2.5rem;
}

.dashboard-cards {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.card {
    background-color: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    flex-grow: 1;
}

/* --- Estilos para el Sidebar del Dashboard --- */

.dashboard-sidebar {
    position: fixed;
    top: 70px; /* Justo debajo del header */
    left: 0;
    width: 240px; /* Ancho del sidebar */
    height: calc(100vh - 70px); /* Altura restante */
    background-color: #2c3e50; /* Un color oscuro y profesional */
    background-color: var(--primary-color); /* Color institucional rojo */
    padding-top: 20px;
    z-index: 1000;
    transition: width 0.3s ease;
}

.dashboard-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard-sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.dashboard-sidebar ul li a .fas {
    margin-right: 15px;
    width: 20px; /* Para alinear los textos */
    text-align: center;
}

.dashboard-sidebar ul li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.2); /* Un rojo más oscuro al pasar el mouse */
    color: var(--white);
}

.dashboard-sidebar ul li a.active {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--white);
    border-left: 4px solid var(--primary-color);
    border-left: 4px solid #FFD700; /* Color dorado para el selector */
}

/* Ajustamos el contenido principal para que no quede detrás del sidebar */
.dashboard-main-content {
    padding: 40px;
    margin-left: 240px; /* Mismo ancho que el sidebar */
    transition: margin-left 0.3s ease;
}

/* Responsividad para el sidebar */
@media (max-width: 992px) {
    .dashboard-sidebar {
        width: 70px; /* Hacemos el sidebar más pequeño */
    }
    .dashboard-sidebar ul li a {
        justify-content: center;
        padding: 15px 0;
    }
    .dashboard-sidebar ul li a .fas {
        margin-right: 0;
    }
    /* Ocultamos el texto y dejamos solo el icono */
    .dashboard-sidebar ul li a {
        font-size: 0;
    }
    .dashboard-main-content {
        margin-left: 70px; /* Ajustamos el margen */
    }
}

/* --- Estilos para la Gestión de Usuarios --- */

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.content-header h1 {
    margin: 0;
}

.btn {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}
.btn-primary:hover {
    background-color: var(--accent-color);
}

.table-container {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

table th {
    background-color: #f9fafb;
    font-weight: 700;
    color: #555;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--white);
}
.role-directivo { background-color: #e74c3c; }
.role-profesor { background-color: #3498db; }
.role-estudiante { background-color: #2ecc71; }
.role-secretaria { background-color: #9b59b6; } /* Nuevo color para Secretaria */
.role-auxiliar { background-color: #f39c12; }
.role-apoderado { background-color: #16a085; }

.status-active { color: #27ae60; font-weight: 600; }
.status-inactive { color: #c0392b; font-weight: 600; }
.status-activo { color: #27ae60; font-weight: 600; }
.status-inactivo { color: #c0392b; font-weight: 600; }
.status-archivado { color: #7f8c8d; font-weight: 600; }

.actions .btn {
    padding: 5px 10px;
    font-size: 0.9rem;
}
.btn-secondary { background-color: #bdc3c7; color: #fff; }
.btn-secondary:hover { background-color: #95a5a6; }
.btn-danger { background-color: #e74c3c; color: #fff; }
.btn-danger:hover { background-color: #c0392b; }
.btn-success { background-color: #2ecc71; color: #fff; }
.btn-success:hover { background-color: #27ae60; }

/* --- Estilos para Formularios del Dashboard --- */

.form-container {
    background-color: var(--white);
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.form-row .form-group {
    flex: 1; /* Cada grupo ocupa el mismo espacio */
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(204, 41, 54, 0.15);
}

.form-actions {
    margin-top: 10px;
    text-align: right;
}

.form-actions .btn-primary {
    padding: 12px 30px; /* Hacemos el botón un poco más grande */
    font-size: 1rem;
}

.sidebar-divider {
    padding: 20px 25px 10px 25px;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Clase para ocultar elementos */
.hidden {
    display: none;
}
/* --- Estilos para la Parrilla de Horarios --- */
.schedule-grid-container .content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-grid {
    display: grid;
    grid-template-rows: auto repeat(12, 60px); /* 1 Fila para header, 12 filas para horas de 60px */
    grid-template-columns: 80px repeat(6, 1fr); /* Columna para hora + 6 días */
    border: 1px solid #ddd;
    background-color: #fff;
    position: relative; /* Necesario para el mensaje de "horario vacío" */
}

.grid-header, .grid-time-label, .grid-cell {
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    box-sizing: border-box;
}

.grid-header {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    height: 50px;
}

.grid-time-label {
    font-size: 12px;
    color: #555;
    background-color: #f8f9fa;
}

.schedule-block {
    position: absolute; /* Usamos posición absoluta relativa a .schedule-grid */
    padding: 8px;
    border-radius: 4px;
    color: white;
    font-size: 13px;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.2);
    margin: 1px;
    display: flex;
    flex-direction: column;
    z-index: 5; /* Para que esté sobre las celdas */
}

.schedule-block strong {
    font-weight: 600;
    margin-bottom: 4px;
}

.grid-empty-message {
    position: absolute;
    top: 50px; /* Debajo del header */
    left: 80px; /* Después de la columna de horas */
    right: 0;
    bottom: 0;
    padding: 40px;
    text-align: center;
    color: #777;
}

/* Colores para las asignaturas */
.color-1 { background-color: #007bff; } .color-2 { background-color: #28a745; }
.color-3 { background-color: #dc3545; } .color-4 { background-color: #ffc107; color: #333; }
.color-5 { background-color: #17a2b8; } .color-6 { background-color: #6f42c1; }
.color-7 { background-color: #fd7e14; } .color-8 { background-color: #343a40; }

/* Al final de tu archivo styles.css */

/* --- ESTILOS DEL CHATBOT --- */
.chatbot-container {
    /* **LA CORRECCIÓN**: El contenedor ahora es fijo y ocupa toda la pantalla, pero es invisible. */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Es un contenedor fantasma, no interfiere con los clics. */
    pointer-events: none; 
    z-index: 9998; /* Un z-index muy alto */
}

.chatbot-toggle-btn {
    /* **LA CORRECCIÓN**: El botón se posiciona de forma absoluta en la esquina inferior derecha de su padre (el contenedor fantasma). */
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
    /* Le devolvemos los eventos de clic al botón. */
    pointer-events: auto;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.1);
}

.chatbot-window {
    /* **LA CORRECCIÓN**: La ventana también se posiciona de forma absoluta. */
    position: absolute;
    bottom: 90px; /* Justo encima del botón */
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s;
    /* Le devolvemos los eventos de clic a la ventana. */
    pointer-events: auto;
}

.chatbot-window.hidden {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
}

.chatbot-header {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
}
.chatbot-close-btn:hover {
    opacity: 1;
}

.chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f4f7f9;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
}

.chat-message p {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 85%;
    line-height: 1.4;
}

.bot-message p {
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 4px;
}

.user-message {
    justify-content: flex-end;
}

.user-message p {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-input-area {
    border-top: 1px solid #ddd;
}

#chatbot-form {
    display: flex;
}

#chatbot-input {
    flex-grow: 1;
    border: none;
    padding: 15px;
    font-size: 1rem;
    outline: none;
}

#chatbot-send-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 20px;
    font-size: 1.2rem;
    cursor: pointer;
}
#chatbot-send-btn:disabled {
    background-color: #ccc;
}

/* Animación de "pensando..." */
.thinking p span {
    display: inline-block;
    animation: bounce 1.4s infinite;
}
.thinking p span:nth-child(2) { animation-delay: 0.2s; }
.thinking p span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
}

/* --- Ajustes Responsive Globales --- */
.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.dashboard-menu-toggle,
.dashboard-sidebar-overlay {
    display: none;
}

.dashboard-menu-toggle {
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: rgba(204, 41, 54, 0.12);
    color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.dashboard-content,
.dashboard-welcome,
.form-container,
.table-container {
    min-width: 0;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container table {
    min-width: 680px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions .btn {
    margin: 0;
}

#schedule-grid-container,
.schedule-grid-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.schedule-grid {
    min-width: 860px;
}

@media (max-width: 992px) {
    .dashboard-background {
        padding-top: 126px;
    }

    .dashboard-cards {
        flex-direction: column;
    }

    .card {
        padding: 28px;
    }

    .dashboard-header {
        height: auto;
        padding: 12px 16px;
    }

    .dashboard-header-content {
        align-items: flex-start;
        gap: 12px;
        flex-wrap: wrap;
    }

    .dashboard-header-left {
        width: 100%;
    }

    .dashboard-logo {
        font-size: 1rem;
        min-width: 0;
    }

    .dashboard-logo span {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-user-info {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .dashboard-user-info span {
        margin-right: 0;
    }

    .dashboard-menu-toggle {
        display: inline-flex;
    }

    .dashboard-sidebar {
        width: min(280px, 82vw);
        height: 100vh;
        top: 0;
        padding-top: 92px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25);
        overflow-y: auto;
        z-index: 1102;
    }

    body.dashboard-nav-open .dashboard-sidebar {
        transform: translateX(0);
    }

    .dashboard-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.48);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1101;
        display: block;
    }

    body.dashboard-nav-open .dashboard-sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .dashboard-sidebar ul li a {
        font-size: 0.95rem;
        justify-content: flex-start;
        padding: 14px 18px;
    }

    .dashboard-sidebar ul li a .fas {
        margin-right: 14px;
    }

    .dashboard-main-content {
        margin-left: 0 !important;
        padding: 20px 16px 88px;
    }

    .dashboard-welcome h1,
    .content-header h1 {
        font-size: 2rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .content-header .btn {
        width: 100%;
        text-align: center;
    }

    .form-container {
        padding: 20px 16px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-actions {
        text-align: left;
    }

    .form-actions .btn,
    .actions .btn {
        width: 100%;
        display: block;
        text-align: center;
    }

    .btn {
        white-space: normal;
    }
}

@media (max-width: 768px) {
    .dashboard-background {
        padding-top: 140px;
    }

    #chatbot-input {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .dashboard-background {
        padding-top: 148px;
    }

    .dashboard-user-info {
        flex-direction: column;
        align-items: stretch;
    }

    .logout-button {
        width: 100%;
        display: block;
        text-align: center;
    }

    .dashboard-main-content {
        padding: 18px 12px 88px;
    }

    .card {
        padding: 20px 16px;
    }

    .table-container table {
        min-width: 600px;
    }

    .schedule-grid {
        min-width: 760px;
    }
}

.attendance-subtitle {
    color: #5c6675;
    margin-top: 6px;
}

.attendance-layout,
.attendance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.attendance-panel {
    padding: 28px;
}

.attendance-panel-header h3,
.attendance-table-header h3 {
    margin-bottom: 6px;
}

.attendance-panel-header p {
    color: #667081;
    margin-bottom: 18px;
}

.attendance-methods {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.attendance-methods strong {
    display: block;
    margin-bottom: 8px;
}

.attendance-methods ul {
    margin: 0;
    padding-left: 18px;
}

.attendance-methods li + li {
    margin-top: 4px;
}

.attendance-field-main input {
    font-size: 1.2rem;
    letter-spacing: 1px;
    font-weight: 700;
}

.attendance-actions {
    display: flex;
    justify-content: flex-end;
}

.attendance-camera-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.attendance-camera-selector {
    margin-bottom: 18px;
}

.attendance-camera-selector select {
    background: #fff;
}

.attendance-camera-panel {
    margin-bottom: 20px;
    border-radius: 18px;
    overflow: hidden;
    background: #0f1720;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.attendance-camera-panel video {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    background: #111827;
}

.attendance-camera-reader {
    width: 100%;
    min-height: 320px;
    background: #0f1720;
    position: relative;
    overflow: hidden;
}

.attendance-camera-reader > div {
    border: none !important;
    box-shadow: none !important;
}

.attendance-camera-reader video,
.attendance-camera-reader canvas {
    width: 100% !important;
    max-height: 360px;
    object-fit: cover;
    display: block;
}

.attendance-camera-reader canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.attendance-camera-reader__fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    color: #e2e8f0;
    padding: 20px;
    text-align: center;
}

.attendance-barcode-guide {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attendance-barcode-guide__box {
    position: absolute;
    left: 11%;
    right: 11%;
    top: 38%;
    height: 24%;
    border: 3px solid rgba(255, 215, 0, 0.95);
    border-radius: 14px;
    box-shadow:
        0 0 0 9999px rgba(4, 8, 15, 0.26),
        0 0 20px rgba(255, 215, 0, 0.28);
    background: rgba(255, 255, 255, 0.03);
}

.attendance-barcode-guide__hint {
    position: absolute;
    bottom: 66px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92%, 520px);
    text-align: center;
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.attendance-camera-status {
    color: #e2e8f0;
    padding: 14px 16px 16px;
    font-size: 0.95rem;
    margin: 0;
}

.attendance-table-panel {
    overflow-x: auto;
}

.attendance-table-header {
    padding: 20px 20px 0;
}

.attendance-flash {
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 24px;
    border: 1px solid transparent;
}

.attendance-flash-success {
    background: #edf9f0;
    border-color: #bde3c3;
    color: #155f31;
}

.attendance-flash-error {
    background: #fdeeee;
    border-color: #f1b9be;
    color: #8d1c28;
}

.attendance-flash-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.attendance-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 94px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
}

.attendance-status-temprano {
    background: #1f8f55;
}

.attendance-status-puntual {
    background: #2f80ed;
}

.attendance-status-tarde {
    background: #d35400;
}

.attendance-status-falta {
    background: #c0392b;
}

.attendance-status-anulado {
    background: #5b6474;
}

.attendance-status-inactivo {
    background: #7f8c8d;
}

.attendance-annul-form {
    display: inline-flex;
    margin: 0;
}

.attendance-annul-button {
    min-width: 84px;
}

.attendance-annul-meta {
    display: inline-flex;
    color: #7b8799;
    font-size: 0.86rem;
}

body.attendance-kiosk-page.dashboard-background {
    background:
        radial-gradient(circle at top center, rgba(32, 48, 105, 0.28), transparent 34%),
        linear-gradient(180deg, #050816 0%, #060912 56%, #090f1e 100%);
}

body.attendance-kiosk-page .dashboard-header {
    background: rgba(6, 10, 24, 0.96);
    box-shadow: 0 14px 40px rgba(1, 4, 14, 0.45);
    border-bottom: 1px solid rgba(104, 124, 188, 0.18);
}

body.attendance-kiosk-page .dashboard-logo span,
body.attendance-kiosk-page .dashboard-user-info span {
    color: #f4f7ff;
}

body.attendance-kiosk-page .dashboard-menu-toggle {
    color: #f4f7ff;
    border-color: rgba(255, 255, 255, 0.18);
}

body.attendance-kiosk-page .dashboard-main-content {
    padding: 26px 28px 34px;
    background: transparent;
}

.attendance-kiosk-view {
    color: #f4f7ff;
}

.attendance-kiosk-shell {
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.attendance-kiosk-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.attendance-kiosk-brand h1 {
    color: #ffffff;
    margin: 0;
    font-size: clamp(1.45rem, 2vw, 1.95rem);
    letter-spacing: 0.02em;
}

.attendance-kiosk-brand__eyebrow {
    margin: 0 0 4px;
    color: #9db0dd;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.76rem;
    font-weight: 700;
}

.attendance-kiosk-brand__meta {
    margin: 8px 0 0;
    color: #b9c5e2;
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attendance-kiosk-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 180px;
}

.attendance-kiosk-clock__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(17, 107, 66, 0.22);
    color: #82f6b6;
    font-size: 0.82rem;
    font-weight: 700;
}

.attendance-kiosk-clock__status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #20d47a;
    box-shadow: 0 0 10px rgba(32, 212, 122, 0.6);
}

.attendance-kiosk-clock strong {
    font-size: clamp(1.9rem, 2.6vw, 2.5rem);
    letter-spacing: 0.03em;
    color: #ffffff;
    line-height: 1;
}

.attendance-kiosk-clock span:last-child {
    color: #b6c2de;
    font-size: 0.92rem;
    text-transform: capitalize;
}

.attendance-kiosk-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attendance-kiosk-scanner {
    width: min(760px, 100%);
    background: linear-gradient(180deg, rgba(15, 20, 40, 0.94), rgba(9, 13, 28, 0.96));
    border: 1px solid rgba(88, 105, 166, 0.24);
    border-radius: 28px;
    box-shadow: 0 28px 70px rgba(3, 7, 19, 0.45);
    padding: 30px 30px 26px;
}

.attendance-camera-actions-kiosk {
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
}

.attendance-camera-actions-kiosk .btn {
    min-width: 150px;
}

.attendance-camera-selector-kiosk {
    max-width: 520px;
    margin: 0 auto 14px;
}

.attendance-camera-selector-kiosk label {
    color: #cfdbfa;
}

.attendance-camera-selector-kiosk select {
    background: rgba(12, 18, 36, 0.88);
    color: #f4f7ff;
    border: 1px solid rgba(110, 129, 193, 0.28);
}

.attendance-camera-panel-kiosk {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 14px;
}

.attendance-kiosk-reader-shell {
    position: relative;
    width: min(100%, 520px);
    min-height: 370px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(101, 118, 182, 0.24);
    background:
        radial-gradient(circle at top center, rgba(66, 88, 162, 0.16), transparent 48%),
        linear-gradient(180deg, #060b1f 0%, #090f22 100%);
}

.attendance-camera-reader-kiosk,
.attendance-camera-panel-kiosk video {
    min-height: 370px;
    max-height: none;
}

.attendance-kiosk-placeholder {
    min-height: 370px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 28px;
    color: #d5e1fb;
}

.attendance-kiosk-placeholder__icon {
    width: 70px;
    height: 70px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: rgba(29, 37, 73, 0.82);
    color: #4ef0b8;
    font-size: 1.7rem;
    box-shadow: inset 0 0 0 1px rgba(78, 240, 184, 0.14);
}

.attendance-kiosk-placeholder strong {
    font-size: 1.15rem;
    color: #ffffff;
}

.attendance-kiosk-placeholder p {
    max-width: 320px;
    color: #aab7d7;
}

.attendance-barcode-guide-kiosk .attendance-barcode-guide__box {
    left: 17%;
    right: 17%;
    top: 36%;
    bottom: auto;
    height: 24%;
    border-radius: 20px;
    border: 2px solid rgba(93, 255, 201, 0.28);
    box-shadow:
        inset 0 0 0 1px rgba(93, 255, 201, 0.12),
        0 0 0 999px rgba(3, 6, 18, 0.12);
}

.attendance-barcode-guide-kiosk .attendance-barcode-guide__box::before,
.attendance-barcode-guide-kiosk .attendance-barcode-guide__box::after {
    content: "";
    position: absolute;
    width: 46px;
    height: 46px;
    border-top: 3px solid #3ef2bf;
    top: 12px;
}

.attendance-barcode-guide-kiosk .attendance-barcode-guide__box::before {
    left: 12px;
    border-left: 3px solid #3ef2bf;
    border-radius: 12px 0 0 0;
}

.attendance-barcode-guide-kiosk .attendance-barcode-guide__box::after {
    right: 12px;
    border-right: 3px solid #3ef2bf;
    border-radius: 0 12px 0 0;
}

.attendance-camera-status-kiosk {
    text-align: center;
    color: #c9d5f1;
    padding: 16px 10px 0;
    font-size: 0.98rem;
}

.attendance-kiosk-toolbar {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.attendance-form-kiosk {
    max-width: 520px;
    margin: 0 auto;
}

.attendance-kiosk-manual-panel {
    margin-top: 10px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(10, 15, 31, 0.9);
    border: 1px solid rgba(88, 105, 166, 0.22);
}

.attendance-kiosk-manual-panel label,
.attendance-kiosk-manual-panel .field-help {
    color: #d2dcf6;
}

.attendance-kiosk-manual-panel input {
    background: rgba(245, 247, 255, 0.98);
}

.attendance-kiosk-manual-panel .attendance-actions {
    justify-content: center;
}

.attendance-kiosk-history {
    border-radius: 24px;
    background: rgba(7, 12, 27, 0.88);
    border: 1px solid rgba(86, 103, 160, 0.18);
    overflow: hidden;
}

.attendance-kiosk-history__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(87, 105, 168, 0.14);
}

.attendance-kiosk-history__header h3 {
    color: #ffffff;
    margin: 0;
}

.attendance-kiosk-history__header span {
    color: #b7c4e3;
    font-size: 0.92rem;
}

.attendance-kiosk-log {
    list-style: none;
    margin: 0;
    padding: 0;
}

.attendance-kiosk-log li {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px;
    border-top: 1px solid rgba(86, 103, 160, 0.12);
}

.attendance-kiosk-log li:first-child {
    border-top: none;
}

.attendance-kiosk-log__identity {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.attendance-kiosk-log__identity strong {
    color: #f7f9ff;
    font-size: 1rem;
}

.attendance-kiosk-log__identity span {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    color: #9fb1d8;
    font-size: 0.9rem;
}

.attendance-kiosk-log__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.attendance-kiosk-log__meta time {
    color: #d9e2f7;
    font-weight: 700;
}

.attendance-kiosk-empty {
    padding: 18px 20px 22px;
    color: #9fb1d8;
}

body.attendance-kiosk-page .attendance-flash {
    margin-bottom: 18px;
    background: rgba(8, 14, 32, 0.92);
    border-color: rgba(90, 108, 170, 0.2);
    color: #f4f7ff;
}

body.attendance-kiosk-page .attendance-flash-success {
    border-color: rgba(78, 240, 184, 0.28);
}

body.attendance-kiosk-page .attendance-flash-error {
    border-color: rgba(255, 103, 120, 0.28);
}

.field-help {
    color: #667081;
    font-size: 0.92rem;
    margin-top: 6px;
    margin-bottom: 14px;
}

.student-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.student-selector-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid #d8dde8;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.student-selector-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
    border-color: rgba(204, 41, 54, 0.35);
}

.student-selector-card input[type="checkbox"] {
    align-self: flex-start;
    width: 18px;
    height: 18px;
    margin-bottom: 4px;
}

.student-selector-name {
    font-weight: 700;
    color: #18212f;
}

.student-selector-meta {
    color: #667081;
    font-size: 0.92rem;
}

.guardian-arrival-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.guardian-arrival-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guardian-arrival-meta,
.guardian-arrival-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    color: #334155;
}

.guardian-inline-flash {
    margin-bottom: 0;
}

.guardian-confirm-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (max-width: 992px) {
    .attendance-layout,
    .attendance-grid {
        grid-template-columns: 1fr;
    }

    body.attendance-kiosk-page .dashboard-main-content {
        padding: 18px 16px 28px;
    }

    .attendance-kiosk-topbar,
    .attendance-kiosk-history__header,
    .attendance-kiosk-log li {
        flex-direction: column;
        align-items: flex-start;
    }

    .attendance-kiosk-clock {
        align-items: flex-start;
        min-width: 0;
    }

    .attendance-kiosk-scanner {
        padding: 22px 16px 18px;
    }

    .attendance-camera-actions-kiosk .btn,
    .attendance-kiosk-toolbar .btn {
        width: 100%;
    }

    .attendance-kiosk-reader-shell,
    .attendance-camera-reader-kiosk,
    .attendance-kiosk-placeholder {
        min-height: 300px;
    }

    .student-selector-grid {
        grid-template-columns: 1fr;
    }

    .attendance-camera-panel video {
        max-height: 280px;
    }

    .attendance-camera-reader,
    .attendance-camera-reader__fallback {
        min-height: 240px;
    }
}

@media (max-width: 640px) {
    .attendance-kiosk-brand h1 {
        font-size: 1.2rem;
    }

    .attendance-kiosk-brand__meta {
        font-size: 0.84rem;
    }

    .attendance-kiosk-clock strong {
        font-size: 1.6rem;
    }

    .attendance-kiosk-reader-shell,
    .attendance-camera-reader-kiosk,
    .attendance-kiosk-placeholder {
        min-height: 250px;
    }

    .attendance-barcode-guide-kiosk .attendance-barcode-guide__box {
        left: 12%;
        right: 12%;
        top: 39%;
        height: 21%;
    }
}

