/**
 * Estilos del Portal de Familias
 * Diseño moderno, limpio y responsive
 */

/* ============================================
   VARIABLES Y RESET
   ============================================ */
:root {
    --primary-color: #5145cd;
    --primary: #5145cd;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ============================================
   PANTALLA DE CARGA
   ============================================ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-content p {
    color: var(--gray-500);
    font-size: 14px;
}

.loading-inline {
    padding: 40px;
    text-align: center;
    color: var(--gray-500);
}

/* ============================================
   PANTALLA DE ERROR
   ============================================ */
.error-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.error-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.error-content h2 {
    color: var(--gray-800);
    margin-bottom: 12px;
    font-size: 24px;
}

.error-content p {
    color: var(--gray-600);
    margin-bottom: 8px;
}

.error-hint {
    color: var(--gray-400);
    font-size: 13px;
    margin-top: 20px;
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */
.main-content {
    width: 100%;
    padding: 20px 40px;
    padding-bottom: 100px;
}

.hidden {
    display: none !important;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px 24px;
    margin-bottom: 20px;
}

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-container {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.logo-icon {
    font-size: 32px;
    color: white;
}

.header-titles h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.subtitle {
    font-size: 14px;
    color: var(--gray-500);
}

/* ============================================
   INFORMACIÓN DEL ALUMNO
   ============================================ */
.student-info {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    color: var(--white);
}

.student-card {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.student-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
}

.student-details h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}

.student-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge.secondary {
    background: rgba(255, 255, 255, 0.1);
}

.expiration-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    font-size: 13px;
}

.expiration-notice .icon {
    font-size: 16px;
}

/* ============================================
   NAVEGACIÓN TABS
   ============================================ */
.tabs-nav {
    display: flex;
    gap: 8px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

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

.tab-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tab-icon {
    font-size: 18px;
}

/* ============================================
   CONTENIDO DE TABS
   ============================================ */
.tab-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.tab-panel {
    padding: 24px;
}

.panel-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.panel-subtitle {
    font-size: 14px;
    color: var(--gray-500);
}

/* ============================================
   TABS DE EVALUACIÓN
   ============================================ */
.evaluation-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    width: fit-content;
}

.eval-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
}

.eval-tab:hover {
    color: var(--primary-color);
    background: var(--white);
}

.eval-tab.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.loading-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
}

.loading-inline .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-inline p {
    color: var(--gray-500);
    font-size: 14px;
}

/* ============================================
   TABLA DE CALIFICACIONES
   ============================================ */
.grades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.grades-table th,
.grades-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.grades-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grades-table tr:last-child td {
    border-bottom: none;
}

.grades-table tr:hover td {
    background: var(--gray-50);
}

.grade-value {
    font-weight: 600;
    font-size: 16px;
}

.grade-value.excellent {
    color: var(--success-color);
}

.grade-value.good {
    color: var(--primary-color);
}

.grade-value.average {
    color: var(--warning-color);
}

.grade-value.poor {
    color: var(--danger-color);
}

.grade-icon {
    font-size: 18px;
    margin-right: 4px;
}

/* Cards de calificaciones (móvil) */
.grades-cards {
    display: none;
}

.grade-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grade-card-label {
    font-weight: 500;
    color: var(--gray-700);
}

.grade-card-value {
    font-size: 20px;
    font-weight: 700;
}

/* ============================================
   PROGRESO / TRACKING
   ============================================ */
.progress-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 4px solid var(--gray-300);
}

.progress-item.completed {
    border-left-color: var(--success-color);
}

.progress-item.in-progress {
    border-left-color: var(--primary-color);
}

.progress-item.not-started {
    border-left-color: var(--gray-300);
}

