/* 
 * assets/css/aprendizaje.css
 * Sistema de diseño para los Objetos de Aprendizaje (OA)
 * Estilo: E-learning Moderno (Cisco NetAcad Style)
 */

:root {
    --blue-tecnm: #1B396A;
    --blue-medium: #24518F;
    --red-tecnm: #dc3545;
    --bg-light: #f8fafc;
    --sidebar-width: 280px;
    --topbar-height: 70px;
    --text-main: #1a202c;
    --text-muted: #4a5568;
    --border-color: #e2e8f0;
    --transition: all 0.3s ease;
    /* Glassmorphism (misma paleta del hero: azul TecNM, cyan y coral) */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-bg-strong: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(27, 57, 106, 0.10);
    --glass-blur: blur(14px);
    --glass-shadow: 0 8px 32px rgba(27, 57, 106, 0.08);
}

/* Reset & Base */
html {
    overflow-x: hidden;
}

body {
    /* Tintes suaves de la paleta (azul TecNM / cyan / coral) para dar
       profundidad al efecto de vidrio de tarjetas y barras */
    background:
        radial-gradient(900px 520px at 88% -10%, rgba(123, 191, 255, 0.14), transparent 60%),
        radial-gradient(720px 460px at -12% 28%, rgba(27, 57, 106, 0.07), transparent 60%),
        radial-gradient(820px 520px at 72% 112%, rgba(255, 107, 122, 0.06), transparent 60%),
        var(--bg-light);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Open Sans', sans-serif !important;
    margin: 0;
    overflow-x: hidden;
}

/* Header Blanco (Minimalista y Limpio) */
.oa-topbar {
    height: var(--topbar-height);
    background: var(--glass-bg-strong) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 2px 10px rgba(27, 57, 106, 0.04);
}

.oa-logo {
    color: var(--blue-tecnm) !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    text-decoration: none !important;
    white-space: nowrap;
}

.oa-logo span {
    color: var(--blue-tecnm) !important;
}

/* Hero Section (Degradado Azul Profundo) */
.library-hero {
    background: linear-gradient(-145deg, var(--blue-tecnm) 0%, var(--blue-medium) 100%) !important;
    padding: 80px 0 120px 0 !important;
    color: white !important;
    text-align: center !important;
    position: relative;
    overflow: hidden;
}

.library-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 60px;
    background: white;
    clip-path: ellipse(60% 100% at 50% 100%);
}

.library-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3rem) !important;
    font-weight: 900 !important;
    margin-bottom: 20px !important;
    color: white !important;
}

.library-hero h1 em {
    font-style: normal !important;
    border-bottom: none !important;
    background: linear-gradient(-145deg, #7bbfff 0%, #ff6b7a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.library-hero p {
    font-size: 18px !important;
    opacity: 0.9 !important;
    max-width: 700px !important;
    margin: 0 auto !important;
    line-height: 1.6 !important;
    color: white !important;
}

/* ── Grid de Catálogo ─────────────────────────────────────────────────── */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
    margin-top: 20px;
}

/* ── Tarjeta de módulo (nuevo diseño) ────────────────────────────────── */
.oa-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    min-width: 0;
}

.oa-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.oa-card-link:hover .oa-card {
    transform: translateY(-5px);
    box-shadow: 0 18px 36px rgba(27, 57, 106, 0.12), 0 4px 10px rgba(0, 0, 0, 0.07);
    border-color: #1B396A;
}

/* Header oscuro con número grande decorativo */
.oa-card-header {
    height: 104px;
    background: #0b1b35;
    /* Color base idéntico al fondo del hero */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* Aurora sutil de luz (cyan a rosa) que replica el efecto de fondo del hero */
.oa-card-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 75% 25%, rgba(123, 191, 255, 0.22) 0%, rgba(255, 107, 122, 0.18) 55%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.oa-card-num {
    font-size: 52px;
    font-weight: 900;
    color: #ffffff;
    opacity: 0.15;
    line-height: 1;
    letter-spacing: -3px;
    font-family: 'Open Sans', sans-serif;
    user-select: none;
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.oa-card-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease, border-color 0.3s ease;
}

/* Micro-animaciones en hover */
.oa-card-link:hover .oa-card-icon {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}

.oa-card-link:hover .oa-card-num {
    opacity: 0.35;
    transform: translateY(-2px) scale(1.05);
}

/* Cuerpo de la tarjeta */
.oa-card-body {
    padding: 20px 22px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.oa-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 6px;
}

.oa-card-meta i {
    font-size: 12px;
}

.oa-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    margin: 0 0 6px;
    word-break: break-word;
}

.oa-card-desc {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 12px;
}

/* Footer de la tarjeta */
.oa-card-footer {
    padding: 16px 22px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    margin-top: 0; /* Sin margen superior porque la barra de progreso sirve de límite */
}

.oa-card-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #1B396A;
    background: rgba(27, 57, 106, 0.08);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.oa-card-tag.tag-done {
    color: #065f46;
    background: rgba(16, 185, 129, 0.10);
}

.oa-card-cta {
    font-size: 13px;
    font-weight: 700;
    color: #1B396A;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.2s ease;
}

.oa-card-cta .fa {
    font-size: 11px;
}

.oa-card-link:hover .oa-card-cta {
    gap: 9px;
}

/* Visor Layout */
.oa-layout {
    display: flex;
    min-height: 100vh;
}

.oa-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 13px;
    font-weight: 800;
    color: var(--blue-tecnm);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding-top: 8px;
}

.nav-item {
    padding: 14px 20px;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.nav-item:hover {
    background: rgba(27, 57, 106, 0.05);
    color: var(--blue-tecnm);
}

.nav-item.active {
    background: white;
    color: var(--blue-tecnm);
    font-weight: 700;
    border-left-color: var(--blue-tecnm);
}

.oa-main {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Lector */
.oa-reader {
    max-width: 850px;
    margin: 0 auto;
    padding: 60px 40px;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.oa-step-content h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 30px;
    color: #111;
}

.theory-block {
    font-size: 18px;
    line-height: 1.8;
    color: #2d3748;
}

.theory-block h2,
.theory-block h3,
.theory-block h4 {
    font-family: inherit;
    color: #1a202c;
    line-height: 1.35;
    margin: 2em 0 0.5em;
}

.theory-block h2 {
    font-size: 20px;
    font-weight: 800;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 6px;
}

.theory-block h3 {
    font-size: 17px;
    font-weight: 800;
    color: #1B396A;
    padding-left: 10px;
    border-left: 3px solid #1B396A;
}

.theory-block h4 {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
}

.objective-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Utils */
.badge {
    padding: 6px 12px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-radius: 5px !important;
}

.badge-interactive {
    color: white !important;
    background-color: var(--blue-tecnm) !important;
}

.card-action-label {
    color: var(--blue-tecnm);
    font-weight: 700;
    font-size: 13px;
}

.card-action-label .fa {
    font-size: 10px;
}

/* Logo del visor (ligeramente más pequeño que el del catálogo) */
.oa-layout .oa-logo {
    font-size: 18px !important;
}

/* Título del módulo en la topbar del visor */
.oa-topbar-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 0;
}

/* Botón Siguiente — siempre azul primario */
.btn-next {
    background: var(--blue-tecnm) !important;
    border-color: var(--blue-tecnm) !important;
    color: white !important;
}

.btn-next:hover:not(:disabled) {
    background: var(--blue-medium) !important;
    border-color: var(--blue-medium) !important;
    color: white !important;
}

.btn-next:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-nav {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.65);
    color: var(--blue-tecnm);
    transition: var(--transition);
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-nav:hover {
    background: var(--bg-light);
    border-color: var(--blue-tecnm);
}

/* Skeleton Loading System */
.skeleton {
    background-color: #f1f5f9 !important;
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 255, 255, 0) 100%) !important;
    background-size: 200% 100% !important;
    background-repeat: no-repeat !important;
    animation: skeleton-shimmer 1.5s infinite linear !important;
    border-color: #e2e8f0 !important;
    color: transparent !important;
    pointer-events: none;
}

