/* =====================================================================
   CAPACÍTATE · Design system (sobre Bootstrap 5.3)
   Paleta: azul marino · blanco · verde esmeralda · cian
   Mobile-first · modo claro / oscuro (data-bs-theme)
   ===================================================================== */

:root {
  --cp-navy-950: #061426;
  --cp-navy-900: #0b1f3a;
  --cp-navy-800: #12305a;
  --cp-navy-700: #1b4079;
  --cp-emerald: #10b981;
  --cp-emerald-600: #059669;
  --cp-cyan: #0ea5e9;
  --cp-amber: #f59e0b;
  --cp-rose: #f43f5e;

  --cp-bg: #f4f7fb;
  --cp-surface: #ffffff;
  --cp-surface-2: #f8fafc;
  --cp-border: #e5eaf2;
  --cp-text: #0f172a;
  --cp-muted: #64748b;
  --cp-sidebar: #ffffff;
  --cp-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --cp-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --cp-shadow-lg: 0 20px 45px -20px rgba(11, 31, 58, .35);
  --cp-radius: 16px;
  --cp-radius-sm: 10px;
  --cp-sidebar-w: 264px;
  --cp-topbar-h: 64px;
  --cp-bottomnav-h: 66px;

  --bs-primary: var(--cp-navy-800);
  --bs-primary-rgb: 18, 48, 90;
  --bs-success: var(--cp-emerald);
  --bs-success-rgb: 16, 185, 129;
  --bs-info: var(--cp-cyan);
  --bs-info-rgb: 14, 165, 233;
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-bg: var(--cp-bg);
  --bs-body-color: var(--cp-text);
  --bs-border-color: var(--cp-border);
  --bs-link-color: var(--cp-navy-700);
  --bs-link-color-rgb: 27, 64, 121;
  --bs-link-hover-color: var(--cp-emerald-600);
}

[data-bs-theme="dark"] {
  --cp-bg: #07111f;
  --cp-surface: #0d1b2e;
  --cp-surface-2: #10223a;
  --cp-border: #1c2f4a;
  --cp-text: #e2e8f0;
  --cp-muted: #94a3b8;
  --cp-sidebar: #050d19;
  --cp-shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --bs-body-bg: var(--cp-bg);
  --bs-body-color: var(--cp-text);
  --bs-border-color: var(--cp-border);
  --bs-link-color: #7dd3fc;
  --bs-link-color-rgb: 125, 211, 252;
  --bs-secondary-color: var(--cp-muted);
  --bs-tertiary-bg: var(--cp-surface-2);
}

html { -webkit-text-size-adjust: 100%; }
body { background: var(--cp-bg); color: var(--cp-text); font-size: .9375rem; word-spacing: .04em; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; letter-spacing: -.02em; color: var(--cp-text); }
.text-muted, .text-secondary { color: var(--cp-muted) !important; }
a { text-decoration: none; }
::selection { background: rgba(16, 185, 129, .25); }

/* ---------- Botones ---------- */
.btn { border-radius: 12px; font-weight: 600; padding: .6rem 1.1rem; transition: all .18s ease; }
.btn-sm { border-radius: 9px; padding: .38rem .75rem; font-size: .82rem; }
.btn-lg { border-radius: 14px; padding: .8rem 1.4rem; }
.btn-primary { --bs-btn-bg: var(--cp-navy-800); --bs-btn-border-color: var(--cp-navy-800); --bs-btn-hover-bg: var(--cp-navy-700); --bs-btn-hover-border-color: var(--cp-navy-700); --bs-btn-active-bg: var(--cp-navy-900); --bs-btn-disabled-bg: var(--cp-navy-800); }
[data-bs-theme="dark"] .btn-primary { --bs-btn-bg: #1d4ed8; --bs-btn-border-color: #1d4ed8; --bs-btn-hover-bg: #2563eb; --bs-btn-hover-border-color: #2563eb; }
.btn-success, .btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--cp-emerald); --bs-btn-border-color: var(--cp-emerald); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--cp-emerald-600); --bs-btn-hover-border-color: var(--cp-emerald-600); --bs-btn-active-bg: #047857; --bs-btn-disabled-bg: var(--cp-emerald); --bs-btn-disabled-border-color: var(--cp-emerald); }
.btn-accent { box-shadow: 0 8px 20px -8px rgba(16, 185, 129, .6); }
.btn-soft { background: var(--cp-surface-2); border: 1px solid var(--cp-border); color: var(--cp-text); }
.btn-soft:hover { background: var(--cp-border); color: var(--cp-text); }
.btn-icon { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }

