/* ═══════════════════════════════════════════════════
   CURSOS UTN — Estilos
   The Academy Aesthetic · sepia/parchment
   ═══════════════════════════════════════════════════ */

:root {
    --bg-cream:      #faf8f5;
    --bg-paper:      #f5f2eb;
    --text-dark:     #2c2c2c;
    --text-muted:    #666;
    --accent-sepia:  #8b7355;
    --accent-gold:   #b8a88a;
    --accent-green:  #2e7d32;
    --accent-blue:   #1565c0;
    --accent-red:    #c62828;
    --border:        #c4b8a8;
    --shadow-soft:   rgba(139, 115, 85, 0.10);
    --shadow-med:    rgba(139, 115, 85, 0.20);
    --radius:        8px;
    --transition:    all 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Crimson Pro', 'Georgia', serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
}

/* ═══ Auth Page ═══ */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-paper) 0%, var(--bg-cream) 55%, #ece8e0 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: 0 8px 40px var(--shadow-med);
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-sepia), var(--accent-gold));
    border-radius: var(--radius) var(--radius) 0 0;
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo .logo-img {
    height: 56px;
    width: auto;
    margin-bottom: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: sepia(20%) saturate(0.9) opacity(0.85);
}

.auth-logo .logo-fallback {
    display: none;
    margin: 0 auto 12px;
    color: var(--accent-sepia);
}

.auth-logo h1 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--accent-sepia);
    text-transform: uppercase;
}

.auth-logo .subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
}

.auth-logo .badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-sepia);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 10px;
}

/* Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 0;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: var(--transition);
}

.auth-tab.active {
    color: var(--accent-sepia);
    border-bottom-color: var(--accent-sepia);
    font-weight: 600;
}

/* Error */
.auth-error {
    display: none;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: var(--radius);
    color: var(--accent-red);
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.auth-error.visible { display: block; }

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: var(--bg-cream);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent-sepia);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.12);
    background: white;
}

.hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
}

/* Botón principal */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--accent-sepia);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-primary:hover { background: #7a6348; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ═══ Dashboard Layout ═══ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-paper);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo .lab-name {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar-logo .app-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-sepia);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.sidebar-logo .app-name svg {
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.nav-section-title {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 20px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(139, 115, 85, 0.07);
    color: var(--accent-sepia);
}

.nav-item.active {
    background: rgba(139, 115, 85, 0.1);
    color: var(--accent-sepia);
    border-left-color: var(--accent-sepia);
    font-weight: 600;
}

.nav-item svg { flex-shrink: 0; color: inherit; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    word-break: break-word;
}

.sidebar-user strong {
    display: block;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.role-badge {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

.role-badge.student {
    background: #e3f2fd;
    color: var(--accent-blue);
}

.role-badge.docente {
    background: #fff3e0;
    color: #e65100;
}

.btn-logout {
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.btn-logout:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.top-bar {
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar h1 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.top-bar .periodo {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-style: italic;
}

.content-area {
    padding: 32px;
    flex: 1;
}

/* ═══ Cursos Grid ═══ */

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
}

.section-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.curso-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.curso-card:hover {
    border-color: var(--accent-sepia);
    box-shadow: 0 4px 20px var(--shadow-med);
    transform: translateY(-2px);
}

.curso-card::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-sepia), var(--accent-gold));
    border-radius: 3px 3px 0 0;
    margin: -24px -24px 20px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.curso-codigo {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-sepia);
    font-weight: 600;
    margin-bottom: 6px;
}

.curso-nombre {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.curso-descripcion {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.curso-periodo {
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.curso-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--bg-paper);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.curso-link {
    font-size: 0.85rem;
    color: var(--accent-sepia);
    font-weight: 600;
}

/* ═══ Empty State ═══ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    display: block;
    margin: 0 auto 20px;
    color: var(--border);
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ═══ Loading ═══ */

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* ═══ Mensaje de bienvenida ═══ */

.welcome-banner {
    background: linear-gradient(135deg, var(--bg-paper), #ece8e0);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.welcome-banner svg {
    flex-shrink: 0;
    color: var(--accent-sepia);
}

.welcome-banner .welcome-text h2 {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.welcome-banner .welcome-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ═══ Responsive ═══ */

@media (max-width: 768px) {
    .app-layout { flex-direction: column; }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-nav { display: flex; padding: 8px; gap: 4px; overflow-x: auto; }
    .nav-section-title { display: none; }
    .nav-item { padding: 8px 12px; border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
    .nav-item.active { border-left: none; border-bottom-color: var(--accent-sepia); }

    .content-area { padding: 20px; }
    .top-bar { padding: 12px 20px; }
}

/* ═══════════════════════════════════════════════════
   SALA DEL CURSO — curso.html
   ═══════════════════════════════════════════════════ */

.sala-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */

.sala-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-paper);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sala-sidebar-header {
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 10px;
    transition: var(--transition);
}
.back-link:hover { color: var(--accent-sepia); }

.sala-codigo {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-sepia);
    font-weight: 600;
}

.sala-nombre {
    display: block;
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.3;
    margin: 3px 0 2px;
}

.sala-periodo {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Progreso */
.progreso-wrap {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.progreso-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.progreso-pct { font-weight: 700; color: var(--accent-sepia); }

.progreso-bar-bg {
    height: 6px;
    background: var(--bg-paper);
    border-radius: 4px;
    overflow: hidden;
}

.progreso-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-sepia), var(--accent-gold));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progreso-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
    text-align: right;
}

/* Panel docente — reportes */
.docente-actions {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    background: #fdf8f2;
}
.docente-actions-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-sepia);
    margin-bottom: 8px;
}
.btn-reporte-html,
.btn-reporte-excel {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 5px;
    border: none;
    text-align: left;
    background: white;
    color: var(--text-dark);
    border: 1px solid var(--border);
}
.btn-reporte-html:hover  { background: var(--accent-sepia); color: white; border-color: var(--accent-sepia); }
.btn-reporte-excel:hover { background: #1a5e1a; color: white; border-color: #1a5e1a; }

/* Lista de módulos */
.modulos-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.modulo-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 18px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    text-align: left;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.4;
}

.modulo-item:hover { background: rgba(139,115,85,0.06); color: var(--accent-sepia); }

.modulo-item.activo {
    background: rgba(139,115,85,0.1);
    border-left-color: var(--accent-sepia);
    color: var(--accent-sepia);
    font-weight: 600;
}

.modulo-item.completado .modulo-check { color: var(--accent-green); }
.modulo-item.completado .modulo-item-text { text-decoration-color: transparent; }

.modulo-check { flex-shrink: 0; margin-top: 2px; color: var(--border); }
.modulo-item.completado .modulo-check { color: var(--accent-green); }

.modulo-item-text { flex: 1; }
.modulo-num { color: var(--text-muted); margin-right: 3px; }

.tipo-icon { flex-shrink: 0; margin-top: 3px; color: var(--text-muted); opacity: 0.6; }

/* ── Main sala ── */

.sala-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-cream);
}

