/* ================================================
   Plataforma de Cursos - Styles
   ================================================ */

/* ================================================
   Variables CSS (Design Tokens)
   ================================================ */
:root {
    /* Colores principales */
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    
    /* Colores de marca */
    --skill-red: #FA7879;
    --day-blue: #8BC2DE;
    --lavender: #A29AED;
    --pistachio: #E1FF67;
    --arena: #FDC293;
    --deep-blue: #15155E;
    --flex-blue: #5352F4;
    
    /* Colores de texto */
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --soft-black: #282828;
    
    /* Colores de fondo */
    --bg-light: #f9fafb;
    --white: #ffffff;
    --warm-white: #F5F2E5;
    
    /* Sombras */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Bordes redondeados */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Layout */
    --sidebar-width: 250px;
    --header-height: 70px;
    --max-content-width: 1200px;
    
    /* Transiciones */
    --transition-fast: 200ms ease;
    --transition-normal: 300ms ease;
}

/* ================================================
   Reset y Base
   ================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Montserrat", sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ================================================
   Layout Principal
   ================================================ */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-body {
    display: flex;
    flex: 1;
    margin-top: var(--header-height);
}

.main-content {
    flex: 1;
    padding: var(--spacing-lg);
    max-width: var(--max-content-width);
    margin: 0 auto;
    width: 100%;
}

/* ================================================
   Header (Cabecera)
   ================================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-lg);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--max-content-width);
    margin: 0 auto;
}

.header-logo img {
    height: 40px;
    width: auto;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-md);
    min-width: 0;
    flex-shrink: 0;
}

.header-user-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
    max-width: min(42vw, 280px);
    min-width: 0;
}

.header-user-greeting {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--deep-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.header-user-masquerade {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.header-user-greeting__icon {
    display: flex;
    flex-shrink: 0;
    color: var(--deep-blue);
}

.header-user-greeting__icon svg {
    width: 1.15em;
    height: 1.15em;
    display: block;
}

.header-user-greeting__name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 2px solid var(--deep-blue);
    border-radius: var(--radius-sm);
    background: transparent;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-normal);
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background-color: var(--deep-blue);
    transition: all var(--transition-normal);
}

.menu-toggle.active {
    background-color: var(--deep-blue);
}

.menu-toggle.active span {
    background-color: var(--white);
}

/* ================================================
   Sidebar (Menú Lateral)
   ================================================ */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--warm-white);
    border-right: 1px solid #e5e7eb;
    padding: var(--spacing-lg);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    transition: transform var(--transition-normal);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: var(--spacing-sm);
}

.sidebar-nav a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-weight: 500;
    transition: all var(--transition-normal);
}

.sidebar-nav a:hover {
    background-color: var(--bg-light);
}

.sidebar-nav a.active {
    background-color: var(--deep-blue);
    color: var(--white);
}

/* Separador visual antes de Cerrar Sesión */
.sidebar-divider {
    border-top: 1px solid #d1d5db;
    margin: var(--spacing-md) 0 var(--spacing-sm);
}