/* ---------- Formularios ---------- */
.form-control, .form-select { border-radius: 12px; padding: .65rem .9rem; border-color: var(--cp-border); background-color: var(--cp-surface); color: var(--cp-text); font-size: .9375rem; }
.form-control:focus, .form-select:focus { border-color: var(--cp-cyan); box-shadow: 0 0 0 4px rgba(14, 165, 233, .15); background-color: var(--cp-surface); color: var(--cp-text); }
.form-label { font-weight: 600; font-size: .83rem; margin-bottom: .35rem; color: var(--cp-text); }
.form-text { color: var(--cp-muted); }
.input-group-text { border-radius: 12px; background: var(--cp-surface-2); border-color: var(--cp-border); color: var(--cp-muted); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--cp-muted); pointer-events: none; }
.input-icon > .form-control, .input-icon > .form-select { padding-left: 2.6rem; }
.input-icon .toggle-pass { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--cp-muted); padding: .35rem .5rem; }
.form-check-input:checked { background-color: var(--cp-emerald); border-color: var(--cp-emerald); }
.is-invalid { border-color: var(--cp-rose) !important; }

/* ---------- Tarjetas ---------- */
.card { border: 1px solid var(--cp-border); border-radius: var(--cp-radius); background: var(--cp-surface); box-shadow: var(--cp-shadow-sm); color: var(--cp-text); }
.card-header { background: transparent; border-bottom: 1px solid var(--cp-border); padding: 1rem 1.25rem; font-weight: 700; }
.card-body { padding: 1.25rem; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--cp-shadow); border-color: rgba(14, 165, 233, .35); }