.sala-topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    flex-shrink: 0;
}

.sala-tabs { display: flex; gap: 0; }

.sala-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: -1px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sala-tab:hover { color: var(--accent-sepia); }
.sala-tab.active { color: var(--accent-sepia); border-bottom-color: var(--accent-sepia); font-weight: 600; }

.anuncios-badge {
    background: var(--accent-sepia);
    color: white;
    font-size: 0.7rem;
    border-radius: 10px;
    padding: 1px 6px;
    font-weight: 700;
}

/* Paneles */
.sala-panel {
    flex: 1;
    overflow-y: auto;
}

#panel-contenido {
    display: flex;
    flex-direction: column;
}

/* Placeholder / loading */
.modulo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex: 1;
    color: var(--text-muted);
    padding: 60px 20px;
    text-align: center;
}

.modulo-placeholder svg { color: var(--border); }
.modulo-placeholder p { font-style: italic; font-size: 0.95rem; }

.modulo-loading { display: flex; align-items: center; justify-content: center; flex: 1; }

/* Artículo del módulo */
.modulo-article {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 28px 32px;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

.modulo-header { margin-bottom: 20px; }

.modulo-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.modulo-tipo-badge {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--bg-paper);
    color: var(--accent-sepia);
    border: 1px solid var(--border);
}

.modulo-tipo-badge.tipo-tarea  { background:#fff3e0; color:#e65100; border-color:#ffe0b2; }
.modulo-tipo-badge.tipo-quiz   { background:#e8f5e9; color:var(--accent-green); border-color:#c8e6c9; }
.modulo-tipo-badge.tipo-video  { background:#e3f2fd; color:var(--accent-blue); border-color:#bbdefb; }

.modulo-fecha {
    font-size: 0.82rem;
    color: var(--accent-red);
    font-style: italic;
}

.modulo-titulo {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.25;
    font-family: 'Playfair Display', 'Georgia', serif;
}

/* Contenido HTML del módulo */
.modulo-body {
    flex: 1;
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text-dark);
    margin-top: 24px;
}

.modulo-body h2, .modulo-body h3 { margin: 1.4em 0 0.5em; color: var(--text-dark); }
.modulo-body p  { margin-bottom: 1em; }
.modulo-body ul, .modulo-body ol { margin: 0.6em 0 1em 1.4em; }
.modulo-body li { margin-bottom: 0.3em; }
.modulo-body blockquote {
    border-left: 3px solid var(--accent-gold);
    padding: 8px 16px;
    margin: 1em 0;
    background: var(--bg-paper);
    font-style: italic;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.modulo-body code {
    font-family: 'Courier New', monospace;
    background: var(--bg-paper);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    border: 1px solid var(--border);
}
.modulo-body pre {
    background: #2c2520;
    color: #f5f2eb;
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.88rem;
    margin: 1em 0;
}
.modulo-body pre code { background: none; border: none; padding: 0; color: inherit; font-size: 1em; }
.modulo-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.92rem;
}
.modulo-body th, .modulo-body td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}
.modulo-body th { background: var(--bg-paper); font-weight: 600; }

/* Footer del módulo */
.modulo-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 28px;
    margin-top: 28px;
    border-top: 1px solid var(--border);
}