/* Botón Cerrar Sesión */
.sidebar-logout {
    display: block;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.sidebar-logout:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

/* Ajustar contenido cuando hay sidebar visible */
body.has-sidebar .main-content {
    margin-left: var(--sidebar-width);
}

/* ================================================
   Componentes Base - Botones
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-normal);
    text-align: center;
}

.btn-primary {
    background-color: var(--deep-blue);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background-color: var(--flex-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--deep-blue);
    border: 2px solid var(--deep-blue);
}

.btn-secondary:hover {
    background-color: var(--deep-blue);
    color: var(--white);
}

.btn-link {
    color: var(--primary-color);
    font-weight: 500;
    padding: 0;
}

.btn-link:hover {
    color: var(--deep-blue);
    text-decoration: underline;
}

/* ================================================
   Componentes Base - Tarjetas
   ================================================ */
.card {
    background-color: var(--white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-alt {
    background-color: var(--warm-white);
}

/* ================================================
   Responsive - Móvil
   ================================================ */
@media (max-width: 768px) {
    /* Header */
    .header {
        padding: 0 var(--spacing-sm);
    }
    
    .header-logo img {
        height: 32px;
    }

    .header-user-block {
        max-width: min(52vw, 220px);
    }

    .header-user-greeting {
        font-size: 0.875rem;
    }

    .header-user-masquerade {
        font-size: 0.68rem;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    /* Sidebar como overlay en móvil */
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
        width: 80%;
        max-width: 300px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* No ajustar contenido en móvil */
    body.has-sidebar .main-content {
        margin-left: 0;
    }
    
    .main-content {
        padding: var(--spacing-sm);
    }
    
    /* Overlay oscuro detrás del menú */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Botones más grandes en móvil */
    .btn {
        width: 100%;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .btn-primary {
        font-size: 1.1rem;
    }

    /* student/sesion.php: Volver + Zoom en una fila — el .btn móvil no puede ser width:100% */
    .session-actions-primary .btn {
        width: auto;
        flex: 0 0 auto;
        padding: 0.5rem 0.65rem;
        font-size: 0.875rem;
    }

    .session-actions-primary .btn-primary {
        font-size: 0.875rem;
    }

    .session-actions-primary .session-zoom-emoji {
        display: none;
    }
}

@media (min-width: 769px) {
    /* En desktop, sidebar siempre visible */
    .sidebar {
        display: block !important;
    }
}

/* ================================================
   Página de Sesión — sidebar oculto por defecto
   ================================================ */

/* Desktop: override sidebar-always-visible para esta página */
@media (min-width: 769px) {
    body.page-sesion {
        padding-left: 0;
    }

    body.page-sesion .menu-toggle {
        display: flex;
    }

    /* Sidebar como overlay (igual que en móvil) */
    body.page-sesion .sidebar {
        transform: translateX(-100%);
        z-index: 999;
        width: var(--sidebar-width);
    }

    body.page-sesion .sidebar.active {
        transform: translateX(0);
    }

    body.page-sesion .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    body.page-sesion .sidebar-overlay.active {
        display: block;
    }
}

/* Anular margin/padding del layout base para esta página */
body.page-sesion.has-sidebar .main-content,
body.page-sesion .main-content {
    margin-left: 0;
    padding: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

/* ================================================
   Barra de Sesión
   ================================================ */
.session-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 var(--spacing-lg);
    min-height: 56px;
    background-color: var(--white);
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    gap: var(--spacing-xs);
}

.session-bar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    min-height: 56px;
    min-width: 0;
}

.session-info {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.session-info strong {
    font-weight: 700;
}

.session-date-short {
    display: none;
}

.session-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Volver + Zoom siempre juntos; en móvil siguen en una fila encima de la lista de contenidos */
.session-actions-primary {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

/* Botón volver */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.85rem;
    color: var(--deep-blue);
    border: 1.5px solid var(--deep-blue);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    min-height: 36px;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.btn-back:hover {
    background-color: var(--deep-blue);
    color: var(--white);
}

/* Grupo de tabs Pre-Task / Contenido */
.tab-group {
    display: flex;
    border: 1.5px solid var(--deep-blue);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.tab-btn {
    padding: 0.35rem 0.9rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--deep-blue);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    min-height: 36px;
    min-width: 76px;
}

.tab-btn + .tab-btn {
    border-left: 1.5px solid var(--deep-blue);
}

.tab-btn.active {
    background-color: var(--deep-blue);
    color: var(--white);
}

.tab-btn:hover:not(.active):not(:disabled) {
    background-color: rgba(21, 21, 94, 0.07);
}

.tab-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

/* ================================================
   Iframe Mindsmith
   ================================================ */
.session-iframe-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.session-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.session-iframe-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    font-size: 1rem;
    padding: var(--spacing-lg);
    text-align: center;
}

/* ================================================
   Página de Sesión — Responsive Móvil
   ================================================ */
@media (max-width: 768px) {
    .session-bar {
        padding: var(--spacing-xs) var(--spacing-sm);
        gap: 0.4rem;
        min-height: auto;
    }

    .session-bar-main {
        min-height: auto;
        flex-direction: column;
        align-items: flex-start;
    }

    .session-info {
        width: 100%;
        white-space: normal;
        font-size: 0.85rem;
    }

    .session-date-full {
        display: none;
    }

    .session-date-short {
        display: inline;
    }

    .session-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .session-actions-primary {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        width: 100%;
        gap: 0.4rem;
    }

    .session-actions-primary .session-zoom-btn {
        flex-shrink: 0;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .btn-back {
        min-height: 44px;
        font-size: 0.9rem;
    }

    .tab-btn {
        min-height: 44px;
        flex: 1;
        font-size: 0.9rem;
    }

    .session-content-nav {
        justify-content: flex-start;
        width: 100%;
        max-width: none;
    }

    .session-content-nav-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        font-size: 0.9rem;
    }
}

/* ================================================
   Panel de Administración
   ================================================ */

/* Quitar max-width en el área de contenido admin */
body.admin-panel .main-content {
    max-width: none;
}

/* Cabecera del sidebar admin */
.sidebar-admin-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--skill-red);
    padding: 0 var(--spacing-sm) var(--spacing-sm);
    border-bottom: 2px solid var(--skill-red);
    margin-bottom: var(--spacing-md);
}

/* Cabecera del sidebar profesor */
.sidebar-teacher-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--flex-blue);
    padding: 0 var(--spacing-sm) var(--spacing-sm);
    border-bottom: 2px solid var(--flex-blue);
    margin-bottom: var(--spacing-md);
}

/* Desplegable reutilizado (p. ej. filtros en admin) */
.role-dropdown {
    position: relative;
}

.role-dropdown summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem var(--spacing-sm);
    border: 1.5px solid var(--deep-blue);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--deep-blue);
    cursor: pointer;
    list-style: none;
    transition: background-color var(--transition-fast);
    user-select: none;
}

