/* ============================================
   ALUMNO MOBILE — CSS DEDICADO
   Mobile-first, responsive hasta desktop

   ⚠️ IMPORTANTE: Este archivo se carga SOLO en alumno.html
   NO cargar en index.html (docente) ni admin.html
   Los estilos aqui rompen el layout del docente.
   ============================================ */

/* Reset para la página del alumno */
.alumno-page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* Prevenir pull-to-refresh nativo del navegador en móvil */
html, body {
    overscroll-behavior: contain;
    -webkit-overscroll-behavior: contain;
}

/* Desktop: fondo normal con layout completo */
@media (min-width: 1025px) {
    .alumno-page {
        background: var(--bg-body);
        display: block;
        align-items: initial;
        justify-content: initial;
    }
}


/* ---- Pantalla de login ---- */
.alumno-login-screen {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.alumno-login-card {
    background: #fff;
    border-radius: 24px;
    padding: 32px 24px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
    animation: slideUp 0.4s ease-out;
}

/* Logo */
.alumno-login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.alumno-login-logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1a73e8, #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 8px 24px rgba(26,115,232,0.4);
}

.alumno-login-logo-icon svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

.alumno-login-logo h1 {
    font-size: 26px;
    font-weight: 800;
    color: #202124;
    margin-bottom: 4px;
}

.alumno-login-logo h1 span {
    background: linear-gradient(135deg, #1a73e8, #9333ea);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.alumno-login-logo p {
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
}

/* Tabs */
.alumno-tabs {
    display: flex;
    background: #f1f3f4;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.alumno-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
}

.alumno-tab.active {
    background: #fff;
    color: #1a73e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Campos */
.alumno-field {
    margin-bottom: 16px;
}

.alumno-field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #5f6368;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.alumno-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.alumno-input-wrap {
    position: relative;
}

.alumno-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #dadce0;
    border-radius: 12px;
    font-size: 15px;
    color: #202124;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
    -webkit-appearance: none;
    appearance: none;
}

.alumno-input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

.alumno-input::placeholder { color: #9aa0a6; }

.alumno-input-wrap .alumno-input {
    padding-right: 48px;
}

.alumno-eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9aa0a6;
    padding: 4px;
    display: flex;
    align-items: center;
}

.alumno-eye-btn svg { width: 18px; height: 18px; }

/* Botón principal */
.alumno-btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a73e8, #1557b0);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(26,115,232,0.35);
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.alumno-btn-primary:hover {
    background: linear-gradient(135deg, #1557b0, #0d47a1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26,115,232,0.45);
}

.alumno-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26,115,232,0.3);
}

.alumno-btn-primary svg { width: 18px; height: 18px; }

/* Error */
.alumno-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #dc2626;
    margin-top: 12px;
    display: none;
    line-height: 1.5;
    text-align: center;
}

/* Footer */
.alumno-login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #9aa0a6;
}

.alumno-login-footer a {
    color: #1a73e8;
    font-weight: 600;
    text-decoration: none;
}

.alumno-login-footer a:hover { text-decoration: underline; }

/* ============================================
   RESPONSIVE — MAIN APP (index.html con rol ALUMNO)
============================================ */

