/* ================================================
   SISTEMA DE GESTIÓN ESCOLAR - ESTILOS PRINCIPALES
   ================================================ */

/* ==================== VARIABLES GLOBALES ==================== */
:root {
    --primary-color: #1d4f13;      /* Color principal (azul) */
    --secondary-color: #791919;    /* Color secundario (gris oscuro) */
    --accent-color: #e74c3c;       /* Color de acento (rojo) */
    --light-color: #ecf0f1;        /* Color claro */
    --dark-color: #34495e;         /* Color oscuro */
    --sidebar-width: 250px;        /* Ancho del panel lateral */
    --sidebar-collapsed-width: 70px; /* Ancho del panel colapsado */
    --header-height: 60px;         /* Altura del encabezado */
    --transition: all 0.3s ease;   /* Transición uniforme */
}

/* ==================== TEMAS DISPONIBLES ==================== */
/* Tema por defecto */
.tema-default {
    --bg-color: #f5f7fa;
    --text-color: #333;
    --modal-bg: #fff;
    --input-bg: #fff;
    --border-color: #ddd;
}

/* Tema oscuro */
.tema-dark {
    --bg-color: #1a1a1a;
    --text-color: #fff;
    --modal-bg: #2d2d2d;
    --input-bg: #3d3d3d;
    --border-color: #4d4d4d;
}

/* Tema claro */
.tema-light {
    --bg-color: #ffffff;
    --text-color: #333;
    --modal-bg: #f8f9fa;
    --input-bg: #fff;
    --border-color: #e9ecef;
}

/* ==================== RESET Y ESTILOS BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

/* ==================== PANEL LATERAL (SIDEBAR) ==================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--secondary-color);
    color: white;
    transform: translateX(-100%);  /* Oculto por defecto en móviles */
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    background-color: red;
    
}

.sidebar.active {
    transform: translateX(0);      /* Visible cuando tiene clase active */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;  /* Oculto en desktop, visible en móviles */
}

.sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-link i {
    margin-right: 1rem;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

/* ==================== OVERLAY (FONDO SEMITRANSPARENTE) ==================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    pointer-events: none;  /* Evita que interfiera cuando está oculto */
}

.overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;   /* Permite cerrar el sidebar al hacer clic */
}

/* ==================== CONTENIDO PRINCIPAL ==================== */
.main-content {
    transition: var(--transition);
    min-height: 100vh;
}

.header {
    display: flex;
    align-items: center;
    height: var(--header-height);
    background: white;
    padding: 0 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
    margin-right: 1rem;
}

.content {
    padding: 2rem;
}

/* ==================== TÍTULOS PRINCIPALES ==================== */
.main-title-container {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.main-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==================== SECCIONES ==================== */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* ==================== TARJETAS ==================== */
.welcome-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card, .admin-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.feature-card:hover, .admin-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-card i, .admin-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ==================== BOTONES ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #1a252f;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
}

.btn-cancel:hover {
    background: #7f8c8d;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--dark-color);
    cursor: pointer;
    font-size: 1rem;
    margin: 0 0.2rem;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--primary-color);
}

/* ==================== BARRA DE ACCIONES Y BÚSQUEDA ==================== */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 0.8rem;
    color: #777;
}

/* ==================== FILTROS ==================== */
.filter-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    gap: 2px;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-tab:hover:not(.active) {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
}

/* ==================== TABLAS ==================== */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--dark-color);
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* ==================== ESTADOS (PRESENTE/AUSENTE) ==================== */
.status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* ==================== BADGES DE ROL ==================== */
.rol-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rol-badge.alumno {
    background: #d4edda;
    color: #155724;
}

.rol-badge.profesor {
    background: #cce7ff;
    color: #004085;
}

.rol-badge.preceptor {
    background: #fff3cd;
    color: #856404;
}

.rol-badge.directivo {
    background: #f8d7da;
    color: #721c24;
}

/* ==================== TARJETAS DE ESTADÍSTICAS ==================== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary-color);
}

.stat-card:nth-child(2) { border-left-color: #27ae60; }
.stat-card:nth-child(3) { border-left-color: #e74c3c; }
.stat-card:nth-child(4) { border-left-color: #f39c12; }

.stat-card i {
    font-size: 1.5rem;
}
.stat-card:nth-child(2) i { color: #27ae60; }
.stat-card:nth-child(3) i { color: #e74c3c; }
.stat-card:nth-child(4) i { color: #f39c12; }

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

/* ==================== PAGINACIÓN ==================== */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0 0 10px 10px;
    border-top: 1px solid #eee;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-pagination {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-pagination:hover:not(:disabled) {
    background: #2980b9;
}

