/* ==========================================================================
   ACADEMIAQR - MÓDULO DE ASISTENCIA Y GARITA (VISTA DEL ALUMNO)
   Diseño Colorido, Moderno, Dinámico y 100% Adaptativo (Web & Móvil)
   ========================================================================== */

:root {
    --att-primary: #2563eb;
    --att-primary-light: #60a5fa;
    --att-primary-dark: #1e40af;
    --att-success: #10b981;
    --att-success-light: #34d399;
    --att-warning: #f59e0b;
    --att-warning-light: #fbbf24;
    --att-danger: #ef4444;
    --att-danger-light: #f87171;
    --att-purple: #7c3aed;
    --att-purple-light: #a78bfa;
    --att-pink: #ec4899;
    --att-cyan: #0284c7;
    --att-radius-sm: 10px;
    --att-radius-md: 16px;
    --att-radius-lg: 24px;
    --att-shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
    --att-shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.14);
}

/* ==========================================================================
   PREVENCIÓN DE FOUC (Flash of Unstyled Content) EN RECARGAS SEGÚN EL ROL
   ========================================================================== */
html[data-user-role="student"]:not([data-tabs-ready]) #viewTeacher,
html[data-user-role="student"]:not([data-tabs-ready]) #teacherGateView,
html[data-user-role="student"]:not([data-tabs-ready]) #mobileQrScannerCard {
    display: none !important;
}

html[data-user-role="student"]:not([data-tabs-ready]) #viewStudent {
    display: block !important;
}

/* ==========================================================================
   1. HERO BANNER DEL ALUMNO
   ========================================================================== */
.student-hero-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #7c3aed 100%);
    border-radius: var(--att-radius-lg);
    padding: 1.6rem 2rem;
    color: #ffffff;
    box-shadow: 0 10px 30px -5px rgba(37, 99, 235, 0.35);
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.student-hero-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.student-hero-banner::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 20%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.student-hero-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.student-hero-avatar-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.student-hero-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.student-hero-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #10b981;
    border: 2.5px solid #ffffff;
    box-shadow: 0 0 8px #10b981;
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
}

.student-hero-info h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 0.3rem 0;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.student-hero-badge-role {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.student-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.88rem;
    opacity: 0.92;
    flex-wrap: wrap;
}

.student-hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.student-hero-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.btn-hero-carnet {
    background: #ffffff;
    color: var(--att-primary-dark);
    font-weight: 800;
    font-size: 0.88rem;
    padding: 0.65rem 1.2rem;
    border-radius: var(--att-radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
}

.btn-hero-carnet:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    background: #f8fafc;
    color: var(--att-primary);
}

.btn-hero-sos {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.65rem 1.1rem;
    border-radius: var(--att-radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    backdrop-filter: blur(6px);
    transition: all 0.25s ease;
}

.btn-hero-sos:hover {
    background: var(--att-danger);
    transform: translateY(-2px);
    border-color: transparent;
}

/* ==========================================================================
   2. GRID PRINCIPAL DEL ALUMNO (CLASE EN VIVO & RANKING)
   ========================================================================== */
.student-main-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

/* Tarjeta de Clase en Vivo */
.student-live-card {
    background: #ffffff;
    border-radius: var(--att-radius-lg);
    border: 1px solid #e2e8f0;
    box-shadow: var(--att-shadow-soft);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.student-live-card:hover {
    box-shadow: var(--att-shadow-hover);
}

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

.student-live-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.student-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: livePulseAnim 1.6s infinite;
}

@keyframes livePulseAnim {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.student-period-pill {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Contenido de la Clase Activa */
.student-live-body {
    margin-bottom: 1.25rem;
}

.student-live-subject-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.student-live-subject-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--att-radius-md);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--att-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    border: 1px solid #bfdbfe;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}

.student-live-subject-info h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.3rem 0;
    line-height: 1.25;
}

.student-live-teacher-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.86rem;
    color: #475569;
    font-weight: 600;
}

.student-live-details-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--att-radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 1.2rem;
}

.student-live-detail-item {
    display: flex;
    flex-direction: column;
}

.student-live-detail-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.15rem;
}

