:root {
    --primary-color: #1b4332;
    --secondary-color: #2d6a4f;
    --accent-color: #52b788;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #2b2d42;
    --text-muted: #6c757d;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #27ae60;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    font-size: 2rem;
}

header p {
    opacity: 0.9;
}

/* Imagen del portal a la izquierda del título */
.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-brand-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
    flex-shrink: 0;
}

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

.badge-header {
    background: rgba(255,255,255,0.2);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.3);
}

/* ===== HEADER SOCIAL ICONS ===== */
.header-social {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.header-social-label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-right: 0.2rem;
    white-space: nowrap;
}

.header-social-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
}

.header-social-icon:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ===== NAV TABS (Público — index.html) ===== */
.nav-tabs {
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-tabs-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 0.25rem;
    padding: 0 1rem;
}

.tab-link {
    padding: 0.9rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tab-link:hover {
    color: var(--secondary-color);
    background: #f8fafc;
}

.tab-link.active {
    color: var(--secondary-color);
    border-bottom-color: var(--accent-color);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ===== QUICK FILTERS ===== */
.quick-filters {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.quick-filters h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.area-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.area-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.area-btn:hover {
    border-color: var(--accent-color);
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.area-btn.active {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: white;
}

/* ===== FILTERS ===== */
.filters-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    background-color: #fff;
    transition: border-color 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--accent-color);
}

.filters-clear-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* ===== RESULTS ===== */
.results-count {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* ===== TEACHER CARD ===== */
.teacher-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    border: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

.teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-header {
    background: #f1f5f9;
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #edf2f7;
}

.avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
    border: 3px solid white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card-header h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.badge-area {
    display: inline-block;
    background: rgba(82, 183, 136, 0.2);
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.badge-sede {
    display: inline-block;
    background: rgba(21, 101, 192, 0.12);
    color: #1565c0;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.3rem;
    margin-left: 0.3rem;
}

.badge-sede i {
    margin-right: 0.3rem;
}

.badge-materias {
    display: inline-block;
    background: rgba(43, 108, 176, 0.15);
    color: #2b6cb0;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 0.2rem;
}

.card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.info-item i {
    width: 25px;
    color: var(--secondary-color);
    margin-top: 3px;
}

.info-item strong {
    margin-right: 5px;
}

.sobre-mi {
    font-style: italic;
    color: var(--text-muted);
    border-top: 1px dashed #e2e8f0;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.materias-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #e2e8f0;
}

.materias-section h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ===== NO RESULTS ===== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: 12px;
    color: var(--text-muted);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

/* ===== LOGIN ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* ===== ADMIN PANEL ===== */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    color: var(--text-muted);
}

.tab-btn:hover {
    background: #f1f5f9;
}

.tab-btn.active {
    background: var(--accent-color);
    color: white;
}

.tab-content {
    display: none;
}

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

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ===== DASHBOARD STATS ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 0.3rem;
}

.stat-change.positive { color: var(--success-color); }
.stat-change.negative { color: var(--danger-color); }
.stat-change.neutral  { color: var(--warning-color); }

.dashboard-stats {
    margin-bottom: 2rem;
}

/* ===== CHARTS ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.chart-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1rem;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

/* ===== DASHBOARD BOTTOM ===== */
.dashboard-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.recent-docentes {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.recent-docentes h4,
.status-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1rem;
}

.status-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #edf2f7;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item .nombre {
    font-weight: 600;
    color: var(--text-color);
}

.recent-item .area {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
}

.recent-item .fecha {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #edf2f7;
}

.status-item:last-child {
    border-bottom: none;
}

.status-item .label {
    font-weight: 500;
}

.status-item .count {
    font-weight: 700;
    color: var(--primary-color);
}

.badge-activo {
    color: var(--success-color);
}

.badge-inactivo {
    color: var(--danger-color);
}

/* ===== TABLES ===== */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

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

.admin-table thead {
    background: #f1f5f9;
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #edf2f7;
}

.admin-table tr:hover {
    background: #f8fafc;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    margin: 0 0.2rem;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    margin: 0 0.2rem;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-search-green {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-search-green:hover {
    background: var(--secondary-color);
    transform: scale(1.02);
}

.btn-secondary-clear {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-secondary-clear:hover {
    background: #f1f5f9;
    color: var(--text-color);
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

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

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.modal-header h3 {
    color: var(--primary-color);
}

.close-modal {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s;
}

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

.modal-body {
    padding: 1.5rem;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-color);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.error-message {
    color: var(--danger-color);
    margin-top: 1rem;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-brand {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .teachers-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-bottom {
        grid-template-columns: 1fr;
    }
}

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

/* ============================================
   HORARIOS - ESTILOS
   ============================================ */

.horario-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow-x: auto;
}

.horario-grid {
    display: flex;
    flex-direction: column;
    min-width: 700px;
}

.horario-header {
    display: grid;
    grid-template-columns: 60px 100px repeat(5, 1fr);
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.horario-header > div {
    padding: 0.8rem 0.5rem;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.horario-header > div:last-child {
    border-right: none;
}

.horario-row {
    display: grid;
    grid-template-columns: 60px 100px repeat(5, 1fr);
    border-bottom: 1px solid #e2e8f0;
}

.horario-row:last-child {
    border-bottom: none;
}

.horario-cell {
    padding: 0.8rem 0.5rem;
    text-align: center;
    border-right: 1px solid #f1f5f9;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
}

.horario-cell:last-child {
    border-right: none;
}

.horario-cell.bloque-num {
    font-weight: 700;
    color: var(--primary-color);
    background: #f1f5f9;
    font-size: 1.1rem;
}

.horario-cell.hora {
    background: #f8fafc;
    font-weight: 500;
    font-size: 0.85rem;
}

.horario-cell.clase {
    background: #dcfce7;
    border-radius: 6px;
    margin: 2px;
    transition: all 0.3s;
}

.horario-cell.clase:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(34,197,94,0.3);
}

.horario-cell.vacio {
    background: #f8fafc;
    border-radius: 6px;
    margin: 2px;
    transition: all 0.3s;
}

.horario-cell.vacio:hover {
    background: #e2e8f0;
    transform: scale(1.02);
}

.horario-cell.descanso {
    background: #fef3c7 !important;
    font-weight: 600;
    color: #92400e;
}

.horario-row.descanso-row .horario-cell {
    background: #fef3c7;
    border-color: #fcd34d;
}

.horario-cell strong {
    color: var(--primary-color);
}

.horario-cell small {
    color: #64748b;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .horario-header,
    .horario-row {
        grid-template-columns: 40px 70px repeat(5, 1fr);
        font-size: 0.75rem;
    }
    
    .horario-cell {
        padding: 0.4rem 0.2rem;
        min-height: 50px;
        font-size: 0.7rem;
    }
    
    .horario-cell.bloque-num {
        font-size: 0.8rem;
    }
}

/* ============================================
   HERO — Página de inicio (index.html)
   ============================================ */

.hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7f4 100%);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(82, 183, 136, 0.1);
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    overflow: hidden;
    margin-bottom: 2.5rem;
    position: relative;
}

.hero-card::before {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
    background-image: radial-gradient(#cbd5e1 2px, transparent 2.5px);
    background-size: 10px 10px;
    opacity: 0.5;
    pointer-events: none;
}

.hero-left {
    padding: 3rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-badge-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.logo-badge {
    width: 45px;
    height: 45px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.school-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.portal-badge {
    background-color: #e8f5e9;
    color: var(--secondary-color);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.hero-title {
    font-size: 2.8rem;
    line-height: 1.15;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
}

.hero-title .green-text {
    color: var(--secondary-color);
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 550px;
}

.hero-search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.3rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
    transition: all 0.3s;
    max-width: 600px;
}

.hero-search-container:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 6px 20px rgba(82, 183, 136, 0.15);
}

.search-icon-left {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

#hero-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.8rem 1rem 0.8rem 3rem;
    font-size: 1.05rem;
    color: var(--text-color);
    background: transparent;
    width: 100%;
}

#hero-search-input::placeholder {
    color: #a0aec0;
}

.hero-right {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 1.5rem;
}

.hero-image-wrapper {
    width: 100%;
    height: 90%;
    min-height: 350px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 30% 70% 70% 30% / 50% 30% 70% 50%;
    animation: morphing 15s ease-in-out infinite alternate;
}

@keyframes morphing {
    0%   { border-radius: 30% 70% 70% 30% / 50% 30% 70% 50%; }
    100% { border-radius: 50% 50% 30% 70% / 50% 60% 40% 50%; }
}

.school-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Populares */
.popular-tags {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.popular-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
}

.popular-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.popular-btn {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.popular-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.pop-icon {
    font-weight: bold;
    color: var(--secondary-color);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem 2.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.03);
    border: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    gap: 1.8rem;
    border-left: 6px solid var(--primary-color);
}

.stat-icon-circle {
    width: 70px;
    height: 70px;
    background-color: #f0f7f4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--secondary-color);
    flex-shrink: 0;
    box-shadow: inset 0 2px 6px rgba(45, 106, 79, 0.05);
}

.stat-text h3 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.stat-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================
   PERFIL DE DOCENTE (docente.html)
   ============================================ */
.profile-page-body {
    background-color: #f8fafc;
    color: #1e293b;
    margin: 0;
    padding: 0;
}

.profile-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Botón Volver */
.back-nav {
    margin-bottom: 1.5rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s;
}

.btn-back:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(-3px);
}

/* Tarjeta Cabecera Perfil */
.profile-header-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #edf2f7;
    padding: 2.5rem;
    margin-bottom: 2rem;
    /* Dos columnas: la derecha (Información General) tiene ancho acotado y la
       izquierda ocupa el resto; ninguna puede invadir a la otra */
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    align-items: center;
    gap: 2rem;
}

.profile-header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    min-width: 0;
}

