/* ============================================================
   Academia Dr. Dam — Portal de alumnos
   Tokens de marca heredados de landing-academia
   ============================================================ */

:root {
  --navy: #0B1F3D;
  --navy-soft: #142A4F;
  --navy-deep: #071630;
  --cyan: #00B8D4;
  --cyan-hover: #009DB5;
  --cyan-soft: rgba(0, 184, 212, 0.12);
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --text: #0B1F3D;
  --text-muted: #5A6B82;
  --border: #E5EAF0;
  --success: #15803D;
  --success-soft: #DCFCE7;
  --danger: #B91C1C;
  --danger-soft: #FEE2E2;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(11, 31, 61, 0.05), 0 8px 24px rgba(11, 31, 61, 0.06);
  --shadow-pop: 0 12px 40px rgba(11, 31, 61, 0.14);
}

/* ============================================================
   TEMA MENOPAUSIA — burgundy + estilo Apple Health
   Hereda el layout del portal; solo redefine los tokens y
   añade toques (tipografía editorial, hero degradado, radios
   más suaves) para que se sienta como la plataforma del curso.
   ============================================================ */
.theme-meno {
  --navy: #592F4E;
  --navy-soft: #7A4669;
  --navy-deep: #3D1F35;
  --cyan: #A87490;
  --cyan-hover: #7A4669;
  --cyan-soft: rgba(168, 116, 144, 0.16);
  --bg: #FAF7FB;
  --surface: #FFFFFF;
  --text: #1A0F18;
  --text-muted: #8A6E80;
  --border: #ECE0EA;
  --radius: 22px;
  --radius-sm: 13px;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}
.theme-meno .serif { font-family: 'Instrument Serif', Georgia, serif; }
.theme-meno .btn-primary { color: #fff; }
.theme-meno .topnav .brand-mark .monogram {
  background: linear-gradient(135deg, #A87490, #592F4E);
  border-color: transparent;
  color: #fff;
}
/* Hero del curso como degradado burgundy (Apple Health vibe) */
.theme-meno .course-hero {
  background: linear-gradient(135deg, #C9A0B5 0%, #A87490 32%, #7A4669 64%, #592F4E 100%);
  border-color: transparent;
  color: #fff;
}
.theme-meno .course-hero h1 { color: #fff; }
.theme-meno .course-hero .course-hero-kicker { color: rgba(255, 255, 255, 0.85); }
.theme-meno .course-hero .course-hero-desc { color: rgba(255, 255, 255, 0.9); }
.theme-meno .course-hero-stat-label { color: rgba(255, 255, 255, 0.85); }
.theme-meno .ring {
  background:
    radial-gradient(closest-side, #592F4E 72%, transparent 73% 100%),
    conic-gradient(#F5D9E5 calc(var(--pct) * 1%), rgba(255,255,255,0.25) 0);
  color: #fff;
}
.theme-meno .week-num { background: var(--cyan-soft); color: var(--navy); }
.theme-meno .unit-head h2 { color: var(--navy); }
.theme-meno .comp-dashboard {
  background:
    radial-gradient(520px 200px at 100% 0%, rgba(168, 116, 144, 0.14), transparent 60%),
    var(--surface);
  border-color: rgba(168, 116, 144, 0.4);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
}

.serif { font-family: Georgia, 'Times New Roman', serif; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 24px;
  transition: background 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary { background: var(--cyan); color: var(--navy-deep); }
.btn-primary:hover { background: var(--cyan-hover); }

.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-soft); }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--navy); }

.btn-block { width: 100%; }

/* ============================================================
   LOGIN
   ============================================================ */

.login-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100dvh;
}

.login-brand {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(0, 184, 212, 0.22), transparent 60%),
    linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  position: relative;
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.brand-mark .monogram {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--navy-soft);
  border: 1px solid rgba(0, 184, 212, 0.45);
  color: var(--cyan);
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  flex: none;
}

.login-brand h1 {
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  max-width: 14ch;
  position: relative;
  z-index: 1;
}

.login-brand h1 em {
  font-style: italic;
  font-family: Georgia, serif;
  font-weight: 600;
  color: var(--cyan);
}

.login-brand .brand-sub {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  max-width: 38ch;
  position: relative;
  z-index: 1;
}

.login-brand .brand-foot {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 1;
}

.login-form-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.login-card { width: 100%; max-width: 400px; }

.login-card h2 {
  font-size: 26px;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.login-card .lead {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 30px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder { color: #9AA7B8; }

.field input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.form-error {
  display: none;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}
.form-error.visible { display: block; }

.login-help {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-muted);
}
.login-help a { color: var(--cyan-hover); font-weight: 600; }

.demo-hint {
  margin-top: 14px;
  background: var(--cyan-soft);
  border: 1px dashed rgba(0, 184, 212, 0.5);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--navy);
}
.demo-hint code {
  background: rgba(255, 255, 255, 0.8);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12.5px;
}

/* ============================================================
   PORTAL (nav + layout)
   ============================================================ */

.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topnav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topnav .brand-mark { color: var(--navy); font-size: 16px; }
.topnav .brand-mark .monogram {
  background: var(--navy);
  border-color: var(--navy);
}

.topnav-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.user-chip .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--cyan);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.btn-logout:hover { background: var(--bg); color: var(--text); }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-head { margin-bottom: 28px; }
.page-head h1 {
  font-size: 28px;
  letter-spacing: -0.02em;
}
.page-head p { color: var(--text-muted); margin-top: 4px; font-size: 15px; }

.section-title {
  font-size: 19px;
  letter-spacing: -0.01em;
  margin: 44px 0 16px;
}

/* ---------- Tarjetas de curso ---------- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.course-card:hover {
  box-shadow: var(--shadow-pop);
  transform: translateY(-3px);
}

.course-cover {
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  color: #fff;
  overflow: hidden;
}

.course-cover .cover-kicker {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.cover-diplomado {
  background:
    radial-gradient(620px 300px at 90% -20%, rgba(0, 184, 212, 0.55), transparent 60%),
    linear-gradient(150deg, var(--navy) 10%, var(--navy-deep) 90%);
}
.cover-menopausia {
  background:
    radial-gradient(620px 320px at 90% -20%, rgba(201, 160, 181, 0.5), transparent 60%),
    linear-gradient(150deg, #A87490 0%, #7A4669 45%, #3D1F35 100%);
}
.cover-marca {
  background:
    radial-gradient(620px 320px at 50% 120%, rgba(0, 184, 212, 0.45), transparent 60%),
    linear-gradient(180deg, var(--navy-soft) 0%, var(--navy-deep) 100%);
}

.course-cover .cover-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 30px;
  color: rgba(0, 184, 212, 0.9);
}

.course-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.course-body h3 {
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.course-meta {
  font-size: 13.5px;
  color: var(--text-muted);
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--cyan);
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.course-foot { margin-top: auto; padding-top: 6px; }

.price-tag {
  font-size: 17px;
  font-weight: 700;
}
.price-tag span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.locked-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ============================================================
   CURSO (detalle + lecciones)
   ============================================================ */

.course-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}