.btn-completar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-sepia);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-completar:hover:not(:disabled) { background: #7a6348; }
.btn-completar:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-completar.completado {
    background: var(--accent-green);
}
.btn-completar.completado:hover:not(:disabled) { background: #1b5e20; }

.btn-siguiente {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: none;
    color: var(--accent-sepia);
    border: 1px solid var(--accent-sepia);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-siguiente:hover { background: var(--accent-sepia); color: white; }

/* ── Anuncios panel ── */

#panel-anuncios { padding: 24px 32px; max-width: 960px; margin: 0 auto; width: 100%; }

.anuncio-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 14px;
}

.anuncio-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.anuncio-titulo { font-size: 1.02rem; font-weight: 600; color: var(--text-dark); }

.anuncio-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
}

.anuncio-cuerpo {
    font-size: 0.92rem;
    color: var(--text-dark);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ── Responsive sala ── */

@media (max-width: 900px) {
    .sala-layout { flex-direction: column; height: auto; min-height: 100vh; }
    .sala-sidebar { width: 100%; height: auto; max-height: 40vh; overflow-y: auto; }
    .sala-main   { overflow: visible; }
    .sala-panel  { overflow: visible; }
    .modulo-article { padding: 24px 20px; }
    #panel-anuncios { padding: 20px; }
}

/* ═══ Btn Tarea (sala del curso) ═══ */

.btn-tarea {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}
.btn-tarea:hover { background: #e65100; color: white; border-color: #e65100; }

/* ═══ Página Tarea ═══ */

.tarea-layout {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 20px 60px;
    min-height: 100vh;
}

.tarea-topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.tarea-topbar-title {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tarea-loading {
    padding: 60px 0;
    text-align: center;
}

/* ── Header card ── */

.tarea-header-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 24px;
}

.tarea-meta-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.tarea-fecha-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.86rem;
    color: var(--text-muted);
}
.tarea-fecha-label.vencida { color: var(--accent-red); }
.label-vencida { font-weight: 600; }

.tarea-puntos {
    font-size: 0.84rem;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 10px;
    color: var(--text-muted);
    margin-left: auto;
}

.tarea-titulo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.3;
}

.tarea-instrucciones {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.7;
}
.tarea-instrucciones p { margin-bottom: 12px; }

/* ── Entrega card (shared) ── */

.entrega-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 24px;
}

.entrega-section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.entrega-status-msg {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 16px;
}
.entrega-status-msg.error   { background: #ffebee; color: var(--accent-red); border: 1px solid #ffcdd2; }
.entrega-status-msg.success { background: #e8f5e9; color: var(--accent-green); border: 1px solid #c8e6c9; }

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.entrega-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-cream);
    font-family: inherit;
    font-size: 0.98rem;
    color: var(--text-dark);
    resize: vertical;
    transition: var(--transition);
    margin-bottom: 18px;
}
.entrega-textarea:focus { outline: none; border-color: var(--accent-sepia); background: white; }

.entrega-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-cream);
    font-family: inherit;
    font-size: 0.96rem;
    color: var(--text-dark);
    transition: var(--transition);
    margin-bottom: 20px;
}
.entrega-input:focus { outline: none; border-color: var(--accent-sepia); background: white; }

.entrega-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-entregar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--accent-sepia);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-entregar:hover:not(:disabled) { background: #6d5a40; }
.btn-entregar:disabled { opacity: 0.6; cursor: not-allowed; }

.entrega-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
}

.entrega-vencida {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    color: #795548;
    font-size: 0.95rem;
}
.entrega-vencida svg { flex-shrink: 0; margin-top: 2px; }

/* ── Entrega enviada ── */

.entrega-enviada-card { border-color: #c8e6c9; }

.entrega-enviada-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-green);
    font-weight: 600;
    font-size: 0.96rem;
    margin-bottom: 16px;
}

.entrega-fecha-sent {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: auto;
}

.entrega-contenido-preview {
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 0.95rem;
    white-space: pre-wrap;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.entrega-link-preview {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9rem;
    color: var(--accent-blue);
    margin-bottom: 12px;
}
.entrega-link-preview a { color: inherit; word-break: break-all; }

.entrega-calificacion {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 16px;
}

.cal-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.cal-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cal-score {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    color: var(--accent-green);
    font-weight: 500;
}

.cal-retro {
    font-size: 0.93rem;
    color: var(--text-dark);
    background: #f1f8e9;
    border: 1px solid #c8e6c9;
    border-radius: var(--radius);
    padding: 10px 14px;
    white-space: pre-wrap;
    display: none;
}

.entrega-pendiente {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    color: var(--text-muted);
    font-style: italic;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 14px;
}

.btn-reenviar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 7px 16px;
    background: transparent;
    color: var(--accent-sepia);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.87rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-reenviar:hover { background: var(--bg-paper); }

/* ── Panel docente ── */

.entregas-docente-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}

.entregas-count {
    font-size: 0.86rem;
    color: var(--text-muted);
}

.entregas-list { display: flex; flex-direction: column; gap: 16px; }

.ecard {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
}

.ecard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.ecard-alumno strong { display: block; font-size: 1rem; }
.ecard-alumno span   { font-size: 0.82rem; color: var(--text-muted); }

