/*
=========================================
PLAYCLASS 3 — ESTILOS PORTAL ESCUELA
=========================================
*/

#schoolDynamicContent, #schoolDynamicContentMobile {
    background: white;
    border-radius: 28px;
    padding: 35px;
    box-shadow: 0 12px 40px rgba(50, 70, 130, 0.05);
    border: 2px solid rgba(91, 108, 255, 0.06);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

/* Loader animado */
.school-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 15px;
}

.school-loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(91, 108, 255, 0.1);
    border-top-color: #5b6cff;
    border-radius: 50%;
    animation: school-spin 1s linear infinite;
}

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

/* Tarjeta de error */
.school-error-card {
    text-align: center;
    padding: 40px 20px;
}

.school-error-card h3 {
    color: #ef4444;
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 800;
}

.school-error-card p {
    color: var(--muted);
    margin-bottom: 20px;
}

/* --- ASISTENTE DE ONBOARDING DOCENTE --- */
.onboarding-wizard {
    max-width: 650px;
    margin: 0 auto;
    padding: 10px 0;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 35px;
}

.onboarding-header h2 {
    font-size: 1.8rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #5b6cff 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onboarding-header p {
    color: #64748b;
    font-size: 0.95rem;
}

/* Barra de progreso de pasos */
.onboarding-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 40px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.onboarding-steps::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
}

.onboarding-step-line {
    position: absolute;
    top: 18px;
    left: 10%;
    width: 0%;
    height: 3px;
    background: #5b6cff;
    z-index: 2;
    transition: width 0.3s ease;
}

.onboarding-step-node {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #64748b;
    z-index: 3;
    transition: all 0.3s ease;
}

.onboarding-step-node.active {
    border-color: #5b6cff;
    background: #5b6cff;
    color: white;
    box-shadow: 0 0 12px rgba(91, 108, 255, 0.4);
}

.onboarding-step-node.completed {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

/* Contenido de los Pasos */
.onboarding-slide {
    display: none;
    animation: school-fade-in 0.3s ease forwards;
}

.onboarding-slide.active {
    display: block;
}

@keyframes school-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Campos de Formulario */
.onboarding-field {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.onboarding-field label {
    font-size: 0.9rem;
    font-weight: 750;
    color: #334155;
}

.onboarding-field input[type="text"],
.onboarding-field select,
.onboarding-field textarea {
    padding: 14px 18px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.onboarding-field input[type="text"]:focus,
.onboarding-field select:focus,
.onboarding-field textarea:focus {
    border-color: #5b6cff;
    box-shadow: 0 0 0 3px rgba(91, 108, 255, 0.1);
}

/* Selector de Chips/Pills */
.onboarding-group-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    margin-top: 15px;
    margin-bottom: 12px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 5px;
}

.onboarding-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    justify-content: flex-start;
}

.onboarding-pill {
    padding: 8px 16px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 750;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.onboarding-pill:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.onboarding-pill.selected {
    border-color: #5b6cff;
    background: #eef2ff;
    color: #5b6cff;
    transform: scale(1.03);
}

/* Botones de navegación del asistente */
.onboarding-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    border-top: 1px solid #f1f5f9;
    padding-top: 25px;
    gap: 15px;
}

.onboarding-actions button {
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-btn-prev {
    background: #f1f5f9;
    color: #475569;
    border: none;
}

.onboarding-btn-prev:hover {
    background: #e2e8f0;
}

.onboarding-btn-next, .onboarding-btn-finish {
    background: #5b6cff;
    color: white;
    border: none;
    flex-grow: 1;
    max-width: 250px;
}

.onboarding-btn-next:hover, .onboarding-btn-finish:hover {
    background: #4758ff;
    box-shadow: 0 4px 12px rgba(91, 108, 255, 0.25);
}

.onboarding-btn-finish {
    background: #10b981;
}

.onboarding-btn-finish:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}


/* --- DASHBOARD DOCENTE --- */
.teacher-dashboard {
    text-align: left;
}

.teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.teacher-title h3 {
    margin: 0;
    font-weight: 900;
    color: #1e293b;
    font-size: 1.4rem;
}

.teacher-title p {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 700;
}

.teacher-actions {
    display: flex;
    gap: 10px;
}

/* Selector de Aulas */
.classroom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 18px;
    padding: 15px 20px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 15px;
}