.skeleton * {
    visibility: hidden !important;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    width: 100%;
}

.skeleton-title {
    height: 2.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    width: 60%;
}

.oa-footer-nav {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    padding: 10px 40px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 50;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

/* Espacio inferior para que el contenido no quede oculto detrás del nav fijo */
.oa-reader {
    padding-bottom: 80px;
}


/* Quiz: countdown chip (Punto 4 anti-trampa) */
.quiz-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    color: #1e40af;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
}

.quiz-option:disabled:not(.correct):not(.incorrect) {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* Quiz & Interactivos */
.quiz-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: 0 10px 30px rgba(27, 57, 106, 0.06);
}

.quiz-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 20px 25px;
    margin-bottom: 15px;
    background: #ffffff;
    border: 2px solid #f1f5f9;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    outline: none !important;
}

.quiz-option:hover {
    border-color: var(--blue-tecnm);
    background: #f8fafc;
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(27, 57, 106, 0.08);
}

.quiz-option.correct {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
    padding-right: 50px;
}

.quiz-option.correct::after {
    content: '\f058';
    font-family: 'FontAwesome';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

.quiz-option.incorrect {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
    padding-right: 50px;
}

.quiz-option.incorrect::after {
    content: '\f057';
    font-family: 'FontAwesome';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

.quiz-option:disabled {
    cursor: default;
}

.quiz-option:disabled:not(.correct):not(.incorrect) {
    opacity: 0.6;
    background: #f8fafc;
    border-color: #f1f5f9;
}

.quiz-option:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Tablas en Contenido */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 30px 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.theory-block table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

.theory-block th {
    background: #f8fafc;
    padding: 15px 20px;
    font-weight: 800;
    color: var(--blue-tecnm);
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.theory-block td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
}

.theory-block tr:last-child td {
    border-bottom: none;
}

/* Navegación de Progreso */
.oa-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #f1f5f9;
}

.oa-progress-bar {
    height: 100%;
    background: var(--blue-tecnm);
    width: 0%;
    transition: width 0.5s ease;
}

/* ── Hamburger toggle — oculto en escritorio, visible en móvil ── */
.btn-sidebar-toggle {
    display: none;
    background: var(--blue-tecnm);
    border: none;
    border-radius: 8px;
    padding: 0;
    width: 38px;
    height: 38px;
    cursor: pointer;
    color: white;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(27, 57, 106, 0.2);
}

.btn-sidebar-toggle:hover {
    background: var(--blue-medium);
}

.btn-sidebar-toggle i {
    display: block;
    line-height: 1;
    transition: opacity 0.15s ease, transform 0.2s ease;
}

/* ── Variantes de btn-nav ── */
.btn-nav-primary {
    background: var(--blue-tecnm);
    border-color: var(--blue-tecnm);
    color: white !important;
}

.btn-nav-primary:hover {
    background: var(--blue-medium);
    border-color: var(--blue-medium);
    color: white !important;
}

.btn-nav-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted) !important;
}

.btn-nav-ghost:hover {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--blue-tecnm) !important;
}

/* ── Botón cerrar sidebar (solo móvil) ── */
.sidebar-close-btn {
    display: none;
    background: #f1f5f9;
    border: none;
    color: var(--blue-tecnm);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-close-btn:hover {
    background: rgba(27, 57, 106, 0.12);
}

/* ── Overlay del sidebar (solo móvil) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 150;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.open {
    display: block;
}

/* ============================================
   RESPONSIVE — TABLET (≤991px)
   ============================================ */
@media (max-width: 991px) {
    /* Blur más ligero en pantallas táctiles para mantener fluidez */
    :root {
        --glass-blur: blur(8px);
    }

    .oa-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
        box-shadow: none;
        top: var(--topbar-height);
        height: calc(100vh - var(--topbar-height));
    }

    .oa-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
    }

    /* Scroll táctil en sidebar móvil */
    .sidebar-nav {
        -webkit-overflow-scrolling: touch;
    }

    .oa-main {
        margin-left: 0;
    }

    .oa-reader {
        padding: 30px 24px 80px;
    }

    .btn-sidebar-toggle {
        display: inline-flex;
    }

    .sidebar-close-btn {
        display: inline-flex;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .oa-suggestion-banner {
        left: 20px;
    }
}

/* ============================================
   RESPONSIVE — MÓVIL (≤767px)
   ============================================ */
@media (max-width: 767px) {
    .oa-topbar {
        padding: 0 16px;
    }

    .library-hero {
        padding: 50px 0 90px 0 !important;
    }

    .library-hero p {
        font-size: 15px !important;
        padding: 0 16px;
    }

    .library-hero::after {
        height: 44px;
        clip-path: ellipse(72% 100% at 50% 100%);
    }

    .library-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cat-section {
        margin-bottom: 40px;
    }

    .cat-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .oa-reader {
        padding: 20px 16px 80px;
    }

    .oa-step-content h2 {
        font-size: 24px;
    }

    .theory-block {
        font-size: 16px;
    }

    /* Bloques de código: scroll horizontal en lugar de overflow */
    .theory-block pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 13px;
        padding: 14px;
    }

    /* Tablas: evitar que rompan el layout en móvil */
    .theory-block table {
        font-size: 14px;
    }

    .theory-block th,
    .theory-block td {
        padding: 10px 12px;
    }

    .quiz-container {
        padding: 24px 16px;
    }

    .quiz-option {
        padding: 14px 18px;
        font-size: 15px;
    }

    .quiz-option:hover {
        transform: none;
        box-shadow: none;
    }

    /* En móvil la sidebar desaparece, el nav ocupa todo el ancho */
    .oa-footer-nav {
        left: 0;
        padding: 8px 16px 10px;
        gap: 10px;
    }

    .oa-save-toast {
        right: 12px;
        top: 80px;
    }

    .oa-suggestion-banner {
        right: 12px;
        left: 12px;
        max-width: none;
        bottom: 12px;
    }

    .card-image {
        height: 100px !important;
        font-size: 38px !important;
    }

    .card-info {
        padding: 18px !important;
    }

    .oa-topbar .btn-nav {
        padding: 8px 14px;
    }

    /* Curva del hero — más suave en tablet */
    .home-hero::after {
        height: 55px;
        clip-path: ellipse(84% 100% at 50% 100%);
    }

}

/* ============================================
   RESPONSIVE — MÓVIL PEQUEÑO (≤480px)
   ============================================ */