.role-dropdown summary::-webkit-details-marker { display: none; }

.role-dropdown summary:hover {
    background-color: rgba(21, 21, 94, 0.06);
}

.role-dropdown[open] summary {
    background-color: var(--deep-blue);
    color: var(--white);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.role-dropdown-menu {
    border: 1.5px solid var(--deep-blue);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
    background-color: var(--white);
}

.role-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem var(--spacing-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.role-dropdown-item:hover {
    background-color: var(--bg-light);
}

/* Banner "viendo como alumno" */
.admin-student-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-md);
    padding: 0.6rem var(--spacing-md);
    margin-bottom: var(--spacing-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: #92400e;
    flex-wrap: wrap;
}

.admin-banner-btn {
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.admin-banner-btn:hover {
    color: var(--deep-blue);
}

/* Placeholder de sección admin */
.admin-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    text-align: center;
    color: var(--text-light);
}

.admin-placeholder h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.admin-placeholder p {
    font-size: 1rem;
}

/* Panel profesor — pestañas de día (hoy + 4 siguientes) */
.teacher-agenda-title {
    margin-bottom: var(--spacing-md);
}

.teacher-agenda-day-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

.teacher-agenda-day-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 7.5rem;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1.5px solid #d1d5db;
    background: var(--white);
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.teacher-agenda-day-tab:hover {
    border-color: var(--primary-color);
}

.teacher-agenda-day-tab--active {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.08);
    box-shadow: var(--shadow-sm);
}

.teacher-agenda-day-tab-line1 {
    font-weight: 700;
}

.teacher-agenda-day-tab-line2 {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.125rem;
}

.teacher-agenda-empty {
    text-align: center;
    padding: var(--spacing-2xl);
}

.teacher-agenda-empty-lead {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.teacher-agenda-empty-hint {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
}

/* ============================================================
   ADMIN — Cabecera de página
   ============================================================ */

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.admin-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.migrations-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: var(--spacing-lg) 0 var(--spacing-sm);
}

/* ============================================================
   ADMIN — Mensajes de feedback
   ============================================================ */

