/* =========================================================
   Campus Solofisa · Grupo Soluciones Ofimáticas
   Rojo corporativo #C0141B · Grafito #3A3F42
   ========================================================= */
:root {
    --red: #C0141B;
    --red-dark: #8E0E14;
    --red-soft: #FCEBEC;
    --graphite: #3A3F42;
    --graphite-2: #5B6266;
    --ink: #24292C;
    --muted: #5F676B;
    --line: #E4E6E8;
    --bg: #F5F6F7;
    --surface: #FFFFFF;
    --green: #15803D;
    --green-soft: #E3F4E8;
    --amber: #B45309;
    --amber-soft: #FFF4DA;
    --blue: #2563EB;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 32, .06);
    --shadow: 0 1px 3px rgba(16, 24, 32, .06), 0 8px 24px -12px rgba(16, 24, 32, .14);
    --shadow-lg: 0 24px 48px -20px rgba(16, 24, 32, .28);
}

html, body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.015em; margin: 0; }
h1 { font-size: 1.75rem; font-weight: 750; line-height: 1.2; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
code { font-family: "Cascadia Code", Consolas, monospace; font-size: .85em; background: #EEF0F1; padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.text-danger { color: var(--red) !important; }
.text-success { color: var(--green) !important; }
.eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.flex-1 { flex: 1; }

/* ---------- Shell ---------- */
.topbar { border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(8px); background: rgba(255,255,255,.92) !important; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none !important; }
.brand img { height: 36px; width: auto; display: block; }
.brand-divider { width: 1px; height: 28px; background: var(--line); }
.brand-product { font-weight: 700; color: var(--graphite); font-size: .95rem; letter-spacing: -.01em; }
@media (max-width: 600px) { .brand-divider, .brand-product { display: none; } .brand img { height: 30px; } }

.user-chip { display: flex; align-items: center; gap: 10px; border: 1px solid transparent; background: none; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; color: var(--ink); font: inherit; }
.user-chip:hover { background: #F0F1F2; border-color: var(--line); }
.user-meta { flex-direction: column; align-items: flex-start; line-height: 1.15; }
.user-meta strong { font-size: .85rem; }
.user-meta small { font-size: .72rem; color: var(--muted); }
.menu-header { padding: 10px 16px; display: flex; flex-direction: column; }
.menu-header small { color: var(--muted); }

.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--graphite), #23272A); color: #fff; font-weight: 700; font-size: .8rem; flex-shrink: 0; letter-spacing: .02em; }
.avatar.sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.4rem; background: linear-gradient(135deg, var(--red), var(--red-dark)); }

.sidebar { border-right: 1px solid var(--line) !important; }
.sidebar .mud-drawer-content { display: flex; flex-direction: column; }
.nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #9AA0A4; padding: 14px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--graphite) !important; font-weight: 550; font-size: .9rem; text-decoration: none !important; transition: background .15s; }
.nav-item:hover { background: #F2F3F4; }
.nav-item.active { background: var(--red-soft); color: var(--red) !important; }
.nav-item.active .mud-icon-root { color: var(--red); }
.sidebar-foot { display: flex; gap: 8px; align-items: center; padding: 16px 20px; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--line); }

.page { max-width: 1280px; margin: 0 auto; padding: 28px 32px 64px; }
@media (max-width: 700px) { .page { padding: 20px 16px 48px; } }
.page-loading { display: grid; place-items: center; min-height: 40vh; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin-top: 6px; max-width: 720px; }
.sticky-head { position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: 12px 0; margin-top: -12px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted) !important; margin-bottom: 14px; }
.back-link:hover { color: var(--red) !important; text-decoration: none; }
.unsaved { align-self: center; font-size: .8rem; color: var(--amber); font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.panel h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }

.empty-state { text-align: center; padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); }
.empty-state.full { min-height: 100vh; justify-content: center; }
.empty-state h1, .empty-state h2 { color: var(--ink); }