@media (max-width: 640px) {

    /* Ocultar textos de botones — NC siempre visible para identificar al usuario */
    .oa-topbar .btn-label {
        display: none;
    }

    .oa-topbar .btn-nav {
        padding: 10px 14px;
        gap: 0;
        font-size: 16px;
    }

    /* Chip de NC: compacto pero con número visible */
    .oa-topbar .header-user-chip {
        padding: 7px 10px;
        gap: 6px;
        font-size: 13px;
        font-weight: 700;
    }

    .oa-topbar .header-user-chip .header-avatar {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .oa-topbar {
        padding: 0 10px;
    }

    /* Eliminar padding del container Bootstrap dentro del topbar para ganar espacio */
    .oa-topbar .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Chip de NC más compacto */
    .oa-topbar .header-user-chip {
        padding: 5px 7px !important;
        gap: 4px !important;
    }

    /* Reducir espacio entre headerSession y Volver btn */
    #topbarRight {
        gap: 8px !important;
    }

    /* Tarjetas: padding reducido */
    .card-info {
        padding: 14px !important;
    }

    .library-hero h1 {
        font-size: 1.8rem !important;
    }

    .library-hero {
        padding: 44px 0 76px 0 !important;
    }

    .library-hero::after {
        height: 32px;
        clip-path: ellipse(82% 100% at 50% 100%);
    }

    .oa-reader {
        padding: 16px 12px 80px;
    }

    .oa-step-content h2 {
        font-size: 20px;
    }

    .session-row {
        flex-direction: column;
    }

    .session-field-wrap {
        min-width: 0;
        width: 100%;
    }

    .session-btn-secondary,
    .session-btn-primary {
        width: 100%;
        justify-content: center;
    }

    .quiz-container {
        padding: 16px 12px;
        margin-top: 24px;
    }

    .quiz-option {
        padding: 12px 14px;
        font-size: 14px;
    }

    .btn-prev,
    .btn-next {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Pasos visitados en el sidebar */
.nav-item.visited {
    color: var(--blue-tecnm);
}

.nav-item.visited::after {
    content: '\f00c';
    font-family: 'FontAwesome';
    font-size: 10px;
    color: #10b981;
    margin-left: auto;
}

/* Medida 3: paso bloqueado en el sidebar */
.nav-item.nav-locked {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Medida 1+4: hint de lectura (entre los botones de navegación) */
.read-hint {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 8px;
    margin: 0;
    background: none;
    border: none;
    font-size: 12.5px;
    font-weight: 500;
    color: #1e40af;
    text-align: center;
    min-width: 0;
    transition: opacity 0.35s ease;
}

.read-hint-icon {
    font-size: 14px;
    flex-shrink: 0;
    color: #1B396A;
}

#readHintMsg {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fa-arrow-down.read-hint-icon {
    animation: bounce-down 1.2s ease-in-out infinite;
}

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(4px); }
}

.read-hint-done {
    opacity: 0;
    pointer-events: none;
}

/* Medida 1+4: pulso en el botón Siguiente al desbloquearse */
@keyframes next-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(27, 57, 106, 0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(27, 57, 106, 0); }
    100% { box-shadow: 0 0 0 0 rgba(27, 57, 106, 0); }
}

.btn-next-pulse {
    animation: next-pulse 0.8s ease-out;
}

/* Toast de guardado — mismo estilo que .oa-suggestion-banner */
.oa-save-toast {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--blue-tecnm);
    color: white;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 1500;
    box-shadow: 0 8px 25px rgba(27, 57, 106, 0.25);
}

.oa-save-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Banner de sugerencia en el visor */
.oa-suggestion-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    background: white;
    border: 1px solid rgba(27, 57, 106, 0.12);
    border-left: 4px solid var(--blue-tecnm);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 28px rgba(27, 57, 106, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    z-index: 500;
    max-width: 320px;
    animation: banner-in 0.3s ease;
}

@keyframes banner-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.banner-icon {
    color: var(--blue-tecnm);
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.banner-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
}

.banner-text strong {
    display: block;
    color: var(--text-main);
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 3px;
}

.banner-text a {
    color: var(--blue-tecnm);
    font-weight: 700;
    font-size: 13px;
    text-decoration: underline;
}

.banner-text a:hover {
    opacity: 0.8;
}

.banner-close {
    background: #f1f5f9;
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    padding: 0;
    margin-left: 4px;
}

.banner-close:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

/* ── Modal de Sesión ─────────────────────────────────────────── */
.oa-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.oa-modal-overlay.open {
    display: flex;
}

.oa-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: modal-in 0.2s ease;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.97);
    }

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

.oa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--blue-tecnm) 0%, var(--blue-medium) 100%);
    color: white;
}

.oa-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 800;
}

.oa-modal-title i {
    font-size: 20px;
    opacity: 0.9;
}

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.oa-modal-body {
    padding: 24px;
}

.modal-section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Área de sesión activa en el header */
.header-user {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* El chip de NC reutiliza btn-nav pero sin interacción */
.header-user-chip {
    cursor: default !important;
}

.header-user-chip:hover {
    background: rgba(255, 255, 255, 0.65) !important;
    border-color: var(--glass-border) !important;
}

.header-avatar {
    width: 22px;
    height: 22px;
    background: var(--blue-tecnm);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    flex-shrink: 0;
}

/* El botón de logout reutiliza btn-nav con hover rojo */
.header-logout-btn:hover {
    color: var(--red-tecnm) !important;
    border-color: var(--red-tecnm) !important;
}

/* Inputs y botones dentro del modal ────────────────────────── */
.session-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.session-field-wrap {
    flex: 1;
    min-width: 180px;
}

.session-input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
    flex: 1;
    min-width: 130px;
}

.session-input:focus {
    border-color: var(--blue-tecnm);
    box-shadow: 0 0 0 3px rgba(27, 57, 106, 0.1);
}

.correo-hint {
    display: none;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
}

.session-btn-secondary {
    padding: 9px 16px;
    background: white;
    border: 1px solid var(--blue-tecnm);
    color: var(--blue-tecnm);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
}

.session-btn-secondary:hover:not(:disabled) {
    background: var(--blue-tecnm);
    color: white;
}

.session-btn-secondary:disabled {
    opacity: 0.5;
    cursor: default;
}

.session-btn-primary {
    padding: 9px 16px;
    background: var(--blue-tecnm);
    border: 1px solid var(--blue-tecnm);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
}

.session-btn-primary:hover:not(:disabled) {
    background: var(--blue-medium);
}

.session-btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
}

.session-msg {
    font-size: 12px;
    margin: 8px 0 0;
    min-height: 18px;
    font-weight: 600;
}

.msg-ok {
    color: #10b981;
}

.msg-warn {
    color: #f59e0b;
}

.msg-error {
    color: var(--red-tecnm);
}

/* ── Modal paneles ───────────────────────────────────────────── */
.modal-panel {
    padding: 24px;
}

.modal-panel-hidden {
    display: none !important;
}

.modal-panel .session-field-wrap {
    margin-bottom: 12px;
}

.modal-panel .session-input {
    display: block;
    margin-bottom: 10px;
}