.admin-feedback {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.admin-feedback--success {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.admin-feedback--success::before {
    content: "✓";
    font-weight: 700;
    flex-shrink: 0;
}

.admin-feedback--error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.admin-feedback--error::before {
    content: "⚠";
    flex-shrink: 0;
}

.admin-feedback--block {
    flex-direction: column;
    align-items: flex-start;
}

.admin-feedback__line {
    white-space: pre-line;
    width: 100%;
}

.admin-feedback--info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.admin-feedback--info::before {
    content: "ℹ";
    font-weight: 700;
    flex-shrink: 0;
}

/* course-edit — aviso «Usar plantilla»: una columna, centrado (evita flex en <p> en varias columnas) */
.ce-template-use-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    width: 100%;
}

.ce-template-use-intro .ce-template-warning.admin-feedback {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 0;
    width: 100%;
    max-width: 38rem;
    box-sizing: border-box;
}

.ce-template-warning__text {
    width: 100%;
    line-height: 1.45;
}

.ce-template-use-intro__hint {
    margin: 0;
    max-width: 38rem;
}

/* ============================================================
   ADMIN — Tabla de datos
   ============================================================ */

.admin-search-bar {
    margin-bottom: var(--spacing-md);
}

.admin-search-bar input[type="search"] {
    width: 100%;
    max-width: 360px;
    padding: 0.65rem var(--spacing-sm);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.admin-search-bar input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.admin-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--white);
}

.admin-table thead th {
    background-color: #f9fafb;
    padding: 0.75rem var(--spacing-md);
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.admin-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color var(--transition-fast);
}

.admin-table tbody tr:last-child {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background-color: #fafafa;
}

.admin-table tbody td {
    padding: 0.875rem var(--spacing-md);
    color: var(--text-dark);
    vertical-align: middle;
}

.admin-table-actions-col {
    width: 1px;
    white-space: nowrap;
}

.admin-table-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    white-space: nowrap;
}

.admin-id-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-dark);
}

.admin-empty {
    color: var(--text-light);
    font-size: 0.95rem;
    padding: var(--spacing-lg) 0;
}

/* ============================================================
   ADMIN — Botones (variantes para tabla y formulario)
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    min-height: 38px;
    gap: 0.4rem;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn--primary {
    background-color: var(--deep-blue);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn--primary:hover {
    background-color: var(--flex-blue);
}

.btn--secondary {
    background-color: var(--white);
    color: var(--deep-blue);
    border: 1.5px solid var(--deep-blue);
}

.btn--secondary:hover {
    background-color: rgba(21, 21, 94, 0.05);
}

.btn--ghost {
    background-color: transparent;
    color: var(--text-light);
    border: 1.5px solid #d1d5db;
}

.btn--ghost:hover {
    background-color: #f9fafb;
    color: var(--text-dark);
}

.btn--danger {
    background-color: var(--white);
    color: #dc2626;
    border: 1.5px solid #fecaca;
}

.btn--danger:hover {
    background-color: #fef2f2;
    border-color: #dc2626;
}

.btn--sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    min-height: 30px;
}

/* ============================================================
   ADMIN — Formularios
   ============================================================ */

.admin-form-card {
    background-color: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl) var(--spacing-lg);
    max-width: 520px;
}