/* Header mobile */
@media (max-width: 768px) {
    header {
        height: 56px;
        padding: 0 12px;
    }

    .logo h1 { font-size: 16px; }
    .logo i { width: 20px; height: 20px; }

    #class-selector-container select {
        font-size: 13px;
        padding: 6px 10px;
        min-width: 140px !important;
    }

    #header-summary { display: none; }

    .header-icon-btn {
        width: 36px;
        height: 36px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    /* App body */
    .app-body {
        flex-direction: column;
    }

    .classes-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    /* Nav de clase — scroll horizontal en móvil */
    .class-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        border-bottom: 2px solid var(--border);
        margin-bottom: 0;
        padding: 0 8px;
        flex-wrap: nowrap;
    }

    .class-nav::-webkit-scrollbar { display: none; }

    .nav-item {
        padding: 12px 14px;
        white-space: nowrap;
        font-size: 13px;
        flex-shrink: 0;
    }

    /* Main content — sin caja, scroll natural */
    .main-content {
        padding: 0;
        overflow-y: visible;
    }

    .content-section {
        max-width: 100%;
        padding: 12px;
    }

    /* Quitar scroll interno del body para que la página fluya naturalmente */
    body {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }

    /* El banner ya no necesita márgenes negativos porque main-content no tiene padding */
    .class-header-banner {
        margin: 0 0 16px 0;
        padding: 16px;
    }

    /* Tarjetas de tareas del alumno */
    .task-card-student {
        flex-direction: column !important;
    }

    .task-card-icon {
        display: none;
    }

    .task-card-content {
        width: 100%;
    }

    .task-card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .task-card-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Modales fullscreen en móvil */
    .modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100vh;
        border-radius: 20px 20px 0 0 !important;
        margin-top: auto;
        padding: 24px 20px;
    }

    .modal-overlay {
        align-items: flex-end !important;
    }

    /* Modal classroom fullscreen */
    .modal-classroom-task {
        border-radius: 0 !important;
    }

    .classroom-modal-body {
        grid-template-columns: 1fr !important;
    }

    .classroom-modal-right {
        border-top: 1px solid var(--border);
        padding: 16px;
    }

    /* Grids */
    .grid {
        grid-template-columns: 1fr !important;
    }

    /* Clases grid */
    #clases-grid {
        grid-template-columns: 1fr;
    }

    /* Dropdown menú usuario */
    .dropdown-menu {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto !important;
        border-radius: 20px 20px 0 0;
        min-width: 100%;
        box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
    }

    /* Apps dropdown */
    .apps-dropdown {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto !important;
        border-radius: 20px 20px 0 0;
        width: 100% !important;
        box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
    }

    .apps-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Notificaciones */
    .notif-dropdown {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
    }

    /* Calendario */
    .cal-wrapper {
        grid-template-columns: 1fr !important;
        height: auto !important;
        padding: 12px;
    }

    .cal-sidebar { display: none; }

    .cal-cell { min-height: 52px; }

    /* Stats */
    .stats-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .stats-charts-row {
        grid-template-columns: 1fr !important;
    }

    /* Asistencia */
    .attendance-student-row {
        flex-wrap: wrap;
        padding: 8px 8px;
    }

    .name-wrap {
        flex: 1;
        min-width: 120px;
    }

    .name-wrap .name-dots {
        display: none;
    }

    .attendance-student-row .status-button-group {
        width: 100%;
        justify-content: center;
        padding-top: 4px;
    }

    .status-button-group {
        flex-wrap: wrap;
        gap: 4px;
    }

    .status-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* Grading */
    #grading-main-container {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }

    /* Tasks layout */
    .tasks-layout {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }

    .tasks-list-pane {
        border-right: none !important;
        border-bottom: 1px solid var(--border);
        max-height: 240px;
    }

    /* Section header */
    .section-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Botones más grandes en móvil */
    .btn {
        min-height: 40px;
        font-size: 13px;
    }

    .btn-sm {
        min-height: 32px;
        font-size: 12px;
    }

    /* Formularios */
    .form-control {
        font-size: 16px; /* evita zoom en iOS */
        padding: 12px;
    }

    /* Classroom create dropdown */
    .classroom-create-dropdown {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto !important;
        border-radius: 20px 20px 0 0;
        min-width: 100%;
        box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
    }

    /* Quick grade panel */
    .quick-grade-item {
        flex-wrap: wrap;
    }

    .quick-grade-item-name {
        min-width: 100%;
    }

    /* Embed iframes */
    .task-embed-wrapper {
        padding-bottom: 75% !important;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cal-wrapper {
        grid-template-columns: 1fr 240px;
    }

    .classroom-modal-body {
        grid-template-columns: 1fr 260px;
    }
}

/* Pantalla pequeña — login */
@media (max-width: 480px) {
    .alumno-login-card {
        padding: 28px 20px 24px;
        border-radius: 20px;
    }

    .alumno-field-row {
        grid-template-columns: 1fr;
    }

    .alumno-login-logo h1 { font-size: 22px; }
}

/* Safe area para iPhone con notch */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .alumno-login-card {
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }

    .dropdown-menu,
    .apps-dropdown,
    .notif-dropdown,
    .classroom-create-dropdown {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* ============================================
   MEJORAS LOGIN — FEEDBACK VISUAL INSTANTÁNEO
============================================ */

/* Spinner dentro del botón */
.spinner-sm {
    display: inline-block;
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin-sm .65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
    flex-shrink: 0;
}
@keyframes spin-sm { to { transform: rotate(360deg); } }

/* Botón deshabilitado durante carga */
.alumno-btn-primary:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none !important;
}

/* Error shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-5px); }
    80%       { transform: translateX(5px); }
}
.alumno-login-card.shake {
    animation: shake 0.4s ease;
}

/* Error message — duplicate removed, merged above */

/* Image previews in grading/submission viewer */
.submission-preview-container img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin-bottom: 12px;
}

/* Multiple file viewer — file label */
.submission-file-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    padding: 6px 12px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-light);
}

/* Google button — hide on very narrow screens if not usable */
@media (max-width: 340px) {
    .btn-google-signin { font-size: 12px; padding: 10px 12px; }
    .google-signin-divider { margin: 12px 0; }
}