.session-btn-full {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

.modal-switch-link {
    margin: 14px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.modal-link-btn {
    background: none;
    border: none;
    color: var(--blue-tecnm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.modal-link-btn:hover {
    color: var(--blue-medium);
}

/* Indicadores de progreso en tarjetas */
.oa-progress-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: auto;
    /* Empuja el indicador al final de la tarjeta, homogenizando su posición */
    margin-bottom: 14px;
    transition: var(--transition);
}

.oa-progress-badge.completed,
.oa-progress-badge.in-progress {
    background: #eff6ff;
    color: #1d4ed8;
}

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

.oa-progress-mini {
    height: 4px;
    background: #f1f5f9;
    border-radius: 0;
    margin-left: -22px; /* Margen negativo para extenderse de borde a borde */
    margin-right: -22px;
    margin-bottom: -14px; /* Cancela el padding inferior de la tarjeta */
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.oa-progress-mini-bar {
    height: 100%;
    border-radius: 0;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.oa-progress-mini-bar.completed,
.oa-progress-mini-bar.in-progress {
    background: linear-gradient(90deg, #60a5fa, #1d4ed8) !important;
}

.oa-progress-mini-bar.not-started {
    background: #e2e8f0 !important;
}

/* Efectos premium de glow al pasar el mouse por la tarjeta */
.oa-card-link:hover .oa-progress-mini-bar.in-progress,
.oa-card-link:hover .oa-progress-mini-bar.completed {
    filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.5));
}

/* Secciones de Catálogo */
.cat-section {
    margin-top: 40px;
    margin-bottom: 60px;
}

.cat-title {
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT UNIFICADO — TutorIA + OA en una sola página
   ═══════════════════════════════════════════════════════════════════════════ */

/* Catalog: split view desktop */
body.app-unified {
    height: 100vh;
    overflow: hidden;
}

#app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#app-main {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
}

/* Visor: split view desktop */
.app-unified-visor {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-unified-visor .oa-layout {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    height: 100vh;
    min-height: unset;
}

/* ── Panel TutorIA (sidebar derecho) ─────────────────────────────────── */
body.app-unified #tia-sidebar {
    width: 380px;
    flex-shrink: 0;
}

/* Override: en el layout unificado el panel vive dentro del flujo flex.
   Fuera de app-unified el panel es position:fixed (modo burbuja). */
body.app-unified #tia-sidebar.tia-panel {
    position: relative !important;
    transform: none !important;
    transition: none !important;
    width: 380px !important;
    height: 100vh !important;
    border-left: 1px solid var(--glass-border) !important;
    box-shadow: -4px 0 16px rgba(27, 57, 106, 0.06) !important;
}

/* Modo burbuja: panel se abre con sidebar-open en cualquier pantalla */
#tia-sidebar.tia-panel.sidebar-open {
    transform: translateX(0) !important;
}

/* ── Botón toggle (visible solo en móvil) ────────────────────────────── */
.btn-tia-toggle {
    background: var(--blue-tecnm);
    border-color: var(--blue-tecnm);
    color: white !important;
}

.btn-tia-toggle:hover {
    background: var(--blue-medium);
    border-color: var(--blue-medium);
    color: white !important;
}

@media (min-width: 992px) {
    .btn-tia-toggle {
        display: none !important;
    }
}

/* ── Overlay móvil ───────────────────────────────────────────────────── */
.tia-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1000;
}

.tia-sidebar-overlay.visible {
    display: block;
}

/* ── Formulario de login: tabs ───────────────────────────────────────── */
.tia-tabs {
    display: flex;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
    width: 100%;
}

.tia-tab {
    flex: 1;
    padding: 9px 8px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Open Sans', sans-serif;
    background: white;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.3;
}

.tia-tab+.tia-tab {
    border-left: 1.5px solid #e2e8f0;
}

.tia-tab.active {
    background: var(--blue-tecnm);
    color: white;
}

.tia-tab:hover:not(.active) {
    background: #f8fafc;
    color: var(--blue-tecnm);
}

.tia-tab-panel {
    width: 100%;
}

.tia-hidden {
    display: none !important;
}

.tia-correo-hint {
    font-size: 11px;
    color: #64748b;
    margin: 0 0 10px;
    display: none;
}

/* ── Documentos de referencia en el visor ────────────────────────────── */
.oa-recursos-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.oa-recursos-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.oa-recursos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.oa-recurso-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8faff;
    border: 1.5px solid #e2eaf4;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    flex: 1 1 200px;
    max-width: 320px;
}

.oa-recurso-card:hover {
    background: #eff4ff;
    border-color: var(--blue-tecnm);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(27, 57, 106, 0.10);
    text-decoration: none;
}

.oa-recurso-icon {
    width: 40px;
    height: 40px;
    background: rgba(220, 53, 69, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
    font-size: 18px;
    flex-shrink: 0;
}

.oa-recurso-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.oa-recurso-nombre {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oa-recurso-cta {
    font-size: 11px;
    color: var(--blue-tecnm);
    font-weight: 600;
}

/* ── Posición ajustada del toast/banner en el visor con sidebar ──────── */
@media (min-width: 992px) {

    .app-unified-visor .oa-save-toast,
    .app-unified-visor .oa-suggestion-banner {
        right: 404px;
        /* 380px sidebar + 24px gap */
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE MÓVIL — Panel TutorIA como overlay
   ═══════════════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════
   HOME PAGE — /aprendizaje/
   ═══════════════════════════════════════════════════════════════════════════ */

body.home-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.home-hero {
    background: #0b1b35;
    padding: 85px 24px 15px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.home-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

@media (min-width: 992px) {
    .home-hero {
        padding: 95px 48px 135px;
        text-align: left;
    }

    .home-hero-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 40px;
    }

    .home-hero-content {
        margin: 0;
    }
}

/* Viñeta radial para dar profundidad y suavidad de fondo */
.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, transparent 20%, rgba(11, 27, 53, 0.8) 100%);
    z-index: 2;
    pointer-events: none;
}

/* Ola inferior */
.home-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--bg-light);
    clip-path: ellipse(62% 100% at 50% 100%);
    z-index: 4;
}

/* ── Blobs de luz (estilo aurora) ────────────────────────────────────── */
.home-hero-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(72px);
    z-index: 1;
    will-change: transform;
}

/* Blob 1 — azul TecNM principal, esquina superior-izquierda */
.home-hero-orb:nth-child(1) {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(27, 57, 106, 0.95) 0%, transparent 65%);
    top: -240px;
    left: -180px;
    animation: blob1 20s ease-in-out infinite alternate;
}

/* Blob 2 — rojo TecNM, esquina inferior-derecha */
.home-hero-orb:nth-child(2) {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(220, 53, 69, 0.7) 0%, transparent 65%);
    bottom: -200px;
    right: -130px;
    animation: blob2 25s ease-in-out infinite alternate;
}

/* Blob 3 — azul medio, zona central-derecha */
.home-hero-orb:nth-child(3) {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(36, 81, 143, 0.55) 0%, transparent 65%);
    top: 10%;
    right: 15%;
    animation: blob3 17s ease-in-out infinite alternate;
}

/* Blob 4 — rojo suave, zona central-izquierda */
.home-hero-orb:nth-child(4) {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(220, 53, 69, 0.35) 0%, transparent 65%);
    bottom: 20%;
    left: 12%;
    animation: blob4 22s ease-in-out infinite alternate;
}

@keyframes blob1 {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(65px, 50px) scale(1.1);
    }
}

@keyframes blob2 {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(-50px, -40px) scale(1.08);
    }
}

@keyframes blob3 {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(-40px, 30px) scale(1.15);
    }
}

@keyframes blob4 {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(30px, -45px) scale(0.9);
    }
}

/* Canvas de partículas interactivo */
.home-hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ── Rayos de luz estilo Gemini (líneas que pasan) ───────────────────── */
.home-hero-ray {
    position: absolute;
    height: 1px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
}