.form-field {
    margin-bottom: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-field label span[aria-hidden] {
    color: #dc2626;
    margin-left: 0.15rem;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="url"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field input[type="time"],
.form-field input[type="search"],
.form-field input[type="password"] {
    padding: 0.7rem var(--spacing-sm);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--white);
    min-height: 44px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-field input:disabled {
    background-color: #f9fafb;
    color: var(--text-light);
    cursor: not-allowed;
}

.form-field--error input {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-field-hint {
    font-size: 0.8rem;
    color: var(--text-light);
}

.form-field-hint--warning {
    color: #b45309;
}

.form-field-error {
    font-size: 0.8rem;
    color: #dc2626;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

/* ============================================================
   ADMIN — Usuarios: filtros de lista
   ============================================================ */

.users-filters {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.users-search-input,
.users-company-select {
    padding: 0.65rem var(--spacing-sm);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    min-height: 40px;
}

.users-search-input {
    flex: 1 1 220px;
    max-width: 320px;
}

.users-company-select {
    flex: 0 0 auto;
}

.users-search-input:focus,
.users-company-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Misma altura que filtros de lista (gana a .form-field input[type="search"] 44px) */
.form-field input.users-search-input[type="search"] {
    min-height: 40px;
    padding: 0.65rem var(--spacing-sm);
    font-size: 0.9rem;
}

/* Email en tabla: monospace sutil */
.table-email {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Badges de estado */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.status-badge--active {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge--inactive {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Botón "Desactivar" */
.btn--warning {
    background-color: var(--white);
    color: #b45309;
    border: 1.5px solid #fcd34d;
}

.btn--warning:hover {
    background-color: #fffbeb;
    border-color: #b45309;
}

/* ============================================================
   ADMIN — Formulario de usuario: campos avanzados
   ============================================================ */

/* Formulario más ancho para acomodar empresa + cursos */
.admin-form-card--wide {
    max-width: 640px;
}

/* Select dentro de form-field */
.form-field select {
    padding: 0.7rem var(--spacing-sm);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--white);
    min-height: 44px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
}

.form-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Grid de checkboxes para cursos */
.checkboxes-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.35rem 0;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================================
   ADMIN — Cursos: tabs del editor
   ============================================================ */

.course-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: var(--spacing-lg);
}

.course-tab {
    padding: 0.65rem var(--spacing-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    white-space: nowrap;
}

.course-tab:hover {
    color: var(--text-dark);
}

.course-tab--active {
    color: var(--deep-blue);
    border-bottom-color: var(--deep-blue);
}

.tab-badge {
    display: inline-block;
    background-color: #f3f4f6;
    color: var(--text-light);
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    margin-left: 0.35rem;
}

/* ============================================================
   ADMIN — Cursos: sección del editor
   ============================================================ */

.course-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.course-section-card {
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.course-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
    color: var(--text-light);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
}

/* Nombre del curso + nivel (select corto) */
.form-grid-2--name-and-level {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.form-field--english-level {
    /* Compacto; el desplegable sigue mostrando el texto completo de la opción */
    width: 9.25rem;
    min-width: 8.5rem;
    max-width: 11rem;
}

.form-field--english-level select {
    width: 100%;
}

.form-grid-3 {
    display: grid;
    /* Una sola línea: empresa | zoom (más ancho) | duración */
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(7.5rem, 9rem);
    gap: var(--spacing-md);
    align-items: end;
}

.form-grid-3 > .form-field {
    min-width: 0;
}

/* Objetivos y schedules — filas dinámicas */
.dynamic-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.dynamic-row input[type="text"],
.dynamic-row input[type="url"],
.dynamic-row input[type="number"],
.dynamic-row input[type="date"],
.dynamic-row input[type="time"] {
    flex: 1;
    padding: 0.65rem var(--spacing-sm);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-dark);
    background: var(--white);
    min-height: 40px;
}

.dynamic-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.schedule-row select {
    flex: 1;
    min-height: 40px;
    padding: 0.5rem var(--spacing-sm);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--white);
}

.schedule-row input.ce-schedule-time-24 {
    width: 5.5rem;
    max-width: 100%;
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    padding: 0.5rem var(--spacing-sm);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--white);
    min-height: 40px;
}

/* ============================================================
   ADMIN — Cursos: lista de sesiones
   ============================================================ */

.sessions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.session-item {
    border-top: 1px solid #f3f4f6;
    background: rgba(248, 250, 252, 0.95);
}

.session-item:first-child {
    border-top: none;
}

/* ============================================================
   DRAG & DROP — Handles + estado SortableJS
   ============================================================ */

.drag-handle--unit,
.drag-handle--session {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.drag-handle--unit:active,
.drag-handle--session:active {
    cursor: grabbing;
}

/* SortableJS aplica estas clases durante el drag */
.sortable-chosen,
.sortable-drag {
    cursor: grabbing;
}

.sortable-chosen .drag-handle--unit,
.sortable-chosen .drag-handle--session,
.sortable-drag .drag-handle--unit,
.sortable-drag .drag-handle--session {
    cursor: grabbing;
}

.session-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.65rem var(--spacing-md);
    cursor: default;
}

.session-header-main {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.session-header-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-left: calc(1.1rem + var(--spacing-sm) * 2); /* drag-handle + gaps (alineado con fila del nombre) */
    flex-wrap: wrap;
}

.drag-handle {
    cursor: grab;
    color: var(--text-light);
    font-size: 1.1rem;
    user-select: none;
    flex-shrink: 0;
}

.drag-handle:active {
    cursor: grabbing;
}

.session-date {
    font-size: 0.875rem;
    color: var(--text-dark);
    flex-shrink: 0;
}

.session-name {
    font-size: 0.875rem;
    color: var(--text-dark);
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-day {
    font-size: 0.8rem;
    color: var(--text-light);
}

.session-time,
.session-teacher {
    font-size: 0.8rem;
    color: var(--text-light);
}

.session-toggle-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.session-body {
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
    background-color: #fafafa;
    border-top: 1px solid #f3f4f6;
}

.session-body textarea {
    width: 100%;
    padding: 0.65rem var(--spacing-sm);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    background: var(--white);
}

.session-body textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Badge "done" */
.status-badge--done {
    background-color: #dcfce7;
    color: #166534;
}

/* ============================================================
   ADMIN — Cursos: cambio profesor en bloque
   ============================================================ */

.bulk-teacher-panel {
    cursor: pointer;
}

.bulk-teacher-summary {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--deep-blue);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bulk-teacher-summary::before {
    content: "▶";
    font-size: 0.7rem;
    transition: transform 0.2s;
}

details[open] .bulk-teacher-summary::before {
    transform: rotate(90deg);
}

/* ============================================================
   ADMIN — Resumen: definición list
   ============================================================ */

.summary-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.5rem var(--spacing-md);
    font-size: 0.9rem;
}

.summary-grid dt {
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    padding-top: 0.2rem;
}

.summary-grid dd {
    color: var(--text-dark);
    margin: 0;
}

/* ============================================================
   ADMIN — Alumnos: chips + modal
   ============================================================ */

.students-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2rem;
    margin-bottom: var(--spacing-sm);
}

.student-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 99px;
    font-size: 0.875rem;
    color: #1d4ed8;
    line-height: 1;
}

.student-chip .chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #93c5fd;
    font-size: 0.75rem;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.student-chip .chip-remove:hover {
    color: #1d4ed8;
}

.student-chip .chip-to-former {
    background: none;
    border: none;
    cursor: pointer;
    color: #f59e0b;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0 0.1rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: color var(--transition-fast);
}

.student-chip .chip-to-former:hover {
    color: #d97706;
}

.student-chip--former .chip-reactivate {
    background: none;
    border: none;
    cursor: pointer;
    color: #16a34a;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0 0.1rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.student-chip--former .chip-reactivate:hover {
    color: #15803d;
}

.students-former {
    margin-top: 0.75rem;
}

.students-former-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.students-former-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.student-chip--former {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: var(--text-light);
    text-decoration: line-through;
}

/* Modal */
.students-modal {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    padding: 0;
    width: min(480px, 94vw);
    max-height: 80vh;
    overflow: hidden;
}

.students-modal[open] {
    display: flex;
    flex-direction: column;
}

.students-modal::backdrop {
    background: rgba(0,0,0,.35);
}

.students-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid #e5e7eb;
}

.students-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.students-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem;
    line-height: 1;
}

.students-modal-body {
    overflow-y: auto;
    padding: var(--spacing-md) var(--spacing-lg);
    flex: 1;
}

.students-modal-search {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.students-modal-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.modal-student-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-student-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background var(--transition-fast);
}

.modal-student-label:hover {
    background: #f0f9ff;
}

.modal-student-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.modal-student-name {
    font-weight: 500;
    color: var(--text-dark);
}

.modal-student-email {
    font-size: 0.8rem;
    color: var(--text-light);
}

.students-modal-footer {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* --- Próximas clases v3 (dos columnas) --- */
.page-title-index {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.index-session-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.index-session-cols {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.index-session-col-left {
    justify-self: start;
    max-width: 100%;
}

.index-session-col-right {
    min-width: 0;
}

@media (max-width: 768px) {
    .index-session-cols {
        grid-template-columns: 1fr;
    }

    .index-session-col-left {
        justify-self: stretch;
    }
}

.index-session-course-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 0.3rem;
    letter-spacing: 0.01em;
}

.index-session-right-head {
    margin-bottom: var(--spacing-md);
}

.index-session-unit-pretitle {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-light);
    margin: 0 0 0.45rem;
    line-height: 1.35;
}

.index-session-assessment-wrap {
    margin: 0 0 0.5rem;
}

.index-session-badge-assessment {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    background: rgba(180, 120, 40, 0.15);
    color: #8a5a12;
}

.index-session-datetime,
.index-session-right-head .index-session-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.25;
}

.index-session-datetime {
    margin-bottom: 0.5rem;
}

.index-session-right-head .index-session-title {
    margin: 0;
}

.index-session-time-range {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.index-session-time-range--pending {
    font-style: italic;
}

.index-session-duration {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-xs);
}

.index-session-planning-note {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

.index-session-teacher {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

.index-session-teacher-label {
    color: var(--text-light);
    margin-right: 0.35rem;
}

.index-session-zoom {
    margin-bottom: var(--spacing-md);
}

.index-session-course-full {
    margin-bottom: var(--spacing-md);
}

.index-session-obj-heading {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    margin-bottom: 0.35rem;
}

.index-session-objectives {
    list-style: disc;
    padding-left: 1.25rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
    line-height: 1.6;
}

.index-session-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
}

/* Visor sesión v3 */
.session-zoom-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Lista de contenidos al visor — student/sesion.php */
.session-content-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    min-width: 0;
    max-width: min(100%, 36rem);
}

.session-content-nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.3rem 0.55rem;
    border-radius: var(--radius-sm);
    color: var(--primary-color);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.session-content-nav-link:hover {
    background: rgba(37, 99, 235, 0.08);
}

.session-content-nav-link.active {
    font-weight: 600;
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}


.session-idx-nav {
    width: 100%;
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    align-items: center;
}

.session-idx-link {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--primary-color);
    border: 1px solid transparent;
}