.ecard-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.estado-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.estado-enviada   { background: #e3f2fd; color: var(--accent-blue); }
.estado-revisada  { background: #fff3e0; color: #e65100; }
.estado-calificada { background: #e8f5e9; color: var(--accent-green); }

.ecard-fecha { font-size: 0.82rem; color: var(--text-muted); }

.ecard-contenido {
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 0.93rem;
    white-space: pre-wrap;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.ecard-link {
    font-size: 0.88rem;
    color: var(--accent-blue);
    margin-bottom: 10px;
    word-break: break-all;
}

.ecard-calificado {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
}
.ecard-calificado .cal-score { font-size: 1.2rem; }

.form-calificar {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-top: 16px;
}

/* ── Tarea responsive ── */

@media (max-width: 640px) {
    .tarea-layout { padding: 0 14px 40px; }
    .tarea-header-card, .entrega-card { padding: 20px 18px; }
    .tarea-titulo { font-size: 1.35rem; }
    .tarea-puntos { margin-left: 0; }
    .ecard { padding: 16px 18px; }
}

/* ═══ Panel Docente ═══ */

.admin-course-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-course-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
    margin-bottom: 0;
}

.admin-select {
    flex: 1;
    max-width: 480px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    font-family: inherit;
    font-size: 0.96rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}
.admin-select:focus { outline: none; border-color: var(--accent-sepia); }

/* ── Tabs ── */

.admin-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: -1px;
}
.admin-tab:hover { color: var(--text-dark); }
.admin-tab.active {
    color: var(--accent-sepia);
    border-bottom-color: var(--accent-sepia);
    font-weight: 600;
}

/* ── Panel container ── */

.admin-panel { animation: fadeIn 0.15s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Form card ── */

.admin-form-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-bottom: 20px;
}

.admin-form-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.admin-msg {
    padding: 9px 13px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    margin-bottom: 14px;
}
.admin-msg.ok    { background: #e8f5e9; color: var(--accent-green); border: 1px solid #c8e6c9; }
.admin-msg.error { background: #ffebee; color: var(--accent-red);   border: 1px solid #ffcdd2; }

.admin-error { color: var(--accent-red); font-size: 0.9rem; padding: 12px 0; }

/* ── List sections ── */

.admin-list { display: flex; flex-direction: column; gap: 0; }

.admin-list-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* ── Anuncio row ── */

.admin-anuncio-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.admin-anuncio-row:last-child { border-bottom: none; }

.admin-anuncio-info { flex: 1; }
.admin-anuncio-info strong { display: block; font-size: 0.97rem; }

.admin-anuncio-fecha {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.admin-anuncio-cuerpo {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: pre-wrap;
}

.admin-btn-delete {
    flex-shrink: 0;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.admin-btn-delete:hover { background: #ffebee; color: var(--accent-red); border-color: #ffcdd2; }

/* ── Tarea rows ── */

.admin-tarea-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: white;
    overflow: hidden;
}

.admin-tarea-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    transition: var(--transition);
    gap: 12px;
}
.admin-tarea-header:hover { background: var(--bg-paper); }

.admin-tarea-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.97rem;
}

.admin-orden { color: var(--text-muted); font-size: 0.88rem; }

.admin-tarea-badges { display: flex; align-items: center; gap: 10px; }

.admin-config-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.admin-config-badge.ok      { background: #e8f5e9; color: var(--accent-green); }
.admin-config-badge.pending { background: #fff3e0; color: #e65100; }

.admin-chevron { color: var(--text-muted); transition: transform 0.2s ease; }

.admin-tarea-form {
    padding: 16px 18px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-paper);
}

.admin-tarea-fields {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.admin-field-group { flex: 1; min-width: 180px; }

/* ── Progreso ── */

.admin-progreso-header {
    margin-bottom: 18px;
}

.admin-inscritos-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.admin-progreso-list { display: flex; flex-direction: column; gap: 12px; }

.admin-progreso-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    flex-wrap: wrap;
}

.admin-progreso-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    flex: 1;
}

.admin-tipo-icon { font-size: 1rem; }

.admin-progreso-titulo {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.admin-progreso-bar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    flex: 1;
}

.admin-progreso-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.admin-progreso-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-sepia), var(--accent-gold));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.admin-progreso-nums {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.admin-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ── Botón Nuevo Curso ── */

.admin-btn-nuevo-curso {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-sepia);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: 0.88rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.admin-btn-nuevo-curso:hover { background: var(--text-dark); }

/* ── Módulos: lista con reordenamiento ── */

.admin-mod-row {
    border: 1px solid var(--border);
    border-bottom: none;
    background: white;
}
.admin-mod-row:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.admin-mod-row:last-of-type  { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.admin-mod-row:only-of-type  { border-radius: var(--radius); border-bottom: 1px solid var(--border); }

.admin-mod-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}

.admin-mod-order-btns {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.admin-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 20px;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    padding: 0;
}
.admin-order-btn:hover:not(:disabled) { background: var(--accent-sepia); color: white; border-color: var(--accent-sepia); }
.admin-order-btn:disabled { opacity: 0.3; cursor: default; }

.admin-mod-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.admin-mod-info strong {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-tipo-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-mod-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.admin-btn-edit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    padding: 0;
}
.admin-btn-edit:hover { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }

.admin-mod-edit-form {
    border-top: 1px solid var(--border);
    padding: 16px;
    background: var(--bg-paper);
    animation: fadeIn 0.15s ease;
}

/* monospace para textarea de HTML */
.mod-editor {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
}

/* ── Inscripciones ── */

.admin-inscr-add-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.admin-inscr-btn { height: 40px; padding: 0 20px; }

.admin-inscr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: white;
}
.admin-inscr-row:last-child { border-bottom: none; }

/* ── Gestión de Curso ── */

.admin-curso-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.admin-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
    user-select: none;
}
.admin-toggle-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ── Modal: Nuevo Curso ── */

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 20px;
}