.btn-pagination:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* ==================== MODALES ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--modal-bg);
    border-radius: 10px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-large {
    max-width: 800px;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: var(--secondary-color);
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #777;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* ==================== FORMULARIOS ==================== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group label i {
    color: var(--primary-color);
    width: 16px;
}

.form-group input,
.custom-dropdown select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.custom-dropdown select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Dropdown personalizado */
.custom-dropdown {
    position: relative;
}

.custom-dropdown select {
    appearance: none;
    background: white;
    cursor: pointer;
}

.dropdown-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    pointer-events: none;
}

/* Campo dinámico (se muestra según el rol) */
.hidden {
    display: none;
}

/* ==================== SECCIÓN RFID ==================== */
.rfid-section {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn-rfid {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-rfid:hover {
    background: #1a252f;
}

.btn-rfid.connected {
    background: #27ae60;
}

.rfid-manual-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
    font-family: monospace;
}

.rfid-manual-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.message-box {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 5px;
    padding: 0.8rem 1rem;
    text-align: center;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.message-box.scanning {
    border-color: var(--primary-color);
    background: rgba(52, 152, 219, 0.05);
    color: var(--primary-color);
}

.message-box.scanned {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.05);
    color: #27ae60;
}

/* ==================== GRÁFICOS CIRCULARES ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-circle-container {
    text-align: center;
}

.circle-chart {
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 2;
}

.circle-alumnos, .circle-profesores, .circle-preceptores, .circle-directivos {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.circle-alumnos { stroke: #3498db; }
.circle-profesores { stroke: #e74c3c; }
.circle-preceptores { stroke: #f39c12; }
.circle-directivos { stroke: #27ae60; }

.percentage {
    fill: #2c3e50;
    font-size: 0.4em;
    text-anchor: middle;
    font-weight: bold;
    transform: rotate(90deg);
    transform-origin: 50% 50%;
}

.stat-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0.5rem 0;
}

/* ==================== ADMINISTRACIÓN ==================== */
.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.permisos-info {
    background: #e8f4fd;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    border-left: 4px solid #3498db;
}

.permisos-info ul {
    margin: 0;
    padding-left: 1.2rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }
    
    .close-btn {
        display: block;
    }
    
    .content {
        padding: 1rem;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-footer {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (min-width: 992px) {
    /* En desktop, el sidebar siempre está visible */
    .sidebar {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    .menu-toggle {
        display: none;
    }
    
    .overlay {
        display: none;
    }
}

/* ================================================
   ESTILOS ADICIONALES PARA SECCIÓN DE ESTADÍSTICAS
   ================================================ */

/* ==================== ESTADÍSTICAS DETALLADAS ==================== */

/* Grid de gráficos circulares */
.stats-detailed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
}

/* Gráficos circulares más grandes para la sección dedicada */
.stat-circle-container {
    text-align: center;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.stat-circle-container:hover {
    transform: translateY(-5px);
}

.stat-circle-container h4 {
    margin: 1rem 0 0.5rem;
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.stat-count {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
}

/* Resumen general detallado */
.stats-summary-detailed {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    color: white;
}

.stats-summary-detailed h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-detailed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.summary-detailed-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.summary-detailed-item:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.25);
}

.summary-icon {
    font-size: 2rem;
}

.summary-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Tabla de asistencia por curso */
.stats-table-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.stats-table-container h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Barra de progreso para porcentajes */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.percentage-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.percentage-badge.high {
    background: #d4edda;
    color: #155724;
}

.percentage-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.percentage-badge.low {
    background: #f8d7da;
    color: #721c24;
}

/* Botones de acción de estadísticas */
.stats-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Información de usuario en header */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: auto;
    background: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    color: white;
}

.user-info i {
    font-size: 1rem;
}

.user-info span {
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-logout-header {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.btn-logout-header:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Elementos ocultos para usuarios no directivos */
.nav-item-oculto {
    display: none !important;
}

/* Responsive para estadísticas */
@media (max-width: 768px) {
    .stats-detailed-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .summary-detailed-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-detailed-item {
        flex-direction: column;
        text-align: center;
    }
    
    .summary-content {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .stats-actions {
        flex-direction: column;
    }
    
    .stats-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-detailed-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   ESTILOS PARA MODALES DE NOTIFICACIÓN
   ================================================ */

/* Modal de notificación */
#notificationModal .modal-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

#notificationModal .modal-header i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

#notificationModal .modal-header h3 {
    color: white;
    margin: 0;
    flex: 1;
}

#notificationModal .modal-header .close-modal {
    color: white;
}

#notificationModal .modal-header .close-modal:hover {
    color: #f0f0f0;
}

/* Modal de confirmación */
#confirmModal .modal-header {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

#confirmModal .modal-header i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

#confirmModal .modal-header h3 {
    color: white;
    margin: 0;
    flex: 1;
}

/* Modal de carga */
#loadingModal .modal-content {
    background: var(--modal-bg);
    border-radius: 15px;
}

#loadingModal .modal-body {
    padding: 2rem;
}