/* Ray 1: Azul Cyan */
.home-hero-ray.ray-1 {
    width: 380px;
    background: linear-gradient(90deg,
            rgba(0, 210, 255, 0) 0%,
            rgba(0, 210, 255, 0.45) 50%,
            rgba(0, 210, 255, 0) 100%);
    filter: blur(2.5px) drop-shadow(0 0 8px rgba(0, 210, 255, 0.6));
    top: 22%;
    animation: ray-flow-1 20s linear infinite;
}

/* Ray 2: Rojo Coral */
.home-hero-ray.ray-2 {
    width: 420px;
    background: linear-gradient(90deg,
            rgba(255, 75, 92, 0) 0%,
            rgba(255, 75, 92, 0.35) 50%,
            rgba(255, 75, 92, 0) 100%);
    filter: blur(3px) drop-shadow(0 0 10px rgba(255, 75, 92, 0.5));
    top: 48%;
    animation: ray-flow-2 25s linear infinite;
    animation-delay: 4s;
}

/* Ray 3: Azul Profundo a Violeta */
.home-hero-ray.ray-3 {
    width: 350px;
    background: linear-gradient(90deg,
            rgba(59, 130, 246, 0) 0%,
            rgba(139, 92, 246, 0.4) 50%,
            rgba(59, 130, 246, 0) 100%);
    filter: blur(2.5px) drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
    top: 68%;
    animation: ray-flow-3 30s linear infinite;
    animation-delay: 9s;
}

/* Ray 4: Mixto (Azul y Rojo) */
.home-hero-ray.ray-4 {
    width: 450px;
    background: linear-gradient(90deg,
            rgba(0, 210, 255, 0) 0%,
            rgba(0, 210, 255, 0.25) 30%,
            rgba(255, 75, 92, 0.25) 70%,
            rgba(255, 75, 92, 0) 100%);
    filter: blur(3.5px) drop-shadow(0 0 12px rgba(0, 210, 255, 0.4));
    top: 32%;
    animation: ray-flow-4 22s linear infinite;
    animation-delay: 14s;
}

/* Keyframes con transform: translate3d e inclinación para cruzar en diagonal (versión lenta y elegante) */
@keyframes ray-flow-1 {
    0% {
        transform: translate3d(-120%, -30px, 0) rotate(-12deg);
        opacity: 0;
    }

    10% {
        opacity: 0.55;
    }

    50% {
        opacity: 0.55;
    }

    60%,
    100% {
        transform: translate3d(120vw, 80px, 0) rotate(-12deg);
        opacity: 0;
    }
}

@keyframes ray-flow-2 {
    0% {
        transform: translate3d(-120%, -40px, 0) rotate(-10deg);
        opacity: 0;
    }

    15% {
        opacity: 0.45;
    }

    55% {
        opacity: 0.45;
    }

    65%,
    100% {
        transform: translate3d(120vw, 60px, 0) rotate(-10deg);
        opacity: 0;
    }
}

@keyframes ray-flow-3 {
    0% {
        transform: translate3d(-120%, -20px, 0) rotate(-15deg);
        opacity: 0;
    }

    8% {
        opacity: 0.5;
    }

    48% {
        opacity: 0.5;
    }

    58%,
    100% {
        transform: translate3d(120vw, 80px, 0) rotate(-15deg);
        opacity: 0;
    }
}

@keyframes ray-flow-4 {
    0% {
        transform: translate3d(-120%, -50px, 0) rotate(-8deg);
        opacity: 0;
    }

    12% {
        opacity: 0.4;
    }

    52% {
        opacity: 0.4;
    }

    62%,
    100% {
        transform: translate3d(120vw, 40px, 0) rotate(-8deg);
        opacity: 0;
    }
}

.home-hero-content {
    position: relative;
    z-index: 3;
    max-width: 620px;
    margin: 0 auto;
}

.home-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.65;
    margin: 0 0 16px;
}

.home-title {
    position: relative;
    font-size: clamp(2.2rem, 6vw, 3.2rem);
    font-weight: 900;
    margin: 0 0 16px;
    line-height: 1.15;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
}

/* Areola/Halo de fondo alrededor del título (Estilo Gemini) */
.home-title::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    height: 160px;
    background: radial-gradient(ellipse, rgba(0, 210, 255, 0.22) 0%, rgba(255, 75, 92, 0.12) 50%, transparent 80%);
    filter: blur(50px);
    z-index: -1;
    pointer-events: none;
    animation: aura-pulse 8s ease-in-out infinite alternate;
}

@keyframes aura-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.9) rotate(-2deg);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1) rotate(2deg);
        opacity: 1;
    }
}

/* "Aprendizaje" con degradado azul→rojo (igual que el nombre TutorIA en la landing) */
.home-title strong {
    background: linear-gradient(-145deg, #7bbfff 0%, #ff6b7a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 14px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-top: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.4px;
}

.home-subtitle::before {
    content: '\f007';
    font-family: 'FontAwesome';
    margin-right: 8px;
    color: #7bbfff;
    font-size: 12px;
}

/* ── Stats glassmorphism dentro del hero ─────────────────────────────── */
.home-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 560px;
    width: 100%;
    margin: 24px auto 0;
    position: relative;
    z-index: 3;
}

@media (min-width: 992px) {
    .home-hero-stats {
        margin: 0;
        width: 480px;
        flex-shrink: 0;
    }
}

/* ── Dashboard Layout ── */
.home-dashboard-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 1200px;
    width: 100%;
    margin: -30px auto 0;
    padding: 0 24px 60px;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
}

@media (min-width: 992px) {
    .home-dashboard-layout {
        grid-template-columns: 7fr 4fr;
        align-items: start;
    }
}

.home-main-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.home-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.home-sidebar-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1.5px solid var(--glass-border);
    border-radius: 18px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.home-sidebar-card:hover {
    border-color: #c8d6e8;
    box-shadow: 0 4px 20px -4px rgba(27, 57, 106, 0.09);
}

.home-hero-stat {
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 18px 10px 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    transition: background 0.2s ease;
}

.home-hero-stat:hover {
    background: rgba(255, 255, 255, 0.2);
}

.home-hero-stat-icon {
    display: block;
    font-size: 18px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.home-hero-stat-val {
    display: block;
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.home-hero-stat-lbl {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.7;
    line-height: 1.3;
}

/* ── Cards de elección ─────────────────────────────────────────────────── */
.home-cards-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    margin: 0;
    padding: 0 0 20px;
    position: relative;
    z-index: 5;
    box-sizing: border-box;
}

.home-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    border: 1.5px solid var(--glass-border);
    box-shadow: 0 8px 32px -6px rgba(27, 57, 106, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-decoration: none !important;
    color: inherit !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.home-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 50px -10px rgba(27, 57, 106, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06);
    text-decoration: none !important;
    color: inherit !important;
}

.home-card-tia:hover {
    border-color: var(--blue-tecnm);
}

.home-card-oa:hover {
    border-color: var(--red-tecnm);
}

.home-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.home-card-tia .home-card-icon {
    background: rgba(27, 57, 106, 0.08);
    color: var(--blue-tecnm);
}

.home-card-oa .home-card-icon {
    background: rgba(220, 53, 69, 0.08);
    color: var(--red-tecnm);
}

.home-card-body {
    flex: 1;
}

.home-card-body h2 {
    font-size: 19px;
    font-weight: 800;
    margin: 0 0 10px;
    border: none;
    background: linear-gradient(-145deg, var(--blue-tecnm) 0%, var(--red-tecnm) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-card-body p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

.home-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--blue-tecnm);
    padding-top: 18px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    width: 100%;
    transition: gap 0.2s ease;
}

.home-card:hover .home-card-cta {
    gap: 12px;
}

.home-card-oa .home-card-cta {
    color: var(--red-tecnm);
}

/* ── Badge de sesión en home ───────────────────────────────────────────── */
.home-session-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
}