/* ---------- Estados ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 650; padding: 3px 10px 3px 8px; border-radius: 999px; white-space: nowrap; margin-right: 4px; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pending { background: #EEF0F1; color: #4B5357; }
.status-inprogress { background: var(--amber-soft); color: var(--amber); }
.status-passed { background: var(--green-soft); color: var(--green); }
.status-failed { background: var(--red-soft); color: var(--red); }
.status-expired { background: #F1E8FF; color: #6D28D9; }
.status-overdue { background: var(--red); color: #fff; }

.tag { display: inline-block; font-size: .72rem; font-weight: 650; padding: 3px 9px; border-radius: 6px; background: #F0F1F2; color: var(--graphite); }

.progress { height: 6px; background: #ECEEEF; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent, var(--red)), color-mix(in srgb, var(--accent, var(--red)) 70%, #ff7a50)); border-radius: inherit; transition: width .4s ease; }
.progress.big { height: 10px; margin: 14px 0 6px; }
.progress.ok span { background: var(--green); }
.mini-progress { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.mini-progress .progress { flex: 1; }
.mini-progress small { color: var(--muted); font-variant-numeric: tabular-nums; }

.ring-track { fill: none; stroke: #ECEEEF; stroke-width: 10; }
.ring-value { fill: none; stroke-width: 10; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; transition: stroke-dashoffset .8s ease; }
.ring-text { font-size: 24px; font-weight: 800; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }

.course-icon { display: inline-grid; place-items: center; width: var(--size); height: var(--size); border-radius: calc(var(--size) * .28); flex-shrink: 0;
    background: color-mix(in srgb, var(--accent) 12%, white); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, white); }
.course-icon .mud-icon-root { font-size: calc(var(--size) * .52); }

/* ---------- Inicio ---------- */
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
    background: linear-gradient(120deg, #2B2F32 0%, var(--graphite) 55%, #4A5054 100%); color: #fff; border-radius: 20px; padding: 32px 36px; margin-bottom: 20px; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; background: var(--red); opacity: .9; transform: rotate(28deg); border-radius: 40px; clip-path: polygon(0 40%, 100% 0, 100% 60%, 30% 100%); }
.hero > * { position: relative; z-index: 1; }
@media (max-width: 700px) { .hero { padding: 24px 20px; } .hero::after { width: 180px; height: 180px; right: -70px; top: -70px; } .hero-ring { width: 100%; } }
.hero h1 { color: #fff; font-size: 2rem; margin-bottom: 8px; }
.hero p { color: rgba(255,255,255,.82); max-width: 560px; }
.hero .eyebrow { color: #FF9C9F; }
.hero-ring { display: flex; align-items: center; gap: 16px; background: rgba(255,255,255,.96); color: var(--ink); padding: 14px 22px 14px 14px; border-radius: 18px; box-shadow: var(--shadow-lg); }
.hero-ring strong { display: block; font-size: 1.25rem; }
.hero-ring small { color: var(--muted); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 32px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat strong { display: block; font-size: 1.35rem; line-height: 1.1; }
.stat small { color: var(--muted); font-size: .8rem; }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--red-soft); color: var(--red); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.dark { background: #ECEEEF; color: var(--graphite); }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.group-title { margin: 28px 0 14px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.course-card { position: relative; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 20px 0; color: var(--ink) !important; text-decoration: none !important; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; overflow: hidden; }
.course-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.course-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.course-card h3 { font-size: 1.05rem; line-height: 1.3; }
.course-card p { color: var(--muted); font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .8rem; }
.course-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.course-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.progress-label { font-size: .8rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.course-card .progress { margin: 12px -20px 0; border-radius: 0; height: 5px; }

/* ---------- Detalle de curso ---------- */
.course-hero { display: flex; gap: 22px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; margin-bottom: 20px; box-shadow: var(--shadow-sm); border-top: 5px solid var(--accent); }
.course-hero h1 { margin: 8px 0; }
.course-hero p { color: var(--muted); max-width: 760px; margin-bottom: 12px; }
.legal-basis { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--graphite) !important; background: #F2F3F4; padding: 6px 12px; border-radius: 8px; margin-top: 12px !important; }
@media (max-width: 700px) { .course-hero { flex-direction: column; padding: 20px; } }

.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
.action-panel { position: sticky; top: 84px; }
.action-status { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.exam-facts { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--line); }
.exam-facts li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.exam-facts span { color: var(--muted); }

.syllabus { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.syllabus li a, .syllabus li.exam-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--ink) !important; text-decoration: none !important; font-size: .92rem; }
.syllabus li a:hover { background: #F5F6F7; }
.syllabus li.exam-item { margin-top: 6px; border: 1px dashed var(--line); font-weight: 600; }
.syllabus-num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: #F0F1F2; color: var(--graphite); font-size: .78rem; font-weight: 700; }
.syllabus li.seen .syllabus-num { background: var(--green-soft); color: var(--green); }

.attempts { list-style: none; padding: 0; margin: 8px 0 0; }
.attempts li a { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink) !important; font-size: .875rem; }

/* ---------- Visor de diapositivas ---------- */
.player, .exam { min-height: 100vh; display: flex; flex-direction: column; background: #EEF0F1; }
.player:fullscreen { background: #EEF0F1; }
.player-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.player-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--graphite) !important; }
.player-close:hover { background: #F0F1F2; }
.player-title { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.player-title small { color: var(--muted); font-size: .75rem; }
.player-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-actions { display: flex; gap: 4px; }
.player-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.player-progress span { display: block; height: 100%; background: var(--accent, var(--red)); transition: width .35s ease; }
.player-body { flex: 1; display: flex; }
.player-outline { width: 290px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; overflow-y: auto; max-height: calc(100vh - 130px); position: sticky; top: 61px; }
.player-outline h3 { padding: 0 10px 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.player-outline ol { list-style: none; margin: 0; padding: 0; }
.player-outline button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: .86rem; color: var(--ink); cursor: pointer; }
.player-outline button:hover:not(:disabled) { background: #F3F4F5; }
.player-outline button:disabled { opacity: .45; cursor: not-allowed; }
.player-outline li.active button { background: var(--red-soft); color: var(--red); font-weight: 650; }
.player-outline li.seen .syllabus-num { background: var(--green-soft); color: var(--green); }
@media (max-width: 900px) { .player-outline { position: fixed; inset: 61px auto 0 0; z-index: 9; max-height: none; box-shadow: var(--shadow-lg); } }
.player-stage { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 36px 24px 120px; overflow-y: auto; }
.player-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.player-counter { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* La diapositiva: lienzo 16:9 que crece si el contenido lo necesita */
.slide { width: 100%; max-width: 1040px; min-height: min(585px, 70vh); background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 52px 64px; position: relative; overflow: hidden; animation: slideIn .35s ease; }
.slide::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) { .slide { padding: 28px 22px; border-radius: 14px; } }
.slide h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 750; margin-bottom: 22px; letter-spacing: -.02em; }
.slide-body { font-size: 1.06rem; line-height: 1.7; color: #33393C; }
.slide-body p { margin: 0 0 14px; }
.slide-body ul, .slide-body ol { padding-left: 1.3em; margin: 0 0 14px; }
.slide-body li { margin-bottom: 8px; }
.slide-body li::marker { color: var(--accent); font-weight: 700; }
.slide-body strong { color: var(--ink); }
.slide-body h3 { font-size: 1.15rem; margin: 18px 0 8px; color: var(--ink); }
.slide-body blockquote { margin: 18px 0; padding: 14px 18px; border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, white); border-radius: 0 10px 10px 0; color: var(--ink); }
.slide-body blockquote p:last-child { margin: 0; }
.slide-body table { border-collapse: collapse; width: 100%; margin: 10px 0 16px; font-size: .95rem; }
.slide-body th { background: #F5F6F7; text-align: left; font-weight: 700; }
.slide-body th, .slide-body td { border: 1px solid var(--line); padding: 9px 12px; vertical-align: top; }
.slide-body a { color: var(--accent); text-decoration: underline; }

.slide-cover { min-height: 480px; display: flex; flex-direction: column; justify-content: center; }
.slide-cover::after { content: ""; position: absolute; right: -90px; bottom: -110px; width: 360px; height: 360px; background: var(--accent); opacity: .1; border-radius: 60px; transform: rotate(32deg); }
.slide-cover h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.12; max-width: 760px; }
.slide-cover .slide-body { font-size: 1.15rem; max-width: 680px; color: var(--muted); }
.slide-kicker { font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.slide-cover-img { max-width: 260px; margin-top: 24px; border-radius: 12px; }
.slide-split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 36px; align-items: center; }
.slide-split.reverse { direction: rtl; }
.slide-split.reverse > * { direction: ltr; }
.slide-split img { width: 100%; border-radius: 14px; box-shadow: var(--shadow); }
@media (max-width: 800px) { .slide-split { grid-template-columns: 1fr; } }
.slide-inline-img { max-width: 100%; border-radius: 12px; margin-top: 12px; }
.slide-quote { min-height: 440px; display: flex; flex-direction: column; justify-content: center; max-width: 820px; margin: 0 auto; }
.slide-quote .quote-mark { font-size: 72px !important; color: var(--accent); opacity: .35; }
.slide-quote .slide-body { font-size: clamp(1.25rem, 2.4vw, 1.7rem); line-height: 1.5; color: var(--ink); font-weight: 550; letter-spacing: -.01em; }
.slide-quote cite { display: block; margin-top: 18px; font-style: normal; font-weight: 700; color: var(--accent); }
.slide-keypoints ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; counter-reset: kp; }
.slide-keypoints li { counter-increment: kp; position: relative; background: #F7F8F8; border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 18px 60px; margin: 0; }
.slide-keypoints li::before { content: counter(kp); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 800; font-size: .9rem; }
.slide-video { position: relative; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 18px; }
.slide-video iframe, .slide-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.slide-notes { margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; background: #FAFAFA; }
.slide-notes summary { cursor: pointer; padding: 12px 16px; font-weight: 650; display: flex; gap: 8px; align-items: center; color: var(--graphite); list-style: none; }
.slide-notes > div { padding: 0 16px 14px; font-size: .95rem; color: var(--muted); }

/* ---------- Examen ---------- */
.exam-intro { max-width: 640px; margin: 0 auto; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; min-height: 100vh; justify-content: center; }
.exam-intro .back-link { align-self: flex-start; }
.exam-rules { list-style: none; padding: 0; margin: 16px 0 24px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.exam-rules li { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.exam-rules li:last-child { border: 0; }
.exam-rules .mud-icon-root { color: var(--red); }
.exam-timer { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 6px 14px; border-radius: 999px; background: #F0F1F2; }
.exam-timer.urgent { background: var(--red); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.exam-body { flex: 1; display: grid; grid-template-columns: 1fr 260px; gap: 24px; max-width: 1100px; width: 100%; margin: 0 auto; padding: 32px 24px; align-items: start; }
@media (max-width: 900px) { .exam-body { grid-template-columns: 1fr; } }
.exam-question { background: #fff; border-radius: 18px; padding: 36px 40px; box-shadow: var(--shadow); }
@media (max-width: 700px) { .exam-question { padding: 24px 18px; } }
.exam-question h2 { font-size: 1.35rem; line-height: 1.4; margin-bottom: 6px; }
.options { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 28px; }
.option { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; font: inherit; font-size: 1rem; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.option:hover { border-color: #C9CDD0; background: #FAFAFA; }
.option.selected { border-color: var(--red); background: var(--red-soft); }
.option-letter { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #F0F1F2; font-weight: 800; font-size: .85rem; color: var(--graphite); flex-shrink: 0; }
.option.selected .option-letter { background: var(--red); color: #fff; }
.option-text { flex: 1; }
.option-check { width: 22px; color: var(--red); }
.exam-nav { display: flex; justify-content: space-between; }
.exam-map { background: #fff; border-radius: 18px; padding: 20px; box-shadow: var(--shadow-sm); position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px; }
.exam-map h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.exam-map-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.exam-map-grid button { aspect-ratio: 1; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--graphite); }
.exam-map-grid button.done { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.exam-map-grid button.current { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }

.result { display: flex; gap: 32px; align-items: center; background: #fff; border-radius: 20px; padding: 32px 36px; box-shadow: var(--shadow); margin-bottom: 24px; flex-wrap: wrap; border-top: 5px solid var(--red); }
.result.passed { border-top-color: var(--green); }
.result.passed .eyebrow { color: var(--green); }
.result h1 { margin-bottom: 8px; }
.result p { margin-bottom: 10px; }
.result > div { flex: 1; min-width: 260px; }
.review { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.review > li { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.review > li.ok .review-head .mud-icon-root { color: var(--green); }
.review > li.ko .review-head .mud-icon-root { color: var(--red); }
.review-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.review ul { list-style: none; padding: 0 0 0 30px; margin: 0; }
.review ul li { padding: 5px 10px; border-radius: 6px; font-size: .92rem; color: var(--muted); }
.review ul li.correct { background: var(--green-soft); color: var(--green); font-weight: 600; }
.review ul li.wrong { background: var(--red-soft); color: var(--red); text-decoration: line-through; }
.review ul li.chosen { font-weight: 600; color: var(--ink); }
.review-explain { display: flex; gap: 8px; margin: 10px 0 0 30px !important; padding: 10px 12px; background: #FFFBEB; border-radius: 8px; font-size: .9rem; }

/* ---------- Diplomas ---------- */
.diploma-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.diploma { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.diploma::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--graphite) 0 30%, var(--red) 30%); }
.diploma.expired { opacity: .7; }
.diploma-ribbon { position: absolute; right: 18px; top: 18px; color: var(--red); }
.diploma h3 { font-size: 1.1rem; padding-right: 32px; }
.diploma dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0; }
.diploma dt { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.diploma dd { margin: 0; font-weight: 650; }
.diploma code { align-self: flex-start; }

/* ---------- Back office ---------- */
.kpi-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .kpi-main { grid-column: span 2; } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.kpi small { color: var(--muted); font-size: .8rem; font-weight: 600; }
.kpi strong { font-size: 1.9rem; line-height: 1.15; letter-spacing: -.02em; }
.kpi span { color: var(--muted); font-size: .8rem; }
.kpi.warn strong { color: var(--red); }
.kpi-main { flex-direction: row; align-items: center; gap: 18px; background: linear-gradient(135deg, #fff, #FDF3F3); }
.kpi-main > div { display: flex; flex-direction: column; }

.compliance-list { display: flex; flex-direction: column; }
.compliance-row { display: flex; align-items: center; gap: 16px; padding: 14px 8px; border-bottom: 1px solid var(--line); color: var(--ink) !important; text-decoration: none !important; border-radius: 8px; }
.compliance-row:hover { background: #FAFAFA; }
.compliance-info { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.compliance-pct { font-size: 1.3rem; font-weight: 800; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.stacked-bar { display: flex; height: 8px; border-radius: 999px; background: #ECEEEF; overflow: hidden; }
.stacked-bar .seg { height: 100%; }
.seg.passed, .legend i.passed { background: var(--green); }
.seg.progress, .legend i.progress { background: #F59E0B; }
.seg.failed, .legend i.failed { background: var(--red); }
.legend i.pending { background: #CDD1D4; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.filter-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-tabs > button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--graphite); cursor: pointer; }
.filter-tabs > button span { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: #F0F1F2; font-size: .75rem; }
.filter-tabs > button.active { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.filter-tabs > button.active span { background: rgba(255,255,255,.2); }

.data-table { border: 1px solid var(--line); border-radius: var(--radius) !important; overflow: hidden; background: #fff !important; }
.data-table .mud-table-head .mud-table-cell { background: #FAFAFA; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.data-table .mud-table-cell { border-bottom-color: #EEF0F1; }
.data-table tr.clickable { cursor: pointer; }
.person { display: flex; gap: 12px; align-items: center; color: var(--ink) !important; text-decoration: none !important; }
.person > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.person small { color: var(--muted); font-size: .78rem; }

.profile { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; }
.profile p { margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Editor */
.editor-tabs .mud-tabs-tabbar { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 800px) { .form-grid, .form-grid.three { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.mono textarea { font-family: "Cascadia Code", Consolas, monospace !important; font-size: .88rem !important; }
.appearance { grid-column: span 2; }
.appearance label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.color-input { width: 48px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: #fff; cursor: pointer; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-picker button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--graphite); }
.icon-picker button.selected { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.file-button { display: inline-flex !important; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }

.slide-editor { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .slide-editor { grid-template-columns: 1fr; } }
.slide-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 150px; max-height: calc(100vh - 170px); overflow-y: auto; }
.slide-list-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.slide-list-item:hover { background: #F5F6F7; }
.slide-list-item.active { background: var(--red-soft); }
.slide-list-item.active .syllabus-num { background: var(--red); color: #fff; }
.slide-list-title { flex: 1; min-width: 0; font-size: .86rem; font-weight: 600; display: flex; flex-direction: column; }
.slide-list-title small { color: var(--muted); font-weight: 500; font-size: .74rem; }
.slide-list-actions { display: flex; opacity: 0; transition: opacity .15s; }
.slide-list-item:hover .slide-list-actions, .slide-list-item.active .slide-list-actions { opacity: 1; }
.slide-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.preview-title { margin: 22px 0 12px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.slide-preview { background: #EEF0F1; border-radius: 14px; padding: 24px; }
.slide-preview .slide { min-height: 360px; padding: 36px 40px; box-shadow: var(--shadow); }
.slide-preview .slide-cover { min-height: 300px; }

.question-editor { padding: 18px 20px; }
.question-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.option-editor { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.option-row { display: flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 10px; }
.option-row.correct { background: var(--green-soft); }

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-hero { display: none !important; } }
.login-hero { position: relative; overflow: hidden; background: linear-gradient(150deg, #23272A, var(--graphite) 60%, #474D51); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.login-hero-shape { position: absolute; right: -140px; top: 50%; width: 520px; height: 520px; transform: translateY(-50%) rotate(30deg); }
.login-hero-shape::before, .login-hero-shape::after { content: ""; position: absolute; left: 0; right: 0; height: 46%; border-radius: 48px; }
.login-hero-shape::before { top: 0; background: linear-gradient(135deg, #8A8F93, #5E6367); clip-path: polygon(0 55%, 100% 0, 100% 45%, 28% 100%); opacity: .55; }
.login-hero-shape::after { bottom: 0; background: linear-gradient(135deg, var(--red), var(--red-dark)); clip-path: polygon(0 0, 72% 0, 100% 45%, 0 100%); opacity: .95; }
.login-hero-content { position: relative; z-index: 1; max-width: 440px; }
.login-hero .eyebrow { color: #FF9C9F; }
.login-hero h2 { color: #fff; font-size: 2.6rem; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 28px; }
.login-hero ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.login-hero li { display: flex; gap: 14px; align-items: center; color: rgba(255,255,255,.88); }
.login-hero li .mud-icon-root { background: rgba(255,255,255,.1); border-radius: 10px; padding: 8px; box-sizing: content-box; }
.login-hero-foot { position: absolute; bottom: 24px; left: 56px; color: rgba(255,255,255,.5); z-index: 1; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.login-card { width: 100%; max-width: 400px; }
.login-logo { height: 64px; width: auto; margin-bottom: 40px; }
.login-card h1 { font-size: 1.9rem; margin-bottom: 6px; }
.login-card > p.muted { margin-bottom: 28px; }
.ms-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 13px 18px; border-radius: 10px; border: 1px solid #C9CDD0; background: #fff; color: var(--ink) !important; font-weight: 650; font-size: .98rem; text-decoration: none !important; transition: background .15s, box-shadow .15s; }
.ms-button:hover { background: #F7F8F8; box-shadow: var(--shadow); }
.dev-users { display: flex; flex-direction: column; gap: 8px; }
.dev-user { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink) !important; text-decoration: none !important; transition: border-color .15s, background .15s; }
.dev-user:hover { border-color: var(--red); background: var(--red-soft); }
.dev-user > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.dev-user small { color: var(--muted); font-size: .8rem; }
.login-legal { margin-top: 32px !important; font-size: .78rem; color: var(--muted); line-height: 1.5; }

/* ---------- Verificación y páginas públicas ---------- */
.verify { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 48px 20px; gap: 28px; }
.verify-logo { height: 56px; }
.verify-card { width: 100%; max-width: 560px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.verify-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.verify-form { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.verify-result { display: flex; gap: 16px; margin-top: 22px; padding: 18px; border-radius: 14px; background: var(--green-soft); color: var(--green); }
.verify-result.expired { background: var(--amber-soft); color: var(--amber); }
.verify-result dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 10px 0 0; color: var(--ink); }
.verify-result dt { color: var(--muted); font-size: .85rem; }
.verify-result dd { margin: 0; font-weight: 600; }
.doc-page { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; background: #fff; min-height: 100vh; }
.doc-page h1 { margin-bottom: 4px; }
.doc-page h2 { margin: 28px 0 8px; }
.doc-page p, .doc-page li { line-height: 1.65; color: #33393C; }

/* Blazor */
#blazor-error-ui { background: #FFF4DA; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: var(--red); padding: 1rem; color: white; border-radius: 8px; }
.blazor-error-boundary::after { content: "Se ha producido un error."; }