.student-live-detail-value {
    font-size: 0.92rem;
    font-weight: 800;
    color: #1e293b;
}

/* ==========================================================================
   3. CAJA PRINCIPAL DE CHECK DE ASISTENCIA EN VIVO
   ========================================================================== */
.student-check-status-box {
    border-radius: var(--att-radius-md);
    padding: 1.1rem 1.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

/* Estado: Presente / Check Confirmado */
.student-check-status-box.status-present {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
    color: #14532d;
    box-shadow: 0 6px 16px -2px rgba(16, 185, 129, 0.15);
}

/* Estado: Tardanza Registrada */
.student-check-status-box.status-late {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
    color: #78350f;
    box-shadow: 0 6px 16px -2px rgba(245, 158, 11, 0.15);
}

/* Estado: En Espera / Pendiente */
.student-check-status-box.status-pending {
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    border-color: #c7d2fe;
    color: #1e3a8a;
    box-shadow: 0 6px 16px -2px rgba(99, 102, 241, 0.12);
}

/* Estado: Ausente */
.student-check-status-box.status-absent {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
    color: #7f1d1d;
    box-shadow: 0 6px 16px -2px rgba(239, 68, 68, 0.15);
}

.student-check-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.status-present .student-check-icon-wrap {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
    animation: bouncePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.status-late .student-check-icon-wrap {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.status-pending .student-check-icon-wrap {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
    animation: rotateSlow 8s linear infinite;
}

.status-absent .student-check-icon-wrap {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

@keyframes bouncePop {
    0% { transform: scale(0.6); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

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

.student-check-text {
    flex: 1;
}

.student-check-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    line-height: 1.25;
}

.student-check-sub {
    font-size: 0.82rem;
    opacity: 0.88;
    line-height: 1.35;
}

.student-live-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #e2e8f0;
    padding-top: 0.9rem;
    margin-top: 0.9rem;
    font-size: 0.82rem;
    color: #64748b;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.student-next-class-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #0284c7;
    font-weight: 700;
}

/* ==========================================================================
   4. TARJETA DE RANKING DE ASISTENCIA & PUNTUALIDAD
   ========================================================================== */
.student-ranking-card {
    background: linear-gradient(145deg, #ffffff 0%, #fffbeb 50%, #fef3c7 100%);
    border-radius: var(--att-radius-lg);
    border: 1.5px solid #fde68a;
    box-shadow: var(--att-shadow-soft);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.student-ranking-card::after {
    content: '🏆';
    position: absolute;
    bottom: -15px;
    right: -10px;
    font-size: 6rem;
    opacity: 0.12;
    pointer-events: none;
}

.student-ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.student-ranking-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #92400e;
}

.student-ranking-badge {
    background: #f59e0b;
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.student-ranking-hero-box {
    background: #ffffff;
    border-radius: var(--att-radius-md);
    padding: 1.2rem;
    border: 1px solid #fef08a;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.student-ranking-trophy-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
    flex-shrink: 0;
}

.student-ranking-pos-number {
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1;
}

.student-ranking-pos-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    opacity: 0.9;
}

.student-ranking-info {
    flex: 1;
}

.student-ranking-grade-rank {
    font-size: 1.15rem;
    font-weight: 800;
    color: #78350f;
    margin-bottom: 0.25rem;
}

.student-ranking-streak-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
}

.student-ranking-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.85);
    padding: 0.85rem;
    border-radius: var(--att-radius-md);
    border: 1px solid #fde68a;
}

.student-ranking-mini-stat {
    display: flex;
    flex-direction: column;
}

.student-ranking-mini-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
}

.student-ranking-mini-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #78350f;
}

/* ==========================================================================
   5. MÉTRICAS CLAVE (SUMATORIA DE TARDANZAS Y VECES QUE NO LLEGÓ)
   ========================================================================== */
.student-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.student-metric-card {
    background: #ffffff;
    border-radius: var(--att-radius-lg);
    border: 1px solid #e2e8f0;
    padding: 1.3rem 1.4rem;
    box-shadow: var(--att-shadow-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.student-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--att-shadow-hover);
}

.student-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.student-metric-card.card-ontime::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.student-metric-card.card-tardy::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.student-metric-card.card-absent::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.student-metric-card.card-gate::before {
    background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.student-metric-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}