.home-session-chip i {
    font-size: 12px;
    opacity: 0.9;
}

/* ── Footer home ──────────────────────────────────────────────────────── */
.home-footer {
    margin-top: auto;
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    opacity: 0.7;
}

/* ── Botón de regreso en el chat ─────────────────────────────────────── */
.chat-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none !important;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    margin-right: 4px;
}

.chat-back-link:hover {
    background: rgba(27, 57, 106, 0.08);
    color: var(--blue-tecnm);
}

/* ── Hero sub-página (Catálogo de Módulos) ────────────────────────────── */
.cat-hero {
    padding: 56px 24px 130px;
}

/* Areola de luz centrada en el título — orbe independiente para evitar
   problemas de stacking context con z-index negativo en ::before */
.cat-hero-aura {
    position: absolute;
    width: 560px;
    height: 210px;
    top: 56%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse, rgba(0, 210, 255, 0.20) 0%, rgba(255, 75, 92, 0.13) 50%, transparent 78%);
    filter: blur(46px);
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    will-change: transform, opacity;
    animation: aura-pulse 8s ease-in-out infinite alternate;
}

.cat-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 30px;
    padding: 7px 16px;
    margin-bottom: 22px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cat-breadcrumb a {
    color: rgba(255, 255, 255, 0.90);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: color 0.2s;
}

.cat-breadcrumb a:hover {
    color: #ffffff;
}

.cat-breadcrumb-sep {
    font-size: 9px;
    opacity: 0.45;
}

/* ── Responsive home ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .home-hero {
        padding: 50px 16px 70px;
    }

    /* Curva del hero casi plana en móvil — la forma pronunciada (62%) se ve mal en pantallas angostas */
    .home-hero::after {
        height: 38px;
        clip-path: ellipse(96% 100% at 50% 100%);
    }

    .home-hero-stats {
        gap: 10px;
        max-width: 100%;
        margin-top: 28px;
        /* minmax(0, 1fr) permite que las columnas encojan a 0 en pantallas angostas */
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-hero-stat {
        padding: 14px 8px 12px;
        overflow: hidden;
    }

    .home-hero-stat-val {
        font-size: 20px;
    }

    .home-hero-stat-lbl {
        font-size: 9px;
        white-space: normal;
        word-break: break-word;
    }

    .home-cards-wrap {
        grid-template-columns: 1fr;
        gap: 16px;
        /* Padding eliminado — el padre (home-dashboard-layout) ya provee 16px laterales */
        padding: 0 0 20px;
        margin-top: -10px;
    }

    .home-card {
        padding: 24px 20px 20px;
    }

    .cat-hero {
        padding: 22px 16px 58px;
    }

    .cat-breadcrumb {
        font-size: 12px;
        padding: 6px 12px;
    }

    .oa-card-header {
        height: 88px;
    }

    .oa-card-num {
        font-size: 42px;
    }
}

/* ── Secciones genéricas bajo las cards ─────────────────────────────── */
.home-section {
    width: 100%;
    margin: 0;
    padding: 0;
}