.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.player-frame {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(700px 340px at 80% -10%, rgba(0, 184, 212, 0.3), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  display: grid;
  place-items: center;
  color: #fff;
  position: relative;
}

.player-frame iframe,
.player-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-placeholder { text-align: center; padding: 24px; }
.player-placeholder .ph-icon { font-size: 46px; color: var(--cyan); }
.player-placeholder p {
  margin-top: 10px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 40ch;
}

.player-info { padding: 20px 24px 24px; }
.player-info .lesson-kicker {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cyan-hover);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.player-info h2 {
  font-size: 21px;
  letter-spacing: -0.015em;
  margin-top: 4px;
}
.player-info .lesson-desc {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-top: 8px;
}

.player-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ---------- Temario ---------- */

.syllabus {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.syllabus-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.syllabus-head h3 { font-size: 16px; }
.syllabus-head .progress-track { margin-top: 12px; }
.syllabus-head .progress-label { margin-top: 7px; display: block; }

.module-group + .module-group { border-top: 1px solid var(--border); }

.module-title {
  padding: 13px 20px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lesson-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  padding: 10px 20px;
  transition: background 0.12s ease;
}
.lesson-row:hover { background: var(--bg); }
.lesson-row.active {
  background: var(--cyan-soft);
  font-weight: 600;
}

.lesson-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}
.lesson-check:hover { border-color: var(--success); color: var(--success); }
.lesson-row.done .lesson-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.lesson-name { flex: 1; }
.lesson-dur { font-size: 12.5px; color: var(--text-muted); }
.lesson-play {
  font-size: 19px;
  color: var(--cyan-hover);
  opacity: 0;
  transition: opacity 0.15s ease;
  flex: none;
}
.lesson-row { cursor: pointer; }
.lesson-row:hover .lesson-play { opacity: 1; }

/* ============================================================
   REPRODUCTOR DE CÁPSULA
   ============================================================ */

.player-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(620px 320px at 80% -10%, rgba(0, 184, 212, 0.32), transparent 60%),
    linear-gradient(150deg, var(--navy-soft) 0%, var(--navy-deep) 100%);
}
.player-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side, rgba(255,255,255,0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.player-stage.playing .player-glow { opacity: 1; }
.player-play {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--navy);
  font-size: 30px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.player-play:hover { transform: scale(1.06); }
.player-play:active { transform: scale(0.97); }
.player-stage.playing .player-play { opacity: 0.4; }
.player-stage.ended .player-play { opacity: 0.4; }
.player-stage-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}
.player-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 12px;
  backdrop-filter: blur(6px);
}
.player-dur {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.32);
  border-radius: 999px;
  padding: 5px 11px;
  backdrop-filter: blur(6px);
}
.player-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.22);
  z-index: 2;
}
.player-bar-fill {
  height: 100%;
  width: 0;
  background: var(--cyan);
}
.player-stage.playing .player-bar-fill { transition: width 6s linear; }

/* ============================================================
   VISTA DE CÁPSULA (lesson.js) — video + audio + script + notas + Q&A
   ============================================================ */

.lesson-head { margin-bottom: 16px; padding-right: 36px; }
.lesson-head h2 { font-size: 21px; letter-spacing: -0.015em; margin-top: 4px; }

.lesson-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.lesson-main { min-width: 0; }

/* Audio lectura */
.audio-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
}
.audio-play {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--navy);
  color: #fff;
  font-size: 17px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.audio-play:hover { transform: scale(1.06); }
.audio-body { flex: 1; min-width: 0; }
.audio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.audio-label i { color: var(--cyan-hover); font-size: 15px; }
.audio-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  margin-top: 8px;
  overflow: hidden;
}
.audio-bar-fill { height: 100%; width: 0; background: var(--cyan); }
.audio-row.playing .audio-bar-fill { transition: width 8s linear; }
.audio-dur { flex: none; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }

/* Script / transcripción */
.script-panel {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.script-head { padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg); }
.script-head i { color: var(--cyan-hover); margin-right: 5px; }
.script-body { padding: 16px; max-height: 200px; overflow-y: auto; }
.script-placeholder { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* Mis notas */
.notes-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  position: sticky;
  top: 0;
}
.notes-panel .comp-kicker i { color: var(--cyan-hover); margin-right: 5px; }
.notes-area {
  width: 100%;
  min-height: 220px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  resize: vertical;
  background:
    repeating-linear-gradient(var(--surface), var(--surface) 27px, var(--border) 27px, var(--border) 28px);
}
.notes-area:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.notes-saved { display: block; font-size: 12px; color: var(--text-muted); margin-top: 8px; height: 14px; }

/* Preguntas de alumnos */
.qa-panel {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.qa-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.qa-head h3 { font-size: 17px; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 8px; }
.qa-head h3 i { color: var(--cyan-hover); }
.qa-count { font-size: 13px; color: var(--text-muted); font-weight: 600; }

.qa-list { display: grid; gap: 12px; margin-bottom: 18px; }
.qa-item { display: flex; gap: 12px; }
.qa-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--cyan);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.qa-mine .qa-avatar { background: var(--cyan); color: var(--navy-deep); }
.qa-body { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; }
.qa-author { font-size: 13.5px; font-weight: 700; }
.qa-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cyan-hover);
  background: var(--cyan-soft);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 5px;
}
.qa-body p { font-size: 14px; color: var(--text); margin-top: 3px; line-height: 1.5; }

.qa-form { display: flex; flex-direction: column; gap: 10px; }
.qa-input {
  width: 100%;
  min-height: 72px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  color: var(--text);
}
.qa-input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.qa-form .btn { align-self: flex-end; }

.lesson-foot {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  padding-bottom: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .lesson-grid { grid-template-columns: 1fr; }
  .notes-panel { position: static; }
}

.player-info { padding: 20px 4px 2px; }
.player-info h2 { font-size: 20px; letter-spacing: -0.015em; margin-top: 4px; }
.player-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  margin-top: 12px;
  line-height: 1.5;
}
.player-note i { font-size: 16px; color: var(--cyan-hover); flex: none; margin-top: 1px; }
.player-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ============================================================
   PAGO
   ============================================================ */