.admin-modal {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    animation: fadeIn 0.18s ease;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.admin-modal-header h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--text-dark);
    margin: 0;
}

.admin-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    padding: 0;
}
.admin-modal-close:hover { background: #ffebee; color: var(--accent-red); border-color: #ffcdd2; }

/* ══════════════════════════════════════════════════════════════
   QUIZ — Vista estudiante
   ══════════════════════════════════════════════════════════════ */

.btn-quiz {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1a237e, #283593);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 10px 22px;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}
.btn-quiz:hover { opacity: 0.88; }

/* Meta bar */
.quiz-meta-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.quiz-meta-item {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.quiz-intentos-badge {
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 12px;
}

/* Pregunta card */
.quiz-pregunta-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}
.quiz-pregunta-card.quiz-sin-responder {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 2px #ffcdd2;
}
.quiz-num { color: var(--text-muted); margin-right: 6px; }
.quiz-enunciado { font-size: 0.97rem; color: var(--text-dark); line-height: 1.5; margin-bottom: 14px; }

/* Opciones */
.quiz-opciones { display: flex; flex-direction: column; gap: 8px; }

.quiz-opcion-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-paper);
    font-size: 0.92rem;
    color: var(--text-dark);
}
.quiz-opcion-label:hover { border-color: #283593; background: #e8eaf6; }
.quiz-opcion-label.selected { border-color: #1a237e; background: #e8eaf6; font-weight: 600; }

.quiz-radio { flex-shrink: 0; accent-color: #1a237e; width: 16px; height: 16px; cursor: pointer; }
.quiz-opcion-texto { flex: 1; line-height: 1.4; }

/* Submit bar */
.quiz-submit-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
}

/* Score card */
.quiz-score-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}
.quiz-nota-grande {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 600;
    line-height: 1;
}
.quiz-nota-ok   { color: var(--accent-green); }
.quiz-nota-fail { color: var(--accent-red); }
.quiz-score-sub { font-size: 1rem; color: var(--text-muted); margin-top: 8px; }
.quiz-intento-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.quiz-score-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* Review */
.quiz-review-section { margin-top: 8px; }
.quiz-review-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--text-dark);
    margin-bottom: 12px;
}
.quiz-review-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    background: white;
}
.review-correcta  { border-left: 3px solid var(--accent-green); }
.review-incorrecta { border-left: 3px solid var(--accent-red); }

.review-header { display: flex; align-items: flex-start; gap: 10px; }
.review-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.review-correcta  .review-icon { color: var(--accent-green); }
.review-incorrecta .review-icon { color: var(--accent-red); }

