/* --- CONFIGURACIÓN GENERAL APP --- */
.app-inicio,
.app-dashboard {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    padding: 0 10px;          /* un poco más de aire en móviles */
}

/* En tablets/PC limitamos el ancho */
@media (min-width: 768px) {
    .app-inicio,
    .app-dashboard {
        max-width: 520px;     /* un poco más ancho que 500px se siente mejor */
        padding: 0 16px;
    }
}

/* --- A) BANNER MEJORADO --- */
.app-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 1;           /* ≈ 300×100 — muy común para banners */
    /* height: 100px; */           /* comenta o elimina, aspect-ratio lo reemplaza */
    max-height: 140px;             /* tope para que no se haga gigante en pantallas anchas */
    margin: 0 auto 20px auto;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e5bbf, #4fa3ff);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.app-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 75%);
    pointer-events: none;
}

.app-banner-content {
    position: relative;
    z-index: 2;
    padding: 16px 20px 20px;
    color: #ffffff;
    font-size: clamp(18px, 5.2vw, 22px);   /* responsivo */
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    width: 100%;
    line-height: 1.25;
}

/* En móviles muy pequeños o si la imagen lo requiere */
@media (max-width: 480px) {
    .app-banner {
        aspect-ratio: 4 / 1;     /* opcional: un poco más ancho */
        max-height: 140px;
    }
    
    .app-banner-content {
        padding: 14px 16px 18px;
        font-size: clamp(17px, 4.8vw, 20px);
    }
}

/* --- B) LISTAS (está bastante bien, solo pequeños retoques) --- */
.app-titulo {
    color: #4b5563;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 4px;
}

.app-lista-estudiantes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 48px;
}

.app-estudiante {
    padding: 18px 20px;
    border-radius: 16px;
    color: #fff;
    font-size: 17px;           /* un poco más pequeño = más legible */
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.12s ease;
}

.app-estudiante:active {
    transform: scale(0.98);
}

.app-estudiante::after {
    content: '→';
    font-size: 22px;
    opacity: 0.75;
}

/* Colores — se mantienen iguales */
.app-color-1 { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.app-color-2 { background: linear-gradient(135deg, #059669, #10b981); }
.app-color-3 { background: linear-gradient(135deg, #ea580c, #f97316); }

/* --- C) PESTAÑAS (TABS) — muy bien, solo pequeños ajustes --- */
.tabs-wrapper {
    position: relative;
    margin: 0 -12px 20px -12px;
    padding: 0 12px;
}

.app-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: flex-start;
}

.app-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: #f3f4f6;
    border: none;
    padding: 8px 14px;
    border-radius: 9999px;
    white-space: nowrap;
    font-size: 13.5px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.tab-btn.active {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* --- DASHBOARD HEADER --- */
.dash-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-back {
    background: none;
    border: none;
    font-size: 26px;
    color: #2563eb;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

#dash-student-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #1f2937;
}

/* --- TARJETAS DE DATOS --- */
.pst-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border: 1px solid #e5e7eb;
}

.row-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.materia {
    max-width: 68%;
}

.row-meta {
    font-size: 12.5px;
    color: #9ca3af;
}

.badge {
    padding: 5px 13px;
    border-radius: 8px;
    font-size: 13.5px;
    min-width: 36px;
    text-align: center;
    font-weight: 600;
}

.bg-green  { background: #dcfce7; color: #166534; }
.bg-yellow { background: #fef9c3; color: #854d0e; }
.bg-red    { background: #fee2e2; color: #991b1b; }
.bg-gray   { background: #f3f4f6; color: #374151; }

/* --- BOTÓN SALIR --- */
.app-salir {
    margin: 32px auto 20px;
    background-color: #faf737;
    color: #ffffff;
    text-align: center;
    padding: 14px;
    border-radius: 14px;
    font-weight: 700;
    width: 100%;
    max-width: 400px;
    display: block;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.25);
    transition: all 0.22s ease;
}

.app-salir:hover,
.app-salir:focus {
    background-color: #c62828;
}

.app-salir:active {
    transform: scale(0.98);
}

/* --- SPINNER --- */
.loader-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Controles superiores (Titulo + Select) */
.app-controles {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 16px 4px;
}

.semestre-select {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

/* Header del Dashboard */
.header-info {
    display: flex;
    flex-direction: column;
}

.badge-semestre {
    font-size: 11px;
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 4px;
    align-self: flex-start;
    margin-top: 2px;
}

/* Detalles extra en tarjetas */
.row-detail {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 4px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 12px;
    margin-top: 20px;
}