/* ---------- Badges ---------- */
.badge { font-weight: 600; border-radius: 8px; padding: .38em .65em; }
.badge-soft-success { background: rgba(16, 185, 129, .12); color: #047857; }
.badge-soft-warning { background: rgba(245, 158, 11, .15); color: #b45309; }
.badge-soft-danger { background: rgba(244, 63, 94, .12); color: #be123c; }
.badge-soft-secondary { background: rgba(100, 116, 139, .12); color: #475569; }
.badge-soft-info { background: rgba(14, 165, 233, .12); color: #0369a1; }
.badge-soft-primary { background: rgba(27, 64, 121, .1); color: var(--cp-navy-700); }
.badge-soft-dark { background: rgba(15, 23, 42, .1); color: #334155; }
[data-bs-theme="dark"] .badge-soft-success { color: #34d399; }
[data-bs-theme="dark"] .badge-soft-warning { color: #fbbf24; }
[data-bs-theme="dark"] .badge-soft-danger { color: #fb7185; }
[data-bs-theme="dark"] .badge-soft-secondary, [data-bs-theme="dark"] .badge-soft-dark { color: #cbd5e1; background: rgba(148, 163, 184, .14); }
[data-bs-theme="dark"] .badge-soft-info { color: #7dd3fc; }
[data-bs-theme="dark"] .badge-soft-primary { color: #93c5fd; background: rgba(147, 197, 253, .12); }

/* =====================================================================
   LAYOUT APP
   ===================================================================== */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--cp-sidebar-w); z-index: 1040;
  background: var(--cp-sidebar); color: #475569; display: flex; flex-direction: column;
  border-right: 1px solid var(--cp-border);
}
.sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: 1.25rem 1.35rem; color: var(--cp-navy-900); }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--cp-emerald), var(--cp-cyan)); box-shadow: 0 8px 20px -8px rgba(16, 185, 129, .8); font-size: 1.15rem; }
.brand-name { font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; line-height: 1.1; }
.brand-sub { font-size: .7rem; color: #94a3b8; font-weight: 500; letter-spacing: .02em; }
.sidebar-nav { padding: .5rem .85rem; overflow-y: auto; flex: 1; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #94a3b8; font-weight: 700; padding: 1rem .75rem .45rem; }
.sidebar-link { display: flex; align-items: center; gap: .8rem; padding: .66rem .8rem; border-radius: 11px; color: #475569; font-weight: 500; font-size: .9rem; margin-bottom: 2px; transition: all .15s; }
.sidebar-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; opacity: .85; }
.sidebar-link:hover { background: var(--cp-surface-2); color: var(--cp-navy-900); }
.sidebar-link.active { background: rgba(16, 185, 129, .1); color: var(--cp-navy-900); font-weight: 600; box-shadow: inset 3px 0 0 var(--cp-emerald); }
.sidebar-link.active i { color: var(--cp-emerald-600); opacity: 1; }
.sidebar-link .count { margin-left: auto; background: var(--cp-amber); color: #111; font-size: .7rem; font-weight: 700; border-radius: 99px; padding: .1rem .5rem; }
.sidebar-user { margin: .85rem; padding: .8rem; border-radius: 14px; background: var(--cp-surface-2); border: 1px solid var(--cp-border); display: flex; align-items: center; gap: .7rem; }
.sidebar-user .name { color: var(--cp-text); font-weight: 600; font-size: .86rem; line-height: 1.2; }
.sidebar-user .role { color: var(--cp-muted); font-size: .74rem; }

.avatar { width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cp-navy-700), var(--cp-cyan)); }
.avatar-sm { width: 32px; height: 32px; border-radius: 10px; font-size: .75rem; }
.avatar-lg { width: 72px; height: 72px; border-radius: 20px; font-size: 1.5rem; }

.main { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; height: var(--cp-topbar-h); display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
  background: color-mix(in srgb, var(--cp-bg) 82%, transparent); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--cp-border); }
.topbar .page-title { font-weight: 700; font-size: 1.05rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 1.1rem 1rem calc(var(--cp-bottomnav-h) + 1.5rem); flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; }

@media (min-width: 992px) {
  .main { margin-left: var(--cp-sidebar-w); }
  .topbar { padding: 0 2rem; }
  .content { padding: 1.75rem 2rem 2.5rem; }
}
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.show { transform: none; box-shadow: var(--cp-shadow-lg); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 1035; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
}

/* ---------- Navegación inferior móvil ---------- */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; height: calc(var(--cp-bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--cp-surface); border-top: 1px solid var(--cp-border); box-shadow: 0 -6px 24px -12px rgba(15, 23, 42, .18); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--cp-muted); font-size: .68rem; font-weight: 600; position: relative; }
.bottom-nav a i { font-size: 1.25rem; transition: transform .15s; }
.bottom-nav a.active { color: var(--cp-emerald-600); }
.bottom-nav a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--cp-emerald); }
.bottom-nav a.active i { transform: translateY(-1px); }
[data-bs-theme="dark"] .bottom-nav a.active { color: #34d399; }
@media (min-width: 992px) { .bottom-nav { display: none; } }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.4rem; margin: 0; }
.page-head p { margin: .2rem 0 0; color: var(--cp-muted); }
@media (min-width: 768px) { .page-head h1 { font-size: 1.65rem; } }

/* ---------- KPI ---------- */
.kpi { position: relative; overflow: hidden; }
.kpi .kpi-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.25rem; }
.kpi .kpi-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-top: .9rem; }
.kpi .kpi-label { color: var(--cp-muted); font-size: .82rem; font-weight: 500; margin-top: .35rem; }
.kpi .kpi-foot { font-size: .75rem; margin-top: .6rem; color: var(--cp-muted); }
@media (max-width: 575.98px) {
  .kpi .card-body { padding: 1rem; }
  .kpi .kpi-icon { width: 38px; height: 38px; font-size: 1.1rem; }
  .kpi .kpi-value { font-size: 1.45rem; margin-top: .7rem; }
}
.tone-navy { background: rgba(27, 64, 121, .1); color: var(--cp-navy-700); }
.tone-emerald { background: rgba(16, 185, 129, .12); color: var(--cp-emerald-600); }
.tone-cyan { background: rgba(14, 165, 233, .12); color: #0284c7; }
.tone-amber { background: rgba(245, 158, 11, .14); color: #d97706; }
.tone-rose { background: rgba(244, 63, 94, .12); color: #e11d48; }
[data-bs-theme="dark"] .tone-navy { background: rgba(147, 197, 253, .12); color: #93c5fd; }

/* ---------- Progreso ---------- */
.progress { height: 8px; border-radius: 99px; background: var(--cp-surface-2); overflow: hidden; }
[data-bs-theme="dark"] .progress { background: #16294a; }
.progress-bar { background: linear-gradient(90deg, var(--cp-emerald), var(--cp-cyan)); border-radius: 99px; }
.progress-thin { height: 5px; }
.ring { --p: 0; --size: 64px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: conic-gradient(var(--cp-emerald) calc(var(--p) * 1%), var(--cp-surface-2) 0); }
.ring::before { content: attr(data-label); width: calc(var(--size) - 12px); height: calc(var(--size) - 12px); border-radius: 50%; background: var(--cp-surface); color: var(--cp-text); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.hero .ring { background: conic-gradient(var(--cp-emerald) calc(var(--p) * 1%), rgba(255,255,255,.14) 0); }
.hero .ring::before { background: var(--cp-navy-800); color: #fff; font-size: 1.5rem; }

/* ---------- Tablas ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--cp-text); margin: 0; }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--cp-border); vertical-align: middle; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--cp-muted); font-weight: 700; background: var(--cp-surface-2); border-bottom: 1px solid var(--cp-border); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: var(--cp-surface-2); --bs-table-bg-state: var(--cp-surface-2); }
.table-card { border-radius: var(--cp-radius); overflow: hidden; }
.sort-th { cursor: pointer; user-select: none; }
.sort-th::after { content: "\2195"; opacity: .35; margin-left: .3rem; font-size: .7rem; }
.sort-th.asc::after { content: "\2191"; opacity: 1; }
.sort-th.desc::after { content: "\2193"; opacity: 1; }

/* Tablas → tarjetas en móvil */
@media (max-width: 767.98px) {
  .table-stack, .table-stack tbody { display: block; width: 100%; }
  .table-stack thead { display: none; }
  .table-stack tbody td:not([data-label]):not(.td-main) { justify-content: flex-end; }
  .table-stack tbody td:not([data-label]):not(.td-main)::before { display: none; }
  .table-stack tbody td > .d-flex { flex: 0 0 55%; }
  .table-stack tbody td form { display: inline; }
  .table-stack tbody tr { display: block; padding: .85rem 1rem; border-bottom: 1px solid var(--cp-border); }
  .table-stack tbody td { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0 !important; border: 0 !important; text-align: right; }
  .table-stack tbody td::before { content: attr(data-label); font-weight: 600; color: var(--cp-muted); font-size: .78rem; text-align: left; }
  .table-stack tbody td.td-main { display: block; text-align: left; padding-bottom: .5rem !important; }
  .table-stack tbody td.td-main::before { display: none; }
}

/* ---------- Filtros / chips ---------- */
.chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .95rem; border-radius: 99px; border: 1px solid var(--cp-border); background: var(--cp-surface); color: var(--cp-text); font-weight: 600; font-size: .83rem; transition: all .15s; }
.chip:hover { border-color: var(--cp-cyan); color: var(--cp-text); }
.chip.active { background: var(--cp-navy-800); border-color: var(--cp-navy-800); color: #fff; }
[data-bs-theme="dark"] .chip.active { background: #1d4ed8; border-color: #1d4ed8; }

/* ---------- Tarjetas de curso ---------- */
.course-card { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.course-cover { position: relative; aspect-ratio: 16 / 8.5; background: var(--c, var(--cp-navy-800)); overflow: hidden; display: flex; align-items: flex-end; padding: 1rem; color: #fff; }
.course-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.course-cover.generated { background: linear-gradient(135deg, var(--cp-navy-900) 0%, color-mix(in srgb, var(--c) 70%, var(--cp-navy-900)) 100%); }
.course-cover.generated::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at var(--gx, 85%) var(--gy, 20%), color-mix(in srgb, var(--c) 55%, transparent) 0, transparent 45%),
  repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 2px, transparent 2px 14px); }
.course-cover .cover-icon { position: absolute; right: 1rem; top: .85rem; font-size: 2.6rem; opacity: .9; }
.course-cover .cover-cat { position: relative; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: rgba(255,255,255,.16); backdrop-filter: blur(6px); padding: .3rem .6rem; border-radius: 8px; }
.course-card .card-body { display: flex; flex-direction: column; flex: 1; }
.course-card h3 { font-size: 1.02rem; line-height: 1.35; margin-bottom: .4rem; }
.course-meta { display: flex; flex-wrap: wrap; gap: .85rem; font-size: .78rem; color: var(--cp-muted); }
.course-meta i { margin-right: .25rem; }
.course-card .enrolled-flag { position: absolute; left: 1rem; top: .9rem; background: var(--cp-emerald); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 8px; padding: .25rem .55rem; }

/* ---------- Hero / bienvenida ---------- */
.hero { border-radius: 22px; padding: 1.5rem; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--cp-navy-900), var(--cp-navy-700) 60%, #0e7490); }
.hero::after { content: ""; position: absolute; width: 340px; height: 340px; right: -80px; top: -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, .45), transparent 65%); }
.hero h1, .hero h2 { color: #fff; }
.hero p { color: #cbd5e1; }
.hero > * { position: relative; z-index: 1; }
@media (min-width: 768px) { .hero { padding: 2rem 2.25rem; } }

/* =====================================================================
   AULA VIRTUAL (LMS Player)
   ===================================================================== */
.player-wrap { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 1200px) { .player-wrap { grid-template-columns: minmax(0, 1fr) 360px; } }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--cp-radius); overflow: hidden; box-shadow: var(--cp-shadow); }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 767.98px) {
  .player-bleed { margin-left: -1rem; margin-right: -1rem; margin-top: -1.1rem; }
  .player-bleed .video-frame { border-radius: 0; }
}
.lesson-body { font-size: 1rem; line-height: 1.75; }
.lesson-body h3 { font-size: 1.15rem; margin-top: 1.4rem; }
.lesson-body ul { padding-left: 1.2rem; }
.lesson-body li { margin-bottom: .4rem; }
.lesson-body li::marker { color: var(--cp-emerald); }
.lesson-body code { background: var(--cp-surface-2); padding: .1rem .35rem; border-radius: 6px; color: var(--cp-navy-700); }
[data-bs-theme="dark"] .lesson-body code { color: #7dd3fc; }
.curriculum { max-height: calc(100vh - 180px); overflow-y: auto; }
.curr-module { border-bottom: 1px solid var(--cp-border); }
.curr-module-title { padding: .85rem 1rem; font-weight: 700; font-size: .84rem; background: var(--cp-surface-2); display: flex; justify-content: space-between; gap: .5rem; }
.curr-item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; color: var(--cp-text); font-size: .87rem; border-left: 3px solid transparent; transition: background .15s; }
.curr-item:hover { background: var(--cp-surface-2); color: var(--cp-text); }
.curr-item.current { background: rgba(14, 165, 233, .08); border-left-color: var(--cp-cyan); font-weight: 600; }
.curr-item .state { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; flex-shrink: 0; border: 2px solid var(--cp-border); color: var(--cp-muted); }
.curr-item.done .state { background: var(--cp-emerald); border-color: var(--cp-emerald); color: #fff; }
.curr-item.locked { opacity: .55; }
.curr-item .meta { font-size: .72rem; color: var(--cp-muted); }
.lesson-nav { position: sticky; bottom: calc(var(--cp-bottomnav-h) + .5rem); z-index: 10; }
@media (min-width: 992px) { .lesson-nav { position: static; } }

/* Quiz */
.quiz-q { border: 1px solid var(--cp-border); border-radius: var(--cp-radius); padding: 1.1rem; background: var(--cp-surface); margin-bottom: 1rem; }
.quiz-q .q-num { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--cp-cyan); }
.quiz-opt { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; border: 1.5px solid var(--cp-border); border-radius: 12px; margin-top: .6rem; cursor: pointer; transition: all .15s; font-weight: 500; }
.quiz-opt:hover { border-color: var(--cp-cyan); }
.quiz-opt input { accent-color: var(--cp-emerald); width: 18px; height: 18px; flex-shrink: 0; }
.quiz-opt:has(input:checked) { border-color: var(--cp-emerald); background: rgba(16, 185, 129, .07); }
.quiz-opt.correct { border-color: var(--cp-emerald); background: rgba(16, 185, 129, .12); }
.quiz-opt.wrong { border-color: var(--cp-rose); background: rgba(244, 63, 94, .08); }

/* =====================================================================
   AUTH
   ===================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 1.05fr 1fr; } }
.auth-aside { display: none; position: relative; overflow: hidden; color: #fff; padding: 3rem;
  background: linear-gradient(150deg, var(--cp-navy-950), var(--cp-navy-800) 55%, #0b5e6e); }
.auth-aside::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent); }
.auth-aside::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(16,185,129,.45), transparent 65%); }
.auth-aside > * { position: relative; z-index: 1; }
@media (min-width: 992px) { .auth-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-aside h2 { color: #fff; font-size: 2.3rem; line-height: 1.15; font-weight: 800; }
.auth-aside .lead { color: #cbd5e1; }
.auth-feature { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; }
.auth-feature i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #34d399; font-size: 1.15rem; flex-shrink: 0; }
.auth-feature strong { display: block; color: #fff; }
.auth-feature span { color: #94a3b8; font-size: .88rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 1.5rem 1.1rem 2.5rem; background: var(--cp-surface); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 560px; }
.auth-mobile-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.75rem; }
@media (min-width: 992px) { .auth-mobile-brand { display: none; } }
.auth-card h1 { font-size: 1.65rem; }
.theme-float { position: fixed; top: 1rem; right: 1rem; z-index: 50; }
.divider-text { display: flex; align-items: center; gap: .75rem; color: var(--cp-muted); font-size: .8rem; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--cp-border); }
.strength { height: 4px; border-radius: 99px; background: var(--cp-border); overflow: hidden; margin-top: .45rem; }
.strength > span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* ---------- Verificación ---------- */
.verify-card { max-width: 620px; margin: 0 auto; }
.seal { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem; margin: 0 auto; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--cp-muted); }
.empty i { font-size: 2.6rem; display: block; margin-bottom: .75rem; color: var(--cp-cyan); opacity: .7; }

/* ---------- Editor de curso ---------- */
.builder-module { border: 1px solid var(--cp-border); border-radius: var(--cp-radius); background: var(--cp-surface); margin-bottom: 1rem; overflow: hidden; }
.builder-module-head { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; background: var(--cp-surface-2); border-bottom: 1px solid var(--cp-border); }
.builder-item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px dashed var(--cp-border); }
.builder-item:last-child { border-bottom: 0; }
.type-dot { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }

/* ---------- Utilidades ---------- */
.fw-800 { font-weight: 800; }
.small-caps { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--cp-muted); }
.text-emerald { color: var(--cp-emerald-600) !important; }
.text-navy { color: var(--cp-navy-800) !important; }
[data-bs-theme="dark"] .text-navy { color: #93c5fd !important; }
.bg-surface { background: var(--cp-surface) !important; }
.min-w-0 { min-width: 0; }
.chart-box { position: relative; height: 260px; }
@media (min-width: 768px) { .chart-box { height: 300px; } }
.dropdown-menu { border-radius: 14px; border-color: var(--cp-border); box-shadow: var(--cp-shadow); padding: .4rem; background: var(--cp-surface); }
.dropdown-item { border-radius: 9px; padding: .5rem .75rem; font-size: .88rem; color: var(--cp-text); }
.dropdown-item:hover { background: var(--cp-surface-2); color: var(--cp-text); }
.modal-content { border-radius: 20px; border: 0; background: var(--cp-surface); color: var(--cp-text); }
.modal-header, .modal-footer { border-color: var(--cp-border); }
.nav-tabs-clean { border-bottom: 1px solid var(--cp-border); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; }
.nav-tabs-clean .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--cp-muted); font-weight: 600; padding: .7rem .9rem; white-space: nowrap; background: none; }
.nav-tabs-clean .nav-link.active { color: var(--cp-text); border-bottom-color: var(--cp-emerald); background: none; }
.swal2-popup { border-radius: 20px !important; font-family: var(--bs-body-font-family) !important; }
[data-bs-theme="dark"] .swal2-popup { background: var(--cp-surface) !important; color: var(--cp-text) !important; }
[data-bs-theme="dark"] .swal2-title, [data-bs-theme="dark"] .swal2-html-container { color: var(--cp-text) !important; }
.fade-in { animation: fadeIn .35s ease backwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.opt-row:has(input[type=radio]:checked) .form-control, .opt-row:has(input[type=radio]:checked) .input-group-text { border-color: var(--cp-emerald); background: rgba(16, 185, 129, .07); }
.table-sm > :not(caption) > * > * { padding: .5rem .55rem; }