.home-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* ── Feature list dentro de las cards ───────────────────────────────── */
.home-card-features {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.home-card-features li {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.home-card-features li .fa-check {
    font-size: 9px;
    color: #10b981;
    flex-shrink: 0;
    background: #ecfdf5;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Módulos recientes ───────────────────────────────────────────────── */
.home-recent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-recent-item {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1.5px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none !important;
    color: inherit !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.home-recent-item:hover {
    border-color: var(--blue-tecnm);
    box-shadow: 0 4px 16px -4px rgba(27, 57, 106, 0.12);
    transform: translateX(4px);
}

.home-recent-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--blue-tecnm), var(--blue-medium));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.home-recent-info {
    flex: 1;
    min-width: 0;
}

.home-recent-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    display: block;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-recent-bar-wrap {
    height: 4px;
    background: #f1f5f9;
    border-radius: 2px;
    margin-bottom: 6px;
    overflow: hidden;
}

.home-recent-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.home-recent-status {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.home-recent-arrow {
    color: #cbd5e1;
    font-size: 14px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.home-recent-item:hover .home-recent-arrow {
    color: var(--blue-tecnm);
}

/* ── Banner informativo ──────────────────────────────────────────────── */
.home-info-banner {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--blue-tecnm);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.home-info-icon {
    font-size: 20px;
    color: var(--blue-tecnm);
    flex-shrink: 0;
    margin-top: 1px;
}

.home-info-body {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

.home-info-body strong {
    display: block;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    font-size: 14px;
}

/* ── Extra Cards (Mi Tutoría · Tu Progreso · ¿Qué estudiar?) ─────────── */
/* ── Extra Cards (Mi Tutoría · Tu Progreso · ¿Qué estudiar?) ─────────── */

.home-extra-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(27, 57, 106, 0.08);
    color: var(--blue-tecnm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.home-extra-card-icon--green {
    background: rgba(16, 185, 129, 0.10);
    color: #059669;
}

.home-extra-card-icon--amber {
    background: rgba(245, 158, 11, 0.10);
    color: #d97706;
}

.home-extra-card-sublabel {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Mi Tutoría Widget */
.home-tutor-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.home-tutor-card-body {
    padding: 4px 0;
}

.home-tutor-card-meta {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.home-tutor-card-footer {
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Mi Tutoría */
.home-tutor-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
}

.home-tutor-session {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.home-tutor-session .fa {
    color: var(--blue-tecnm);
    font-size: 11px;
    flex-shrink: 0;
}

.home-tutor-no-session {
    font-size: 12px;
    color: var(--text-muted);
    margin: 8px 0 0;
}

/* Anillo de progreso */
.home-progress-ring-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-ring {
    display: block;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 10;
}

.progress-ring-fill {
    fill: none;
    stroke: #10b981;
    stroke-width: 10;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-ring-center {
    position: absolute;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-ring-pct {
    font-size: 21px;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
}

.progress-ring-sub {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 3px;
}

.progress-ring-counts {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin: -4px 0 0;
}

.home-progress-detail-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding: 7px 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--blue-tecnm);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.home-progress-detail-btn:hover {
    background: var(--blue-tecnm);
    color: white;
}

/* ¿Qué estudiar hoy? */
.home-study-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.home-study-link {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--blue-tecnm), var(--blue-medium));
    border-radius: 12px;
    padding: 14px 16px;
    text-decoration: none !important;
    color: white !important;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.home-study-link:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.home-study-link-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.home-study-link-text {
    flex: 1;
    min-width: 0;
}

.home-study-link-label {
    font-size: 10px;
    opacity: 0.78;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: block;
}

.home-study-link-title {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-top: 2px;
}

.home-study-tip {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

.home-study-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    color: #059669;
    text-align: center;
}

.home-study-done .fa {
    font-size: 28px;
    margin-bottom: 4px;
}

.home-study-done strong {
    font-size: 14px;
}

.home-study-done span {
    font-size: 12px;
    color: var(--text-muted);
}

.home-study-loading {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px 0;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .home-dashboard-layout {
        padding: 0 16px 40px;
        gap: 18px;
        margin-top: 0;
    }

    .home-sidebar-card {
        padding: 18px;
    }

    .home-recent-item {
        padding: 14px 14px;
        gap: 12px;
    }

    .home-recent-icon {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
}

/* ── Banner de constancia en el catálogo ────────────────────────────── */
.cert-catalog-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1.5px solid var(--glass-border);
    border-left: 4px solid #10b981;
    border-radius: 14px;
    padding: 18px 22px;
    margin: 28px 0 4px;
    box-shadow: 0 2px 12px rgba(27, 57, 106, 0.05);
    animation: banner-slide-in 0.35s ease forwards;
    flex-wrap: wrap;
}

@keyframes banner-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.cert-catalog-icon {
    width: 44px;
    height: 44px;
    background: rgba(16, 185, 129, 0.10);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #059669;
    font-size: 19px;
    flex-shrink: 0;
}

.cert-catalog-body {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cert-catalog-body strong {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    display: block;
}

.cert-catalog-body span {
    font-size: 13px;
    color: var(--text-muted);
}

.cert-catalog-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.cert-catalog-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--blue-tecnm);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.cert-catalog-btn:hover:not(:disabled) {
    background: var(--blue-medium);
}

.cert-catalog-btn:disabled {
    opacity: 0.65;
    cursor: default;
}

.cert-catalog-btn.cert-btn-done {
    background: #059669;
}

@media (max-width: 640px) {
    .cert-catalog-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }
    .cert-catalog-actions {
        align-items: stretch;
        width: 100%;
    }
    .cert-catalog-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Página de verificación de constancia (/verificar) ──────────────── */
body.verificar-body {
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.v-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.v-card {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 8px 40px rgba(27, 57, 106, 0.10);
    overflow: hidden;
}

.v-loading {
    padding: 60px 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.v-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--blue-tecnm);
    border-radius: 50%;
    animation: v-spin 0.8s linear infinite;
}

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

.v-authentic .v-card-header {
    background: linear-gradient(135deg, #059669, #047857);
    padding: 32px 36px 28px;
    text-align: center;
    color: white;
}

.v-invalid .v-card-header {
    background: linear-gradient(135deg, var(--red-tecnm), #b91c1c);
    padding: 32px 36px 28px;
    text-align: center;
    color: white;
}

.v-header-icon {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.v-card-header h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.v-card-header p  { font-size: 13px; opacity: 0.85; margin: 0; }

.v-body { padding: 28px 36px 32px; }

.v-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 14px;
}

.v-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 16px;
}

.v-field-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.v-field-value {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.v-field-value.big {
    font-size: 19px;
    color: var(--blue-tecnm);
}

.v-field-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.v-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.v-modules-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 0;
}

.v-modules-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #374151;
}

.v-modules-list li .fa {
    color: #059669;
    font-size: 13px;
    flex-shrink: 0;
}

.v-tutoria-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(27, 57, 106, 0.08);
    color: var(--blue-tecnm);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.v-cert-id {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
    word-break: break-all;
    margin-top: 20px;
}

.v-invalid-msg {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}

.v-no-id {
    padding: 60px 40px;
    text-align: center;
    color: var(--text-muted);
}

.v-no-id .fa   { font-size: 40px; color: #cbd5e1; display: block; margin-bottom: 16px; }
.v-no-id h2    { font-size: 18px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.v-no-id p     { font-size: 14px; margin: 0; }

.v-topbar-label {
    cursor: default;
    pointer-events: none;
}

.v-footer {
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 560px) {
    .v-body { padding: 20px 20px 24px; }
    .v-authentic .v-card-header,
    .v-invalid   .v-card-header { padding: 24px 20px 20px; }
}

/* ── Barra de búsqueda y filtros del catálogo ────────────────────────── */
.cat-filter-bar {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin: 28px 0 4px;
}

.cat-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.cat-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}

.cat-search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1.5px solid var(--glass-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.cat-search-input:focus {
    border-color: var(--blue-tecnm);
    box-shadow: 0 0 0 3px rgba(27, 57, 106, 0.08);
}

.cat-filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cat-chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.3s ease;
    line-height: 1;
}

.cat-chip:hover {
    border-color: var(--blue-tecnm);
    color: var(--blue-tecnm);
}

.cat-chip.active {
    background: var(--blue-tecnm);
    border-color: var(--blue-tecnm);
    color: white;
}

.cat-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.cat-no-results .fa {
    font-size: 28px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

@media (max-width: 640px) {
    .cat-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .cat-filter-chips {
        justify-content: flex-start;
    }

    .cat-chip {
        padding: 7px 12px;
        font-size: 11px;
    }
}

/* ── Animación fadeIn entre pasos del visor ──────────────────────────── */
@keyframes step-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-enter {
    animation: step-fade-in 0.22s ease forwards;
}

/* ── Pantalla de celebración al completar módulo ────────────────────── */
.oa-completion-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 27, 53, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.oa-completion-overlay.open {
    display: flex;
    animation: overlay-in 0.35s ease forwards;
}

@keyframes overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.oa-completion-card {
    background: white;
    border-radius: 28px;
    padding: 52px 40px 40px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: card-in 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s both;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
}

@keyframes card-in {
    from { opacity: 0; transform: scale(0.82) translateY(28px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* Confetti */
.confetti-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -12px;
    border-radius: 2px;
    animation: confetti-fall linear both;
    pointer-events: none;
}

@keyframes confetti-fall {
    0%   { transform: translateY(0)    rotate(0deg);   opacity: 1; }
    80%  { opacity: 0.8; }
    100% { transform: translateY(520px) rotate(720deg); opacity: 0; }
}

/* Icono trofeo */
.completion-icon {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    color: white;
    margin: 0 auto 22px;
    box-shadow: 0 8px 32px rgba(251, 191, 36, 0.45), 0 0 0 10px rgba(251, 191, 36, 0.12);
    animation: trophy-pop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.45s both;
}

@keyframes trophy-pop {
    from { transform: scale(0) rotate(-20deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

/* Badge */
.completion-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    color: #059669;
    border: 1.5px solid #6ee7b7;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Textos */
.completion-title {
    font-size: 34px;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.15;
}

.completion-module-name {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 0 28px;
    line-height: 1.5;
}

/* Stats */
.completion-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px 24px;
    background: #f8fafc;
    border-radius: 16px;
    margin-bottom: 28px;
}

.completion-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.completion-stat-val {
    font-size: 30px;
    font-weight: 900;
    color: var(--blue-tecnm);
    line-height: 1;
}

.completion-stat-check {
    color: #059669 !important;
}

.completion-stat-lbl {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Botones */
.completion-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    background: var(--blue-tecnm);
    color: white !important;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.completion-btn-primary:hover {
    background: var(--blue-medium);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(27, 57, 106, 0.25);
    color: white !important;
    text-decoration: none !important;
}

.completion-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 24px;
    background: white;
    color: var(--text-muted);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
    box-sizing: border-box;
}

.completion-btn-secondary:hover {
    border-color: var(--blue-tecnm);
    color: var(--blue-tecnm);
}

/* Botón de descarga de constancia (solo visible cuando el alumno completó su tutoría) */
.completion-btn-cert {
    display: none; /* JS lo muestra cuando aplica */
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    margin-bottom: 10px;
    box-sizing: border-box;
    box-shadow: 0 4px 22px rgba(217, 119, 6, 0.38);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    animation: cert-btn-appear 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cert-btn-appear {
    from { opacity: 0; transform: translateY(10px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.completion-btn-cert:hover:not(:disabled) {
    opacity: 0.88;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(217, 119, 6, 0.48);
}

.completion-btn-cert:disabled {
    opacity: 0.65;
    cursor: default;
    transform: none;
}

.completion-btn-cert.cert-btn-done {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 22px rgba(5, 150, 105, 0.35);
}

.cert-btn-content,
.cert-btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cert-error {
    color: var(--red-tecnm);
    font-size: 12px;
    font-weight: 600;
    margin: -4px 0 8px;
    text-align: center;
}

@media (max-width: 480px) {
    .oa-completion-card {
        padding: 40px 20px 32px;
        border-radius: 22px;
    }
    .completion-title { font-size: 28px; }
    .completion-icon  { width: 72px; height: 72px; font-size: 30px; }
    .completion-stats { gap: 28px; padding: 16px 20px; }
    .completion-stat-val { font-size: 24px; }
}

/* ── Toast de error al guardar progreso ─────────────────────────────── */
.oa-error-toast {
    background: #dc3545 !important;
    top: 122px;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.25) !important;
}

@media (max-width: 767px) {
    .oa-error-toast {
        top: 126px;
    }
}

@media (max-width: 991px) {

    /* Catalog: restaurar flujo normal en móvil */
    body.app-unified {
        height: auto;
        overflow: auto;
    }

    #app-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    #app-main {
        overflow-y: visible;
        height: auto;
    }

    /* Visor: restaurar flujo normal en móvil */
    .app-unified-visor {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .app-unified-visor .oa-layout {
        overflow-y: visible;
        height: auto;
        min-height: 100vh;
    }

    /* Panel TutorIA: overlay deslizable desde la derecha (solo en split-view) */
    body.app-unified #tia-sidebar.tia-panel {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        transform: translateX(100%) !important;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-left: none !important;
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.18) !important;
        z-index: 1001;
    }
}

/* ============================================================
   HOME — NUEVO LAYOUT STACK
   ============================================================ */

.home-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 860px;
    padding-top: 32px;
    padding-bottom: 60px;
}

/* ── ¿Qué estudiar hoy? (tarjeta destacada) ─── */
.home-featured-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1.5px solid var(--glass-border);
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: var(--glass-shadow);
}

.home-featured-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.home-featured-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
}

.home-featured-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ── Mi Tutoría (banner horizontal) ─────────── */
.home-tutor-wide {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1.5px solid var(--glass-border);
    border-radius: 18px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 0;
    box-shadow: var(--glass-shadow);
    flex-wrap: wrap;
}

.home-tutor-wide-col {
    flex: 1;
    min-width: 160px;
    padding: 0 20px;
}

.home-tutor-wide-col.home-tutor-wide-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 0;
}

.home-tutor-wide-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.home-tutor-wide-val {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
}

.home-tutor-wide-divider {
    width: 1px;
    align-self: stretch;
    background: var(--border-color);
    flex-shrink: 0;
}

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

    .home-tutor-wide {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 18px;
    }

    .home-tutor-wide-col {
        padding: 0;
        width: 100%;
    }

    .home-tutor-wide-divider {
        width: 100%;
        height: 1px;
        align-self: auto;
    }
}

/* ============================================================
   DASHBOARD PERSONAL DEL ALUMNO
   ============================================================ */

.dash-container {
    padding-top: 32px;
    padding-bottom: 60px;
    max-width: 860px;
}

/* ── Tarjeta de perfil ───────────────────────────────────────── */
.dash-profile-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), 0 1px 3px rgba(0,0,0,0.04);
    padding: 24px 28px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.dash-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(-145deg, #1B396A, #0b1b35);
    color: white;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 1px;
}

.dash-profile-info {
    flex: 1;
    min-width: 0;
}

.dash-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--blue-tecnm);
    margin-bottom: 6px;
    line-height: 1.2;
}

.dash-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.dash-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.dash-tutor-line {
    font-size: 12.5px;
    color: #64748b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-overall {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-overall-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

.dash-overall-fill {
    height: 100%;
    background: linear-gradient(90deg, #1B396A, #3b82f6);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

.dash-overall-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

/* ── Fila de estadísticas ────────────────────────────────────── */
.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.dash-stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 8px rgba(27,57,106,0.05);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.dash-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 2px;
}

.dash-stat-green  { background: #d1fae5; color: #059669; }
.dash-stat-blue   { background: #dbeafe; color: #2563eb; }
.dash-stat-purple { background: #ede9fe; color: #7c3aed; }

.dash-stat-val {
    font-size: 28px;
    font-weight: 900;
    color: var(--blue-tecnm);
    line-height: 1;
}

.dash-stat-of {
    font-size: 15px;
    font-weight: 600;
    color: #94a3b8;
}

.dash-stat-lbl {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

/* ── Lista de módulos ────────────────────────────────────────── */
.dash-section-title {
    font-size: 14px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 14px;
}

.dash-module-item {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    border-left-width: 4px;
    box-shadow: 0 1px 6px rgba(27,57,106,0.05);
    padding: 14px 18px 14px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.dash-module-item:hover {
    box-shadow: 0 6px 20px rgba(27,57,106,0.10);
    transform: translateY(-2px);
}

.dash-mod-completed   { border-left-color: #10b981; }
.dash-mod-in-progress { border-left-color: #3b82f6; }
.dash-mod-not-started { border-left-color: #e2e8f0; }

.dash-mod-num {
    font-size: 13px;
    font-weight: 800;
    color: #cbd5e1;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.dash-mod-body {
    flex: 1;
    min-width: 0;
}

.dash-mod-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.dash-mod-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-mod-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.dash-cta-completed {
    background: #f1f5f9;
    color: #475569;
}
.dash-cta-completed:hover   { background: #e2e8f0; color: #1e293b; }

.dash-cta-in-progress {
    background: #dbeafe;
    color: #1d4ed8;
}
.dash-cta-in-progress:hover { background: #1d4ed8; color: white; }

.dash-cta-not-started {
    background: var(--blue-tecnm);
    color: white;
}
.dash-cta-not-started:hover { background: #122a50; color: white; }

.dash-mod-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-mod-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 120px;
}

.dash-mod-progress-track {
    flex: 1;
    height: 5px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}

.dash-mod-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease;
}

.dash-fill-completed   { background: #10b981; }
.dash-fill-in-progress { background: #3b82f6; }
.dash-fill-not-started { background: #e2e8f0; }

.dash-mod-progress-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.dash-mod-time {
    font-size: 11.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    .dash-profile-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 18px;
    }

    .dash-stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .dash-stat-card {
        padding: 14px 12px;
    }

    .dash-stat-val { font-size: 22px; }

    .dash-mod-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .dash-mod-cta { width: 100%; justify-content: center; }

    .dash-mod-title {
        white-space: normal;
    }

    .dash-mod-progress { min-width: 0; }
}

@media (max-width: 400px) {
    .dash-stats-row {
        grid-template-columns: 1fr 1fr;
    }
    .dash-stat-card:last-child {
        grid-column: span 2;
    }
}