/* =========================================
   ESTILOS DE GESTIÓN (Golden Ratio + Blue Palette)
========================================= */

/* --- GRID DE PROMOCIONES --- */
.promos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.promo-card {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
    padding: var(--space-lg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}
.promo-card:hover { transform: translateY(-4px); border-color: var(--primary-main); }
.promo-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary-main);
}

.promo-header { border-bottom: 1px solid #f0f0f0; padding-bottom: var(--space-sm); margin-bottom: var(--space-md); }
.promo-title { font-family: var(--font-ui); font-weight: 700; font-size: 1.1rem; color: var(--secondary); }
.promo-course { font-size: 0.9rem; color: var(--text-gray); font-weight: 500; margin-top: 4px; }

.promo-dates { 
    font-size: 0.9rem; color: var(--text-dark); margin-bottom: var(--space-lg); 
    display: flex; align-items: center; gap: 8px;
    background: #f8faff; padding: 8px; border-radius: 6px;
}
.promo-dates i { color: var(--primary-main); }

/* --- ASISTENCIAS --- */
.attendance-controls {
    display: flex; gap: var(--space-md); margin-bottom: var(--space-xl); align-items: center;
    background: var(--white); padding: var(--space-lg); border-radius: var(--radius); border: 1px solid #eee;
    box-shadow: var(--shadow);
}

.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.class-day-card {
    background: var(--white);
    border: 1px solid #eee;
    border-radius: var(--radius);
    padding: 20px;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    justify-content: space-between;
    transition: 0.2s;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.class-day-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); border-color: var(--primary-pale); }