.profile-photo-container {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    background-color: #f1f5f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
}

.profile-name-section {
    flex: 1;
    min-width: 0;
}

.profile-full-name {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.15;
    margin: 0 0 0.5rem;
    overflow-wrap: anywhere;
}

.profile-role {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0 0 1.5rem;
}

/* Anclajes de Pestañas */
.profile-nav-anchors {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.2rem;
    row-gap: 0.2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.1rem;
}

.anchor-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    transition: all 0.3s;
}

.anchor-link:hover {
    color: var(--primary-color);
}

.anchor-link.active {
    color: var(--secondary-color);
}

.anchor-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 3px;
}

/* Información General */
.profile-header-right {
    min-width: 0;
}

.info-general-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem;
}

.info-general-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.4rem;
}

.general-info-item {
    margin-bottom: 0.8rem;
    display: flex;
    flex-direction: column;
}

.general-info-item:last-child {
    margin-bottom: 0;
}

.general-info-item strong {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.general-info-item span {
    overflow-wrap: anywhere;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

/* Dashboard Grid */
.profile-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.01);
    padding: 1.8rem;
}

.dashboard-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.6rem;
}

/* Card: Sobre mí */
.sobre-mi-text {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

/* Card: Materias */
.profile-materias-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.badge-materia-profile {
    background-color: #f0fdf4;
    color: var(--secondary-color);
    border: 1px solid #bbf7d0;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Card: Contacto */
.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.95rem;
}

.contact-item i {
    font-size: 1.1rem;
    color: var(--secondary-color);
    width: 20px;
    text-align: center;
}

.contact-item span {
    color: #334155;
    word-break: break-all;
}

/* Card: Horario de Clases (fila completa para que la tabla no necesite scroll) */
.card-horario-clases {
    grid-column: 1 / -1;
}

.horario-table-wrapper {
    overflow-x: auto;
}

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

.profile-horario-table th {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    padding: 0.8rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.profile-horario-table td {
    padding: 0.6rem;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
}

.profile-horario-table tr:hover {
    background-color: #f8fafc;
}

.profile-horario-table .col-center {
    text-align: center;
}

.profile-horario-table .col-block {
    font-weight: 700;
    color: var(--primary-color);
    background-color: #f1f5f9;
    width: 60px;
}

.profile-horario-table .col-time {
    background-color: #f8fafc;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 100px;
}

/* Receso */
.descanso-row {
    background-color: #fffbeb !important;
}

.descanso-row .descanso-label {
    text-align: center;
    font-weight: 700;
    color: #b45309;
    background-color: #fffbeb;
    letter-spacing: 0.05em;
    padding: 0.6rem !important;
}

.descanso-row .select-time {
    font-weight: 600;
    color: #b45309;
    background-color: #fffbeb;
    font-size: 0.8rem;
}

/* Celda con clase */
.cell-clase {
    background-color: #f0fdf4;
    text-align: center;
    transition: all 0.3s;
    min-width: 120px;
}

.cell-clase:hover {
    background-color: #dcfce7;
    transform: scale(1.01);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.clase-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.materia-name {
    font-weight: 700;
    color: #14532d;
    font-size: 0.85rem;
}

.curso-badge {
    display: inline-block;
    background-color: #dcfce7;
    color: #166534;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin: 0 auto;
    width: fit-content;
}

.salon-label {
    font-size: 0.75rem;
    color: #475569;
}

.cell-vacia {
    text-align: center;
    color: #cbd5e1;
}

/* Card: Horario de Atención (debajo del horario de clases, a lo ancho) */
.card-horario-atencion {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-left: 6px solid var(--accent-color);
}

.atencion-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.atencion-hours {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.3;
}

/* Footer Verde */
.profile-footer {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 4rem 1.5rem 1.5rem;
    margin-top: 5rem;
}

.profile-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-logo-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.footer-logo-row h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.footer-logo-row p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-description {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.85;
}

.contact-col p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.contact-col p i {
    color: var(--accent-color);
    margin-top: 3px;
}

.links-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-col li {
    margin-bottom: 0.8rem;
}

.links-col a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.links-col a:hover {
    color: #ffffff;
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 0.8rem;
}

.social-icons a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.social-icons a:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

.profile-footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1.5rem;
    display: flex;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Tarjeta simple en el listado */
.teacher-card-simple {
    text-align: center;
    padding: 2rem 1.5rem !important;
}

.teacher-card-simple .card-header {
    border-bottom: none;
    background: transparent;
    padding: 0;
}

.teacher-card-simple .avatar {
    margin: 0 auto 1.2rem;
}

.teacher-card-simple h3 {
    margin-bottom: 0.3rem;
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .profile-header-card {
        grid-template-columns: 1fr;
    }

    .profile-footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .profile-header-card {
        padding: 1.5rem;
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    
    .profile-header-left {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-nav-anchors {
        justify-content: center;
    }
    
    .profile-header-right {
        min-width: 0;
    }
    
    .profile-dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .card-horario-clases {
        grid-column: span 1;
    }
    
    .profile-footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}
/* ============================================
   📱 AJUSTES PARA CELULAR Y TABLETA
   ============================================
   Va al final para tener prioridad sobre las reglas anteriores.
   Objetivo: ninguna página debe tener scroll horizontal; las tablas
   anchas se desplazan dentro de su propio contenedor. */

/* Las tablas del panel se desplazan dentro de su tarjeta en vez de cortarse */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Las tarjetas del perfil pueden encogerse: la tabla de horario se desplaza
   dentro de .horario-table-wrapper en lugar de ensanchar toda la página */
.profile-dashboard-grid > *,
.charts-grid > *,
.dashboard-bottom > * {
    min-width: 0;
}

/* ---------- Tableta (≤ 900px) ---------- */
@media (max-width: 900px) {
    /* Inicio: texto arriba, imagen institucional debajo */
    .hero-card {
        grid-template-columns: 1fr;
    }

    .hero-left {
        padding: 2.5rem 2rem 1.5rem;
    }

    .hero-right {
        justify-content: center;
        padding: 0 2rem 2rem;
    }

    .hero-image-wrapper {
        height: 260px;
        min-height: 0;
    }
}

/* ---------- Celular (≤ 768px) ---------- */
@media (max-width: 768px) {
    /* Inicio */
    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-box {
        padding: 1.5rem;
        gap: 1.2rem;
    }

    /* Perfil del docente */
    .profile-dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Panel: pestañas en una sola fila que se desliza con el dedo,
       en lugar de una columna que ocupa media pantalla */
    .admin-tabs {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.7rem 1rem;
    }

    /* Panel: encabezados de sección y sus controles apilados */
    .admin-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .admin-header > div {
        width: 100%;
    }

    /* Horarios: selectores a todo el ancho y botones repartidos */
    #horarioSede,
    #horarioDocente,
    #horarioAno {
        width: 100%;
        min-width: 0;
    }

    #btnCargarHorario,
    #btnNewHorario {
        flex: 1;
    }

    .horario-container {
        padding: 1rem;
    }

    /* Tablas del panel: ancho mínimo legible; se desplazan dentro de su tarjeta */
    .admin-table {
        min-width: 640px;
    }

    /* Ventanas emergentes: casi todo el ancho de la pantalla */
    .modal-content {
        width: 94%;
        max-height: 92vh;
    }
}

/* ---------- Celular pequeño (≤ 480px) ---------- */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
    }

    .hero-left {
        padding: 2rem 1.25rem 1.25rem;
    }

    .hero-right {
        padding: 0 1.25rem 1.25rem;
    }

    .hero-title {
        font-size: 1.7rem;
    }

    .hero-image-wrapper {
        height: 200px;
    }

    .stat-icon-circle {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
    }

    .stat-text h3 {
        font-size: 1.8rem;
    }

    .dashboard-card {
        padding: 1.25rem;
    }

    .profile-header-card {
        padding: 1.25rem;
    }

    .profile-full-name {
        font-size: 1.7rem;
    }
}
