:root {
  --accent: #b00020;
  --muted: #70757a;
  --line: rgba(18,21,33,.08);
  --side-width: 260px;
  --side-collapsed: 60px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --text: #3c4043;
}

body { margin: 0; font-family: 'Inter', sans-serif; background: #fff; color: var(--text); overflow: hidden; }

/* TOPBAR ESTILO GOOGLE */
.topbar {
  height: 65px; background: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--line); position: relative; z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 15px; }
.btn-toggle { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); padding: 8px; border-radius: 50%; transition: 0.2s; }
.btn-toggle:hover { background: #f1f3f4; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* PERFIL DERECHA */
.user-menu-container { position: relative; }
.user-info-top { 
  display: flex; align-items: center; gap: 12px; padding: 5px 5px 5px 15px; 
  border-radius: 50px; cursor: pointer; border: 1px solid transparent; position: relative;
}
.user-info-top:hover { background: #f8f9fa; border-color: var(--line); }

.text-right { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--muted); }
.user-avatar { 
  width: 34px; height: 34px; background: var(--accent); color: #fff; 
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold;
}

/* Badge de estado (Puntito verde) */
.status-indicator {
  position: absolute; bottom: 4px; right: 4px; width: 10px; height: 10px;
  background: #10b981; border: 2px solid #fff; border-radius: 50%;
}

/* DROPDOWN */
.user-dropdown {
  position: absolute; top: 110%; right: 0; width: 280px; background: #fff;
  border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); display: none;
  flex-direction: column; z-index: 1001; overflow: hidden;
}
.user-dropdown.active { display: flex; animation: fadeIn 0.2s ease; }