.checkout-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

.pay-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
}

.pay-card h2 { font-size: 20px; letter-spacing: -0.015em; }
.pay-card .pay-sub { color: var(--text-muted); font-size: 14.5px; margin-top: 4px; }

.pay-options { margin-top: 22px; display: grid; gap: 14px; }

.pay-option {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  transition: border-color 0.15s ease;
}
.pay-option:hover { border-color: var(--cyan); }

.pay-option h4 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15.5px;
}
.pay-option h4 i { color: var(--cyan-hover); font-size: 19px; }

.pay-option p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

.pay-option .btn { margin-top: 14px; }

.bank-details {
  margin-top: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13.5px;
  display: grid;
  gap: 7px;
}
.bank-details .row { display: flex; justify-content: space-between; gap: 12px; }
.bank-details .row b { font-weight: 600; }
.bank-details .row code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 12.5px;
}

/* ---------- Formulario de inscripción ---------- */

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.req { color: var(--cyan-hover); font-weight: 700; }

.field select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6B82' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 38px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.field select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}
.field input.input-error,
.field select.input-error { border-color: var(--danger); }

.field-err {
  display: none;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--danger);
  margin-top: 6px;
}
.field-err.show { display: block; }

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 6px 0 4px;
  cursor: pointer;
}
.field-check input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--cyan);
  flex: none;
}
.field-check a { color: var(--cyan-hover); font-weight: 600; }

/* ---------- Resumen de datos registrados (pago) ---------- */

.reg-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.reg-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.reg-summary-head i { color: var(--cyan-hover); margin-right: 5px; }
.reg-summary-head a { color: var(--cyan-hover); font-weight: 600; text-transform: none; letter-spacing: 0; }
.reg-name { font-size: 16px; font-weight: 700; }
.reg-meta { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

.order-perks {
  list-style: none;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: grid;
  gap: 10px;
}
.order-perks li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.85);
}
.order-perks i { color: var(--cyan); font-size: 17px; flex: none; }

.order-summary {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 28px;
  position: sticky;
  top: 92px;
}

.order-summary .cover-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}
.order-summary h3 { font-size: 19px; margin-top: 6px; line-height: 1.3; }
.order-summary .order-meta {
  color: rgba(255, 255, 255, 0.65);
  font-size: 13.5px;
  margin-top: 10px;
}

.order-total {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.order-total .amount { font-size: 26px; font-weight: 700; }
.order-total .currency { font-size: 13px; color: rgba(255, 255, 255, 0.6); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.back-link:hover { color: var(--text); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 13px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Empty state ---------- */

.empty-state {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .btn { margin-top: 16px; }

/* ============================================================
   CURSO — hero + mapa de unidades/semanas
   ============================================================ */

.page-narrow { max-width: 860px; }

.course-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 30px;
}
.course-hero-kicker {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan-hover);
}
.course-hero h1 { font-size: 26px; letter-spacing: -0.02em; margin-top: 6px; }
.course-hero-desc { color: var(--text-muted); font-size: 15px; margin-top: 8px; max-width: 60ch; }

.course-hero-stat { text-align: center; flex: none; }
.ring {
  --pct: 0;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, var(--surface) 72%, transparent 73% 100%),
    conic-gradient(var(--cyan) calc(var(--pct) * 1%), var(--border) 0);
  font-weight: 700;
  font-size: 19px;
  color: var(--navy);
}
.course-hero-stat-label {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.unit { margin-bottom: 40px; }

/* Encabezado de parte: insignia + etiqueta + título + conteo + hairline */
.part-head {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 0 0 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  font: inherit;
  color: inherit;
}
.part-head-toggle { cursor: pointer; padding-top: 4px; }
.part-head-toggle:hover .part-caret { color: var(--cyan-hover); }
.part-head-toggle:hover .part-count { border-color: var(--cyan); }
.part-caret {
  flex: none;
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.25s ease, color 0.15s ease;
}
.unit-collapsed .part-caret { transform: rotate(-90deg); }
.unit-collapsed .part-head { margin-bottom: 0; }
.unit-collapsed .week-grid { display: none; }
.part-badge {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--navy-soft), var(--navy-deep));
  box-shadow: 0 6px 18px rgba(11, 31, 61, 0.18);
}
.part-badge-lock {
  background: var(--bg);
  color: var(--text-muted);
  border: 1.5px dashed var(--border);
  box-shadow: none;
  font-size: 18px;
}
.part-head-text { flex: 1; min-width: 0; }
.part-kicker {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan-hover);
}
.part-head-text h2 { font-size: 20px; letter-spacing: -0.02em; line-height: 1.2; margin-top: 2px; }
.part-count {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
}
.unit-locked {
  opacity: 0.78;
}
.unit-locked .part-head { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.week-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.week-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 17px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
/* Filo de color superior que aparece al pasar el cursor */
.week-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--navy-soft));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.week-card:hover {
  box-shadow: var(--shadow-pop);
  transform: translateY(-3px);
  border-color: var(--cyan);
}
.week-card:hover::before { transform: scaleX(1); }
.week-card-done::before { transform: scaleX(1); background: var(--success); }

.week-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.week-top-right { display: inline-flex; align-items: center; gap: 8px; }
.week-arrow {
  font-size: 18px;
  color: var(--cyan-hover);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.week-card:hover .week-arrow { opacity: 1; transform: translateX(0); }
.week-num {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--cyan-soft);
  color: var(--cyan-hover);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.week-done {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.week-card h3 { font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; }
.week-summary { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }

.week-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
}
.chip i { font-size: 13px; color: var(--cyan-hover); }

.week-card-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.week-card-foot .progress-track { flex: 1; }
.week-card-foot .progress-label { font-size: 12px; }

/* ============================================================
   SEMANA — hero + componentes
   ============================================================ */

.week-hero { margin-bottom: 26px; }
.week-hero h1 { font-size: 25px; letter-spacing: -0.02em; margin-top: 6px; }
.week-hero-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  max-width: 460px;
}
.week-hero-progress .progress-track { flex: 1; }

.comp {
  display: flex;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.comp-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 23px;
  background: var(--cyan-soft);
  color: var(--cyan-hover);
}
.comp-main { flex: 1; min-width: 0; }
.comp-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.comp-main h2 { font-size: 18px; letter-spacing: -0.015em; margin: 3px 0 6px; }
.comp-main > p { font-size: 14.5px; color: var(--text-muted); line-height: 1.55; }
.comp-main .btn { margin-top: 14px; }
.comp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.comp-dashboard {
  background:
    radial-gradient(520px 200px at 100% 0%, rgba(0, 184, 212, 0.1), transparent 60%),
    var(--surface);
  border-color: rgba(0, 184, 212, 0.35);
}
.comp-live .live-when {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-top: 10px;
}
.comp-live .live-when i { color: var(--cyan-hover); font-size: 17px; }