.classroom-select-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.classroom-select-container label {
    font-weight: 800;
    color: #475569;
    font-size: 0.9rem;
}

.classroom-select {
    padding: 10px 16px;
    border-radius: 10px;
    border: 2px solid #cbd5e1;
    font-size: 0.9rem;
    font-weight: 750;
    color: #1e293b;
    outline: none;
    background: white;
}

.classroom-code-badge {
    background: #eef2ff;
    color: #5b6cff;
    border: 1px solid rgba(91, 108, 255, 0.2);
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 900;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Barra de Pestañas */
.teacher-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.teacher-tab {
    padding: 12px 20px;
    font-weight: 800;
    font-size: 0.9rem;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.teacher-tab:hover {
    color: #5b6cff;
    background: #f8fafc;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.teacher-tab.active {
    color: #5b6cff;
    border-bottom-color: #5b6cff;
}

/* Contenido de Pestañas */
.teacher-tab-content {
    display: none;
}

.teacher-tab-content.active {
    display: block;
    animation: school-fade-in 0.3s ease;
}

/* Pestaña: Seguimiento */
.tracker-empty {
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 20px;
    border: 2px dashed #e2e8f0;
}

.tracker-grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.tracker-stat-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 15px 20px;
    border: 1px solid #e2e8f0;
}

.tracker-stat-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 4px;
}

.tracker-stat-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
}

.tracker-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.tracker-controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tabla Estilizada */
.school-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.01);
}

.school-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.school-table th {
    background: #f8fafc;
    padding: 14px 18px;
    font-weight: 800;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.school-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-weight: 700;
}

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

/* Estados de Calificación */
.status-badge {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-block;
}

.status-badge.not-started {
    background: #f1f5f9;
    color: #64748b;
}

.status-badge.in-progress {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.started-unfinished {
    background: #ffe4e6;
    color: #e11d48;
}

.status-badge.score {
    background: #dcfce7;
    color: #15803d;
    font-weight: 900;
}

/* Pestaña: Control de Acceso */
.access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.access-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 15px 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s ease;
}

.access-card:hover {
    border-color: #cbd5e1;
}

.access-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.access-card-icon {
    font-size: 1.8rem;
}

.access-card-name {
    font-weight: 800;
    color: #1e293b;
    font-size: 0.9rem;
}

.access-card-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

/* Pestaña: Creador con IA */
.ai-creator-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .ai-creator-container {
        grid-template-columns: 1fr;
    }
}

.ai-creator-panel {
    background: #f8fafc;
    border-radius: 20px;
    padding: 25px;
    border: 1px solid #e2e8f0;
}

.ai-preview-panel {
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    padding: 25px;
    background: #fafafa;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.ai-preview-empty {
    margin: auto;
    text-align: center;
    color: #94a3b8;
}

.ai-preview-empty span {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

/* Diapositivas en Vista Previa */
.preview-slide-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.preview-slide-header {
    font-weight: 800;
    color: #5b6cff;
    font-size: 0.85rem;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.preview-slide-title {
    font-weight: 900;
    font-size: 1.05rem;
    color: #1e293b;
    margin-bottom: 8px;
}

.preview-slide-content {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.4;
}

/* Modales personalizados */
.school-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: school-fade-in 0.2s ease;
}

.school-modal-box {
    background: white;
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    animation: school-scale-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes school-scale-up {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.school-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.school-modal-header h3 {
    margin: 0;
    font-weight: 900;
    color: #1e293b;
    font-size: 1.25rem;
}

.school-modal-close {
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    background: none;
    border: none;
}

.school-modal-close:hover {
    color: #1e293b;
}

.school-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
}


/* --- SECCIÓN ACCESO ESTUDIANTE --- */
.student-portal {
    max-width: 550px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Entrada de Código */
.student-code-card {
    text-align: center;
    background: #f8fafc;
    border-radius: 24px;
    padding: 35px 25px;
    border: 1px solid #e2e8f0;
}

.student-code-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
}

.student-code-card h3 {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 8px;
}

.student-code-card p {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 25px;
    font-weight: 700;
}

.student-code-input {
    font-size: 2.2rem;
    font-weight: 900;
    text-align: center;
    letter-spacing: 4px;
    padding: 10px 15px;
    border-radius: 18px;
    border: 3px solid #cbd5e1;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 25px auto;
    outline: none;
    text-transform: uppercase;
    color: #5b6cff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.01);
}

.student-code-input:focus {
    border-color: #5b6cff;
    box-shadow: 0 0 0 4px rgba(91, 108, 255, 0.1);
}

/* Selector de Nombres (Roster) */
.student-roster-header {
    text-align: center;
    margin-bottom: 30px;
}

.student-roster-header h3 {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1e293b;
}

.student-roster-header p {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 4px;
    font-weight: 750;
}

.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.student-card-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.01);
}