/* ============================================
   B — MEJORAS EXPERIENCIA MÓVIL
   Bottom nav · Task cards · Image lightbox
   Pull-to-refresh · Swipe · Landscape
============================================ */

/* ── Bottom Navigation Bar (móvil) ──────────────────────────── */
.mobile-bottom-nav {
    display: none; /* solo visible en móvil */
}

@media (max-width: 768px) {
    /* Espacio para la barra inferior */
    .app-body {
        padding-bottom: 64px;
    }
    main {
        padding-bottom: 72px !important;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--bg-card, #fff);
        border-top: 1px solid var(--border, #e5e7eb);
        z-index: 900;
        align-items: stretch;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    }

    .mobile-bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        cursor: pointer;
        border: none;
        background: none;
        color: var(--text-sub, #6b7280);
        font-size: 10px;
        font-weight: 600;
        padding: 6px 4px;
        transition: color 0.15s;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        font-family: inherit;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .mobile-bottom-nav-item svg,
    .mobile-bottom-nav-item i {
        width: 22px !important;
        height: 22px !important;
        stroke-width: 2;
    }

    .mobile-bottom-nav-item.active {
        color: var(--primary, #1a73e8);
    }

    .mobile-bottom-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 28px;
        height: 3px;
        background: var(--primary, #1a73e8);
        border-radius: 0 0 3px 3px;
    }

    .mobile-bottom-nav-badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 18px);
        min-width: 16px;
        height: 16px;
        background: var(--error, #ef4444);
        color: #fff;
        border-radius: 8px;
        font-size: 9px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
    }

    /* Ocultar class-nav horizontal cuando hay bottom nav activo */
    .has-bottom-nav .class-nav {
        display: none;
    }

    /* Clase activa con bottom nav — no necesita top nav */
    .mobile-bottom-nav-item:active {
        opacity: 0.7;
    }
}

/* ── Tarjetas de tarea mejoradas en móvil ───────────────────── */
@media (max-width: 768px) {
    .task-card-student {
        border-radius: 16px !important;
        margin-bottom: 12px !important;
        padding: 0 !important;
        overflow: hidden;
        border-left: none !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
        transition: transform 0.15s, box-shadow 0.15s;
    }

    .task-card-student:active {
        transform: scale(0.99);
    }

    /* Franja de color superior según estado */
    .task-card-student::before {
        content: '';
        display: block;
        height: 4px;
        width: 100%;
        background: var(--border, #e5e7eb);
        flex-shrink: 0;
    }

    /* Estado pendiente → naranja */
    .task-card-student:has(.badge-pending)::before {
        background: linear-gradient(90deg, #f59e0b, #fbbf24);
    }
    /* Estado entregado → verde */
    .task-card-student:has(.badge-submitted)::before {
        background: linear-gradient(90deg, #10b981, #34d399);
    }
    /* Estado calificado → azul */
    .task-card-student:has(.badge-success)::before,
    .task-card-student:has(.badge-error)::before,
    .task-card-student:has(.badge-warning)::before {
        background: linear-gradient(90deg, #1a73e8, #60a5fa);
    }

    .task-card-content {
        padding: 14px 16px 16px !important;
    }

    .task-card-header {
        margin-bottom: 8px;
    }

    .task-card-header h4 {
        font-size: 15px !important;
        font-weight: 700 !important;
        line-height: 1.3;
        color: var(--text-main, #111827);
        margin: 0 0 6px 0;
    }

    .task-card-meta {
        display: flex;
        gap: 12px;
        font-size: 12px;
        color: var(--text-sub, #6b7280);
        margin-bottom: 8px;
        flex-wrap: wrap;
    }

    .task-card-meta span {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .task-card-footer {
        padding-top: 12px !important;
        border-top: 1px solid var(--border-light, #f3f4f6) !important;
        gap: 8px !important;
    }

    /* Botón de entrega — más grande en móvil */
    .btn-deliver {
        flex: 1 !important;
        justify-content: center !important;
        min-height: 42px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }

    /* Badge de estado */
    .task-status-block {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 10px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
    }

    .task-description {
        font-size: 13px;
        color: var(--text-sub, #6b7280);
        line-height: 1.5;
        margin-bottom: 8px;
    }

    /* Nota con colores */
    .task-grade-display {
        font-size: 22px;
        font-weight: 800;
        line-height: 1;
    }
}

/* ── Visor de imágenes / Lightbox ───────────────────────────── */
.img-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInLightbox 0.2s ease;
    touch-action: none;
}

@keyframes fadeInLightbox {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.img-lightbox-img {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.2s;
    user-select: none;
    -webkit-user-drag: none;
}

.img-lightbox-controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
    z-index: 10000;
}

.img-lightbox-counter {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 600;
}

.img-lightbox-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.img-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    z-index: 10000;
    transition: background 0.15s;
}

.img-lightbox-nav:active { background: rgba(255,255,255,0.3); }
.img-lightbox-prev { left: 12px; }
.img-lightbox-next { right: 12px; }

.img-lightbox-thumbs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    scrollbar-width: none;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.img-lightbox-thumbs::-webkit-scrollbar { display: none; }

.img-lightbox-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: opacity 0.15s, border-color 0.15s;
}

.img-lightbox-thumb.active {
    opacity: 1;
    border-color: #fff;
}

/* ── Imágenes en visor de entregas ──────────────────────────── */
.submission-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.submission-img-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    border: 2px solid transparent;
}

.submission-img-thumb:hover,
.submission-img-thumb:active {
    opacity: 0.85;
    transform: scale(0.97);
}

/* ── Landscape en móvil ─────────────────────────────────────── */
@media (max-width: 900px) and (orientation: landscape) {
    .alumno-login-screen {
        align-items: flex-start;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .alumno-login-card {
        padding: 20px 24px;
        max-height: 95vh;
        overflow-y: auto;
    }

    .alumno-login-logo {
        margin-bottom: 16px;
    }

    .alumno-login-logo-icon {
        width: 48px;
        height: 48px;
    }

    .alumno-login-logo h1 {
        font-size: 20px;
    }

    .mobile-bottom-nav {
        height: 52px;
    }

    .app-body,
    main {
        padding-bottom: 56px !important;
    }
}

/* ── Swipe hint en tarjetas (primera visita) ─────────────────── */
@keyframes swipeHint {
    0%   { transform: translateX(0); opacity: 1; }
    30%  { transform: translateX(12px); opacity: 0.7; }
    60%  { transform: translateX(-6px); opacity: 0.9; }
    100% { transform: translateX(0); opacity: 1; }
}

.swipe-hint {
    animation: swipeHint 1s ease 1s 1;
}

/* ── Mejoras de accesibilidad en móvil ──────────────────────── */
@media (max-width: 768px) {
    /* Área táctil mínima de 44px para todos los botones */
    button, .btn, [role="button"] {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 36px;
    }

    /* Feedback táctil visual */
    button:active, .btn:active, [role="button"]:active {
        opacity: 0.8;
        transform: scale(0.98);
    }

    /* Input sin zoom en iOS */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Scroll suave en todos los contenedores */
    .main-content,
    .content-section,
    .modal {
        -webkit-overflow-scrolling: touch;
    }

    /* Evitar selección accidental de texto al tap */
    .task-card-student,
    .class-card,
    .nav-item,
    .mobile-bottom-nav-item {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ── Dark mode mobile ───────────────────────────────────────── */
body.dark-mode .mobile-bottom-nav {
    background: var(--bg-card);
    border-top-color: var(--border);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
}

body.dark-mode .img-lightbox-overlay {
    background: rgba(0,0,0,0.98);
}

body.dark-mode .task-card-student {
    background: var(--bg-card);
}

/* ── Google sign-in button ──────────────────────────────────── */
.btn-google-signin {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #dadce0;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: #3c4043;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-google-signin:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26,115,232,0.15);
}

.btn-google-signin:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 340px) {
    .btn-google-signin {
        font-size: 12px;
        padding: 10px 12px;
    }
}

/* ============================================
   MEJORA VISUAL - Portal del Alumno
============================================ */

/* Background principal mas suave */
.alumno-page {
    background: linear-gradient(160deg, #667eea 0%, #5a67d8 25%, #4c51bf 50%, #2d3748 100%);
}

/* Animacion de entrada para el dashboard */
#class-content-wrapper {
    animation: fadeInUp 0.4s ease-out;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header del alumno mejorado */
.alumno-header {
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 12px 20px;
    border-radius: 16px 16px 0 0;
}
.alumno-header .user-name {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    letter-spacing: -0.3px;
}
.alumno-header .class-badge {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #e2e8f0;
}

/* Sidebar/nav lateral mejorado */
#sidebar-nav, .class-nav {
    background: rgba(30,41,59,0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 8px;
}
#sidebar-nav .nav-item, .class-nav .nav-item {
    border-radius: 10px;
    padding: 10px 14px;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s;
    margin-bottom: 2px;
}
#sidebar-nav .nav-item:hover, .class-nav .nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transform: translateX(2px);
}
#sidebar-nav .nav-item.active, .class-nav .nav-item.active {
    background: rgba(99,102,241,0.3);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}

/* Contenido principal */
#class-content-wrapper {
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
}
.content-section {
    padding: 20px;
}

/* Cards mejorados */
.card, .post-card, .task-card-student, .task-card-v2 {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 14px !important;
    backdrop-filter: blur(10px);
    transition: all 0.25s;
}
.card:hover, .post-card:hover, .task-card-v2:hover {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.15) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Botones del alumno */
.alumno-btn, .btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea, #5a67d8) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99,102,241,0.4);
}
.btn-outline {
    border: 1px solid rgba(255,255,255,0.15) !important;
    color: #e2e8f0 !important;
    background: rgba(255,255,255,0.05) !important;
}
.btn-outline:hover {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.25) !important;
}

/* Badges y chips */
.badge, .task-chip {
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-success, .task-chip.material { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.badge-submitted, .task-chip.submitted { background: rgba(59,130,246,0.2); color: #93c5fd; }
.badge-pending, .task-chip.pending { background: rgba(245,158,11,0.2); color: #fcd34d; }

/* Texto mejorado */
.task-title, .post-author, h3, h4 {
    color: #f1f5f9 !important;
}
.task-description, .post-content, .task-meta {
    color: #94a3b8 !important;
}

/* Footer y comentarios */
.task-card-footer {
    border-top: 1px solid rgba(255,255,255,0.06) !important;
}
.task-comments-container {
    border-top: 1px solid rgba(255,255,255,0.06) !important;
}

/* Animacion de notificaciones */
.refresh-indicator {
    background: rgba(99,102,241,0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 6px 16px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   TEMA SELECTOR - Multiples temas
============================================ */
.theme-option { cursor: pointer; }
.theme-option:hover { background: rgba(255,255,255,0.08); }
.theme-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

body[data-theme="default"] .alumno-page { background: linear-gradient(160deg, #667eea 0%, #5a67d8 25%, #4c51bf 50%, #2d3748 100%); }
body[data-theme="ocean"] .alumno-page { background: linear-gradient(160deg, #06b6d4 0%, #0891b2 25%, #0e7490 50%, #164e63 100%); }
body[data-theme="ocean"] #class-content-wrapper { background: rgba(8,47,73,0.7); }
body[data-theme="ocean"] .btn-primary { background: linear-gradient(135deg, #06b6d4, #0891b2) !important; box-shadow: 0 4px 12px rgba(6,182,212,0.3); }
body[data-theme="ocean"] #sidebar-nav .nav-item.active { background: rgba(6,182,212,0.3); }

body[data-theme="forest"] .alumno-page { background: linear-gradient(160deg, #10b981 0%, #059669 25%, #047857 50%, #064e3b 100%); }
body[data-theme="forest"] #class-content-wrapper { background: rgba(6,78,59,0.7); }
body[data-theme="forest"] .btn-primary { background: linear-gradient(135deg, #10b981, #059669) !important; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
body[data-theme="forest"] #sidebar-nav .nav-item.active { background: rgba(16,185,129,0.3); }

body[data-theme="sunset"] .alumno-page { background: linear-gradient(160deg, #f97316 0%, #ea580c 25%, #c2410c 50%, #7c2d12 100%); }
body[data-theme="sunset"] #class-content-wrapper { background: rgba(124,45,18,0.7); }
body[data-theme="sunset"] .btn-primary { background: linear-gradient(135deg, #f97316, #ea580c) !important; box-shadow: 0 4px 12px rgba(249,115,22,0.3); }
body[data-theme="sunset"] #sidebar-nav .nav-item.active { background: rgba(249,115,22,0.3); }

body[data-theme="midnight"] .alumno-page { background: linear-gradient(160deg, #1e293b 0%, #0f172a 25%, #020617 100%); }
body[data-theme="midnight"] #class-content-wrapper { background: rgba(2,6,23,0.8); }
body[data-theme="midnight"] .btn-primary { background: linear-gradient(135deg, #475569, #334155) !important; box-shadow: 0 4px 12px rgba(71,85,105,0.3); }
body[data-theme="midnight"] #sidebar-nav .nav-item.active { background: rgba(71,85,105,0.3); }

/* Responsive mobile ajustes */
@media (max-width: 768px) {
    .alumno-page {
        background: linear-gradient(180deg, #4c51bf 0%, #2d3748 100%) !important;
        padding: 0;
    }
    #class-content-wrapper, #sidebar-nav, .class-nav {
        border-radius: 0;
        border: none;
    }
    .card, .post-card, .task-card-v2 {
        border-radius: 12px !important;
        margin: 0 8px 8px;
    }
}

/* ============================================
   MOBILE PHONE OPTIMIZATION (< 430px)
============================================ */
@media (max-width: 430px) {
    .alumno-page {
        padding: 0 !important;
        background: linear-gradient(180deg, #4c51bf 0%, #2d3748 100%) !important;
        align-items: flex-start;
    }

    /* Contenedor principal: que ocupe todo el ancho */
    #class-content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    /* Login card mobile */
    .alumno-login-card { 
        padding: 20px 16px !important; border-radius: 16px; 
        width: 92%; max-width: 92%; margin: 8px auto;
    }
    .alumno-login-logo h1 { font-size: 18px; }
    .alumno-login-logo-icon { width: 48px; height: 48px; }
    .alumno-login-logo-icon svg { width: 24px; height: 24px; }
    .alumno-input { padding: 10px 12px; font-size: 14px; }
    .alumno-btn-primary { padding: 11px; font-size: 14px; }
    .alumno-tabs { gap: 2px; }
    .alumno-tab { font-size: 12px; padding: 8px 14px; }
    .alumno-field label { font-size: 11px; }

    /* Header compacto */
    .app-header {
        padding: 6px 8px;
        height: 44px;
    }
    .app-header .logo-text { font-size: 13px; }
    .user-avatar { width: 28px; height: 28px; font-size: 11px; }

    /* Body - full width */
    .app-body { flex-direction: column; gap: 0; width: 100%; }
    #sidebar-nav { 
        flex-direction: row; overflow-x: auto; padding: 3px 4px;
        border-radius: 0; gap: 1px; white-space: nowrap;
        -webkit-overflow-scrolling: touch; width: 100%;
        scrollbar-width: none;
    }
    #sidebar-nav::-webkit-scrollbar { display: none; }
    #sidebar-nav .nav-item {
        padding: 6px 10px; font-size: 11px; border-radius: 8px;
        flex-shrink: 0; white-space: nowrap;
    }
    #sidebar-nav .nav-item i, #sidebar-nav .nav-item svg { width: 13px; height: 13px; }

    /* Content area */
    .main-content { padding: 0 !important; height: auto; }
    #class-content-wrapper { border-radius: 0; border: none; }
    .content-section { padding: 10px 6px; }

    /* Cards */
    .card, .post-card, .task-card-v2, .task-card-student {
        padding: 12px !important; margin: 0 4px 6px !important;
        border-radius: 10px !important;
    }
    .tc-icon { width: 30px; height: 30px; border-radius: 8px; }
    .tc-icon svg { width: 14px; height: 14px; }
    .tc-title { font-size: 13px !important; }
    .tc-meta { font-size: 10px; gap: 8px; }
    .tc-actions .btn { font-size: 11px; padding: 5px 10px; }
    .task-due { font-size: 10px; }
    .task-chip { font-size: 10px; padding: 2px 8px; }
    .tc-points { font-size: 10px; }

    /* Post cards */
    .post-header { gap: 8px; }
    .avatar { width: 30px; height: 30px; font-size: 12px; }
    .post-author { font-size: 12px; }
    .post-date { font-size: 10px; }
    .post-content { font-size: 12px; margin-top: 8px; }
    .post-content p { line-height: 1.5; }

    /* Buttons */
    .btn { font-size: 11px; padding: 6px 12px; border-radius: 8px; }
    .btn-primary { font-size: 11px; padding: 7px 14px; }
    .btn-sm { font-size: 10px; padding: 4px 10px; }

    /* Section headers */
    .section-header { padding: 8px 10px; }
    .section-header h2 { font-size: 14px; }
    .header-actions { gap: 4px; }
    .header-actions .btn { font-size: 10px; padding: 5px 8px; }

    /* Class selector */
    .class-selector { padding: 8px 10px; }
    .class-selector h3 { font-size: 14px; }
    .class-selector .class-code { font-size: 11px; }

    /* Modal adjustments */
    .modal { width: 95% !important; max-width: 95% !important; margin: 8px; }
    .modal-header { padding: 10px 14px; }
    .modal-header h2 { font-size: 15px; }
    .modal-body { padding: 12px; }

    /* Tablon composer */
    .tablon-composer { padding: 12px; border-radius: 10px; margin-bottom: 8px; }
    .tablon-composer-input { font-size: 13px; padding: 8px 10px; min-height: 48px; }

    /* Grade bar */
    .grade-progress-bar { height: 4px; margin-top: 4px; }

    /* Notifications */
    .refresh-indicator { top: 52px; right: 8px; font-size: 10px; padding: 4px 10px; }

    /* Toast */
    .toast { min-width: auto; width: calc(100% - 16px); right: 8px; top: 8px; }
    .toast-container { top: 8px; right: 8px; left: 8px; }

    /* User menu */
    #user-menu .dropdown-menu { right: 4px; width: 200px; }
    .dropdown-item { font-size: 12px; padding: 8px 12px; }
}

/* Tiny phones < 360px */
@media (max-width: 360px) {
    .tc-title { font-size: 12px !important; }
    .task-card-v2 { padding: 10px !important; gap: 8px; }
    .tc-icon { width: 26px; height: 26px; }
    #sidebar-nav .nav-item { font-size: 10px; padding: 5px 8px; }
    .btn { font-size: 10px; padding: 5px 10px; }
}

/* ============================================
   FIX: Cards and content padding improvements
============================================ */
#alumno-tasks-container {
    padding: 8px 4px;
}

#alumno-tasks-container .task-card-student {
    margin: 0 0 10px 0 !important;
}

#modal-unirse-clase .modal {
    padding: 24px;
}

@media (min-width: 769px) {
    #alumno-tasks-container {
        padding: 16px 8px;
    }
    .content-section {
        padding: 20px 24px !important;
    }
}

@media (max-width: 430px) {
    #alumno-tasks-container {
        padding: 4px 2px;
    }
    #alumno-tasks-container .task-card-student {
        margin: 0 2px 8px 2px !important;
    }
}

/* Fix: Modal "Unirse a clase" padding */
#modal-unirse-clase .modal {
    padding: 20px;
}

@media (max-width: 430px) {
    #modal-unirse-clase .modal {
        padding: 16px;
        margin: 12px;
        width: calc(100% - 24px);
    }
    #modal-unirse-clase .modal-header h2 {
        font-size: 16px;
    }
    #class-join-code {
        font-size: 16px !important;
    }
}

/* Fix: Botón Unirse en modales */
.modal-footer {
    gap: 8px;
    flex-wrap: wrap;
}

.modal-footer .btn {
    flex: 1;
    min-width: 100px;
    text-align: center;
}

/* ============================================
   FIX: Header layout - avoid overflow
============================================ */
.header-left {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

#class-selector-container {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

#class-selector-container select {
    max-width: 100%;
    width: auto;
    min-width: 0 !important;
    text-overflow: ellipsis;
}

.header-right {
    flex-shrink: 0;
    gap: 4px;
}

.header-icon-btn {
    width: 36px;
    height: 36px;
}

@media (max-width: 768px) {
    .header-left {
        gap: 6px;
    }
    #class-selector-container select {
        font-size: 12px !important;
        padding: 4px 6px !important;
        max-width: 140px !important;
    }
    .header-icon-btn {
        width: 32px;
        height: 32px;
    }
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}

@media (max-width: 430px) {
    header {
        padding: 4px 8px !important;
        gap: 4px !important;
    }
    .header-left {
        gap: 4px;
    }
    #class-selector-container select {
        font-size: 11px !important;
        padding: 3px 4px !important;
        max-width: 110px !important;
        min-width: 0 !important;
    }
    .header-icon-btn {
        width: 28px;
        height: 28px;
    }
    .user-avatar {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    .logo h1 {
        font-size: 14px !important;
    }
    .logo span {
        font-size: 10px !important;
    }
}

/* Fix: class banner - avoid overflow */
.class-header-banner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px !important;
    margin: -16px -16px 16px -16px !important;
    overflow: hidden;
}

.class-banner-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.class-banner-info h2 {
    font-size: 18px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.class-banner-info p {
    font-size: 12px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.class-banner-code {
    padding: 6px 12px !important;
    gap: 6px !important;
    flex-shrink: 0;
}

.class-banner-code-value {
    font-size: 16px !important;
}

@media (max-width: 430px) {
    .class-header-banner {
        padding: 10px 12px !important;
        margin: -8px -8px 12px -8px !important;
    }
    .class-banner-info h2 {
        font-size: 15px !important;
    }
    .class-banner-code-value {
        font-size: 14px !important;
    }
    .class-banner-code {
        padding: 4px 8px !important;
    }
}

/* Fix: task detail view - avoid overflow */
.task-detail-header {
    flex-wrap: wrap;
    overflow: hidden;
}

.task-detail-header h2 {
    font-size: 18px !important;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Fix: general overflow prevention */
* {
    max-width: 100%;
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

pre, code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Fix tables */
table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
}

/* ============================================
   FIX: Header layout - prevent overlap
============================================ */
header {
    height: auto !important;
    min-height: 48px;
    padding: 6px 10px !important;
    gap: 6px !important;
    flex-wrap: nowrap;
}

.header-left {
    flex-shrink: 1 !important;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    gap: 6px !important;
}

.header-right {
    flex-shrink: 0;
    gap: 2px !important;
}

#class-selector-container {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

#class-selector-container select {
    max-width: 100%;
    width: auto;
    min-width: 0 !important;
    text-overflow: ellipsis;
    font-size: 13px !important;
    padding: 4px 8px !important;
    border-radius: 8px;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 16px !important;
    white-space: nowrap;
}

.logo span {
    font-size: 11px !important;
}

.header-icon-btn {
    width: 34px !important;
    height: 34px !important;
}

.user-profile-menu {
    flex-shrink: 0;
}

.user-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
}

#header-summary {
    display: none;
}

@media (max-width: 768px) {
    header {
        min-height: 44px;
        padding: 4px 8px !important;
        gap: 4px !important;
    }
    .header-left {
        gap: 4px !important;
    }
    #class-selector-container select {
        font-size: 12px !important;
        padding: 3px 6px !important;
        max-width: 130px !important;
    }
    .logo h1 {
        font-size: 14px !important;
    }
    .logo span {
        font-size: 10px !important;
    }
    .header-icon-btn {
        width: 30px !important;
        height: 30px !important;
    }
    .header-icon-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
    .user-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 430px) {
    header {
        min-height: 40px;
        padding: 3px 6px !important;
        gap: 3px !important;
    }
    .header-left {
        gap: 3px !important;
    }
    #class-selector-container select {
        font-size: 11px !important;
        padding: 2px 4px !important;
        max-width: 100px !important;
        min-width: 60px !important;
    }
    .logo h1 {
        font-size: 12px !important;
    }
    .logo span {
        font-size: 9px !important;
    }
    .logo i, .logo svg {
        width: 18px !important;
        height: 18px !important;
    }
    .header-icon-btn {
        width: 26px !important;
        height: 26px !important;
    }
    .header-icon-btn svg {
        width: 14px !important;
        height: 14px !important;
    }
    .user-avatar {
        width: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
    }
}

/* Fix: class banner overflow */
.class-header-banner {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 10px 14px !important;
    margin: -16px -16px 16px -16px !important;
    overflow: hidden;
}

.class-banner-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.class-banner-info h2 {
    font-size: 18px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.class-banner-info p {
    font-size: 12px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.class-banner-code {
    padding: 4px 10px !important;
    gap: 4px !important;
}

.class-banner-code-value {
    font-size: 14px !important;
}

@media (max-width: 430px) {
    .class-header-banner {
        padding: 8px 10px !important;
        margin: -8px -8px 12px -8px !important;
    }
    .class-banner-info h2 {
        font-size: 15px !important;
    }
    .class-banner-code-value {
        font-size: 12px !important;
    }
    .class-banner-code {
        padding: 3px 6px !important;
    }
}

/* Fix: Prevent header icon overlap */
header .header-right {
    gap: 1px !important;
}

.header-notif-menu,
.header-apps-menu {
    position: relative;
}

#notif-btn,
#apps-btn {
    position: relative;
    z-index: 1;
}

/* Better spacing between items */
.user-profile-menu {
    margin-left: 2px;
}

/* When header is too narrow, reduce gap between icons */
@media (max-width: 900px) {
    header {
        gap: 4px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .header-right {
        gap: 0px !important;
    }
    .header-icon-btn {
        width: 32px !important;
        height: 32px !important;
    }
}

@media (max-width: 600px) {
    header .header-right {
        gap: 0px !important;
    }
    .header-icon-btn {
        width: 28px !important;
        height: 28px !important;
    }
    #class-selector-container select {
        max-width: 90px !important;
        font-size: 11px !important;
    }
}

/* Ensure dropdown menus don't overlap */
#header-notif-menu .notif-dropdown,
#header-apps-menu .apps-dropdown {
    right: -10px !important;
}
} /* fin @media max-width: 1024px */

/* ============================================
   LOGIN — Estilos universales (PC y móvil)
   ============================================ */
/* El login debe estar centrado con gradiente en TODOS los tamaños */
.alumno-login-screen {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.alumno-login-card {
    background: #fff;
    border-radius: 24px;
    padding: 32px 24px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
    animation: slideUp 0.4s ease-out;
}

/* Logo */
.alumno-login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.alumno-login-logo-icon svg {
    width: 56px;
    height: 56px;
    color: var(--primary);
}

.alumno-login-logo h1 {
    font-size: 26px;
    font-weight: 800;
    margin: 12px 0 4px;
    color: #1a1a2e;
}

.alumno-login-logo h1 span {
    background: linear-gradient(135deg, #1a73e8, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.alumno-login-logo p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Desktop: si el alumno está en dashboard, NO en login */
@media (min-width: 1025px) {
    .alumno-page:not(:has(.alumno-login-screen)) {
        background: var(--bg-body);
        display: block;
        align-items: initial;
        justify-content: initial;
    }
}
/* Mobile: estilos dedicados */
@media (max-width: 1024px) {
.alumno-page {
    background: linear-gradient(160deg, #1a73e8 0%, #0d47a1 40%, #1a1a2e 100%);
}
html { font-size: 16px; }
@media (max-width: 430px) { html { font-size: 15px; } }
@media (max-width: 375px) { html { font-size: 14px; } }
@media (max-width: 320px) { html { font-size: 13px; } }