.review-detail { margin-top: 10px; padding-left: 24px; display: flex; flex-direction: column; gap: 4px; }
.review-opcion { font-size: 0.88rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.review-opcion-correcta { color: var(--accent-green); font-weight: 600; }
.review-opcion-elegida-mal { color: var(--accent-red); }
.review-check { color: var(--accent-green); font-weight: 700; }
.review-x     { color: var(--accent-red);   font-weight: 700; }
.review-dot   { color: var(--text-muted); }

/* Tabla resultados docente */
.quiz-tabla-resultados {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.quiz-tabla-resultados th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 2px solid var(--border);
}
.quiz-tabla-resultados td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.quiz-nota-ok   { color: var(--accent-green); }
.quiz-nota-fail { color: var(--accent-red); }

/* ══════════════════════════════════════════════════════════════
   QUIZ — Banco de preguntas (panel admin)
   ══════════════════════════════════════════════════════════════ */

.admin-btn-quiz-banco {
    gap: 4px;
    background: #e8eaf6;
    color: #1a237e;
    border-color: #c5cae9;
}
.admin-btn-quiz-banco:hover { background: #c5cae9; color: #1a237e; border-color: #9fa8da; }

.admin-quiz-banco-panel {
    border-top: 2px dashed #c5cae9;
    background: #f5f5fb;
    animation: fadeIn 0.15s ease;
}
.admin-quiz-banco-inner { padding: 18px 18px 6px; }
.admin-quiz-banco-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1a237e;
    margin-bottom: 14px;
}

/* Lista de preguntas en el banco */
.admin-quiz-preguntas-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.admin-quiz-preg-row {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.admin-quiz-preg-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.admin-quiz-preg-num  { color: var(--text-muted); font-size: 0.82rem; flex-shrink: 0; padding-top: 2px; }
.admin-quiz-preg-texto { flex: 1; font-size: 0.92rem; color: var(--text-dark); line-height: 1.4; }

.admin-quiz-preg-opciones { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.admin-quiz-preg-opcion {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.opcion-correcta { color: var(--accent-green); font-weight: 600; }

/* Formulario nueva pregunta */
.admin-quiz-nueva-form { margin-top: 6px; background: white; }

.admin-quiz-opciones-grid { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.admin-quiz-opcion-row { display: flex; align-items: center; gap: 10px; }
.quiz-radio-admin { width: 16px; height: 16px; accent-color: #1a237e; flex-shrink: 0; cursor: pointer; }
.quiz-radio-admin-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    background: var(--bg-paper);
    transition: all 0.15s;
}
.quiz-radio-admin:checked + .quiz-radio-admin-label {
    background: #e8f5e9;
    border-color: var(--accent-green);
    color: var(--accent-green);
    font-weight: 700;
}
.admin-quiz-opcion-row .entrega-input { flex: 1; margin-bottom: 0; }

/* ── Admin responsive ── */

@media (max-width: 640px) {
    .admin-course-bar { flex-direction: column; align-items: flex-start; }
    .admin-select { max-width: 100%; width: 100%; }
    .admin-tabs { overflow-x: auto; }
    .admin-tab { white-space: nowrap; padding: 10px 14px; }
    .admin-progreso-row { flex-direction: column; align-items: flex-start; }
    .admin-tarea-fields { flex-direction: column; }
    .admin-inscr-add-row { flex-direction: column; }
    .admin-inscr-btn { width: 100%; }
    .admin-mod-info strong { max-width: 160px; }
}

/* ═══════════════════════════════════════════════════
   FASE C — Constructor EFE Interactivo
   ═══════════════════════════════════════════════════ */

.efe-layout {
    min-height: 100vh;
    background: var(--bg-parchment);
    display: flex;
    flex-direction: column;
}

.efe-topbar {
    background: var(--bg-cream);
    border-bottom: 1px solid var(--border-light);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.efe-topbar-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.efe-main {
    max-width: 880px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    width: 100%;
}

/* Caso de estudio */
.efe-case-section {
    background: var(--bg-cream);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    margin-bottom: 24px;
    overflow: hidden;
}

.efe-case-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
}

.efe-case-toggle:hover { background: var(--bg-hover); }

.efe-case-body {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
}

.efe-case-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.efe-case-col h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.efe-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.efe-data-table th {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border-light);
}

.efe-data-table td {
    padding: 5px 8px;
    color: var(--text-primary);
}

.efe-data-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.efe-data-table .efe-total-row td {
    border-top: 1px solid var(--border-light);
    padding-top: 8px;
    font-weight: 600;
}

.efe-data-table .efe-sub-row td {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.efe-muted { color: var(--text-muted) !important; }
.text-ok   { color: #2e7d32; }
.text-warn { color: #c77a00; }

.efe-hint-box {
    background: var(--bg-parchment);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 12px 14px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.efe-hint-info {
    border-color: #7a5c3a44;
    background: #f9f4ee;
}

/* Instrucciones */
.efe-instructions {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--bg-cream);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent-brown);
    border-radius: 4px;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

/* EFE Form */
.efe-form { display: flex; flex-direction: column; gap: 20px; }

.efe-section {
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-cream);
}

.efe-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
}

.efe-section-letter {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.efe-op-color  { background: #4a6741; }
.efe-inv-color { background: #1a5276; }
.efe-fin-color { background: #6b3fa0; }

.efe-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}

.efe-row:last-of-type { border-bottom: none; }

.efe-row-indent { padding-left: 32px; }

.efe-row-ok  { background: #e8f5e9 !important; }
.efe-row-err { background: #ffebee !important; }

.efe-row-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex: 1;
}

.efe-row-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.efe-currency {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.efe-input {
    width: 140px;
    padding: 7px 10px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-parchment);
    text-align: right;
    transition: border-color 0.15s;
}

.efe-input:focus {
    outline: none;
    border-color: var(--accent-brown);
}

.efe-input-error { border-color: #c62828 !important; }

.efe-row-icon { width: 20px; display: flex; align-items: center; }

.efe-group-label {
    padding: 6px 18px 2px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-parchment);
    border-bottom: 1px solid var(--border-light);
}

.efe-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.efe-subtotal-num {
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
}

/* Totales finales */
.efe-totales {
    background: var(--bg-cream);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
}

.efe-total-row-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.efe-total-row-final:last-child { border-bottom: none; }

.efe-total-row-inicial { background: var(--bg-parchment); }

.efe-total-row-final-bold {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    background: #f0ebe4;
}

.efe-total-num {
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
    font-weight: 600;
}

/* Acciones */
.efe-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Resultado */
.efe-resultado { margin-top: 20px; }

.efe-feedback-list { margin-top: 20px; }

.efe-feedback-all-ok {
    text-align: center;
    color: #2e7d32;
    font-size: 1.05rem;
    padding: 20px;
}

.efe-feedback-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    margin: 0 0 12px;
    color: var(--text-secondary);
}

.efe-feedback-item {
    background: var(--bg-cream);
    border: 1px solid #f5c6cb;
    border-left: 3px solid #c62828;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.efe-feedback-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.efe-feedback-vals {
    display: flex;
    gap: 20px;
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.efe-feedback-wrong   { color: #c62828; }
.efe-feedback-correct { color: #2e7d32; font-weight: 600; }

.efe-feedback-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   FASE D — Sección Solución del Docente
   ═══════════════════════════════════════════════════ */

.solucion-section {
    border-top: 1px solid var(--border-light);
    margin: 20px 0 0;
    padding-top: 12px;
}

.solucion-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff8f0;
    border: 1px solid #d4a96a44;
    border-radius: 4px;
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #7a5c3a;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.solucion-toggle:hover { background: #f5ede0; }

.solucion-body {
    margin-top: 12px;
    padding: 16px 20px;
    background: #fffdf9;
    border: 1px dashed #d4a96a66;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════
   FASE E — Panel de Calificaciones
   ═══════════════════════════════════════════════════ */

.calificaciones-wrap {
    padding: 24px 32px;
}

.calif-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 20px;
}

.calif-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.calif-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border-light);
}

.calif-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

.calif-table tr:last-child td { border-bottom: none; }
.calif-table tr:hover td { background: var(--bg-hover); }

.calif-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.calif-badge.calif-ok   { background: #e8f5e9; color: #2e7d32; }
.calif-badge.calif-pend { background: #f5f5f5; color: #888; }

.calif-tipo {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 640px) {
    .efe-case-cols { grid-template-columns: 1fr; }
    .efe-input { width: 110px; }
    .efe-row-label { font-size: 0.82rem; }
    .calificaciones-wrap { padding: 16px; }
    .calif-table { font-size: 0.8rem; }
    .calif-table th, .calif-table td { padding: 8px 8px; }
}

/* ══════════════════════════════════════════════════════════════════
   FASE F — Adjuntos de entrega
   ══════════════════════════════════════════════════════════════════ */

.archivo-drop-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: 2px dashed var(--border, #ddd);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .18s, background .18s;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
    user-select: none;
}
.archivo-drop-zone:hover,
.archivo-drop-zone.tiene-archivo {
    border-color: var(--accent, #2d6cdf);
    background: var(--accent-soft, #eef6ff);
    color: var(--accent, #2d6cdf);
}

.archivo-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--accent-soft, #eef6ff);
    border: 1px solid var(--accent, #2d6cdf);
    border-radius: 6px;
    font-size: 0.86rem;
    color: var(--text, #222);
    margin-bottom: 12px;
}
.archivo-chip svg { flex-shrink: 0; color: var(--accent, #2d6cdf); }

.archivo-quitar {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0 4px;
    line-height: 1;
    transition: color .15s;
}
.archivo-quitar:hover { color: var(--accent-red, #c0392b); }

.archivo-size {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-left: 2px;
}

/* Chips de descarga (vista de entrega enviada / docente) */
.archivos-adjuntos-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.archivo-chip-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font-size: 0.84rem;
    color: var(--accent, #2d6cdf);
    text-decoration: none;
    transition: background .15s, border-color .15s;
    max-width: 280px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.archivo-chip-link:hover {
    background: var(--accent-soft, #eef6ff);
    border-color: var(--accent, #2d6cdf);
}

/* ══════════════════════════════════════════════════════
   ACCESIBILIDAD TOOLBAR
══════════════════════════════════════════════════════ */
.accesibilidad-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 10px 16px;
    background: #f9f7f2;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.82rem;
}
.toolbar-grupo { display: flex; align-items: center; gap: 5px; }
.toolbar-label { color: var(--text-muted); font-size: 0.78rem; }
.toolbar-sep   { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

.btn-fuente {
    width: 28px; height: 28px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.btn-fuente:hover, .btn-fuente.activo {
    background: var(--accent-sepia); color: white; border-color: var(--accent-sepia);
}
.btn-fuente-base { font-size: 0.95rem; }

.btn-toolbar {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 5px;
    border: 1px solid var(--border);
    background: white; color: var(--text-dark);
    font-size: 0.8rem; cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-toolbar:hover     { background: var(--accent-sepia); color: white; border-color: var(--accent-sepia); }
.btn-toolbar-stop:hover{ background: #c62828; color: white; border-color: #c62828; }
.btn-braille:hover     { background: #1a3a6b; color: white; border-color: #1a3a6b; }

/* ══════════════════════════════════════════════════════
   SUB-TABS DEL MÓDULO (Teoría / Evaluación / Soluciones)
══════════════════════════════════════════════════════ */
.mod-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}
.mod-tab {
    padding: 9px 20px;
    border: none; background: none;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit;
}
.mod-tab:hover { color: var(--accent-sepia); }
.mod-tab.active {
    color: var(--accent-sepia);
    border-bottom-color: var(--accent-sepia);
    font-weight: 600;
}

/* Banner soluciones */
.solucion-banner {
    display: flex; align-items: center; gap: 8px;
    background: #fffbea;
    border: 1px solid #d4a600;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.82rem;
    color: #7a5c00;
    margin-bottom: 16px;
}

/* ══════════════════════════════════════════════════════
   QUIZ EMBEBIDO
══════════════════════════════════════════════════════ */
.quiz-embed-wrap { padding: 4px 0 16px; }

.quiz-intento-bar {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
    background: #f3f4f8;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    gap: 8px;
}
.quiz-intento-bar strong { color: var(--accent-sepia); }

.quiz-pregunta {
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 18px 20px;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}
.quiz-pregunta.respondida { border-color: var(--accent-sepia); }

.quiz-pregunta-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
}
.quiz-num {
    font-size: 0.75rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--accent-sepia);
}
.btn-audio-pregunta {
    width: 30px; height: 30px;
    border: 1px solid var(--border); border-radius: 50%;
    background: white; cursor: pointer; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.btn-audio-pregunta:hover, .btn-audio-pregunta.leyendo {
    background: var(--accent-sepia); color: white; border-color: var(--accent-sepia);
}

.quiz-enunciado {
    font-size: 1rem; color: var(--text-dark);
    margin: 0 0 14px; line-height: 1.5;
}

.quiz-opciones { display: flex; flex-direction: column; gap: 8px; }
.quiz-opcion {
    display: flex; align-items: flex-start; gap: 10px;
    border: 1px solid var(--border); border-radius: 7px;
    padding: 10px 14px; cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.quiz-opcion input[type=radio] { display: none; }
.quiz-opcion:hover { border-color: var(--accent-sepia); background: #fdf8f2; }
.quiz-opcion.seleccionada { border-color: var(--accent-sepia); background: #fdf8f2; }

.quiz-opcion-letra {
    min-width: 24px; height: 24px;
    background: var(--bg-paper); border: 1px solid var(--border);
    border-radius: 50%; font-size: 0.78rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-sepia); flex-shrink: 0;
}
.quiz-opcion.seleccionada .quiz-opcion-letra {
    background: var(--accent-sepia); color: white; border-color: var(--accent-sepia);
}
.quiz-opcion-texto { font-size: 0.92rem; color: var(--text-dark); line-height: 1.4; }

.quiz-embed-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap; gap: 10px;
}
.quiz-respondidas { font-size: 0.82rem; color: var(--text-muted); }
.btn-quiz-submit {
    padding: 10px 24px;
    background: var(--accent-sepia); color: white;
    border: none; border-radius: 7px;
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    transition: var(--transition);
}
.btn-quiz-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-quiz-submit:not(:disabled):hover { background: #5a3a1a; }

/* Resultados */
.quiz-resultado-wrap { padding: 4px 0; }
.quiz-resultado-header {
    display: flex; align-items: center; gap: 20px;
    border-radius: 10px; padding: 20px 24px; margin-bottom: 20px;
}
.quiz-resultado-header.aprobado { background: #e8f5e9; border: 1.5px solid #4caf50; }
.quiz-resultado-header.reprobado{ background: #fff3f3; border: 1.5px solid #e53935; }
.qr-icono svg { flex-shrink: 0; }
.quiz-resultado-header.aprobado .qr-icono svg { stroke: #388e3c; }
.quiz-resultado-header.reprobado .qr-icono svg { stroke: #c62828; }
.qr-info h3 { margin: 0 0 4px; font-size: 1.1rem; }
.qr-nota { font-size: 1.8rem; font-weight: 700; color: var(--text-dark); }
.qr-sub  { font-size: 0.82rem; color: #666; margin-top: 4px; }
.btn-reintentar {
    background: none; border: 1px solid var(--accent-sepia);
    border-radius: 5px; color: var(--accent-sepia);
    padding: 3px 10px; cursor: pointer; font-size: 0.8rem;
    margin-left: 8px; transition: var(--transition);
}
.btn-reintentar:hover { background: var(--accent-sepia); color: white; }

.quiz-resultados-detalle { display: flex; flex-direction: column; gap: 8px; }
.quiz-resultado-item {
    border-radius: 7px; padding: 10px 14px;
    border: 1px solid var(--border); font-size: 0.85rem;
}
.quiz-resultado-item.correcto  { background: #f0fdf4; border-color: #a7f3d0; }
.quiz-resultado-item.incorrecto{ background: #fff5f5; border-color: #fca5a5; }
.qri-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.qri-num    { font-weight: 700; color: var(--text-muted); }
.qri-estado { font-weight: 600; }
.correcto  .qri-estado { color: #16a34a; }
.incorrecto .qri-estado { color: #dc2626; }
.qri-correcta { color: #16a34a; margin: 2px 0; }
.qri-elegida  { color: var(--text-muted); margin: 2px 0; }
.qri-error    { color: #dc2626; }

/* Aprobado / Agotado / Vacío */
.quiz-aprobado, .quiz-agotado, .quiz-empty {
    text-align: center; padding: 40px 20px;
    border-radius: 10px; background: #f9f7f2;
}
.quiz-aprobado { background: #e8f5e9; border: 1.5px solid #4caf50; }
.quiz-aprobado svg { stroke: #388e3c; margin-bottom: 10px; }
.quiz-aprobado h3 { color: #388e3c; font-size: 1.3rem; margin-bottom: 8px; }
.quiz-agotado h3  { color: #c62828; }
.quiz-sub { font-size: 0.82rem; color: #666; margin-top: 6px; }

/* ══════════════════════════════════════════
   Banco de preguntas — Vista Docente (Soluciones)
   ══════════════════════════════════════════ */

.banco-wrap { display: flex; flex-direction: column; gap: 22px; }

.banco-pregunta {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 22px;
}

.banco-pregunta-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.banco-num {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.banco-cat {
    font-size: 0.7rem;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2px 8px;
    color: var(--accent-sepia);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.banco-enunciado {
    margin: 0 0 14px;
    font-size: 0.97rem;
    line-height: 1.5;
    color: var(--text-primary);
    font-weight: 500;
}

.banco-opciones {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.banco-opcion {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1.5px solid #e5e0d8;
    background: #fdfcfa;
    font-size: 0.9rem;
    color: #555;
}

.banco-opcion.banco-correcta {
    background: #f0fdf4;
    border-color: #4ade80;
    color: #15803d;
    font-weight: 600;
}

.banco-letra {
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e5e0d8;
    color: #555;
    flex-shrink: 0;
    margin-top: 1px;
}

.banco-correcta .banco-letra {
    background: #4ade80;
    color: #fff;
}

.banco-texto { flex: 1; line-height: 1.4; }

.banco-check {
    font-size: 1rem;
    flex-shrink: 0;
}

.banco-explicacion {
    margin-top: 4px;
    padding: 8px 12px;
    background: #fffbeb;
    border-left: 3px solid #fbbf24;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: #78350f;
    font-style: italic;
    line-height: 1.5;
}