.progress-status {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.progress-item.completed .progress-status {
    background: var(--success-color);
    color: var(--white);
}

.progress-item.in-progress .progress-status {
    background: var(--primary-color);
    color: var(--white);
}

.progress-item.not-started .progress-status {
    background: var(--gray-200);
    color: var(--gray-500);
}

.progress-details {
    flex: 1;
}

.progress-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.progress-description {
    font-size: 13px;
    color: var(--gray-500);
}

.progress-evaluation {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.evaluation-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.evaluation-badge.eval-1 {
    background: #dbeafe;
    color: #1e40af;
}

.evaluation-badge.eval-2 {
    background: #fef3c7;
    color: #92400e;
}

.evaluation-badge.eval-3 {
    background: #d1fae5;
    color: #065f46;
}

/* ============================================
   PROGRAMACIÓN DEL CURSO
   ============================================ */

/* Layout de 2 columnas */
.course-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: start;
}

/* Índice de navegación lateral */
.course-index {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.course-index-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.course-index-title i {
    font-size: 18px;
    color: var(--primary);
}

.course-index-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.course-index-item {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.course-index-item:hover {
    background: var(--gray-100);
    color: var(--primary);
    border-left-color: var(--primary);
}

.course-index-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

/* Contenido del curso */
.course-content-wrapper {
    min-width: 0;
}

.toc-empty {
    font-size: 13px;
    color: var(--gray-400);
    font-style: italic;
}

.course-section {
    margin-bottom: 24px;
    scroll-margin-top: 80px;
}

.course-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.course-content {
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-700);
}

.course-content ul {
    margin-left: 20px;
    margin-top: 8px;
}

.course-content li {
    margin-bottom: 6px;
}

/* ============================================
   MENSAJES VACÍOS
   ============================================ */
.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-message .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-message h4 {
    color: var(--gray-600);
    margin-bottom: 8px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--gray-500);
    font-size: 13px;
}

.footer-note {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .main-content {
        padding: 12px;
    }

    .header {
        padding: 16px;
    }

    .header-titles h1 {
        font-size: 18px;
    }

    .student-info {
        padding: 20px;
    }

    .student-avatar {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .student-details h2 {
        font-size: 18px;
    }

    .tabs-nav {
        padding: 6px;
        gap: 4px;
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .tab-text {
        display: none;
    }

    .tab-icon {
        font-size: 20px;
    }

    .tab-panel {
        padding: 16px;
    }

    /* Mostrar cards en lugar de tabla en móvil */
    .grades-table {
        display: none;
    }

    .grades-cards {
        display: block;
    }

    .progress-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .progress-evaluation {
        align-items: flex-start;
        width: 100%;
        flex-direction: row;
        gap: 8px;
    }

    /* Layout curso en una columna en móvil */
    .course-layout {
        grid-template-columns: 1fr;
    }

    .course-index {
        position: relative;
        top: 0;
    }

    .course-index-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .course-index-item {
        border-left: none;
        border-radius: 16px;
        background: var(--gray-100);
        padding: 6px 12px;
    }

    .course-index-item:hover,
    .course-index-item.active {
        border-left: none;
    }
}

@media (max-width: 480px) {
    .logo-section {
        gap: 12px;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    .header-titles h1 {
        font-size: 16px;
    }

    .subtitle {
        font-size: 12px;
    }

    .student-card {
        flex-direction: column;
        text-align: center;
    }

    .student-meta {
        justify-content: center;
    }

    .expiration-notice {
        justify-content: center;
        font-size: 12px;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    .header,
    .tabs-nav,
    .footer {
        display: none;
    }

    .main-content {
        max-width: 100%;
        padding: 0;
    }

    .tab-panel {
        display: block !important;
        page-break-inside: avoid;
    }

    .student-info {
        background: var(--gray-100);
        color: var(--gray-800);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================
   SEGUIMIENTO SEMANAL - ACORDEONES
   ============================================ */
.tracking-evaluations,
.programming-evaluations {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eval-accordion,
.prog-accordion {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.eval-header,
.prog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.eval-header:hover,
.prog-header:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.eval-title,
.prog-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.eval-icon,
.prog-icon {
    font-size: 18px;
}

.eval-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.accordion-arrow {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.eval-content,
.prog-content {
    padding: 16px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* Observaciones de evaluación */
.eval-observation {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-color);
}

.eval-observation h5 {
    margin-bottom: 8px;
    color: var(--gray-700);
}

.observation-content {
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.6;
}

/* Acordeón de mes */
.month-accordion {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-100);
    cursor: pointer;
    transition: var(--transition);
}

.month-header:hover {
    background: var(--gray-200);
}

.month-name {
    font-weight: 600;
    color: var(--gray-700);
}

.month-sessions {
    color: var(--gray-500);
    font-size: 13px;
}

.month-content {
    padding: 12px 16px;
}

/* Tarjeta de sesión */
.session-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.session-header {
    background: var(--gray-100);
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.session-number {
    font-weight: 600;
    color: var(--primary-color);
}

.session-body {
    padding: 16px;
}

.session-instruments {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.instrument-item {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 10px 12px;
    text-align: center;
    flex: 1 1 140px;
    min-width: 120px;
}

.instrument-name {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.instrument-value {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
}

.session-observations {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-600);
}

.session-observations strong {
    color: var(--gray-700);
}

.session-observations p {
    margin-top: 6px;
}

/* ============================================
   PROGRAMACIÓN POR EVALUACIONES
   ============================================ */

/* Pestañas de evaluación */
.eval-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--gray-100);
    padding: 6px;
    border-radius: var(--radius-lg);
}

.eval-tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    transition: var(--transition);
    white-space: nowrap;
}

.eval-tab-btn:hover {
    background: var(--white);
    color: var(--gray-800);
}

.eval-tab-btn.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow);
}

/* Barra de progreso general */
.prog-progress-bar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-200);
}

.prog-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
}

.prog-progress-track {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.prog-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Secciones como acordeones */
.prog-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prog-section-accordion {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.prog-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--gray-50);
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

.prog-section-header:hover {
    background: var(--gray-100);
}

.prog-section-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prog-section-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 15px;
}

.prog-section-progress {
    background: var(--primary-light);
    color: var(--white);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.prog-section-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.prog-mini-bar {
    width: 80px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.prog-mini-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.prog-section-content {
    padding: 0 20px 20px;
    display: block;
}

/* Lista de conceptos */
.prog-concepts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.prog-concept-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.prog-concept-item:last-child {
    margin-bottom: 0;
}

.prog-concept-item.completed {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.prog-concept-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.concept-status {
    font-size: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.concept-icon {
    font-size: 20px;
    color: var(--gray-400);
    transition: all 0.2s ease;
}

.concept-icon.completed {
    color: #10b981;
}

.concept-text {
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.5;
}

.prog-concept-item.completed .concept-text {
    color: #065f46;
}

.prog-body {
    padding: 8px 0;
}

/* Responsive para acordeones */
@media (max-width: 640px) {

    .eval-header,
    .prog-header {
        padding: 14px 16px;
    }

    .eval-title,
    .prog-title {
        font-size: 14px;
    }

    .session-instruments {
        grid-template-columns: repeat(2, 1fr);
    }

    .eval-meta {
        flex-direction: column;
        gap: 6px;
        align-items: flex-end;
    }

    /* Pestañas de evaluación en móvil */
    .eval-tabs {
        flex-wrap: wrap;
    }

    .eval-tab-btn {
        font-size: 12px;
        padding: 10px 12px;
    }

    .prog-section-header {
        padding: 12px 16px;
    }

    .prog-section-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .prog-mini-bar {
        display: none;
    }
}

/* ============================================
   AUTORIZACIONES
   ============================================ */

/* Badge de pendientes en el tab */
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--danger-color);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

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

/* Lista de autorizaciones */
.authorizations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Tarjeta de autorización */
.authorization-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}

.authorization-card:hover {
    box-shadow: var(--shadow-md);
}

.authorization-card.pending {
    border-left: 4px solid var(--warning-color);
}

.authorization-card.signed {
    border-left: 4px solid var(--success-color);
    background: var(--gray-50);
}

.auth-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.auth-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.auth-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.auth-status.signed {
    background: #d1fae5;
    color: #065f46;
}

.auth-deadline {
    font-size: 12px;
    color: var(--gray-500);
}

.auth-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.auth-message {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 16px;
    line-height: 1.5;
}

.auth-card-actions {
    display: flex;
    justify-content: flex-end;
}

.auth-sign-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.auth-sign-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.auth-signed-info {
    font-size: 13px;
    color: var(--gray-500);
    font-style: italic;
}

@media (max-width: 640px) {
    .authorization-card {
        padding: 16px;
    }

    .auth-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .auth-sign-btn {
        width: 100%;
        justify-content: center;
    }
}
/* Identidad compartida con el cuaderno docente, sin añadir navegación docente. */
body { background: #f6f7fb; color: #202538; }
.header { box-shadow: none; border-bottom: 1px solid #e1e5ed; }
.student-info { background: #fff; color: #202538; border: 1px solid #e1e5ed; border-left: 3px solid #5145cd; padding: 20px 24px; }
.student-avatar { background: #eeecff; color: #5145cd; width: 48px; height: 48px; font-size: 18px; }
.student-details h2 { letter-spacing: -.025em; }
.student-info .badge, .student-info .badge.secondary { background: #f0eefc; color: #5145cd; border-radius: 6px; }
.expiration-notice { background: #f6f7fb; color: #60697c; }
.tabs-nav { border: 1px solid #e1e5ed; box-shadow: none; gap: 4px; padding: 5px; }
.tabs-nav .tab-btn { padding: 10px 14px; border-radius: 7px; }
.tabs-nav .tab-btn.active { background: #eeecff; color: #5145cd; }
.tab-content { border: 1px solid #e1e5ed; box-shadow: 0 1px 2px rgb(17 24 39 / .04); }
.panel-header h3 { letter-spacing: -.02em; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid #5145cd; outline-offset: 3px; }
@media (max-width: 600px) {
  .student-info { padding: 16px; }
  .student-details h2 { font-size: 18px; overflow-wrap: anywhere; }
  .tabs-nav .tab-btn { flex: 0 0 auto; min-height: 44px; }
  .tab-panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 600px) {
  .tabs-nav { flex-wrap: nowrap; scrollbar-width: thin; }
  .tabs-nav .tab-text { display: inline; }
  .tabs-nav .tab-icon { font-size: 16px; }
}

.family-grade-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 24px; border-bottom: 1px solid #e1e5ed; padding-bottom: 14px; }
.family-grade-tabs button { border: 1px solid #e1e5ed; background: white; color: #50586a; padding: 10px 16px; min-height: 44px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.family-grade-tabs button.active { border-color: #5145cd; color: #5145cd; background: #eeecff; font-weight: 600; }
.family-grade-entries { display: grid; gap: 16px; }
.family-grade-entry { border: 1px solid #e1e5ed; border-radius: 12px; padding: 20px; min-width: 0; }
.family-grade-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.family-grade-heading h4 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.family-grade-score { font-size: 22px; font-weight: 700; color: #5145cd; flex-shrink: 0; }
.family-grade-label { color: #657083; font-size: 12px; margin-top: 8px; }
.family-grade-comment { background: #f7f8fb; border-left: 3px solid #d8d3f5; padding: 14px 16px; margin-top: 16px; border-radius: 4px; font-size: 13px; }
.family-grade-comment p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; color: #4b5563; }
.family-rubric { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; table-layout: fixed; }
.family-rubric caption { text-align: left; color: #657083; margin-bottom: 10px; }
.family-rubric th, .family-rubric td { padding: 12px; border-bottom: 1px solid #e1e5ed; text-align: left; overflow-wrap: anywhere; }
.family-rubric thead { background: #f7f8fb; }
.family-rubric th { font-weight: 500; }
.family-rubric th:last-child, .family-rubric td:last-child { width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.family-rubric tfoot { background: #eeecff; color: #5145cd; font-weight: 700; }
@media (max-width: 480px) { .family-grade-entry { padding: 16px 12px; } .family-rubric th, .family-rubric td { padding: 10px 6px; } }

/* Family notebook: restrained typography, clear navigation, no entrance effects. */
.main-content { max-width: 1200px; margin: auto; padding: 24px 32px 48px; }
.header { background: transparent; padding: 0 0 22px; margin-bottom: 28px; border-radius: 0; }
.logo-container { width: 44px; height: 44px; background: #5145cd; box-shadow: none; border-radius: 12px; }
.logo { width: 30px; height: 30px; filter: none; }
.header-titles h1 { font-size: 22px; letter-spacing: -.04em; }
.subtitle { font-size: 12px; letter-spacing: .02em; }
.student-info { padding: 30px; border: 1px solid #e1e5ed; border-radius: 18px; margin-bottom: 28px; }
.student-card { gap: 22px; margin-bottom: 24px; }
.student-avatar { width: 68px; height: 68px; flex-shrink: 0; border-radius: 18px; font-size: 24px; }
.student-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: #73798b; margin-bottom: 8px; }
.student-details { min-width: 0; }
.student-details h2 { font-size: clamp(20px, 2.5vw, 30px); line-height: 1.25; margin-bottom: 12px; overflow-wrap: anywhere; }
.student-info .badge { padding: 5px 10px; font-size: 12px; }
.student-info .badge.secondary { background: #f1f3f7; color: #596175; }
.expiration-notice { padding: 14px 0 0; border-top: 1px solid #eceef3; background: transparent; border-radius: 0; font-size: 12px; }
.tabs-nav { background: transparent; border: 0; border-bottom: 1px solid #dce0eb; border-radius: 0; padding: 0 0 10px; gap: 8px; margin-bottom: 24px; }
.tabs-nav .tab-btn { min-height: 46px; font-size: 13px; font-weight: 600; transition: background-color .15s, color .15s; }
.tabs-nav .tab-btn.active { background: #5145cd; color: white; }
.tab-content { border-radius: 18px; box-shadow: none; min-height: 300px; }
.tab-panel { padding: 30px; }
.panel-header { padding-bottom: 20px; margin-bottom: 24px; }
.panel-header h3 { font-size: 22px; }
.panel-subtitle { font-size: 13px; margin-top: 6px; line-height: 1.6; }
.eval-tabs { background: #f2f3f8; max-width: 600px; padding: 5px; gap: 4px; }
.eval-tab-btn { font-size: 13px; min-height: 44px; min-width: 0; transition: background-color .15s, color .15s; }
.eval-tab-btn.active { background: white; color: #5145cd; box-shadow: 0 1px 4px #20253814; }
.prog-progress-bar { padding: 20px; background: #f8f8fc; border: 0; border-radius: 12px; }
.prog-progress-header { font-size: 13px; }
.prog-progress-fill { background: #5145cd; }
.prog-section-accordion { box-shadow: none; }
.prog-section-header { background: white; border-left-width: 3px; padding: 20px; }
.prog-section-progress { color: #5145cd; background: #eeecff; }
.prog-concept-item { background: white; border: 0; border-bottom: 1px solid #eef0f5; border-radius: 0; padding: 14px 8px; margin: 0; }
.prog-concept-item.completed { background: #f3faf7; border-color: #e3f0e9; }
.prog-concept-item:hover { transform: none; box-shadow: none; }
.eval-header, .prog-header { background: #f1effb; color: #35304f; }
.eval-header:hover, .prog-header:hover { background: #e9e6f8; }
.grades-table th { background: #f7f8fb; font-size: 11px; letter-spacing: .08em; }
.grades-table td { padding: 18px 16px; }
.footer { padding-top: 28px; font-size: 12px; }
.footer-note { color: #697184; }
.fade-in { animation: none; }
#familyAccessForm { box-shadow: 0 16px 60px #252b4010; max-width: min(440px, calc(100% - 32px)) !important; }
#familyAccessForm h1 { margin-bottom: 12px; letter-spacing: -.04em; }
#familyAccessForm > p { font-size: 14px; color: #60697c; margin-bottom: 24px; }
#familyAccessForm label { font-size: 12px; font-weight: 600; }
#familyAccessForm input { font-size: 22px; letter-spacing: .15em; text-transform: uppercase; }
#familyAccessForm button { width: 100%; font: inherit; font-weight: 600; min-height: 46px; cursor: pointer; }
@media (max-width: 768px) {
  .main-content { padding: 20px 14px 32px; }
  .student-info { padding: 22px 18px; }
  .student-card { flex-direction: row; text-align: left; align-items: flex-start; gap: 14px; }
  .student-avatar { width: 46px; height: 46px; font-size: 18px; border-radius: 12px; }
  .student-meta { justify-content: flex-start; }
  .expiration-notice { justify-content: flex-start; align-items: flex-start; }
  .tabs-nav { flex-wrap: nowrap; }
  .tabs-nav .tab-btn { flex: 0 0 auto; }
  .tabs-nav .tab-text { display: inline; }
  .tab-panel { padding: 20px 16px; }
  .panel-header h3 { font-size: 20px; }
  .eval-tabs { flex-wrap: nowrap; }
  .eval-tab-btn { padding: 10px 6px; font-size: 11px; white-space: normal; }
}

/* ============================================
   ESTUDIO EN CASA
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.study-week {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.study-week__nav {
    display: flex;
    gap: 16px;
    min-height: 1.2em;
}

.study-week__title {
    margin: 0;
    font-size: 1.05rem;
    color: var(--gray-900);
}

.study-block {
    margin-bottom: 16px;
    padding: 18px 20px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}

.study-block__title {
    margin: 0 0 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.study-hint,
.study-note {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--gray-600);
}

.study-note {
    margin-top: 10px;
    font-style: italic;
}

.study-tasks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.study-tasks li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 6px 0;
    line-height: 1.45;
    color: var(--gray-800);
}

.study-tasks__mark {
    flex: 0 0 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--success-color);
    transform: translateY(4px);
}

.study-tasks li.is-done .study-tasks__mark {
    border-color: var(--success-color);
}

.study-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.study-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.study-field > span,
.study-field legend {
    font-weight: 600;
    padding: 0;
}

.study-field em {
    font-weight: 400;
    font-style: normal;
    color: var(--gray-500);
}

.study-field select,
.study-field textarea,
.study-minutes input {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-900);
    font: inherit;
    font-size: 1rem;
}

.study-field textarea {
    resize: vertical;
    line-height: 1.5;
}

.study-minutes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.study-minutes input {
    width: 84px;
}

.study-chip {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    background: var(--white);
    color: var(--gray-700);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.study-chip:hover,
.study-chip:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
}

.study-checks {
    gap: 4px;
}

.study-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 6px 0;
    font-weight: 400;
    line-height: 1.45;
    cursor: pointer;
}

.study-check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.study-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.study-save {
    padding: 11px 22px;
    border: 0;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--white);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.study-save:disabled {
    opacity: 0.6;
    cursor: default;
}

.study-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.study-delete[data-confirming="true"] {
    color: var(--danger-color);
}

.study-message {
    margin: 0;
    min-height: 1.2em;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.study-message[data-state="ok"] {
    color: var(--success-color);
}

.study-message[data-state="error"] {
    color: var(--danger-color);
}

.study-total {
    margin: 0 0 10px;
    font-weight: 600;
    color: var(--gray-900);
}

.study-logs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.study-logs li {
    padding: 10px 0;
    border-top: 1px solid var(--gray-100);
}

.study-logs li:first-child {
    border-top: 0;
}

.study-logs__head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.study-logs__head strong {
    color: var(--gray-900);
}

.study-logs__head span {
    color: var(--gray-500);
}

.study-logs p {
    margin: 4px 0 6px;
    font-size: 0.92rem;
    color: var(--gray-700);
}

/* ============================================
   ASISTENCIA: FALTAS Y SU JUSTIFICACIÓN
   ============================================ */
.absence-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.absence {
    padding: 16px 18px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-300);
    border-radius: var(--radius-lg);
}

.absence--none { border-left-color: var(--danger-color); }
.absence--pending { border-left-color: var(--warning-color); }
.absence--rejected { border-left-color: var(--danger-color); }
.absence--justified { border-left-color: var(--success-color); }

.absence__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.absence__when {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.absence__when strong {
    color: var(--gray-900);
}

.absence__kind {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.absence__state {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
}

.absence--none .absence__state,
.absence--rejected .absence__state { color: #b91c1c; }
.absence--pending .absence__state { color: #b45309; }
.absence--justified .absence__state { color: #047857; }

.absence__reason,
.absence__note {
    margin: 8px 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--gray-700);
}

.absence__note {
    padding: 8px 10px;
    border-radius: var(--radius);
    background: #fef2f2;
    color: #991b1b;
}

.absence__action {
    margin-top: 10px;
}

.absence-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
}

.absence-form input[type="file"] {
    font: inherit;
    font-size: 0.9rem;
}

.absence-form__hint {
    font-size: 0.82rem;
    color: var(--gray-500);
}

.absence-file {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    cursor: pointer;
}

.absence-file__button {
    padding: 9px 14px;
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius);
    background: var(--gray-50);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.absence-file:hover .absence-file__button,
.absence-file:focus-within .absence-file__button {
    border-color: var(--primary);
}

.absence-file:focus-within .absence-file__button {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.absence-file__name {
    font-size: 0.88rem;
    color: var(--gray-700);
    word-break: break-all;
}

/* ---- Registro rápido de estudio ----------------------------------------- */
.study-days {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.study-day {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 1px;
    min-width: 52px;
    padding: 8px 6px 7px;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: 12px;
    background: var(--white);
    color: var(--gray-700);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.study-day__name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

.study-day__num {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.study-day__mark {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.study-day:hover {
    border-color: var(--primary-color);
}

.study-day.is-selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.study-day.is-selected .study-day__name {
    color: rgba(255, 255, 255, 0.85);
}

.study-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.study-pill {
    position: relative;
    cursor: pointer;
}

.study-pill input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.study-pill span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: 999px;
    background: var(--white);
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.study-pill input:checked + span {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.study-pill input:checked + span::before {
    content: "✓";
    font-size: 13px;
}

.study-pill input:focus-visible + span,
.study-day:focus-visible,
.study-chip:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.study-chip.is-selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.study-extra__field[hidden],
.study-extra__toggle[hidden] {
    display: none;
}

.study-extra__toggle {
    justify-self: start;
}

/* En el móvil el botón Guardar queda siempre al alcance del pulgar */
@media (max-width: 640px) {
    .study-form .study-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin: 0 -4px;
        padding: 10px 4px calc(10px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(to top, var(--white) 75%, rgba(255, 255, 255, 0));
    }

    .study-form .study-save {
        flex: 1;
    }
}

.session-empty {
    margin: 0;
    padding: 4px 2px;
    font-size: 13px;
    color: var(--gray-500);
}

.study-tasks li[data-study-item] {
    cursor: pointer;
}

.study-tasks li.is-picked .study-tasks__mark {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.study-tasks li.is-picked:not(.is-done) .study-tasks__mark::before {
    content: "✓";
}

.study-tasks li[data-study-item]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---- Bloque de estudio más compacto -------------------------------------- */
.study-week__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 12px;
}

.study-week__meta .study-hint {
    margin: 0;
    font-size: 13px;
}

.study-week__meta .study-link {
    margin: 0;
    font-size: 13px;
}

.study-block {
    padding: 14px 16px;
    margin-bottom: 12px;
}

.study-block__title {
    margin-bottom: 8px;
}

.study-tasks li {
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 0.95rem;
    line-height: 1.35;
}

.study-tasks__mark {
    flex: 0 0 18px;
    height: 18px;
    border-radius: 5px;
    transform: none;
}

.study-tasks__body strong {
    margin-right: 4px;
}

.study-form {
    gap: 14px;
}

/* ============================================
   APP DE FAMILIAS: código de entrada, avisos y notificaciones
   ============================================ */
.app-code-form {
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 420px;
    margin: 10vh auto 0;
    padding: 28px 24px;
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    color: var(--gray-800);
    text-align: center;
}
.app-code-form[hidden] { display: none; }
.app-code-logo { border-radius: 14px; margin-bottom: 8px; }
.app-code-form h1 { font-size: 1.4rem; margin-bottom: 8px; }
.app-code-form p { color: var(--gray-600); font-size: 0.95rem; line-height: 1.5; }
.app-code-form label { display: block; margin: 20px 0 8px; font-size: 0.85rem; font-weight: 600; color: var(--gray-700); }
.app-code-form input {
    box-sizing: border-box;
    width: 100%;
    padding: 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: 12px;
    font: 600 1.5rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
}
.app-code-form input:focus { outline: 3px solid rgb(81 69 205 / 0.25); border-color: var(--primary-color); }
.app-code-form .app-code-message { min-height: 1.4em; margin: 10px 0; font-size: 0.88rem; color: var(--danger-color); }
.app-code-submit {
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 12px;
    background: var(--primary-color);
    color: var(--white);
    font: 600 1rem/1 inherit;
    cursor: pointer;
}
.app-code-submit:disabled { opacity: 0.6; cursor: wait; }
.app-code-back[hidden] { display: none; }
.app-code-back { display: inline-block; margin-top: 14px; font-size: 0.9rem; color: var(--primary-color); }

/* Avisos */
.notice-list { list-style: none; display: grid; gap: 10px; }
.notice {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
}
.notice.is-new { border-color: var(--primary-light); background: #f7f7ff; }
.notice-icon {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ecebff;
    color: var(--primary-color);
    font-size: 1.2rem;
}
.notice-main { min-width: 0; flex: 1; }
.notice-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice-new { padding: 1px 8px; border-radius: 999px; background: var(--primary-color); color: var(--white); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.notice-main p { margin-top: 4px; font-size: 0.92rem; line-height: 1.5; color: var(--gray-700); overflow-wrap: anywhere; }
.notice-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 0.8rem; color: var(--gray-500); }

/* Tarjeta de notificaciones */
.push-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #ddd8fa;
    border-radius: var(--radius-lg);
    background: #f3f1ff;
}
.push-card[hidden] { display: none; }
.push-card > i { font-size: 1.6rem; color: var(--primary-color); flex: 0 0 auto; }
.push-card > div { flex: 1; min-width: 0; }
.push-card p { margin-top: 2px; font-size: 0.85rem; line-height: 1.45; color: var(--gray-600); }
.push-card button {
    flex: 0 0 auto;
    padding: 9px 14px;
    border: 0;
    border-radius: 10px;
    background: var(--primary-color);
    color: var(--white);
    font: 600 0.85rem/1 inherit;
    cursor: pointer;
}
.push-card button.push-off { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-300); }
.push-card button:disabled { opacity: 0.6; }
@media (max-width: 480px) {
    .push-card { flex-wrap: wrap; }
    .push-card button { width: 100%; }
}

/* Varios alumnos en el mismo móvil */
.footer-children { margin-top: 8px; text-align: center; }
.footer-children[hidden] { display: none; }
.children-switcher { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.children-switcher button {
    padding: 6px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    background: var(--white);
    color: var(--gray-700);
    font: 600 0.82rem/1 inherit;
    cursor: pointer;
}
.children-switcher button.active { border-color: var(--primary-color); background: var(--primary-color); color: var(--white); }

/* App instalada: respeta las zonas seguras del iPhone */
@media (display-mode: standalone) {
    body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}
.footer-children .study-link { font-size: 0.82rem; }

/* Informes de evaluación publicados */
.reports-list { display: flex; flex-direction: column; gap: 16px; }
.report-card { background: var(--white); border: 1px solid var(--gray-200); border-left: 4px solid var(--primary-color); border-radius: var(--radius-lg); padding: 20px; }
.report-card-header { margin-bottom: 12px; }
.report-card-header h4 { margin: 0 0 4px; font-size: 1.05rem; color: var(--gray-900); }
.report-card-meta { font-size: .8rem; color: var(--gray-500); }
.report-card-body h5 { margin: 14px 0 4px; font-size: .95rem; color: var(--primary-dark); }
.report-card-body p { margin: 0 0 8px; line-height: 1.55; color: var(--gray-700); white-space: pre-line; overflow-wrap: anywhere; }