/* Tipos de notificación */
.notification-success .modal-header {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.notification-error .modal-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.notification-warning .modal-header {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.notification-info .modal-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* Animación para modales */
.modal.active .modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.logo{
    width: 40px;
    height: 40px;
    background: url('../assets/logo.png') no-repeat center center;
    background-size: contain;
}

.sidebar-profile {
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);

}

/* ================================================
   ESTILOS PARA FOTOS DE PERFIL Y FICHAS DE ALUMNOS
   ================================================ */

/* Foto en el sidebar */
.user-profile-sidebar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.user-avatar-sidebar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-avatar-sidebar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-sidebar i {
    font-size: 2.5rem;
    color: white;
}

.user-info-sidebar {
    flex: 1;
}

.user-name-sidebar {
    display: block;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
}

.user-role-sidebar {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.user-course-sidebar {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Foto en el header */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: auto;
    background: var(--primary-color);
    padding: 0.3rem 0.8rem 0.3rem 0.3rem;
    border-radius: 40px;
    color: white;
}

.user-avatar-header {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-avatar-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-header i {
    font-size: 1.8rem;
}

.user-details-header {
    display: flex;
    flex-direction: column;
}

.user-details-header #userName {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-role-header {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Contenedor de carga de foto */
.photo-upload-container {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 10px;
}

.photo-preview {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--primary-color);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-upload-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.photo-hint {
    font-size: 0.7rem;
    color: #6c757d;
    margin: 0;
}

/* Tabla con fotos */
.data-table td .user-thumb {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
}

/* Ficha del alumno */
.ficha-container {
    display: flex;
    gap: 2rem;
    padding: 1rem;
}

.ficha-foto {
    width: 200px;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ficha-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ficha-datos {
    flex: 1;
}

.ficha-datos h4 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.ficha-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ficha-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ficha-item label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.8rem;
}

.ficha-item span {
    font-size: 1rem;
    color: var(--text-color);
}

.ficha-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Responsive para ficha */
@media (max-width: 768px) {
    .ficha-container {
        flex-direction: column;
        align-items: center;
    }
    
    .ficha-foto {
        width: 150px;
        height: 150px;
    }
    
    .ficha-info-grid {
        grid-template-columns: 1fr;
    }
    
    .ficha-actions {
        justify-content: center;
    }
}

/* Foto en tabla de alumnos del curso */
.alumno-thumb {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.alumno-thumb:hover {
    transform: scale(1.1);
}

/* Estilo para filas clickeables */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: var(--light-color) !important;
}

/* ==================== NUEVAS CLASES PARA MEJORAS ==================== */

/* Selector de fechas para historial de asistencia */
.date-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: var(--card-bg);
    border-radius: 12px;
}

.date-selector label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-picker {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
}

.btn-fecha {
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
}

/* Botones de exportación */
.btn-excel {
    background: #28a745;
    color: white;
}

.btn-excel:hover {
    background: #218838;
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

/* Badge para asistencia historial */
.asistencia-historial {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

.asistencia-fecha-actual {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-left: 0.5rem;
}

/* Modal de edición de persona */
.edit-persona-modal .modal-content {
    max-width: 600px;
}

.edit-field {
    border: 1px solid var(--primary-color);
    background: var(--input-bg);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    width: 100%;
}

.edit-field:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
}

.foto-edit-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
    border: 2px solid var(--primary-color);
}

/* Indicador de carga en botones */
.btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Toast de notificaciones */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }
.toast.warning { border-left-color: var(--warning-color); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== SIDEBAR ESTILO NUEVO (CORREGIDO) ==================== */

.sidebar {
    background: linear-gradient(180deg, #cc2828 0%, #230202 100%);
    font-family: 'Segoe UI', sans-serif;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Logo */
.sidebar-logo {
    text-align: center;
    padding: 0.5rem 0;
}

.sidebar-logo h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-logo h3 i {
    margin-right: 0.5rem;
    color: #6e89d4;
}

.sidebar-logo p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
    margin: 0.3rem 0 0;
}

/* Perfil de usuario en sidebar */
.user-profile-sidebar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.7rem;
    margin-top: 0.5rem;
}

.user-avatar-sidebar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-sidebar i {
    font-size: 2rem;
    color: white;
}

.user-info-sidebar {
    flex: 1;
    min-width: 0;
}

.user-name-sidebar {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-sidebar {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.user-course-sidebar {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Botón cerrar sidebar (solo móviles) */
.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
}

/* Navegación */
.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-section {
    margin-bottom: 1.5rem;
}

.sidebar-nav .nav-section-title {
    padding: 0.5rem 1.2rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 0.8rem;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: rgba(255, 255, 255, 0.3);
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #ffc107;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-nav .nav-link span {
    font-size: 0.85rem;
}

/* Responsive para móviles */
@media (max-width: 992px) {
    .close-btn {
        display: block;
    }
    
    .sidebar-logo h3 {
        font-size: 1rem;
    }
    
    .user-name-sidebar {
        font-size: 0.8rem;
    }
}

/* ==================== PROFESORES ==================== */

.profesores-stats {
    margin: 1rem 0;
}

/* Materias y horarios */
.materias-container {
    background: var(--light-color);
    border-radius: 8px;
    padding: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.materia-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 0.4rem 0.8rem;
    margin: 0.3rem 0;
    border-radius: 6px;
}

.materia-nombre {
    flex: 1;
    font-size: 0.85rem;
}

.materia-eliminar {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
}

.horario-container {
    background: var(--light-color);
    border-radius: 8px;
    padding: 0.5rem;
}

.horario-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.horario-dia {
    width: 100px;
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
}

.horario-hora {
    flex: 1;
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
}

.btn-eliminar-horario {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
}

.btn-agregar-horario {
    margin-top: 0.5rem;
}

/* Perfil de profesor */
.perfil-profesor-container {
    display: flex;
    gap: 2rem;
}

.perfil-foto {
    width: 150px;
    height: 150px;
    border-radius: 15px;
    overflow: hidden;
    background: var(--light-color);
    border: 3px solid var(--primary-color);
}

.perfil-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.perfil-datos {
    flex: 1;
}

.perfil-datos h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.perfil-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.perfil-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.perfil-item label {
    font-size: 0.7rem;
    color: #6c757d;
}

.perfil-materias, .perfil-horario {
    margin-bottom: 1.5rem;
}

.perfil-materias h5, .perfil-horario h5 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.materias-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.materia-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

.horario-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.horario-table th, .horario-table td {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: left;
}

.horario-table th {
    background: var(--light-color);
}

.perfil-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Responsive perfil */
@media (max-width: 768px) {
    .perfil-profesor-container {
        flex-direction: column;
        align-items: center;
    }
    
    .perfil-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== PROFESORES ==================== */

.profesores-stats {
    margin: 1rem 0;
}

.materias-container {
    background: var(--light-color);
    border-radius: 8px;
    padding: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.materia-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 0.4rem 0.8rem;
    margin: 0.3rem 0;
    border-radius: 6px;
}

.materia-nombre {
    flex: 1;
    font-size: 0.85rem;
}

.materia-eliminar {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
}

.horario-container {
    background: var(--light-color);
    border-radius: 8px;
    padding: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.horario-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.horario-dia {
    width: 100px;
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
}

.horario-hora {
    width: 120px;
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
}

.horario-materia {
    flex: 1;
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
}

.btn-eliminar-horario {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
}

/* Perfil de profesor */
.perfil-profesor-container {
    display: flex;
    gap: 2rem;
}

.perfil-foto {
    width: 150px;
    height: 150px;
    border-radius: 15px;
    overflow: hidden;
    background: var(--light-color);
    border: 3px solid var(--primary-color);
}

.perfil-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.perfil-datos {
    flex: 1;
}

.perfil-datos h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.perfil-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.perfil-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.perfil-item label {
    font-size: 0.7rem;
    color: #6c757d;
}

.perfil-materias, .perfil-horario {
    margin-bottom: 1.5rem;
}

.perfil-materias h5, .perfil-horario h5 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.materias-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.materia-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

.horario-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.horario-table th, .horario-table td {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: left;
}

.horario-table th {
    background: var(--light-color);
}

.perfil-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .perfil-profesor-container {
        flex-direction: column;
        align-items: center;
    }
    
    .perfil-info-grid {
        grid-template-columns: 1fr;
    }
    
    .horario-row {
        flex-wrap: wrap;
    }
    
    .horario-dia, .horario-hora {
        width: 100%;
    }
}

/* ==================== MODALES SCROLLEABLES (CORREGIDO) ==================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--modal-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Modal grande (como perfil de profesor) */
.modal-large {
    max-width: 900px;
}

/* Modal pequeño (notificaciones) */
.modal-small {
    max-width: 400px;
}

/* Header sticky */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--modal-bg);
    z-index: 10;
}

/* Footer sticky */
.modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--modal-bg);
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    z-index: 10;
}

/* Acciones sticky */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    background: var(--modal-bg);
    z-index: 10;
}