.video-list { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.video-list .lesson-row { border-bottom: 1px solid var(--border); }
.video-list .lesson-row:last-child { border-bottom: none; }

.file-list { margin-top: 12px; display: grid; gap: 8px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease;
}
.file-row:hover { border-color: var(--cyan); }
.file-ext {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan-hover);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 7px;
}
.file-name { flex: 1; font-weight: 500; }
.file-size { font-size: 12.5px; color: var(--text-muted); }
.file-dl { font-size: 18px; color: var(--text-muted); }

.comp-quiz .quiz-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan-hover);
  margin-top: 8px;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 22, 48, 0.55);
  backdrop-filter: blur(3px);
}
.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 17px;
  display: grid;
  place-items: center;
  z-index: 2;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 28px; }

/* Modal ancho para plataformas interactivas embebidas (iframe) */
.modal-card.modal-wide {
  max-width: 1180px;
  width: 96vw;
  height: 92vh;
}
.modal-card.modal-wide .modal-body {
  padding: 20px 22px 30px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.modal-frame-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-right: 40px;
  margin-bottom: 12px;
}
.modal-frame-head h2 { font-size: 18px; letter-spacing: -0.015em; margin-top: 2px; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.dash-frame {
  flex: 1;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

/* ============================================================
   SIMULADOR (dashboard interactivo)
   ============================================================ */

.sim-head { margin-bottom: 18px; padding-right: 30px; }
.sim-head h2 { font-size: 20px; letter-spacing: -0.015em; margin: 4px 0 6px; }
.sim-head p { font-size: 14px; color: var(--text-muted); }

.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.sim-field { margin-bottom: 16px; }
.sim-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.sim-field label b { color: var(--navy); font-weight: 700; }
.sim-field input[type="range"] { width: 100%; accent-color: var(--cyan); }

.sim-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.sim-seg button {
  border: none;
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 6px;
}
.sim-seg button.on { background: var(--navy); color: #fff; }

.sim-schedule {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.sim-sub {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sched-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.sched-row:last-child { border-bottom: none; }
.sched-row span:first-child { font-weight: 600; }
.sched-row span:last-child { color: var(--text-muted); }

.sim-readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.readout {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 12px 11px;
  text-align: center;
}
.readout.ro-hl { background: var(--navy); border-color: var(--navy); }
.readout.ro-hl .ro-label, .readout.ro-hl .ro-tag { color: rgba(255,255,255,0.7); }
.readout.ro-hl .ro-value { color: var(--cyan); }
.ro-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.ro-value { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0; }
.ro-tag { display: block; font-size: 11px; color: var(--text-muted); }

.sim-chartwrap { margin-top: 16px; }
.sim-chart { width: 100%; height: auto; margin-top: 8px; }
.sim-chart .ax { font-size: 9px; fill: #8696aa; font-family: inherit; }
.sim-note { font-size: 11.5px; color: var(--text-muted); margin-top: 12px; line-height: 1.45; }

/* ============================================================
   QUIZ
   ============================================================ */

.quiz-top { display: flex; justify-content: space-between; align-items: center; }
.quiz-step { font-size: 13px; font-weight: 700; color: var(--cyan-hover); }
.quiz-score { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.quiz-bar { height: 6px; border-radius: 999px; background: var(--border); margin: 12px 0 22px; overflow: hidden; }
.quiz-bar-fill { height: 100%; background: var(--cyan); transition: width 0.3s ease; }
.quiz-q { font-size: 18px; line-height: 1.4; letter-spacing: -0.01em; margin-bottom: 18px; }

.quiz-options { display: grid; gap: 10px; }
.quiz-option {
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-option:hover:not(:disabled) { border-color: var(--cyan); }
.quiz-option.picked { border-color: var(--cyan); background: var(--cyan-soft); }
.quiz-option.correct { border-color: var(--success); background: var(--success-soft); font-weight: 600; }
.quiz-option.wrong { border-color: var(--danger); background: var(--danger-soft); }
.quiz-option:disabled { cursor: default; }

.quiz-explain {
  display: none;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.55;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  gap: 8px;
}
.quiz-explain.show { display: flex; align-items: flex-start; }
.quiz-explain i { font-size: 18px; flex: none; margin-top: 1px; }
.quiz-explain.ok { background: var(--success-soft); color: #14532D; }
.quiz-explain.bad { background: var(--bg); color: var(--text); }
.quiz-explain.ok i { color: var(--success); }
.quiz-explain.bad i { color: var(--cyan-hover); }

.quiz-foot { margin-top: 22px; display: flex; justify-content: flex-end; }
.quiz-foot .btn:disabled { opacity: 0.5; cursor: default; }

.quiz-result { text-align: center; padding: 14px 0 6px; }
.quiz-result-ring {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border: 6px solid var(--border);
}
.quiz-result-ring span { font-size: 30px; font-weight: 700; color: var(--navy); }
.quiz-result-ring small { font-size: 16px; color: var(--text-muted); font-weight: 600; }
.quiz-result-ring.pass { border-color: var(--success); }
.quiz-result-ring.fail { border-color: var(--cyan); }
.quiz-result h3 { font-size: 21px; letter-spacing: -0.015em; }
.quiz-result p { font-size: 14.5px; color: var(--text-muted); margin-top: 8px; max-width: 42ch; margin-left: auto; margin-right: auto; }
.quiz-result-actions { margin-top: 20px; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 38dvh; padding: 32px 28px; }
  .login-brand .brand-foot { display: none; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .course-layout { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .order-summary { position: static; }
  .sim-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .course-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr; }
  .course-hero { flex-direction: column; align-items: flex-start; }
  .comp { flex-direction: column; gap: 14px; }
  .sim-readouts { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .modal-body { padding: 22px 18px; }
  .topnav-inner { padding: 0 16px; }
  .page { padding: 28px 16px 64px; }
  .user-chip .user-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   APP SHELL — barra lateral + contenido (dashboard del alumno)
   ============================================================ */

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

.sidebar {
  width: 244px;
  flex: none;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  font-size: 15px;
  line-height: 1.1;
}
.side-brand .monogram {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  background: var(--navy);
  color: var(--cyan);
  display: grid; place-items: center;
  font-family: Georgia, serif; font-size: 21px; font-weight: 700;
}
.theme-meno .side-brand .monogram { background: linear-gradient(135deg, #A87490, #592F4E); color: #fff; }
.side-brand-text { color: var(--text-muted); font-weight: 500; }
.side-brand-text b { color: var(--text); font-weight: 700; }

.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.side-link i { font-size: 20px; flex: none; }
.side-link:hover { background: var(--bg); color: var(--text); }
.side-link.active { background: var(--navy); color: #fff; }
.side-link.active i { color: var(--cyan); }
.theme-meno .side-link.active i { color: #F5D9E5; }
.side-help { margin-top: 8px; color: #1A8A4E; }
.side-help i { color: #25D366; }
.side-help:hover { background: rgba(37, 211, 102, 0.1); color: #1A8A4E; }

.side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 8px 4px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
}
.side-foot .user-chip { font-size: 13.5px; min-width: 0; }
.side-foot .user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .btn-logout { font-size: 18px; padding: 7px 9px; }

.app-main { flex: 1; min-width: 0; }
.app-page { max-width: 1120px; margin: 0 auto; padding: 34px 32px 80px; }
.app-head { margin-bottom: 26px; }
.app-head h1 { font-size: 27px; letter-spacing: -0.02em; }
.app-head p { color: var(--text-muted); margin-top: 4px; font-size: 15px; }

/* ============================================================
   DASHBOARD (inicio)
   ============================================================ */

.dash-hero {
  background: radial-gradient(800px 300px at 90% -30%, rgba(0,184,212,0.22), transparent 60%),
              linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 30px 34px;
  margin-bottom: 24px;
}
.theme-meno .dash-hero {
  background: radial-gradient(800px 300px at 90% -30%, rgba(201,160,181,0.4), transparent 60%),
              linear-gradient(135deg, #7A4669 0%, #3D1F35 100%);
}
.dash-hero .hello { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan); }
.theme-meno .dash-hero .hello { color: #F5D9E5; }
.dash-hero h1 { font-size: 30px; letter-spacing: -0.02em; margin-top: 6px; }
.dash-hero p { color: rgba(255,255,255,0.78); margin-top: 8px; font-size: 15px; max-width: 60ch; }

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}
.dash-col { display: grid; gap: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.card-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted); display: flex; align-items: center; gap: 7px; margin-bottom: 14px;
}
.card-title i { color: var(--cyan-hover); font-size: 16px; }

/* progreso por curso */
.prog-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.prog-row:last-child { border-bottom: none; }
.prog-row .ring { width: 52px; height: 52px; font-size: 13px; flex: none; }
.prog-info { flex: 1; min-width: 0; }
.prog-info h4 { font-size: 14.5px; letter-spacing: -0.01em; }
.prog-info span { font-size: 12.5px; color: var(--text-muted); }
.prog-row .btn { flex: none; }

/* stats fila */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.stat-box .num { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stat-box .lbl { font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-top: 2px; display: block; }

/* dato clínico */
.dato-card {
  background: linear-gradient(135deg, var(--cyan-soft), transparent);
  border: 1px solid rgba(0,184,212,0.35);
}
.theme-meno .dato-card { border-color: rgba(168,116,144,0.4); }
.dato-card .dato-tipo { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--cyan-hover); }
.dato-card p { font-size: 15.5px; line-height: 1.55; margin-top: 8px; }

/* listas avisos / fechas */
.mini-list { display: grid; gap: 12px; }
.mini-item { display: flex; gap: 11px; align-items: flex-start; }
.mini-item .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--cyan); }
.mini-item .dot.warn { background: var(--orange, #F97316); }
.mini-item .dot.ok { background: var(--success); }
.mini-item .mi-body p { font-size: 14px; font-weight: 600; }
.mini-item .mi-body span { font-size: 12.5px; color: var(--text-muted); }

/* calendario */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h4 { font-size: 15px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-align: center; padding: 4px 0; }
.cal-day { aspect-ratio: 1; display: grid; place-items: center; font-size: 12.5px; border-radius: 8px; color: var(--text); }
.cal-day.muted { color: var(--border); }
.cal-day.today { background: var(--navy); color: #fff; font-weight: 700; }
.theme-meno .cal-day.today { background: var(--navy); }
.cal-day.event { background: var(--cyan-soft); color: var(--cyan-hover); font-weight: 700; }

/* ============================================================
   FORO
   ============================================================ */

.foro-wrap { max-width: 680px; margin: 0 auto; }
.composer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 22px; }
.composer textarea {
  width: 100%; min-height: 70px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font: inherit; font-size: 14.5px; resize: vertical; color: var(--text);
}
.composer textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.composer .composer-foot { display: flex; justify-content: flex-end; margin-top: 12px; }

.post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.post-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.post-head .avatar { width: 40px; height: 40px; }
.post-author { font-size: 14.5px; font-weight: 700; }
.post-role { font-size: 12.5px; color: var(--text-muted); }
.post-body { font-size: 15px; line-height: 1.55; }
.post-actions { display: flex; gap: 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.post-act { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); background: none; border: none; cursor: pointer; }
.post-act:hover { color: var(--cyan-hover); }
.post-act.liked { color: var(--cyan-hover); }
.post-comments { margin-top: 12px; display: grid; gap: 8px; }
.post-comment { display: flex; gap: 9px; font-size: 13.5px; background: var(--bg); border-radius: var(--radius-sm); padding: 9px 12px; }
.post-comment b { font-weight: 700; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { flex: 1; border: 1.5px solid var(--border); border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 13.5px; }
.comment-form input:focus { outline: none; border-color: var(--cyan); }

/* ============================================================
   CALCULADORAS
   ============================================================ */

.calc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.calc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.calc-card h3 { font-size: 16px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.calc-card h3 i { color: var(--cyan-hover); font-size: 19px; }
.calc-card .calc-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.calc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.calc-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.calc-field input, .calc-field select {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 11px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
}
.calc-field input:focus, .calc-field select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.calc-result {
  margin-top: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.calc-result .res-num { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.theme-meno .calc-result .res-num { color: var(--navy); }
.calc-result .res-tag { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.calc-note { font-size: 11.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.45; }
.full-col { grid-column: 1 / -1; }

/* ============================================================
   REGISTRO DE PACIENTES
   ============================================================ */

.pac-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.pac-form .form-section { margin-bottom: 20px; }
.pac-form .form-section h3 { font-size: 14px; letter-spacing: -0.01em; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.pac-form .form-section h3 i { color: var(--cyan-hover); }
.pac-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pac-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.summary-card { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px 24px; position: sticky; top: 24px; }
.theme-meno .summary-card { background: var(--navy-deep); }
.summary-card h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.summary-card h3 i { color: var(--cyan); }
.summary-body { margin-top: 14px; font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,0.9); white-space: pre-wrap; min-height: 120px; }
.summary-empty { color: rgba(255,255,255,0.5); font-style: italic; }
.summary-card .btn { margin-top: 16px; }

.pac-list { margin-top: 30px; }
.pac-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pac-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border); }
.pac-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.pac-table tr:hover td { background: var(--bg); }
.pac-del { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 16px; }

/* ============================================================
   Responsive app shell
   ============================================================ */

@media (max-width: 980px) {
  .dash-grid { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .pac-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
}
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 30;
    flex-direction: row; align-items: center; gap: 8px;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 10px 12px; overflow-x: auto;
  }
  .side-brand { padding: 0 6px 0 0; border: none; flex: none; }
  .side-brand-text { display: none; }
  .side-nav { flex-direction: row; gap: 2px; }
  .side-link span { display: none; }
  .side-link { padding: 10px; }
  .side-foot { display: none; }
  .app-page { padding: 22px 16px 70px; }
  .stat-row { grid-template-columns: 1fr; }
  .pac-grid3, .pac-grid2, .calc-fields { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   DASHBOARD v2 — búsqueda, quick cards, gamificación, ranking, caso
   ============================================================ */

/* Búsqueda global */
.search-box { position: relative; margin-top: 18px; max-width: 560px; }
.search-box > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 18px; }
.search-box input {
  width: 100%; border: none; border-radius: 999px; padding: 13px 18px 13px 44px;
  font: inherit; font-size: 14.5px; background: rgba(255,255,255,0.95); color: var(--text);
}
.search-box input:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,0.4); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); overflow: hidden; display: none; max-height: 380px; overflow-y: auto;
}
.search-results.open { display: block; }
.sr-item { display: flex; align-items: center; gap: 11px; padding: 11px 16px; font-size: 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--bg); }
.sr-item i { color: var(--cyan-hover); font-size: 17px; flex: none; }
.sr-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-type { font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--bg); border-radius: 999px; padding: 3px 8px; flex: none; }

/* Quick row: reanudar + masterclass */
.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.quick-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; transition: box-shadow 0.18s ease, transform 0.18s ease; }
.quick-card.resume:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); border-color: var(--cyan); }
.quick-ic { width: 50px; height: 50px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 25px; background: var(--cyan-soft); color: var(--cyan-hover); }
.quick-body { flex: 1; min-width: 0; }
.quick-kicker { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.quick-body h3 { font-size: 16px; letter-spacing: -0.01em; margin: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-sub { font-size: 12.5px; color: var(--text-muted); }
.quick-arrow { font-size: 20px; color: var(--cyan-hover); flex: none; }
.quick-card.live h3 { font-variant-numeric: tabular-nums; color: var(--navy); }

/* Nivel + racha + logros */
.level-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.level-badge { flex: none; background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; border-radius: 10px; padding: 8px 12px; }
.level-bar-wrap { flex: 1; min-width: 0; }
.level-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.level-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--navy-soft)); transition: width 0.4s ease; }
.level-sub { font-size: 12px; color: var(--text-muted); margin-top: 5px; display: block; }
.streak { flex: none; display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 14px; color: #E8590C; }
.streak i { color: #F97316; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 6px 11px; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); opacity: 0.6; }
.badge.on { opacity: 1; color: var(--navy); border-color: var(--cyan); background: var(--cyan-soft); }
.badge i { font-size: 15px; }

/* Ranking */
.rank-row { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank-row.me { background: var(--cyan-soft); border-radius: 10px; padding: 8px 10px; border-bottom: none; }
.rank-pos { width: 20px; font-weight: 700; font-size: 13px; color: var(--text-muted); text-align: center; }
.rank-row .avatar { width: 30px; height: 30px; font-size: 11px; }
.rank-name { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-pts { font-size: 12.5px; font-weight: 700; color: var(--cyan-hover); }

/* Caso clínico del día */
.caso-q { font-size: 14.5px; line-height: 1.55; background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; }
.caso-pregunta { font-size: 15px; font-weight: 700; margin: 14px 0 10px; }
.caso-opts { display: grid; gap: 8px; }
.caso-opt { text-align: left; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; transition: border-color 0.15s ease; }
.caso-opt:hover:not(:disabled) { border-color: var(--cyan); }
.caso-opt.correct { border-color: var(--success); background: var(--success-soft); font-weight: 600; }
.caso-opt.wrong { border-color: var(--danger); background: var(--danger-soft); }
.caso-opt:disabled { cursor: default; }
.caso-explain { display: none; margin-top: 14px; gap: 8px; font-size: 14px; line-height: 1.55; padding: 12px 14px; border-radius: var(--radius-sm); }
.caso-explain.show { display: flex; align-items: flex-start; }
.caso-explain i { font-size: 18px; flex: none; margin-top: 1px; }
.caso-explain.ok { background: var(--success-soft); color: #14532D; } .caso-explain.ok i { color: var(--success); }
.caso-explain.bad { background: var(--bg); color: var(--text); } .caso-explain.bad i { color: var(--cyan-hover); }

/* Notas y guardados */
.note-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.note-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease; }
.note-card:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); border-color: var(--cyan); }
.note-ctx { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.note-card h4 { font-size: 15px; letter-spacing: -0.01em; margin: 5px 0; display: flex; align-items: center; gap: 7px; }
.note-card h4 i { color: var(--cyan-hover); }
.note-text { font-size: 13.5px; color: var(--text); line-height: 1.5; background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; margin: 8px 0; white-space: pre-wrap; }
.note-go { font-size: 13px; font-weight: 600; color: var(--cyan-hover); display: inline-flex; align-items: center; gap: 5px; }

/* Favorito en cápsula */
.lesson-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fav-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.fav-btn:hover { border-color: var(--cyan); color: var(--cyan-hover); }
.fav-btn.on { background: var(--cyan-soft); border-color: var(--cyan); color: var(--cyan-hover); }

/* ============================================================
   PANEL DEL MAESTRO
   ============================================================ */

.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 12px; }
.kpi-ic { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; font-size: 20px; background: var(--cyan-soft); color: var(--cyan-hover); }
.kpi-num { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-lbl { display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-top: 1px; }

.maestro-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }

.chart { width: 100%; height: auto; }
.chart .cv { font-size: 9px; fill: var(--text); font-weight: 700; font-family: inherit; }
.chart .cax { font-size: 9px; fill: var(--text-muted); font-family: inherit; }

.table-scroll { max-height: 420px; overflow-y: auto; }
.mini-bar { display: inline-block; width: 60px; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; vertical-align: middle; margin-right: 7px; }
.mini-bar div { height: 100%; background: var(--cyan); border-radius: 999px; }
.st-chip { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.st-chip.ok { background: var(--success-soft); color: #14532D; }
.st-chip.warn { background: #FEF3C7; color: #92400E; }
.st-chip.bad { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .maestro-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .quick-row { grid-template-columns: 1fr; }
  .note-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   BANDEJA DE PREGUNTAS (maestro) + badge sidebar
   ============================================================ */

.side-badge {
  margin-left: auto;
  background: #E5484D;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
}
.side-link.active .side-badge { background: #fff; color: var(--navy); }

.inbox-card { border-color: rgba(229,72,77,0.3); margin-bottom: 24px; }
.inbox-count {
  background: #E5484D; color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 999px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px;
}
.inbox-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; }
.inbox-item:last-child { margin-bottom: 0; }
.inbox-head { display: flex; align-items: center; gap: 11px; }
.inbox-head .avatar { width: 36px; height: 36px; }
.inbox-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inbox-meta b { font-size: 14px; }
.inbox-meta span { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-date { font-size: 12px; color: var(--text-muted); flex: none; }
.inbox-text { font-size: 14.5px; line-height: 1.5; margin: 10px 0 12px; background: var(--bg); border-radius: var(--radius-sm); padding: 11px 13px; }
.inbox-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inbox-reply { flex: 1; min-width: 180px; border: 1.5px solid var(--border); border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 13.5px; color: var(--text); }
.inbox-reply:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }

/* Caso clínico del día — colores invertidos (fondo oscuro, texto claro) */
.caso-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-color: var(--navy-deep);
  box-shadow: 0 10px 30px rgba(11, 31, 61, 0.28);
  color: #fff;
}
.caso-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cyan), #6FE0F0);
}
.caso-card .card-title { color: #fff; }
.caso-card .card-title i { color: var(--cyan); }
.caso-card .caso-q { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.92); }
.caso-card .caso-pregunta { color: #fff; }
.caso-card .caso-opt { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.caso-card .caso-opt:hover:not(:disabled) { border-color: var(--cyan); background: rgba(255, 255, 255, 0.12); }

/* ============================================================
   CALCULADORAS v2 — navegación por categoría + desglose
   ============================================================ */
.cat-nav {
  position: sticky; top: 0; z-index: 15;
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 0 14px; margin-bottom: 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 13px; white-space: nowrap;
  transition: all 0.15s ease;
}
.cat-pill i { font-size: 15px; color: var(--cyan-hover); }
.cat-pill:hover { border-color: var(--cyan); color: var(--text); }
.cat-pill.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.cat-pill.active i { color: var(--cyan); }

.cat-section { padding-top: 18px; scroll-margin-top: 76px; }
.cat-title {
  width: 100%; text-align: left; cursor: pointer;
  font-size: 18px; font-weight: 700; letter-spacing: -0.015em;
  margin-bottom: 16px; padding: 6px 0 14px;
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; border-bottom: 1px solid var(--border); color: var(--text); font-family: inherit;
}
.cat-title > i:first-child { color: var(--cyan-hover); font-size: 22px; flex: none; }
.cat-title-text { flex: 1; }
.cat-count {
  flex: none; font-size: 12px; font-weight: 700; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
}
.cat-caret { flex: none; font-size: 18px; color: var(--text-muted); transition: transform 0.25s ease; }
.cat-title:hover .cat-caret { color: var(--cyan-hover); }
.cat-section.collapsed .cat-caret { transform: rotate(-90deg); }
.cat-section.collapsed .cat-title { margin-bottom: 0; }
.cat-section.collapsed .calc-grid { display: none; }

.calc-out { margin-top: 16px; }
.calc-rows { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.calc-rowi { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.calc-rowi:last-child { border-bottom: none; }
.calc-rowi b { font-weight: 700; color: var(--navy); }

/* ============================================================
   CONSTANCIAS — hub de certificados
   ============================================================ */
.cert-hero {
  display: flex; align-items: center; gap: 24px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff; border-radius: var(--radius); padding: 28px 32px;
  position: relative; overflow: hidden;
}
.cert-hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(500px 240px at 100% 0%, rgba(200,162,39,0.25), transparent 60%);
  pointer-events: none;
}
.cert-hero.on { box-shadow: 0 14px 40px rgba(11,31,61,0.25); }
.cert-seal {
  width: 74px; height: 74px; flex: none; border-radius: 50%;
  border: 2px solid rgba(200,162,39,0.7);
  display: grid; place-items: center; position: relative; z-index: 1;
}
.cert-seal .monogram { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,0.08); color: #E3C463; display: grid; place-items: center; font-size: 27px; }
.cert-hero-body { position: relative; z-index: 1; }
.cert-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #E3C463; }
.cert-hero-body h2 { font-size: 22px; letter-spacing: -0.015em; margin: 5px 0 6px; }
.cert-hero-body p { color: rgba(255,255,255,0.72); font-size: 14px; margin-bottom: 14px; }
.cert-lock { display: flex; flex-direction: column; gap: 8px; }
.cert-lock span { font-size: 13px; color: rgba(255,255,255,0.75); display: inline-flex; align-items: center; gap: 6px; }
.cert-lock .progress-track { background: rgba(255,255,255,0.2); }

.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cert-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 8px;
}
.cert-card.on { border-color: rgba(200,162,39,0.55); box-shadow: 0 6px 20px rgba(200,162,39,0.12); }
.cert-card-top { display: flex; align-items: center; justify-content: space-between; }
.cert-badge { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--cyan-soft); color: var(--cyan-hover); font-size: 13px; font-weight: 700; }
.cert-check { color: #C9A227; font-size: 24px; }
.cert-lockic { color: var(--text-muted); font-size: 18px; }
.cert-card h3 { font-size: 15px; line-height: 1.3; letter-spacing: -0.01em; }
.cert-meta { font-size: 12.5px; color: var(--text-muted); }
.cert-card .btn { margin-top: auto; }
.cert-mini { margin-top: auto; }
.cert-mini span { font-size: 12px; color: var(--text-muted); display: block; margin-top: 5px; }

/* ============================================================
   CERTIFICADO IMPRIMIBLE
   ============================================================ */
.cert-body { background: #E7E9ED; min-height: 100dvh; }
.cert-toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}
.cert-toolbar-title { font-weight: 700; font-size: 15px; }
.cert-stage { padding: 28px 20px 60px; display: flex; justify-content: center; }

.certificate {
  width: min(1040px, 96vw);
  aspect-ratio: 297 / 210;
  background:
    radial-gradient(900px 500px at 50% -20%, #F4F7FA, transparent 60%),
    #fff;
  box-shadow: 0 24px 70px rgba(11,31,61,0.28);
  border-radius: 4px;
  overflow: hidden;
}
.cert-frame {
  height: 100%;
  margin: 16px;
  border: 2px solid var(--navy);
  border-radius: 3px;
  position: relative;
  padding: 3px;
}
.cert-frame::before {
  content: ""; position: absolute; inset: 6px;
  border: 1px solid #C9A227; border-radius: 2px; pointer-events: none;
}
.cert-corner { position: absolute; width: 26px; height: 26px; border: 2px solid #C9A227; }
.cert-corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.cert-corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.cert-corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.cert-corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.cert-inner {
  height: 100%; box-sizing: border-box;
  padding: 4% 8% 3.4%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  color: var(--navy);
}
.cert-brandrow { display: flex; align-items: center; gap: 12px; }
.cert-monogram { width: 42px; height: 42px; border-radius: 10px; background: var(--navy); color: var(--cyan); display: grid; place-items: center; font-size: 24px; font-weight: 700; }
.cert-brandtext { text-align: left; display: flex; flex-direction: column; line-height: 1.1; }
.cert-academy { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.cert-academy-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.02em; }

.cert-scope {
  margin-top: 3.2%;
  font-size: clamp(18px, 3.4vw, 34px); font-weight: 700; letter-spacing: 0.28em;
  text-transform: uppercase; color: #B8912B;
}
.cert-otorga { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: clamp(14px, 1.7vw, 19px); color: var(--text-muted); margin-top: 4px; }

.cert-name {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700;
  font-size: clamp(30px, 5.6vw, 58px); line-height: 1.05; margin-top: 1.2%;
  color: var(--navy); padding-bottom: 6px; position: relative;
}
.cert-name::after { content: ""; display: block; width: 46%; height: 2px; margin: 8px auto 0; background: linear-gradient(90deg, transparent, #C9A227, transparent); }
.cert-cedula { font-size: clamp(12px, 1.4vw, 15px); color: var(--text-muted); margin-top: 8px; }

.cert-por { font-family: 'Cormorant Garamond', Georgia, serif; font-size: clamp(14px, 1.7vw, 19px); color: var(--text); margin-top: 2%; }
.cert-course { font-size: clamp(18px, 3vw, 30px); font-weight: 600; color: var(--navy-soft); margin-top: 4px; max-width: 90%; }
.cert-detail { font-size: clamp(12px, 1.4vw, 15px); color: var(--text-muted); margin-top: 8px; }

.cert-foot {
  margin-top: auto; width: 100%;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 24px;
}
.cert-sign { display: flex; flex-direction: column; align-items: center; }
.cert-sign-line { width: 78%; height: 1.5px; background: var(--navy); margin-bottom: 7px; }
.cert-sign b { font-size: clamp(12px, 1.4vw, 15px); }
.cert-sign span { font-size: clamp(10px, 1.1vw, 12px); color: var(--text-muted); margin-top: 2px; }
.cert-sealbig { padding-bottom: 4px; }
.cert-sealbig-ring {
  width: clamp(48px, 6vw, 70px); height: clamp(48px, 6vw, 70px); border-radius: 50%;
  border: 2px solid #C9A227; display: grid; place-items: center; position: relative;
  box-shadow: 0 0 0 4px rgba(200,162,39,0.14);
}
.cert-sealbig-ring::before { content: ""; position: absolute; inset: 5px; border: 1px dashed rgba(200,162,39,0.6); border-radius: 50%; }
.cert-sealbig-ring span { font-size: clamp(22px, 3vw, 34px); font-weight: 700; color: var(--navy); }

.cert-folio { margin-top: 2%; font-size: clamp(9px, 1vw, 11px); color: var(--text-muted); letter-spacing: 0.01em; }
.cert-folio b { color: var(--navy); font-weight: 700; letter-spacing: 0.05em; }

@media (max-width: 620px) { .cert-grid { grid-template-columns: 1fr; } .cert-hero { flex-direction: column; text-align: center; } }

@media print {
  @page { size: A4 landscape; margin: 0; }
  .cert-body { background: #fff; }
  .cert-toolbar { display: none !important; }
  .cert-stage { padding: 0; }
  .certificate { width: 100%; height: 100vh; aspect-ratio: auto; box-shadow: none; border-radius: 0; }
  .cert-frame { margin: 8mm; }
}

.course-hero-cert { margin-top: 14px; display: inline-flex; }
/* En el hero degradado (menopausia) el botón va en blanco translúcido */
.theme-meno .course-hero .course-hero-cert {
  background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.4); color: #fff;
}
.theme-meno .course-hero .course-hero-cert:hover { background: rgba(255,255,255,0.24); border-color: rgba(255,255,255,0.7); }

/* Reproductor real embebido (Vimeo) dentro del stage de la cápsula */
.player-embed { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }

/* ---------- Panel de gestión de alumnos (editor) ---------- */
.ecourse-cell { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ecourse-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--navy);
  background: var(--cyan-soft); border: 1px solid rgba(0,184,212,0.35);
  border-radius: 999px; padding: 3px 5px 3px 10px;
}
.ecourse-chip .chip-x {
  border: none; background: rgba(11,31,61,0.12); color: var(--navy);
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
  font-size: 13px; line-height: 1; display: grid; place-items: center;
}
.ecourse-chip .chip-x:hover { background: var(--danger); color: #fff; }
.add-course {
  font: inherit; font-size: 12.5px; border: 1px dashed var(--border);
  border-radius: 999px; padding: 4px 10px; color: var(--text-muted);
  background: var(--surface); cursor: pointer;
}
.add-course:focus { outline: none; border-color: var(--cyan); }
.row-disabled { opacity: 0.55; }

/* Respuesta del maestro bajo una pregunta de cápsula */
.qa-answer {
  margin-top: 8px; font-size: 13.5px; line-height: 1.5;
  background: var(--success-soft); color: #14532D;
  border-radius: var(--radius-sm); padding: 9px 12px;
}
.qa-answer b { display: inline-flex; align-items: center; gap: 5px; }
.qa-answer i { color: var(--success); }