.student-metric-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--att-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.card-ontime .student-metric-icon {
    background: #ecfdf5;
    color: #059669;
}

.card-tardy .student-metric-icon {
    background: #fffbeb;
    color: #d97706;
}

.card-absent .student-metric-icon {
    background: #fef2f2;
    color: #dc2626;
}

.card-gate .student-metric-icon {
    background: #f0f9ff;
    color: #0284c7;
}

.student-metric-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.card-ontime .student-metric-badge {
    background: #d1fae5;
    color: #065f46;
}

.card-tardy .student-metric-badge {
    background: #fef3c7;
    color: #92400e;
}

.card-absent .student-metric-badge {
    background: #fee2e2;
    color: #991b1b;
}

.card-gate .student-metric-badge {
    background: #e0f2fe;
    color: #075985;
}

.student-metric-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.25rem;
}

.student-metric-value {
    font-size: 1.85rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

/* Callout con Sumatoria del Tiempo de Tardanzas */
.student-metric-sum-callout {
    background: #fffbeb;
    border: 1px solid #fef08a;
    border-radius: var(--att-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    color: #92400e;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.4rem;
}

.student-metric-sum-callout strong {
    color: #b45309;
    font-size: 0.92rem;
}

.student-metric-subtext {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.3;
}

/* ==========================================================================
   6. SECCIÓN DE FILTROS & HISTORIAL DE ASISTENCIAS ANTERIORES
   ========================================================================== */
.student-history-section {
    background: #ffffff;
    border-radius: var(--att-radius-lg);
    border: 1px solid #e2e8f0;
    box-shadow: var(--att-shadow-soft);
    padding: 1.6rem;
    margin-bottom: 1.5rem;
}

.student-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.student-history-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
}

/* Barra de Filtros Dedicada del Estudiante */
.student-filters-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--att-radius-md);
    padding: 1rem 1.2rem;
    margin-bottom: 1.4rem;
    align-items: flex-end;
}

.student-filter-field {
    display: flex;
    flex-direction: column;
}

.student-filter-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.student-filter-select,
.student-filter-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--att-radius-sm);
    background: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.student-filter-select:focus,