/* Cuerpo del modal con scroll interno */
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Contenedores internos scrollables */
.materias-container {
    background: var(--light-color);
    border-radius: 8px;
    padding: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.horario-container {
    background: var(--light-color);
    border-radius: 8px;
    padding: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.table-container {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 0.8rem 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== FICHA DE ALUMNO EXPANDIDA ==================== */

/* Tabs de la ficha */
.ficha-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.ficha-tab {
    padding: 0.6rem 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
}

.ficha-tab:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
}

.ficha-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.ficha-tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

.ficha-tab-content.active {
    display: block;
}

/* Botón cambiar foto */
.btn-cambiar-foto {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.ficha-foto {
    position: relative;
}

/* Tarjetas académicas */
.academico-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.academico-card {
    background: var(--light-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.academico-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.3rem;
}

.academico-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Datos familiares */
.familia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.familia-card {
    background: var(--light-color);
    border-radius: 12px;
    padding: 1rem;
}

.familia-card h5 {
    margin-bottom: 0.8rem;
    color: var(--secondary-color);
}

.familia-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.familia-item label {
    font-weight: 600;
    color: #6c757d;
}

/* Datos de salud */
.salud-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    background: var(--light-color);
    border-radius: 12px;
    padding: 1rem;
}

.salud-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.salud-item label {
    font-weight: 600;
    color: #6c757d;
}

/* Resumen asistencia */
.asistencia-resumen {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.asistencia-stat {
    background: var(--light-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.asistencia-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
}

.asistencia-value {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.progress-bar-container {
    margin: 1rem 0;
}

.progress-bar-container label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Documentos */
.documentos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    background: var(--light-color);
    border-radius: 12px;
    padding: 1rem;
}

.documento-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.documento-item input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.documento-item label {
    font-size: 0.85rem;
    cursor: pointer;
}

/* Botón exportar PDF */
.btn-excel {
    background: #dc3545;
    color: white;
}

.btn-excel:hover {
    background: #c82333;
}

/* Responsive */
@media (max-width: 768px) {
    .academico-stats, .asistencia-resumen {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .familia-grid {
        grid-template-columns: 1fr;
    }
    
    .salud-grid {
        grid-template-columns: 1fr;
    }
    
    .documentos-grid {
        grid-template-columns: 1fr;
    }
    
    .ficha-tabs {
        gap: 0.2rem;
    }
    
    .ficha-tab {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Sección colapsable para datos adicionales */
.datos-alumno-extra {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.collapsible-header {
    background: var(--light-color);
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapsible-header:hover {
    background: rgba(52, 152, 219, 0.1);
}

.collapsible-content {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.collapsible-content.hidden {
    display: none;
}

/* ==================== ANUNCIOS MEJORADOS ==================== */

/* Editor de texto enriquecido */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.5rem;
    background: var(--light-color);
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--border-color);
}

.editor-toolbar button {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.editor-toolbar button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.editor-content {
    min-height: 150px;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    background: var(--input-bg);
    color: var(--text-color);
    overflow-y: auto;
}

.editor-content:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Anuncio destacado */
.anuncio-card.destacado {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255, 193, 7, 0.05) 100%);
}

.anuncio-destacado-badge {
    background: #ffc107;
    color: #856404;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Categorías */
.anuncio-categoria {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.categoria-Evento { background: #3498db; color: white; }
.categoria-Comunicado { background: #2ecc71; color: white; }
.categoria-Actividad { background: #9b59b6; color: white; }
.categoria-Urgente { background: #e74c3c; color: white; }

/* Programación de publicación */
.fecha-programada {
    font-size: 0.7rem;
    color: var(--warning-color);
}

.anuncio-vencido {
    opacity: 0.7;
    background: rgba(231, 76, 60, 0.05);
}

/* Archivos adjuntos */
.anuncio-adjuntos {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.adjunto-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--light-color);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
}

.adjunto-item i {
    font-size: 0.8rem;
}

.adjunto-item a {
    color: var(--text-color);
    text-decoration: none;
}

.adjunto-item a:hover {
    text-decoration: underline;
}

/* Vista previa */
.preview-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Notificaciones */
.notification-badge {
    position: relative;
}

.notification-badge .badge-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Input de fecha programada */
.datetime-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.datetime-input input {
    flex: 1;
}