.class-day-card.status-pendiente { border-top: 4px solid var(--warning); }
.class-day-card.status-realizada { border-top: 4px solid var(--success); }
.class-day-card.status-cancelada { border-top: 4px solid var(--danger); background: #fffdfd; opacity: 0.8; }

.status-badge {
    padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 15px; display: inline-block;
}
.badge-pending { background: #fff8e1; color: #f39c12; }
.badge-done { background: #e8f5e9; color: #2ecc71; }
.badge-cancelled { background: #ffebee; color: #e74c3c; }

.attendance-sheet { width: 100%; border-collapse: collapse; margin-top: var(--space-lg); }
.attendance-sheet th { 
    background: var(--secondary); color: var(--white); 
    padding: var(--space-md); text-align: left; font-family: var(--font-head);
}
.attendance-sheet td { padding: var(--space-md); border-bottom: 1px solid #eee; }
.attendance-sheet tr:hover td { background: #f0f7ff; }

.attendance-check { width: 24px; height: 24px; cursor: pointer; accent-color: var(--success); }

/* --- ALERTAS --- */
.alerts-grid { display: flex; flex-direction: column; gap: var(--space-md); }

.alert-card {
    background: var(--white); padding: var(--space-lg); border-radius: var(--radius);
    border-left: 5px solid #ccc;
    display: flex; gap: var(--space-lg); align-items: flex-start;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

.alert-icon { 
    font-size: 1.6rem; 
    background: #f4f4f4; width: 50px; height: 50px; 
    border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-shrink: 0;
}
.alert-content { flex: 1; }
.alert-content h4 { margin: 0 0 6px 0; font-size: 1.05rem; font-family: var(--font-ui); color: var(--secondary); }
.alert-content p { margin: 0; font-size: 0.95rem; color: var(--text-gray); line-height: 1.5; }
.alert-date { font-size: 0.8rem; color: #999; margin-top: 8px; font-family: var(--font-body); }

.alert-info { border-left-color: var(--primary-main); } 
.alert-info .alert-icon { color: var(--primary-main); background: #eef4ff; }
.alert-warning { border-left-color: var(--warning); } 
.alert-warning .alert-icon { color: var(--warning); background: #fff8e1; }
.alert-critical { border-left-color: var(--danger); } 
.alert-critical .alert-icon { color: var(--danger); background: #ffebee; }

/* --- CALIFICACIONES --- */
.grades-table-wrapper { 
    background: var(--white); border-radius: var(--radius); padding: var(--space-lg); 
    box-shadow: var(--shadow); overflow-x: auto;
}
.grade-input { width: 60px; padding: 6px; text-align: center; border: 1px solid #ddd; border-radius: 4px; }
.grade-final { font-weight: 800; color: var(--secondary); }
.grade-low { color: var(--danger); }
.grade-high { color: var(--success); }

/* --- REPORTE DE NOTAS --- */
.report-student-header {
    display: flex; align-items: center; gap: 15px; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #eee;
}
.student-initials {
    width: 45px; height: 45px; background: #f8f9fa; border: 1px solid #ddd; 
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #555; border-radius: 4px; font-size: 1.1rem;
}
.student-name-title { font-size: 1.2rem; font-weight: 800; color: #212121; text-transform: uppercase; margin: 0; }

.gradebook-table {
    width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: 0.9rem;
}
.gradebook-table th {
    background: #f9f9f9; color: #666; font-weight: 600; padding: 12px; text-align: left; border-bottom: 2px solid #ddd;
    font-size: 0.85rem; text-transform: uppercase;
}
.gradebook-table td { padding: 12px; border-bottom: 1px solid #eee; color: #333; }

.row-category td { background: #fff; font-weight: 700; color: #000; padding-top: 20px; border-bottom: none; font-size: 0.95rem; }
.row-item td { padding-left: 25px; }
.row-item:hover td { background: #fcfcfc; }
.row-total td { background: #f5f5f5; font-weight: 600; border-top: 1px solid #ddd; color: #000; }
.row-final-total td { background: #f0f0f0; font-weight: 800; border-top: 2px solid #ccc; font-size: 1rem; padding: 15px; }
.col-num { text-align: center; }

/* --- HORARIO GRID --- */
.schedule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-md); }
.schedule-item { background: #fbfbfb; padding: var(--space-md); border-radius: 8px; border: 1px solid #eee; }
.schedule-item label { font-weight: 600; display: block; margin-bottom: 5px; color: var(--secondary); }
.schedule-inputs { display: flex; gap: 8px; align-items: center; margin-top: 5px; }

/* =========================================
   CORRECCIÓN DE ALINEACIÓN DE BOTONES
========================================= */
.btn-primary, .btn-outline, .btn-add-res, .btn-google, .mini-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}
.btn-primary i, .btn-outline i, .btn-add-res i, .btn-google i {
    display: inline-block !important; margin: 0 !important; padding: 0 !important;
}

/* =========================================
   --- TARJETAS DE CURSOS (DISEÑO FIXED) ---
========================================= */
.course-card-custom {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.course-card-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.course-img-bg {
    height: 160px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.card-actions-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.btn-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}
.btn-circle:hover {
    background: #fff;
    transform: scale(1.1);
}
.btn-circle.delete {
    color: #d9534f;
}

/* =========================================
   TABLA DE CALIFICACIONES TIPO MOODLE
========================================= */
.gradebook-wrapper { background: var(--white); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid #eee; }
.gradebook-table { width: 100%; border-collapse: collapse; text-align: left; }
.gradebook-table th { background: #f8faff; padding: 15px 20px; font-family: var(--font-ui); font-weight: 600; color: var(--secondary); font-size: 0.9rem; text-transform: uppercase; border-bottom: 2px solid #e2e8f0; }
.gradebook-table td { padding: 15px 20px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }

.grade-row-summary { cursor: pointer; transition: background 0.2s; }
.grade-row-summary:hover { background: #f4f8ff; }
.grade-row-summary .chevron { transition: transform 0.3s; color: #aaa; }
.grade-row-summary.expanded .chevron { transform: rotate(180deg); color: var(--primary-main); }

.grade-row-details { display: none; background: #fafcff; }
.grade-row-details.active { display: table-row; animation: fadeIn 0.3s ease; }

.details-inner-table { width: 100%; border-collapse: collapse; margin: 10px 0; background: white; border-left: 4px solid var(--primary-main); box-shadow: 0 2px 5px rgba(0,0,0,0.04); border-radius: 0 8px 8px 0; overflow: hidden; }
.details-inner-table th { background: #fdfdfd; border-bottom: 1px solid #eee; font-size: 0.85rem; color: #888; padding: 12px 20px; text-transform: uppercase; }
.details-inner-table td { border-bottom: 1px dashed #eee; font-size: 0.95rem; padding: 12px 20px; color: #444; }
.details-inner-table tr:hover td { background: #fcfcfc; }

.grade-badge { padding: 5px 12px; border-radius: 6px; font-weight: 700; font-size: 0.9rem; display: inline-block; min-width: 60px; text-align: center; }
.grade-excellent { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.grade-good { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.grade-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.grade-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.grade-null { background: #f8f9fa; color: #adb5bd; border: 1px dashed #ddd; }

/* =========================================
   BLOQUEO ESTRICTO DE ROLES (SEGURIDAD)
========================================= */
body.role-student .admin-only,
body.role-student .teacher-allowed {
    display: none !important;
}

body.role-teacher .admin-only:not(.teacher-allowed) {
    display: none !important;
}