/* ==========================================================================
   SANJOSE MAGIC SCHOOL - ESTILOS PRINCIPALES (FRUTIGER AERO)
   ========================================================================== */

/* --- Reset general --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background: radial-gradient(circle at top, #90caf9 0%, #42a5f5 25%, #1976d2 60%, #0d47a1 100%);
    background-attachment: fixed;
    height: 100vh;
    color: #ffffff;
    overflow: hidden;
}

/* --- Contenedores Cristal Líquido --- */
.glass-container {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.15) 100%);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    box-shadow: 0 10px 35px rgba(0, 30, 80, 0.25), 
                inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.standard-padding { padding: 35px; }
.text-center { text-align: center; }

/* --- Animación suave --- */
.animate-fade {
    animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   PÁGINA DE INICIO DE SESIÓN (LOGIN)
   ========================================================================== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    width: 390px;
    padding: 45px 35px;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-small {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: #e3f2fd;
    font-weight: 600;
    display: block;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.logo-main {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin-top: 3px;
    text-shadow: 0 2px 10px rgba(0, 80, 180, 0.6), 0 1px 2px rgba(0,0,0,0.3);
}

.input-group { margin-bottom: 24px; }
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #f5fafd;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    color: #0d47a1;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.input-group input:focus {
    background: #ffffff;
    border-color: #00b0ff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), 0 0 12px rgba(0, 176, 255, 0.6);
}

/* Botón Glossy Aero */
.btn-aero {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    border: 1px solid #01579b;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(to bottom, #00b0ff 0%, #0091ea 49%, #0077c2 51%, #005691 100%);
    box-shadow: 0 5px 15px rgba(0, 40, 90, 0.45), 
                inset 0 1px 0 rgba(255, 255, 255, 0.7);
    text-shadow: 0 -1px 1px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.btn-aero:hover {
    filter: brightness(1.12);
    box-shadow: 0 6px 20px rgba(0, 40, 90, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-0.5px);
}

.btn-aero:active {
    background: linear-gradient(to bottom, #005691 0%, #0077c2 100%);
    transform: translateY(1px);
}

.alert-error {
    background: rgba(211, 47, 47, 0.4);
    border: 1px solid #ff1744;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* ==========================================================================
   MAQUETACIÓN DEL DASHBOARD (MENÚ Y PANEL PRINCIPAL)
   ========================================================================== */
.dashboard-page {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar-glass {
    width: 290px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.12) 100%);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    border-right: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 25px rgba(0, 20, 50, 0.15);
}

.sidebar-brand {
    padding: 35px 20px 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-main-sidebar {
    font-size: 21px;
    font-weight: 800;
    margin-top: 2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.sidebar-user {
    padding: 18px;
    margin: 20px 15px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.4);
}

/* --- REGLAS ESTRICTAS PARA AVATARES (CORRECCIÓN DE TAMAÑO) --- */
.avatar-circle {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    max-width: 46px;
    max-height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ebff 0%, #0072ff 100%);
    border: 2px solid #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    overflow: hidden; /* Corta bordes sobrantes */
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;
    max-width: 120px;
    max-height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ebff 0%, #0072ff 100%);
    border: 4px solid #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 48px;
    color: white;
    margin: 0 auto 20px auto;
    box-shadow: 0 8px 25px rgba(0, 114, 255, 0.4), inset 0 2px 5px rgba(255,255,255,0.6);
    overflow: hidden; /* Corta bordes sobrantes */
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 15px; }
.user-role {
    font-size: 12px;
    color: #e0f2fe;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}
.status-dot.online {
    width: 9px;
    height: 9px;
    background-color: #00e676;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e676;
}

.sidebar-menu { flex: 1; padding: 10px 15px; }
.sidebar-menu ul { list-style: none; }
.sidebar-menu li { margin-bottom: 7px; }
.sidebar-menu li a {
    display: block;
    padding: 12px 16px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.sidebar-menu li a:hover, .sidebar-menu li.active a {
    background: rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.menu-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 15px 0;
}
.logout-link:hover { background: rgba(255, 23, 68, 0.3) !important; }

/* --- CONTENIDO DINÁMICO (Derecha) --- */
.main-viewport { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.top-bar-glass {
    height: 75px;
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    padding: 0 35px;
}
.content-body { flex: 1; padding: 35px; overflow-y: auto; }
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 15px; }

/* ==========================================================================
   ETAPA 2: MÓDULO DE CHAT
   ========================================================================== */
.chat-wrapper { display: flex; height: 100%; gap: 20px; }
.chat-sidebar { 
    width: 260px; 
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 15px; 
    padding: 15px; 
    overflow-y: auto; 
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.5);
}
.chat-contact { 
    display: flex; align-items: center; gap: 12px; padding: 12px; 
    border-radius: 10px; cursor: pointer; transition: all 0.2s ease; 
    margin-bottom: 8px; border: 1px solid transparent;
}
.chat-contact:hover, .chat-contact.active { 
    background: rgba(255, 255, 255, 0.35); 
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
}
.chat-contact-name { font-weight: 600; font-size: 14px; text-shadow: 0 1px 1px rgba(0,0,0,0.1); }
.chat-contact-role { font-size: 11px; opacity: 0.8; }

.chat-main { 
    flex: 1; display: flex; flex-direction: column; 
    background: rgba(255, 255, 255, 0.25); border-radius: 15px; 
    border: 1px solid rgba(255, 255, 255, 0.4); overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
}
.chat-header { 
    padding: 18px 20px; background: rgba(255, 255, 255, 0.2); 
    border-bottom: 1px solid rgba(255, 255, 255, 0.4); 
    font-weight: 700; font-size: 16px; text-shadow: 0 1px 2px rgba(0,0,0,0.1); 
}
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.msg-bubble { max-width: 65%; padding: 12px 16px; border-radius: 15px; font-size: 14px; line-height: 1.4; box-shadow: 0 3px 8px rgba(0,0,0,0.1); }
.msg-received { align-self: flex-start; background: rgba(255, 255, 255, 0.9); color: #0d47a1; border-bottom-left-radius: 2px; border: 1px solid rgba(255,255,255,1); }
.msg-sent { align-self: flex-end; background: linear-gradient(135deg, #42a5f5 0%, #1976d2 100%); color: white; border-bottom-right-radius: 2px; border: 1px solid #1565c0; text-shadow: 0 1px 1px rgba(0,0,0,0.2); }

.chat-input-box { display: flex; gap: 10px; padding: 15px; background: rgba(255, 255, 255, 0.2); border-top: 1px solid rgba(255, 255, 255, 0.4); }
.chat-input-box input { flex: 1; padding: 12px 18px; border-radius: 25px; border: 1px solid rgba(255, 255, 255, 0.7); outline: none; background: rgba(255, 255, 255, 0.9); color: #0d47a1; font-size: 14px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); }

/* ==========================================================================
   ETAPA 3: MÓDULO DE NOTAS (TARJETAS)
   ========================================================================== */
.notas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    padding: 10px;
}
.nota-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.2) 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 31, 63, 0.15), inset 0 2px 5px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}
.nota-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0, 31, 63, 0.25), inset 0 2px 5px rgba(255, 255, 255, 1); }
.nota-materia { font-size: 18px; font-weight: 700; color: #0d47a1; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); }
.nota-valor { font-size: 48px; font-weight: 800; color: #00b0ff; text-shadow: 2px 2px 0px #ffffff, 0 4px 10px rgba(0, 176, 255, 0.4); }
.nota-bimestre-badge {
    display: inline-block; padding: 5px 15px; background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 15px; font-size: 12px;
    font-weight: 600; color: #1565c0; margin-bottom: 25px;
}

/* ==========================================================================
   ETAPA 4: GESTIÓN DE NOTAS (TABLA AERO)
   ========================================================================== */
.table-glass {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: rgba(255, 255, 255, 0.15); 
    -webkit-backdrop-filter: blur(12px); 
    backdrop-filter: blur(12px); 
    border-radius: 15px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 31, 63, 0.15), inset 0 2px 5px rgba(255, 255, 255, 0.6);
}
.table-glass th {
    background: rgba(255, 255, 255, 0.35); padding: 18px 15px; font-weight: 700;
    color: #0d47a1; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.5); text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}
.table-glass td { padding: 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); color: #ffffff; text-align: center; vertical-align: middle; }
.table-glass tr:last-child td { border-bottom: none; }
.table-glass tr:hover td { background: rgba(255, 255, 255, 0.1); }

.input-nota {
    width: 65px; padding: 8px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.9); color: #0d47a1; font-weight: 800; font-size: 14px; text-align: center; box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); transition: all 0.2s ease;
}
.input-nota:focus { outline: none; border-color: #00b0ff; box-shadow: 0 0 10px rgba(0, 176, 255, 0.5), inset 0 2px 4px rgba(0,0,0,0.05); }

.btn-update {
    padding: 8px 18px; border-radius: 20px; background: linear-gradient(to bottom, #00e676 0%, #00c853 100%);
    border: 1px solid #00b34a; color: white; cursor: pointer; font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 200, 83, 0.3), inset 0 1px 2px rgba(255,255,255,0.6); transition: all 0.2s ease;
}
.btn-update:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 15px rgba(0, 200, 83, 0.4); }

.toast-msg {
    position: fixed; bottom: 30px; right: 30px; background: rgba(255, 255, 255, 0.9); color: #0d47a1;
    padding: 15px 25px; border-radius: 10px; font-weight: bold; box-shadow: 0 5px 15px rgba(0,0,0,0.2); border-left: 5px solid #00e676; display: none; z-index: 1000;
}

/* ==========================================================================
   ETAPA 5: PERFIL FRUTIGER AERO
   ========================================================================== */
.profile-card {
    width: 100%; max-width: 450px; padding: 40px; text-align: center; border-radius: 25px; margin: 40px auto;
}
.profile-name { font-size: 28px; font-weight: 800; margin-bottom: 5px; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.profile-role { font-size: 14px; color: #e0f2fe; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 30px; font-weight: 600; }
.profile-details {
    background: rgba(255, 255, 255, 0.15); border-radius: 15px; padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3); text-align: left; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.detail-group { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.detail-group:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.detail-group label { display: block; font-size: 11px; color: #b3e5fc; text-transform: uppercase; margin-bottom: 5px; font-weight: bold; letter-spacing: 1px; }
.detail-group .detail-value { font-size: 16px; font-weight: 600; color: #ffffff; }

/* ==========================================================================
   ETAPA 7: SUBIDA DE AVATARES
   ========================================================================== */
.upload-btn-wrapper { position: relative; overflow: hidden; display: inline-block; margin-top: 15px; }
.upload-btn-wrapper input[type=file] { font-size: 100px; position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; }
.btn-upload-aero {
    padding: 8px 20px; background: linear-gradient(to bottom, #4fc3f7 0%, #0288d1 100%);
    border: 1px solid #0277bd; border-radius: 20px; color: white; font-weight: bold; font-size: 13px;
    cursor: pointer; box-shadow: 0 4px 10px rgba(2, 136, 209, 0.4), inset 0 1px 2px rgba(255,255,255,0.6); transition: all 0.2s;
}
.btn-upload-aero:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ==========================================================================
   SELECTOR DE PERIODOS / BIMESTRES
   ========================================================================== */
.select-aero {
    padding: 10px 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.9);
    color: #0d47a1;
    font-weight: 800;
    font-size: 14px;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
}
.select-aero:hover {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), 0 6px 15px rgba(0, 176, 255, 0.3);
}

/* --- CALENDARIO AERO --- */
.calendar-container {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.day-cell {
    background: rgba(255,255,255,0.4);
    border-radius: 10px;
    padding: 10px;
    min-height: 80px;
    border: 1px solid rgba(255,255,255,0.6);
}
.event-tag {
    background: #0072ff;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 5px;
    margin-top: 4px;
    display: block;
    cursor: pointer;
}

/* --- CALENDARIO AERO (ACTUALIZACIÓN) --- */
.cal-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 8px 15px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
}

.cal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Celda para el día de HOY */
.today-cell {
    background: rgba(0, 176, 255, 0.35) !important;
    border: 2px solid #00e5ff !important;
    box-shadow: inset 0 0 15px rgba(0, 229, 255, 0.4), 0 0 10px rgba(0, 229, 255, 0.3) !important;
}

.today-cell small {
    font-weight: 900;
    font-size: 15px;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* =========================================================
   MOTOR DE TEMAS VISUALES (Pegar al final de styles.css)
   ========================================================= */

/* --- 1. LUNA (Windows XP) --- */
body[data-theme="luna"] {
    background: #004e98 !important; /* Azul clásico de escritorio XP */
    color: #000000 !important;
}
body[data-theme="luna"] .glass-container,
body[data-theme="luna"] .sidebar-glass,
body[data-theme="luna"] .top-bar-glass {
    background: #ece9d8 !important; /* Beige clásico de ventanas XP */
    border: 2px solid #0055e5 !important;
    border-top: 30px solid #0055e5 !important; /* Barra de título azul */
    border-radius: 8px 8px 0 0 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: 4px 4px 5px rgba(0,0,0,0.3) !important;
}
body[data-theme="luna"] .welcome-text, 
body[data-theme="luna"] .sidebar-brand {
    color: #ffffff !important;
    margin-top: -28px !important; /* Sube el texto a la barra azul */
    text-shadow: 1px 1px 2px #000000 !important;
    font-family: 'Tahoma', sans-serif !important;
}
body[data-theme="luna"] .section-title, 
body[data-theme="luna"] td, 
body[data-theme="luna"] th, 
body[data-theme="luna"] label {
    color: #000000 !important; text-shadow: none !important;
}
body[data-theme="luna"] .btn-aero, 
body[data-theme="luna"] .btn-update {
    background: linear-gradient(to bottom, #3b8823 0%, #2f6c1c 100%) !important; /* Botón verde de Inicio */
    border: 1px solid #ffffff !important; border-radius: 3px !important; box-shadow: none !important;
}
body[data-theme="luna"] .sidebar-menu li a { color: #0033cc !important; font-family: 'Tahoma', sans-serif !important; }
body[data-theme="luna"] .sidebar-menu li a:hover,
body[data-theme="luna"] .sidebar-menu li.active a { 
    background: #316ac5 !important; color: #ffffff !important; 
}

/* --- 2. Y2K (Cyber Pop de los 2000s) --- */
body[data-theme="y2k"] {
    background: radial-gradient(circle at center, #2b00ff 0%, #000000 100%) !important;
    color: #ffffff !important;
    font-family: 'Courier New', Courier, monospace !important;
}
body[data-theme="y2k"] .glass-container, 
body[data-theme="y2k"] .sidebar-glass,
body[data-theme="y2k"] .top-bar-glass {
    background: rgba(20, 20, 20, 0.8) !important;
    border: 2px solid #ff00cc !important; /* Neón fucsia */
    border-radius: 20px !important;
    box-shadow: 0 0 20px rgba(255, 0, 204, 0.5) !important;
}
body[data-theme="y2k"] .btn-aero {
    background: linear-gradient(to right, #ff00cc, #00ffff) !important;
    border-radius: 20px !important;
    text-transform: uppercase !important;
    font-weight: 900 !important;
    box-shadow: 0 0 15px #ff00cc !important;
    color: black !important;
}
body[data-theme="y2k"] .section-title, 
body[data-theme="y2k"] .logo-main-sidebar {
    color: #00ffff !important; text-shadow: 2px 2px 0px #ff00cc !important;
}

/* --- 3. MINIMALISTA (Blanco, Negro y Limpio) --- */
body[data-theme="minimalista"] {
    background: #f4f5f7 !important;
    color: #333333 !important;
}
body[data-theme="minimalista"] .glass-container, 
body[data-theme="minimalista"] .sidebar-glass, 
body[data-theme="minimalista"] .top-bar-glass {
    background: #ffffff !important;
    border: 1px solid #e1e4e8 !important;
    border-radius: 6px !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}
body[data-theme="minimalista"] .section-title, 
body[data-theme="minimalista"] th, 
body[data-theme="minimalista"] td, 
body[data-theme="minimalista"] label, 
body[data-theme="minimalista"] .welcome-text {
    color: #1a1a1a !important; text-shadow: none !important; font-weight: normal !important;
}
body[data-theme="minimalista"] .btn-aero {
    background: #000000 !important; color: #ffffff !important; border: none !important;
    border-radius: 4px !important; box-shadow: none !important; font-weight: normal !important;
}
body[data-theme="minimalista"] .sidebar-menu li a { color: #4a4a4a !important; }
body[data-theme="minimalista"] .sidebar-menu li.active a { background: #f0f0f0 !important; color: #000000 !important; font-weight: bold !important; }

/* ==========================================================================
   DISEÑO RESPONSIVO (MÓVILES Y TABLETS)
   ========================================================================== */

/* Botón flotante para abrir el menú (Oculto en PC) */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    background: linear-gradient(to bottom, #00b0ff 0%, #0077c2 100%);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 28px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4), inset 0 2px 5px rgba(255,255,255,0.5);
    cursor: pointer;
    text-align: center;
    line-height: 56px;
    user-select: none;
}

/* Sombra de fondo al abrir el menú en móvil */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 9997;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* --- REGLAS SOLO PARA PANTALLAS MENORES A 850px --- */
@media (max-width: 850px) {
    /* Mostrar los controles móviles */
    .mobile-nav-toggle { display: block; }
    .mobile-overlay.show-mobile { display: block; }

    /* Convertir el menú lateral en un panel deslizante */
    .sidebar-glass {
        position: fixed;
        top: 0;
        left: -320px; /* Oculto fuera de la pantalla por defecto */
        height: 100vh;
        width: 280px;
        z-index: 9998;
        transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        /* En móvil, le damos un color más sólido para que no se mezcle con el fondo */
        background: linear-gradient(180deg, rgba(13, 71, 161, 0.98) 0%, rgba(25, 118, 210, 0.98) 100%);
    }

    /* Clase que activa la aparición del menú */
    .sidebar-glass.show-mobile { left: 0; }

    /* Ajustar el espacio principal al 100% de la pantalla */
    .main-viewport { width: 100vw; }
    .content-body { padding: 15px; }
    .top-bar-glass { padding: 0 15px; }

    /* Proteger las Tablas: Habilitar el scroll horizontal interno para que no deformen la pantalla */
    .table-glass { 
        display: block; 
        overflow-x: auto; 
        white-space: nowrap; 
    }

    /* Proteger Formularios: Convertirlos en columnas apiladas */
    form[style*="display: flex"] { 
        flex-direction: column !important; 
        align-items: stretch !important; 
    }
    form[style*="display: flex"] > div, 
    form[style*="display: flex"] > button { 
        width: 100% !important; 
        margin-top: 10px; 
    }

    /* Proteger el Calendario: Forzar un ancho mínimo para poder hacer scroll lateral */
    .calendar-container { overflow-x: auto; }
    .calendar-container > div:nth-child(2), 
    .calendar-container > div:nth-child(3) { 
        min-width: 600px; 
    }

    /* Proteger el Módulo de Chat */
    .chat-wrapper { flex-direction: column; }
    .chat-sidebar { width: 100%; height: 180px; }
}