.dropdown-header { padding: 20px; text-align: center; border-bottom: 1px solid var(--line); }
.user-avatar-big { width: 60px; height: 60px; background: var(--accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 10px; }
.dropdown-item { width: 100%; padding: 12px; border: none; background: none; text-align: left; cursor: pointer; border-radius: 8px; }
.dropdown-item:hover { background: #f8f9fa; }

/* LAYOUT & SIDEBAR */
.appShell { display: flex; height: calc(100vh - 65px); width: 100%; }
.side { width: var(--side-width); border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: width var(--transition); flex-shrink: 0; }
.side.collapsed { width: var(--side-collapsed); }

.nav { padding: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.navBtn { display: flex; align-items: center; padding: 12px 15px; border: none; background: transparent; cursor: pointer; width: 100%; transition: 0.2s; border-left: 4px solid transparent; }
.navBtn.active { background: #fff5f5; border-left-color: var(--accent); }
.navBtn:hover { background: #f8f9fa; }

.ico { min-width: 32px; height: 32px; border-radius: 8px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; background: var(--bg-ico); flex-shrink: 0; }
.navTxt { margin-left: 12px; white-space: nowrap; display: flex; flex-direction: column; text-align: left; }
.navTxt b { font-size: 13px; }
.navTxt span { font-size: 11px; color: var(--muted); }

.side.collapsed .navBtn { justify-content: center; padding: 12px 0; }
.side.collapsed .navTxt, .side.collapsed .sideFooter { display: none; }

.stack { flex: 1; overflow-y: auto; background: #fff; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* --- RESTAURACIÓN DE ESTILO: LOGO Y TEXTOS --- */
.brand h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: .2px;
  background: linear-gradient(135deg, var(--text), #6b7280);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2, #ff5252));
  box-shadow: 0 0 0 5px rgba(176, 0, 32, 0.1);
}

/* --- RESTAURACIÓN: BOTONES --- */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(176, 0, 32, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

/* --- RESTAURACIÓN: STATUS SIDEBAR --- */
.sideFooter {
  margin-top: auto;
  padding: 20px 15px;
  border-top: 1px solid var(--line);
  background: #fafafa;
}

.badge-status {
  font-size: 10px;
  font-weight: 800;
  color: #10b981;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.badge-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    /* background: #323232; */
    color: white;
    border-radius: 8px;
    /* box-shadow: 0 5px 15px rgba(0,0,0,0.3); */
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10001; /* Por encima del modal de vista previa */
    transform: translateY(0);
    transition: all 0.3s ease;
    font-weight: 500;
}

.toast.hidden {
    display: none;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
}
.toast-hidden {
    opacity: 0;
}
.toast-ok { background: #2e7d32; border-left: 5px solid #1b5e20; }
.toast-error { background: #d32f2f; border-left: 5px solid #b71c1c; }
@keyframes highlight {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.badge-status-active {
    animation: highlight 0.5s ease-in-out;
    font-weight: bold;
    font-size: 11px;
}

/* --- Estilos del Loader Global --- */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex; /* Siempre flex para centrar */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    
    /* FONO DIFUMINADO: En lugar de gris sólido, usamos un blanco/oscuro traslúcido */
    background: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(8px); /* AQUÍ ocurre la magia del difuminado */
    -webkit-backdrop-filter: blur(8px); /* Soporte para Safari */
    
    /* TRANSICIÓN */
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.4s;
    
    opacity: 1;
    visibility: visible;
}

/* Estado oculto pero animable */
.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Evita que bloquee clics mientras es invisible */
}

/* Caja de contenido con leve escala */
.loaderBox {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    text-align: center;
    transform: scale(1);
    transition: transform 0.4s ease;
}

.loader.hidden .loaderBox {
    transform: scale(0.9); /* Efecto de que se encoge al desaparecer */
}
  .spinner{
    width:44px;height:44px;border-radius:999px;
    border: 4px solid rgba(18,21,33,.18);
    border-top-color: rgba(176,0,32,.95);
    margin: 2px auto 12px;
    animation: spin 1s linear infinite;
  }
  @keyframes spin{ to { transform: rotate(360deg); } }
  .status-validation-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}
#reviewContainer .spinner {
    margin: 0 auto 20px;
    border-top-color: var(--accent);
}
/* Reset total para el centrado */
body.full-screen-mode {
    /* display: flex !important; */
    align-items: center !important;
    justify-content: center !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden; /* Evita scrolls innecesarios */
}

/* Forzar que el envoltorio no limite el centrado */
body.full-screen-mode .wrap {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 20px !important;
    display: flex;
    justify-content: center;
}

/* La tarjeta o el box debe ser lo único con ancho limitado */
body.full-screen-mode .success-box {
    margin: 0 auto !important; /* Asegura el centrado horizontal */
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ocultamos la tarjeta original (bordes/sombras) para que solo luzca el box */
body.full-screen-mode .card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
/* Ocultamos el envoltorio principal inicialmente para evitar el parpadeo */
#main-wrapper {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Esta clase la pondremos por JS al terminar la carga */
.content-ready {
    opacity: 1 !important;
}
/* --- Capas Base (Overlay) --- */
.loader, .error-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* Por encima de cualquier sidebar o modal */
    background: rgba(15, 23, 42, 0.7); /* Azul oscuro traslúcido */
    backdrop-filter: blur(5px); /* Efecto de desenfoque moderno */
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

/* --- Tarjeta de Error --- */
.error-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

.error-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.error-title {
    color: #b00020; /* Color guinda institucional */
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.error-text {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* --- Loader Box --- */
.loaderBox {
    background: white;
    padding: 30px 50px;
    border-radius: 12px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b00020;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Reutilizamos el efecto de desenfoque pero con un tinte verdoso muy leve */
#validationBox.error-screen {
    background: rgba(232, 245, 233, 0.6); /* Tinte verde muy suave */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Animación sutil para que el spinner no sea agresivo */
#validationBox .spinner {
    margin: 0 auto 20px;
    border-color: #e8f5e9;
    border-top-color: #2e7d32;
}
/* Clase para ocultar componentes de la interfaz */
.is-login .topbar, 
.is-login .side {
    display: none !important;
}
/* Ajuste del main para que ocupe todo el espacio en login */
.is-login .appShell {
    grid-template-columns: 1fr !important;
}

/* Fondo con el logo de la escuela */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: url('../assets/img/escuela2.jpg') no-repeat center center;
    background-size: contain; /* O 'cover' según prefieras */
    filter: blur(8px); /* El efecto de desenfoque */
    opacity: 0.15;    /* Para que no distraiga del formulario */
}
/* --- COMPONENTES GLOBALES DE VISTA (CARD & TABLES) --- */

.view { 
    padding: 25px; 
    animation: fadeIn 0.4s ease-out; 
    max-width: 1200px; 
    margin: 0 auto; 
}

/* Tarjeta Principal */
.card-main {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Encabezado de la Tarjeta */
.cardHd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.cardHd h2 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.cardHd p { margin: 4px 0 0; }

/* Cuerpo de la Tarjeta */
.cardBd { padding: 25px; }

/* --- TABLAS ESTANDARIZADAS --- */
.table-responsive { width: 100%; overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    background: #f8fafc;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--line);
}

tbody td {
    padding: 15px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    vertical-align: middle;
}

tbody tr:hover { background-color: #fcfcfc; }

/* --- BOTONES ADICIONALES --- */
.btn-nuevo {
    background: #1e293b;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-nuevo:hover { background: #0f172a; transform: translateY(-1px); }

/* --- UTILIDADES DE TEXTO --- */
.text-center { text-align: center; }
.bold { font-weight: 700; }
.text-muted { color: var(--muted); }
.small { font-size: 12px; }
/* --- BOTÓN GLOBAL DE ACCIÓN --- */
.btn-success {
    background: #16a34a; /* Verde éxito */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-success:hover {
    background: #15803d;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
    transform: translateY(-1px);
}

.btn-success:active { transform: translateY(0); }/* Loader Global con Identidad CUT */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000; /* Prioridad máxima */
  transition: var(--transition);
}

.loader-overlay.hidden {
  display: none;
  opacity: 0;
  visibility: hidden;
}

.loader-box {
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--line);
  border-top: 4px solid var(--accent); /* Tu color #b00020 */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

.loader-box p {
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  margin: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Animación de movimiento */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.skeleton-cell {
    height: 20px;
    margin: 10px 0;
    border-radius: 4px;
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px;
    display: inline-block;
    width: 100%;
    animation: shimmer 1.5s infinite linear;
}

/* Variaciones de ancho para que parezca contenido real */
.sk-w-50 { width: 50%; }
.sk-w-75 { width: 75%; }
.sk-w-30 { width: 30%; }




/* --- ESTILOS DEL MODAL KARDEX --- */
#modalOpcionesKardex .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#modalOpcionesKardex .modal-header {
    background: linear-gradient(45deg, #a81d24, #d9534f); /* Degradado Rojo UJED */
    border: none;
}

#modalOpcionesKardex .btn-lg {
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 12px;
}

#modalOpcionesKardex .btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Input de confirmación de correo */
#txtCorreoConfirmar {
    height: 50px;
    border-radius: 8px;
    border: 2px solid #eee;
    font-weight: 500;
}

#txtCorreoConfirmar:focus {
    border-color: #d9534f;
    box-shadow: none;
}

/* --- TOAST DE ÉXITO (Mensaje flotante) --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast-custom {
    background: #28a745; /* Verde éxito */
    color: white;
    padding: 16px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
/* Asegura que el modal flote sobre todo */
.modal-backdrop {
    z-index: 1040 !important;
}

#modalOpcionesKardex {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.5); /* Oscurece el fondo si falla el backdrop */
}

/* Forzar que el modal sea blanco y visible */
#modalOpcionesKardex .modal-content {
    background-color: #fff !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Evitar que se vea abajo de la tabla */
#modalOpcionesKardex.show {
    display: block !important;
}

.toast-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 9999;
}

.toast-custom {
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideIn 0.4s ease-out forwards;
}

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}


/* 1. EL CONTENEDOR PADRE (El que hace la magia de izquierda/derecha) */
.p-3.bg-light.border-top.d-flex {
    display: flex !important;
    justify-content: space-between !important; /* Manda uno a cada lado */
    align-items: center !important;
    width: 100%;
}

/* 2. EL CONTENEDOR DE LA PAGINACIÓN (Cajita de botones) */
.pagination-container {
    display: flex !important;
    background: #fff;
    /*border: 1px solid #d9534f;  Borde rojo UJED */
    border-radius: 6px;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* 3. LAS FLECHAS ROJAS */
.pag-btn {
    background-color: #d9534f !important; /* Rojo */
    color: white !important;
    border: none;
    padding: 0 12px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.pag-btn:hover:not(:disabled) {
    background-color: #b52b27 !important;
}

.pag-btn:disabled {
    background-color: #f5c6c4 !important;
    cursor: not-allowed;
}

/* 4. LOS NÚMEROS (Lista horizontal) */
.pag-list {
    display: flex !important;
    flex-direction: row !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.pag-link-num {
    border: none;
    background: white;
    color: #495057;
    padding: 0 15px;
    height: 38px;
    display: flex;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    border-right: 1px solid #f0f0f0;
    transition: all 0.2s;
}

/* Número Activo */
.pag-link-num.active {
    color: #d9534f !important;
    background-color: #fff5f5 !important;
    box-shadow: inset 0 -3px 0 #d9534f;
}

.pag-link-num:hover:not(.active) {
    background-color: #f8f9fa;
}

/* --- PAGINACIÓN (Se mantiene igual, está correcta) --- */
.p-3.bg-light.border-top.d-flex {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100%;
}
/* Ejemplo de cómo suele estar configurado */
.nav-link.active {
    border-left: 4px solid red; /* La famosa rayita roja */
    background-color: rgba(255, 0, 0, 0.1);
    color: red;
}
/* Estilos para el botón activo en el menú lateral */
.navBtn.active {
    position: relative;
    background: rgba(0, 0, 0, 0.05); /* Un fondo sutil opcional */
}

.navBtn.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 4px;
    background-color: #e74c3c; /* Tu color rojo */
    border-radius: 0 4px 4px 0;
}

.navBtn.active .ico {
    transform: scale(1.1); /* Efecto visual opcional en el icono */
    filter: saturate(1.5);
}
.menu-item-icon {
    background-color: var(--item-color-alpha); /* 10% de opacidad del color original */
    color: var(--item-color); /* El color hexadecimal que te pasé */
    border-radius: 12px;
}   




/* Transiciones de desvanecimiento */
.fade-view {
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-out;
    opacity: 1;
    transform: translateY(0);
}

.fade-out {
    opacity: 0 !important;
    transform: translateY(20px);
    pointer-events: none;
}

.hidden-view {
    display: none !important;
}

/* Botón rojo personalizado */
.btn-add-red {
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: transform 0.2s;
}
.btn-add-red:hover {
    transform: scale(1.1);
    background-color: #c82333;
}