.student-card-btn:hover {
    border-color: #5b6cff;
    background: #eef2ff;
    transform: scale(1.05);
}

.student-card-avatar {
    width: 48px;
    height: 48px;
    background: #5b6cff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 900;
    box-shadow: 0 4px 8px rgba(91, 108, 255, 0.25);
}

.student-card-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: #334155;
    text-align: center;
    line-height: 1.3;
}

/* Teclado de PIN Estudiantil */
.pin-login-container {
    text-align: center;
    max-width: 320px;
    margin: 0 auto;
}

.pin-indicator {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0 35px 0;
}

.pin-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #cbd5e1;
    transition: all 0.15s ease;
}

.pin-dot.filled {
    border-color: #5b6cff;
    background: #5b6cff;
    box-shadow: 0 0 10px rgba(91, 108, 255, 0.4);
}

/* Keypad de Botones */
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.pin-key {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: white;
    font-size: 1.4rem;
    font-weight: 900;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.15s ease;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.01);
}

.pin-key:hover {
    border-color: #5b6cff;
    color: #5b6cff;
    background: #eef2ff;
}

.pin-key:active {
    transform: scale(0.92);
}

.pin-key-backspace {
    border-color: transparent;
    background: none;
    font-size: 1.1rem;
    color: #64748b;
}

.pin-key-backspace:hover {
    background: #f1f5f9;
    border-color: transparent;
    color: #ef4444;
}

/* --- REPRODUCTOR DE CLASES INTERACTIVAS (FASE 6) --- */
.student-player-container {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
}

.player-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.player-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5b6cff 0%, #8b5cf6 100%);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 35px 30px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.015);
    margin-bottom: 30px;
}

.player-card-slide h2 {
    font-size: 1.6rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 15px;
}

.player-card-slide p {
    font-size: 1rem;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

/* Cuestionario del reproductor */
.player-question {
    font-size: 1.25rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 25px;
    text-align: left;
}

.player-options-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.player-option-btn {
    background: white;
    border: 2.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 15px 20px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #334155;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.005);
}

.player-option-btn:hover {
    border-color: #5b6cff;
    background: #f8faff;
}

.player-option-btn.active {
    border-color: #5b6cff !important;
    background: #eef2ff !important;
    color: #5b6cff !important;
    transform: scale(1.02);
}

/* Clases de retroalimentación de respuestas */
.player-option-btn.correct {
    border-color: #10b981 !important;
    background: #dcfce7 !important;
    color: #15803d !important;
    box-shadow: 0 0 10px rgba(16,185,129,0.15);
}

.player-option-btn.incorrect {
    border-color: #ef4444 !important;
    background: #ffe4e6 !important;
    color: #b91c1c !important;
    box-shadow: 0 0 10px rgba(239,68,68,0.15);
    animation: school-shake 0.3s ease;
}

.player-feedback-msg {
    margin-top: 15px;
    font-weight: 800;
    font-size: 0.95rem;
    animation: school-fade-in 0.2s ease;
}

.player-feedback-msg.correct-text {
    color: #059669;
}

.player-feedback-msg.incorrect-text {
    color: #dc2626;
}

/* Animación de Shake para respuestas incorrectas */
@keyframes school-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Celebración de resultados */
.score-badge-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, #eef2ff 0%, #e0e7ff 100%);
    border: 4px solid #5b6cff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    box-shadow: 0 8px 24px rgba(91, 108, 255, 0.2);
}

.score-badge-num {
    font-size: 2.2rem;
    font-weight: 950;
    color: #5b6cff;
    line-height: 1;
}