.student-filter-input:focus {
    border-color: var(--att-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.student-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filter-reset {
    padding: 0.65rem 1rem;
    border-radius: var(--att-radius-sm);
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-filter-reset:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Timeline / Lista de Asistencias Pasadas */
.student-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.student-timeline-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--att-radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.2s ease;
    border-left: 5px solid #94a3b8;
}

.student-timeline-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.student-timeline-item.item-present {
    border-left-color: #10b981;
}

.student-timeline-item.item-late {
    border-left-color: #f59e0b;
    background: #fffdf5;
}

.student-timeline-item.item-absent {
    border-left-color: #ef4444;
    background: #fffafa;
}

.student-timeline-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.student-timeline-datebox {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: var(--att-radius-sm);
    padding: 0.5rem 0.75rem;
    min-width: 64px;
    text-align: center;
}

.student-timeline-dayname {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
}

.student-timeline-daynumber {
    font-size: 1.2rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
}

.student-timeline-info {
    display: flex;
    flex-direction: column;
}

.student-timeline-subject {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.student-timeline-teacher {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.student-timeline-note {
    font-size: 0.78rem;
    color: #0284c7;
    margin-top: 0.3rem;
    font-style: italic;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.student-timeline-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    text-align: right;
}

.student-timeline-time-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.student-timeline-time {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    font-family: monospace;
}

.student-timeline-late-delay {
    font-size: 0.75rem;
    font-weight: 800;
    color: #d97706;
    background: #fef3c7;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-top: 0.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.student-timeline-badge {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    text-transform: uppercase;
}

.badge-status-present {
    background: #d1fae5;
    color: #065f46;
}

.badge-status-late {
    background: #fef3c7;
    color: #92400e;
}

.badge-status-absent {
    background: #fee2e2;
    color: #991b1b;
}

/* ==========================================================================
   7. VISTA DE GARITA Y CAMPUS PARA EL ALUMNO
   ========================================================================== */
.student-gate-wrapper {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.student-gate-status-card {
    background: #ffffff;
    border-radius: var(--att-radius-lg);
    border: 1px solid #e2e8f0;
    box-shadow: var(--att-shadow-soft);
    padding: 1.6rem;
}

.student-gate-badge-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0369a1 100%);
    border-radius: var(--att-radius-lg);
    color: #ffffff;
    padding: 1.8rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.student-gate-badge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
}

.student-gate-today-alert {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1.5px solid #6ee7b7;
    border-radius: var(--att-radius-md);
    padding: 1.2rem;
    margin-bottom: 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.student-gate-today-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.student-gate-today-info h4 {
    margin: 0 0 0.2rem 0;
    color: #065f46;
    font-size: 1.05rem;
    font-weight: 800;
}

.student-gate-today-info p {
    margin: 0;
    color: #047857;
    font-size: 0.85rem;
    line-height: 1.35;
}

.student-telegram-confirm-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--att-radius-sm);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #166534;
    margin-top: 1rem;
    font-weight: 600;
}

.student-telegram-confirm-box i {
    color: #229ed9;
    font-size: 1.25rem;
}

/* ==========================================================================
   8. ADAPTACIONES MÓVILES Y TABLETS (RESPONSIVE FIRST & TOUCH OPTIMIZATION)
   ========================================================================== */

/* Tablets y pantallas medianas (<= 1024px) */
@media (max-width: 1024px) {
    .student-portal-wrapper {
        max-width: 100%;
        overflow-x: hidden;
    }

    .student-main-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .student-gate-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .student-hero-banner {
        padding: 1.35rem 1.5rem;
        border-radius: var(--att-radius-md);
        gap: 1.2rem;
    }

    .student-hero-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .student-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .student-filter-bar {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .student-filter-field {
        min-width: 160px;
    }
}

/* Teléfonos y pantallas pequeñas (<= 640px) */
@media (max-width: 640px) {
    .student-hero-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 1.1rem 1.15rem;
        border-radius: 18px;
        gap: 1rem;
    }

    .student-hero-profile {
        flex-direction: row;
        align-items: center;
        gap: 0.9rem;
    }

    .student-hero-avatar-wrap {
        width: 58px;
        height: 58px;
    }

    .student-hero-info h2 {
        font-size: 1.2rem;
        line-height: 1.25;
        margin-bottom: 0.25rem;
    }

    .student-hero-meta {
        font-size: 0.78rem;
        flex-wrap: wrap;
        gap: 0.35rem 0.5rem;
    }

    .student-hero-meta-item {
        background: rgba(255, 255, 255, 0.15);
        padding: 0.2rem 0.55rem;
        border-radius: 999px;
    }

    .student-hero-meta span:not(.student-hero-meta-item):not(.badge) {
        display: none;
    }

    .student-hero-actions {
        width: 100%;
    }

    .student-hero-actions .btn-live-student-action {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.88rem;
    }

    .student-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }

    .student-metric-card {
        padding: 0.85rem 0.9rem;
        border-radius: 16px;
    }

    .student-metric-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .student-metric-val {
        font-size: 1.45rem;
    }

    .student-metric-lbl {
        font-size: 0.72rem;
    }

    .student-live-class-card {
        padding: 1.15rem;
        border-radius: 18px;
    }

    .student-live-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .student-live-schedule-badge {
        align-self: flex-start;
    }

    .student-check-status-box {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.9rem 1rem;
    }

    .student-check-status-box .btn {
        width: 100%;
        justify-content: center;
    }

    .student-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.9rem;
    }

    .student-filter-field {
        width: 100%;
        min-width: 100%;
    }

    .student-filter-input,
    .student-filter-select {
        min-height: 42px;
        font-size: 0.88rem;
    }

    .student-filter-actions {
        width: 100%;
    }

    .btn-filter-reset {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    .student-timeline-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.9rem 1rem;
    }

    .student-timeline-right {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        border-top: 1px dashed #e2e8f0;
        padding-top: 0.6rem;
    }

    .student-gate-badge-card {
        padding: 1.25rem 1rem;
    }

    .student-gate-badge-card .btn {
        min-height: 46px;
        font-size: 0.88rem;
    }
}
