/* --- Estilos Generales y Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    background-color: hsl(216, 82%, 54%); 
    color: hwb(0 0% 100%);
}

/* --- Layout del Dashboard (Menu) --- */
.dashboard-container { 
    display: flex; 
    width: 100%; 
    min-height: 100vh; 
}

.sidebar { 
    width: 280px; 
    background-color: hsl(60, 91%, 53%); 
    color: white; 
    padding: 25px; 
}

.logo-box {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid hsl(210, 93%, 48%);
    padding-bottom: 20px;
}

.logo { 
    width: 90px; 
    height: 90px;
    border-radius: 50%; 
    margin: 0 auto 10px; 
    display: block; 
    object-fit: cover;
    border: 2px solid hsl(276, 80%, 45%);
}

.school-title {
    font-size: 0.85rem;
    color: #3498db;
    font-weight: 600;
    margin-top: 5px;
}

.sidebar nav a { 
    display: block; 
    color: #bdc3c7; 
    padding: 15px; 
    text-decoration: none; 
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar nav a:hover { 
    background-color: #34495e; 
    color: white; 
    border-radius: 5px; 
}

.sidebar nav a.logout-link {
    margin-top: 30px;
    color: #e74c3c;
    border-top: 1px dashed #34495e;
}

.sidebar nav a.logout-link:hover {
    background-color: #c0392b;
    color: white;
}

/* --- Contenido Principal --- */
.main-content { 
    flex: 1; 
    padding: 40px; 
}

.main-content h1 {
    font-size: 2rem;
    color: hsl(299, 98%, 60%);
    margin-bottom: 10px;
}

.welcome-msg, .subtitle {   
    color: hsl(2, 94%, 51%);
    margin-bottom: 30px;
}

/* --- Grid de Tarjetas --- */
.cards-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 25px; 
}

.card { 
    background: white; 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 6px 12px rgba(0,0,0,0.05); 
    border-top: 5px solid #c0392b; 
}

.card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.card p {
    color: hsl(257, 89%, 14%);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* --- Tablas Semánticas --- */
table { 
    width: 100%; 
    border-collapse: collapse; 
    background: white; 
    border-radius: 10px; 
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
    margin-top: 15px;
}

th { 
    background-color: #2c3e50; 
    color: white; 
    padding: 15px; 
    text-align: left;
    font-weight: 600;
}

td { 
    padding: 15px; 
    border-bottom: 1px solid #edeef0; 
}

tr:hover {
    background-color: #f8f9fa;
}

select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: white;
    font-size: 0.9rem;
}

/* --- Botones --- */
.btn { 
    background: #3498db; 
    color: white; 
    padding: 10px 20px; 
    text-decoration: none; 
    border-radius: 5px; 
    display: inline-block; 
    font-weight: 600;
    border: none;
    transition: background 0.2s;
}

.btn:hover { 
    background: #2980b9; 
}

.btn-secondary {
    background: #95a5a6;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* --- Estilos para las Páginas de Formulario --- */
.form-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.form-container-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.standard-form .form-group {
    margin-bottom: 20px;
}

.standard-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: hsl(94, 94%, 53%);
}

.standard-form input[type="text"],
.standard-form input[type="number"],
.standard-form input[type="email"],
.standard-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
}

.standard-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%20334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.standard-form input:focus,
.standard-form select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.btn-group {
    margin-top: 30px;
    display: flex;
    align-items: center;
}

/* --- Estilos Exclusivos de Login --- */
.login-body {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 100%;
}

.login-header h2 {
    color: #2c3e50;
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dcdde1;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
}

.login-form input:focus {
    border-color: #2a5298;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: #2a5298;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #1e3c72;
}

/* ==========================================
      ESTILO DEL BALÓN FLOTANTE (ESTILO ODM)
   ========================================== */
.balon-flotante {
    position: absolute;   /* Permite moverlo con coordenadas exactas */
    width: 100px;         /* Tamaño del balón (puedes variarlo si lo quieres más grande/chico) */
    height: auto;
    
    /* Ubicación exacta: Ajusta estos porcentajes o píxeles para moverlo a donde quieras */
    top: 45%;             /* Distancia desde el borde superior de la pantalla */
    left: 33%;            /* Distancia desde el borde izquierdo de la pantalla */
    
    z-index: 10;          /* Asegura que quede por encima del fondo azul */
    pointer-events: none; /* Hace que puedas hacer clic "a través" de él si tapa un input */
    
    /* Opcional: Una ligera sombra para darle profundidad como en la captura */
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
}

/* ==========================================
   MEJORAS VISTA DE CONCENTRADO DE CALIFICACIONES
   ========================================== */

.dashboard-body {
    background-color: #f1f5f9;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-title i {
    font-size: 2rem;
    color: #3498db;
}

/* Tarjetas KPI de Resumen */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.kpi-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.kpi-title {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 5px;
}

.kpi-success {
    color: #10b981;
}

/* Barra de Filtros y Búsqueda */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-input, .filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.filter-input:focus, .filter-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* Formateo de Tabla y Calificaciones */
.text-center {
    text-align: center;
}

.text-capitalize {
    text-transform: capitalize;
    font-weight: 500;
}

/* Distintivos de Calificaciones Reprobatorias / Aprobatorias */
.grade-fail {
    color: #ef4444;
    font-weight: 600;
}

.grade-badge {
    font-weight: 700;
}

.grade-badge.grade-pass {
    color: #059669;
}

.grade-badge.grade-fail {
    color: #dc2626;
    background-color: #fef2f2;
    border-radius: 4px;
}

/* ========================================== */
/* 🌙 VARIABLES Y ESTILOS DE MODO OSCURO       */
/* ========================================== */
body.dark-mode {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

body.dark-mode .container,
body.dark-mode .success-card,
body.dark-mode .error-card,
body.dark-mode .calendar-card,
body.dark-mode .table-card,
body.dark-mode .toolbar,
body.dark-mode .stat-card,
body.dark-mode .chart-card,
body.dark-mode .modal-card,
body.dark-mode .card,
body.dark-mode .login-card,
body.dark-mode .form-container-card,
body.dark-mode .filter-bar,
body.dark-mode main {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

body.dark-mode th {
    background-color: #090d16 !important;
    color: #f8fafc !important;
}

body.dark-mode td {
    color: #cbd5e1 !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode tr:hover {
    background-color: #273548 !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

/* Botón flotante de cambio de modo */
.dark-mode-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #1e3a8a;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: transform 0.2s, background 0.2s;
}
.dark-mode-toggle:hover {
    transform: scale(1.1);
    background: #2563eb;
}