.session-idx-link:hover {
    background: rgba(37, 99, 235, 0.08);
}

.session-idx-link.active {
    font-weight: 600;
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

/* student/curso.php — sesiones agrupadas por unidad */
.curso-sesiones-section {
    margin-bottom: var(--spacing-xl);
}

.curso-sesiones-section-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

.curso-sesiones-empty {
    color: var(--text-light);
    font-size: 1rem;
}

.curso-unit-block {
    margin-bottom: var(--spacing-xl);
}

.curso-unit-block:last-child {
    margin-bottom: 0;
}

.curso-unit-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--deep-blue);
    margin: 0 0 var(--spacing-md);
    line-height: 1.3;
}

.curso-unit-sessions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.curso-session-card {
    padding: 0.4rem 0.75rem;
    border-top: 1px solid #aeb6c2;
}

.curso-session-card--next {
    border-left: 3px solid var(--flex-blue);
    border-top-color: #9aa3b2;
    background: linear-gradient(90deg, rgba(83, 82, 244, 0.1) 0%, transparent 45%);
    box-shadow: var(--shadow), 0 0 0 1px rgba(83, 82, 244, 0.18);
}

.curso-session-next-badge {
    margin: 0 0 0.15rem;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--flex-blue);
}

.curso-session-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem var(--spacing-sm);
}

/* Fecha en negrita; nombre de sesión debajo, estilo secundario */
.curso-session-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 0;
    max-width: 100%;
}

.curso-session-card-meta .curso-session-order-label {
    margin-right: 0;
}

.curso-session-order-label {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
    color: var(--text-dark);
    margin-right: var(--spacing-sm);
}

.curso-session-date-label {
    font-size: 0.85rem;
    line-height: 1.25;
    color: var(--text-light);
}

.curso-session-card--next .curso-session-order-label {
    color: var(--deep-blue);
}

.curso-session-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    align-items: center;
}

.curso-session-no-materials {
    color: var(--text-light);
    font-size: 0.8rem;
}