.score-badge-max {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 800;
    margin-top: 2px;
}

.score-stars {
    font-size: 1.8rem;
    color: #fbbf24;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ====================================================
   ESTILOS DE IMPRESIÓN (FASE 7)
   ==================================================== */
@media print {
    /* Ocultar toda la interfaz de la web */
    body * {
        visibility: hidden;
    }
    /* Mostrar solo el área de impresión */
    #print-area, #print-area * {
        visibility: visible;
    }
    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        color: #000;
        background: #fff;
    }
    /* Forzar saltos de página adecuados en impresión física */
    .print-section {
        page-break-inside: auto;
    }
    .print-slide-block, .print-question-block {
        page-break-inside: avoid;
    }
}


/* =========================================
   RESPONSIVE MOVIL - max-width: 767px
   ========================================= */
@media (max-width: 767px) {
    /* Responsive Calificador Inteligente en Celular Vertical */
    .calificador-grid-container {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        min-height: auto !important;
    }
    .calificador-right-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    #app { display: block !important; }

    #schoolDynamicContent, #schoolDynamicContentMobile { padding: 16px; border-radius: 18px; }

    .teacher-tabs { gap: 4px; margin-bottom: 16px; }
    .teacher-tab { padding: 8px 10px; font-size: 0.74rem; white-space: nowrap; }

    /* Ocultar tab Creador con IA en movil */
    .teacher-tab[data-tab="creador"],
    .teacher-tab-content#tabContent-creador { display: none !important; }

    /* Mostrar aviso desktop-only */
    .mobile-creator-notice { display: block !important; }

    .school-table th, .school-table td { padding: 8px 10px; font-size: 0.76rem; }

    .tracker-grid-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
    .tracker-stat-card { padding: 12px; }
    .tracker-stat-num { font-size: 1.8rem; }

    .school-modal-box { padding: 20px; margin: 10px; border-radius: 18px; }
    .teacher-actions { flex-direction: column; gap: 6px; }

    .player-card { padding: 16px; border-radius: 18px; }
    .player-card-slide { font-size: 0.88rem; }
    .player-question { font-size: 0.95rem !important; }
    .player-btn { padding: 10px 18px; font-size: 0.85rem; }
}

/* Aviso Creador IA solo en PC (oculto por defecto en desktop) */
.mobile-creator-notice {
    display: none;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    padding: 16px 20px;
    text-align: center;
    color: #64748b;
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.mobile-creator-notice .notice-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }


/* =========================================
   CALIFICADOR OMR PANTALLA COMPLETA (v210.0)
   ========================================= */
.calif-fullscreen-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: white;
    font-family: system-ui, -apple-system, sans-serif;
}

.calif-scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.calif-scanner-viewport {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

.calif-target-frame {
    position: relative;
    width: min(92vw, 440px);
    height: 62vh;
    border: 3px dashed #22c55e;
    border-radius: 16px;
    pointer-events: none;
    z-index: 5;
    background: rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    box-sizing: border-box;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
    margin: 4px auto 0 auto;
}

.calif-corner-anchor {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #22c55e;
}
.calif-anchor-tl { top: -2px; left: -2px; border-radius: 4px 0 0 0; }
.calif-anchor-tr { top: -2px; right: -2px; border-radius: 0 4px 0 0; }
.calif-anchor-bl { bottom: -2px; left: -2px; border-radius: 0 0 0 4px; }
.calif-anchor-br { bottom: -2px; right: -2px; border-radius: 0 0 4px 0; }

.calif-scanner-footer {
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1.5px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    text-align: center;
}


/* ── v210.165 FASE 4: PORTAL ESCUELA RESPONSIVE MÓVIL EN 1 COLUMNA ── */
@media (max-width: 768px) {
    #schoolPortalContainer, .school-portal-wrapper {
        padding: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .school-profile-selector, .profile-grid, .school-roles-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        width: 100% !important;
    }

    .role-card, .profile-card, .school-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 20px !important;
        box-sizing: border-box !important;
        border-radius: 20px !important;
    }

    .school-areas-grid, .areas-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .school-header-title, .classroom-banner h2 {
        font-size: 1.3rem !important;
    }
}
