/* ==========================================================================
   Ministerios Palabra de Gloria · Plataforma (formación y panel)
   Paleta tomada del logotipo y de los bloques institucionales.
   Los tokens heredados (--navy, --cyan, --gold) conservan su nombre por compatibilidad:
   --cyan es hoy el acento dorado.
   ========================================================================== */

:root {
  /* Ministerios Palabra de Gloria · identidad (logo y bloques institucionales):
     azul noche #0A192F · azul profundo #102C54 · dorado #C5A059 / #D4AF37 · llama #BC2020 */
  --navy: #102C54;
  --navy-800: #0D2443;
  --navy-900: #0A192F;
  --navy-50: #EEF2F8;
  --cyan: #C5A059;          /* acento dorado (bordes, progreso, foco) */
  --cyan-600: #7E6025;      /* dorado oscuro para texto y enlaces (AA sobre blanco) */
  --cyan-50: #FAF4E6;
  --gold: #D4AF37;
  --gold-600: #B8962E;
  --gold-50: #FBF5E1;
  --flame: #BC2020;         /* llamados a la acción */
  --flame-600: #9E1A1A;
  --map: #DCD6CB;

  --bg: #F7F4EE;            /* marfil cálido */
  --surface: #ffffff;
  --surface-2: #FBF9F5;
  --text: #1B2436;
  --muted: #5E6575;
  --border: #E7E1D6;
  --border-strong: #D6CDBE;

  --success: #13774F;
  --success-50: #E4F4EC;
  --danger: #B42318;
  --danger-50: #FCEBEA;
  --warning: #9A5B00;
  --warning-50: #FFF4DD;
  --info: #1F5E9C;
  --info-50: #E8F1FA;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(10, 25, 47, .06);
  --shadow: 0 1px 2px rgba(10, 25, 47, .05), 0 10px 28px rgba(10, 25, 47, .07);
  --shadow-lg: 0 22px 56px rgba(10, 25, 47, .16);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --sidebar: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.6;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan-600); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.btn:hover, .appnav-link:hover, .appnav-item:hover, .card a:hover.btn { text-decoration: none; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
hr, .divider { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
:focus-visible { outline: 3px solid rgba(197, 160, 89, .45); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.75rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-aside { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1020px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-aside { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .55rem 1.1rem; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: .95rem; line-height: 1.2; cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-800); color: #fff; }
.btn-accent { background: linear-gradient(135deg, #C9361F, var(--flame)); color: #fff; box-shadow: 0 6px 16px rgba(188, 32, 32, .22); }
.btn-accent:hover { background: var(--flame-600); color: #fff; box-shadow: 0 8px 20px rgba(188, 32, 32, .28); }
.btn-ghost-light { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .16); color: #fff; border-color: #fff; }
.btn-lg { min-height: 50px; padding: .75rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn-gold { background: var(--gold); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-600); color: var(--navy-900); }
.btn-ghost { background: var(--surface); color: var(--navy); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #efc5c2; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0c6a4a; color: #fff; }
.btn-sm { min-height: 34px; padding: .35rem .75rem; font-size: .86rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--cyan-600); font: inherit; cursor: pointer; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 1.35rem; }
.card-header { padding: 1rem 1.35rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.card-footer { padding: .9rem 1.35rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card-accent { border-top: 4px solid var(--cyan); }
.card-gold { border-top: 4px solid var(--gold); }

/* ---------- Insignias ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-muted { background: #F1EEE8; color: var(--muted); }
.badge-gold { background: var(--gold-50); color: #7A5A12; }
.badge-navy { background: var(--navy-50); color: var(--navy); }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.chip svg { width: 15px; height: 15px; }

/* ---------- Alertas ---------- */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 12px; border: 1px solid; font-size: .95rem; margin-bottom: 1rem; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--success-50); border-color: #bfe5d4; color: #0b5c40; }
.alert-error { background: var(--danger-50); border-color: #f2c9c6; color: #8d2620; }
.alert-warning { background: var(--warning-50); border-color: #f5dca6; color: #7a4d00; }
.alert-info { background: var(--info-50); border-color: #C7DAEE; color: #174A7C; }
.alert-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0 .2rem; }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label, .label { display: block; font-weight: 650; font-size: .9rem; color: var(--navy); margin-bottom: .35rem; }
.field .req { color: var(--danger); }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number],
.field input[type=date], .field input[type=datetime-local], .field input[type=tel], .field input[type=url], .field input[type=search], .field select, .field textarea {
  width: 100%; min-height: 44px; padding: .6rem .8rem; font: inherit; font-size: .96rem; color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(197, 160, 89, .15); }
.field input[type=file] { width: 100%; padding: .5rem; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); font: inherit; font-size: .9rem; }
.is-invalid, .field .is-invalid { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: .84rem; margin: .3rem 0 0; font-weight: 600; }
.hint { color: var(--muted); font-size: .83rem; margin: .3rem 0 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .93rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--navy); flex: none; }
.input-group { display: flex; gap: .5rem; }
.input-group > :first-child { flex: 1; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem 1.25rem; margin: 0; }
legend { padding: 0 .45rem; font-weight: 750; color: var(--navy); }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; }

/* ---------- Tablas ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: .7rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FFFDF9; }
.table th.text-center { text-align: center; }
.table th.text-right { text-align: right; }
.table .cell-title { font-weight: 650; color: var(--navy); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.page-head .lead { margin: .25rem 0 0; color: var(--muted); }
.eyebrow { display: inline-block; font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--cyan-600); margin-bottom: .35rem; }
.breadcrumb { font-size: .86rem; color: var(--muted); margin-bottom: .5rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--navy); }

.subnav { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; }
.subnav a { padding: .7rem 1rem; font-weight: 650; font-size: .93rem; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--navy); }
.subnav a.is-active { color: var(--navy); border-bottom-color: var(--cyan); }

/* ---------- Progreso ---------- */
.progress { height: 8px; background: #e7ecf3; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--navy)); border-radius: 99px; }
.progress.is-done > span { background: linear-gradient(90deg, #26b37f, var(--success)); }

/* ---------- KPI ---------- */
.kpi { display: flex; gap: 1rem; align-items: center; padding: 1.15rem 1.25rem; }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi-icon svg { width: 23px; height: 23px; }
.kpi-icon.navy { background: var(--navy-50); color: var(--navy); }
.kpi-icon.cyan { background: var(--cyan-50); color: var(--cyan-600); }
.kpi-icon.gold { background: var(--gold-50); color: #8A6A28; }
.kpi-icon.green { background: var(--success-50); color: var(--success); }
.kpi-value { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.kpi-label { font-size: .84rem; color: var(--muted); }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--map); margin: 0 auto .75rem; }
.empty h3 { color: var(--navy); }

/* ==========================================================================
   Layout de aplicación (barra lateral)
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--navy-900) 0 var(--sidebar), var(--bg) var(--sidebar)); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--navy-900); color: #DCCFB8; display: flex; flex-direction: column; z-index: 60; }
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar-brand img { width: 38px; height: auto; }
.sidebar-brand strong { display: block; color: #fff; font-size: 1rem; line-height: 1.15; }
.sidebar-brand span { font-size: .74rem; color: var(--cyan); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.side-nav { padding: 1rem .75rem; flex: 1; }
.side-label { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #6f86a6; padding: .9rem .75rem .35rem; }
.side-nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 10px; color: #DCCFB8; font-weight: 600; font-size: .93rem; margin-bottom: 2px; }
.side-nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.is-active { background: linear-gradient(90deg, rgba(197, 160, 89, .22), rgba(197, 160, 89, .06)); color: #fff; box-shadow: inset 3px 0 0 var(--cyan); }
.side-nav .count { margin-left: auto; background: var(--gold); color: var(--navy-900); font-size: .72rem; font-weight: 800; border-radius: 99px; padding: .05rem .5rem; }
.sidebar-user { padding: 1rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: .7rem; }
.sidebar-user .who { min-width: 0; flex: 1; }
.sidebar-user strong { display: block; color: #fff; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user span { font-size: .76rem; color: #A8B4C7; }
.sidebar-user button { background: none; border: 0; color: #A8B4C7; cursor: pointer; padding: .35rem; border-radius: 8px; }
.sidebar-user button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.sidebar-user svg { width: 19px; height: 19px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--cyan); color: #fff; flex: none; }
.avatar.gold { background: var(--gold); color: var(--navy-900); }

.app-top { display: none; }
.app-main { padding: 2rem clamp(16px, 3vw, 2.5rem) 3rem; max-width: 1280px; width: 100%; }
.backdrop { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(var(--sidebar), 84vw); transform: translateX(-100%); transition: transform .22s ease, visibility .22s; visibility: hidden; }
  .sidebar.is-open { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  .backdrop.is-open { display: block; position: fixed; inset: 0; background: rgba(10, 25, 47, .45); z-index: 55; }
  .app-top { display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--border); padding: .6rem 16px; }
  .app-top img { height: 30px; width: auto; }
  .app-top .nav-toggle { display: grid; place-items: center; margin-left: 0; }
  .app-main { padding: 1.25rem 16px 2.5rem; }
}

/* ==========================================================================
   Autenticación
   ========================================================================== */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { position: relative; overflow: hidden; background: var(--navy-900) var(--auth-photo, none) center / cover no-repeat; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(10, 25, 47, .92) 0%, rgba(16, 44, 84, .78) 55%, rgba(10, 25, 47, .9) 100%); }
.auth-side::after { content: ""; position: absolute; inset: auto -140px -160px auto; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(197, 160, 89, .35), rgba(197, 160, 89, 0) 70%); }
.auth-logo img { height: 66px; width: auto; }
.auth-side-copy { max-width: 470px; }
.auth-side .eyebrow { color: var(--gold); }
.auth-foot { color: #b9c3d3; }
.auth-side > * { position: relative; }
.auth-side img.logo { height: 44px; width: auto; }
.auth-side h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 700; max-width: 460px; }
.auth-side h2 em { font-style: italic; color: var(--gold); }
.auth-side p { color: #dfe5ee; max-width: 440px; }
.auth-side .shield { width: 120px; margin-bottom: 1.5rem; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 2.5rem 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 460px; }
.auth-card.wide { max-width: 680px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: .25rem; }
.auth-card .lead { color: var(--muted); margin-bottom: 1.5rem; }
.auth-links { margin-top: 1.25rem; font-size: .92rem; text-align: center; color: var(--muted); }
.auth-mobile-brand { display: none; margin-bottom: 1.5rem; }
.auth-mobile-brand img { height: 54px; width: auto; }
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand { display: block; }
}

/* ==========================================================================
   Aula virtual
   ========================================================================== */
.course-hero { --school-accent: var(--gold); background: radial-gradient(120% 140% at 100% 0%, rgba(197, 160, 89, .28) 0%, rgba(197, 160, 89, 0) 45%), linear-gradient(135deg, var(--navy-900) 0%, var(--navy) 70%, #1C3F6E 100%); color: #fff; border-radius: var(--radius); padding: 1.75rem; position: relative; overflow: hidden; }
.course-hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid color-mix(in srgb, var(--school-accent) 18%, transparent); }
.course-hero .eyebrow { color: var(--school-accent); }
.course-hero .breadcrumb, .course-hero .breadcrumb a { color: #c6cfdd; }
.course-hero h1 { color: #fff; margin-bottom: .35rem; }
.course-hero p { color: #d2e1f4; margin: 0; }
.course-hero .chip { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #e6eef9; }
.course-hero .row { margin-top: 1rem; position: relative; z-index: 1; }

.outline { list-style: none; margin: 0; padding: 0; }
.outline-module + .outline-module { border-top: 1px solid var(--border); }
.outline-module > .module-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .95rem 1.25rem; font-weight: 750; color: var(--navy); background: var(--surface-2); }
.outline-module ul { list-style: none; margin: 0; padding: 0; }
.lesson-item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem; border-top: 1px solid var(--border); color: var(--text); font-size: .94rem; }
a.lesson-item:hover { background: var(--surface-2); color: var(--navy); text-decoration: none; }
.lesson-item.is-current { background: var(--cyan-50); box-shadow: inset 3px 0 0 var(--cyan); }
.lesson-state { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; flex: none; }
.lesson-state svg { width: 14px; height: 14px; }
.lesson-item.is-done .lesson-state { background: var(--success); border-color: var(--success); color: #fff; }
.lesson-item .dur { margin-left: auto; color: var(--muted); font-size: .82rem; white-space: nowrap; }

.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.lesson-layout .outline-card { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
@media (max-width: 1020px) { .lesson-layout { grid-template-columns: 1fr; } .lesson-layout .outline-card { position: static; max-height: none; } }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; margin-bottom: 1.25rem; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose { font-size: 1.02rem; line-height: 1.75; }
.prose p { margin-bottom: 1.05em; }
.prose a { text-decoration: underline; word-break: break-word; }
.lesson-nav { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Pasos del certificado */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; counter-reset: s; margin-bottom: 1.5rem; }
.step { position: relative; padding: .9rem 1rem .9rem 3.2rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: #F1EEE8; color: var(--muted); }
.step strong { display: block; color: var(--navy); }
.step.is-done { border-color: #bfe5d4; background: var(--success-50); }
.step.is-done::before { content: "✓"; background: var(--success); color: #fff; }
.step.is-current { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(197, 160, 89, .12); }
.step.is-current::before { background: var(--cyan); color: #fff; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }

/* Cuestionario */
.quiz-bar { position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; margin-bottom: 1.25rem; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
@media (max-width: 980px) { .quiz-bar { top: 52px; } }
.timer { font-weight: 800; font-size: 1.1rem; color: var(--navy); font-variant-numeric: tabular-nums; display: inline-flex; gap: .4rem; align-items: center; }
.timer svg { width: 19px; height: 19px; color: var(--cyan); }
.timer.is-low { color: var(--danger); }
.question { padding: 1.25rem 1.35rem; }
.question + .question { border-top: 1px solid var(--border); }
.question-head { display: flex; gap: .75rem; margin-bottom: .85rem; }
.question-num { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .88rem; }
.question-text { font-weight: 650; color: var(--text); white-space: pre-line; }
.options { display: grid; gap: .5rem; padding-left: 2.6rem; }
@media (max-width: 560px) { .options { padding-left: 0; } }
.option { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .9rem; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; transition: border-color .12s, background .12s; }
.option:hover { border-color: var(--cyan); background: #f7fcff; }
.option input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--navy); flex: none; }
.option:has(input:checked) { border-color: var(--navy); background: var(--navy-50); }
.option.is-correct { border-color: #9fd8bf; background: var(--success-50); }

/* Certificado (vista y verificación) */
.verify-card { max-width: 720px; margin: 0 auto; text-align: center; }
.verify-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; }
.verify-icon svg { width: 36px; height: 36px; }
.verify-icon.ok { background: var(--success-50); color: var(--success); }
.verify-icon.bad { background: var(--danger-50); color: var(--danger); }
.data-list { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: .55rem 1rem; text-align: left; margin: 0; }
.data-list dt { color: var(--muted); font-size: .9rem; }
.data-list dd { margin: 0; font-weight: 650; color: var(--text); word-break: break-word; }
@media (max-width: 560px) { .data-list { grid-template-columns: 1fr; gap: .1rem; } .data-list dd { margin-bottom: .6rem; } }

.price-box { display: flex; gap: 1rem; flex-wrap: wrap; }
.price-box > div { flex: 1; min-width: 140px; padding: .85rem 1rem; border-radius: 12px; background: var(--gold-50); border: 1px solid #f3dea2; }
.price-box span { display: block; font-size: .8rem; color: #7A5A12; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.price-box strong { font-size: 1.3rem; color: var(--navy); }

details.inline-form summary { cursor: pointer; list-style: none; }
details.inline-form summary::-webkit-details-marker { display: none; }
details.inline-form[open] summary { margin-bottom: .75rem; }
details.inline-form .box { padding: 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }

.pagination { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; padding: 1rem; }
.pagination a, .pagination span { min-width: 38px; height: 38px; padding: 0 .6rem; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: #fff; font-weight: 650; font-size: .9rem; color: var(--navy); }
.pagination .is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination a:hover { border-color: var(--navy); }
.pagination .pg-step { display: inline-flex; align-items: center; gap: .35rem; padding: 0 .8rem; white-space: nowrap; }
.pagination .pg-step .pg-txt { display: inline; min-width: 0; height: auto; padding: 0; border: 0; background: none; font: inherit; color: inherit; }
.pagination .is-disabled { color: var(--muted); background: var(--bg, #f5f7fa); cursor: not-allowed; opacity: .65; }
.pagination .pg-gap { border: 0; background: none; min-width: 20px; color: var(--muted); }
.pagination { padding-bottom: .4rem; }
.pagination-info { text-align: center; font-size: .82rem; color: var(--muted); margin: 0 0 1rem; }
@media (max-width: 520px) { .pagination .pg-step .pg-txt { display: none; } .pagination a, .pagination span { min-width: 34px; height: 34px; } }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; }
.filters .grow { flex: 1; min-width: 200px; }

.signature-preview { max-height: 70px; width: auto; border: 1px dashed var(--border-strong); border-radius: 8px; padding: .35rem; background: #fff; }
.cover-preview { max-height: 120px; width: auto; border-radius: 10px; }

.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .04em; color: var(--navy); background: var(--navy-50); padding: .15rem .45rem; border-radius: 6px; }

.error-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 16px; text-align: center; background: var(--bg); }
.error-page .code-big { font-size: clamp(4rem, 12vw, 7rem); font-weight: 800; color: var(--navy); line-height: 1; letter-spacing: -.04em; }
.error-page .code-big span { color: var(--cyan); }
.error-page pre { text-align: left; background: #0f1b2e; color: #dce6f5; padding: 1rem; border-radius: 10px; overflow: auto; max-width: 900px; font-size: .8rem; }

@media print {
  .sidebar, .app-top, .topbar, .footer, .btn, .form-actions { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}

/* ---------- Utilidades finales ---------- */
[hidden] { display: none !important; }
svg.inline { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; }
.opt-row { align-items: center; }
.opt-row .check { flex: none; }
.opt-row .check input { margin-top: 0; }
details.inline-form { position: relative; }
.table details.inline-form[open] .box { position: absolute; right: 0; z-index: 20; box-shadow: var(--shadow-lg); background: #fff; }
.table td.text-center details.inline-form[open] .box { left: 50%; right: auto; transform: translateX(-50%); }
@media (max-width: 1020px) { aside[style*="sticky"] { position: static !important; } }

/* Ruta de navegación del verificador interno */
.verify-crumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; font-size: .85rem; color: var(--muted); }
.verify-crumbs a { color: var(--sky-ink, #0077B6); font-weight: 600; }

/* Recursos insertados (iframe/embed saneados por App\Services\Embed) */
.embed { position: relative; width: 100%; padding-top: var(--ratio, 56.25%); border-radius: var(--radius); overflow: hidden; background: var(--navy-900); box-shadow: var(--shadow); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed--fixed { padding-top: 0; background: var(--surface); border: 1px solid var(--border); }
.embed--fixed iframe { position: static; display: block; }
.embed + .embed { margin-top: 1rem; }

/* Catálogo público con filtros (área, tipo y palabra clave) */
.catalog-filters { display: grid; grid-template-columns: 1fr; gap: .9rem; margin-bottom: 1rem; }
.catalog-filters .field { margin: 0; }
.catalog-filters-actions { display: flex; gap: .5rem; align-items: flex-end; }
@media (min-width: 760px) { .catalog-filters { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; } }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.input-icon input, .input-icon input[type=search] { padding-left: 2.6rem; width: 100%; }
.type-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.type-chips a { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--navy); font-weight: 700; font-size: .86rem; text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.type-chips a span { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border-radius: 999px; background: var(--navy-50); font-size: .75rem; }
.type-chips a:hover { border-color: var(--cyan); transform: translateY(-1px); }
.type-chips a.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.type-chips a.is-on span { background: var(--gold); color: var(--navy); }

/* Tarjetas de selección (radio) */
.choice-cards { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .choice-cards { grid-template-columns: 1fr 1fr; } }
.choice-card, .field .choice-card { position: relative; display: flex; gap: .75rem; align-items: flex-start; padding: 1rem 1.1rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color .2s, box-shadow .2s, background .2s; }
.choice-card input { margin-top: .2rem; accent-color: var(--navy); }
.choice-card strong { display: block; color: var(--navy); }
.choice-card small { display: block; color: var(--muted); font-size: .84rem; margin-top: .2rem; }
.choice-card:hover { border-color: var(--cyan); }
.choice-card:has(input:checked) { border-color: var(--navy); background: var(--navy-50); box-shadow: 0 0 0 3px rgba(16, 44, 84, .08); }
[data-edu-only][hidden], [data-task-only][hidden] { display: none !important; }

/* Entregas de tareas */
.submission-list { list-style: none; margin: 0; padding: 0; }
.submission-list li { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: grid; gap: .45rem; }
.submission-list li:first-child { border-top: 0; }
.file-chip { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; padding: .35rem .7rem; border-radius: var(--radius-sm); background: var(--navy-50); color: var(--navy); font-weight: 600; font-size: .85rem; text-decoration: none; word-break: break-all; }
.file-chip svg { width: 16px; height: 16px; flex: none; }
.file-chip:hover { background: var(--cyan-50); }
.feedback { padding: .6rem .8rem; border-left: 3px solid var(--success); background: var(--success-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.text-warning { color: var(--warning); }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.tpl-thumb { display: block; max-height: 90px; max-width: 220px; margin-top: .5rem; padding: .35rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: repeating-conic-gradient(#f1f4f8 0% 25%, #fff 0% 50%) 50% / 14px 14px; object-fit: contain; }

/* Pago en línea dentro del aula */
.pay-online .pay-logos { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pay-online .pay-logos img { height: 30px; width: auto; padding: 3px 6px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.pay-kv { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; font-size: .9rem; padding-bottom: .5rem; border-bottom: 1px dashed var(--border); }
.pay-kv span { color: var(--muted); }
.pay-kv strong { color: var(--navy); }

/* ===================== v1.4 · Menú lateral desplegable, transiciones y tablas adaptables ===================== */
.sidebar { scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior: contain; }
.sidebar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.side-nav { padding: .85rem .7rem; display: flex; flex-direction: column; gap: 2px; }
.side-nav a { transition: background .2s ease, color .2s ease, transform .2s ease; }
.side-nav a:hover { transform: translateX(2px); }
.side-group { border-radius: 12px; transition: background .25s ease; }
.side-group.is-open { background: rgba(255, 255, 255, .035); }
.side-group-btn { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .62rem .75rem; border: 0; border-radius: 10px; background: none; color: #B9C3D3; font: 700 .78rem/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; text-align: left; transition: color .2s, background .2s; }
.side-group-btn svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.side-group-btn > span:not(.side-chev) { flex: 1; }
.side-group-btn:hover, .side-group.is-current > .side-group-btn { color: #fff; background: rgba(255, 255, 255, .05); }
.side-group-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.side-chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .25s ease; flex: none; }
.side-group.is-open .side-chev { transform: rotate(-135deg) translateY(-1px); }
.side-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.side-group-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.2, .7, .2, 1); }
.side-group.is-open .side-group-items { grid-template-rows: 1fr; }
.side-group-inner { overflow: hidden; padding-left: .35rem; }
.side-group.is-open .side-group-inner { padding-bottom: .35rem; }
.side-group-inner a { font-size: .9rem; }
.no-js .side-group-items { grid-template-rows: 1fr; }

/* Entrada suave del contenido y microinteracciones */
@keyframes mpg-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.app-main > * { animation: mpg-rise .38s cubic-bezier(.2, .7, .2, 1) both; }
.app-main > *:nth-child(2) { animation-delay: .04s; }
.app-main > *:nth-child(3) { animation-delay: .08s; }
.card { transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease; }
a.card:hover, .course-card:hover, .kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn { transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.btn:active { transform: translateY(1px); }
html { scroll-behavior: smooth; }
details > summary { transition: background .2s ease; }
details[open] > .box { animation: mpg-rise .22s ease both; }
.alert { animation: mpg-rise .3s ease both; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .app-main > *, .alert, details[open] > .box { animation: none; }
  .side-group-items, .side-chev, .card, .btn, .side-nav a { transition: none; }
}

/* Tablas: si no caben, se convierten en tarjetas (sin desplazamiento horizontal) */
.table-wrap.is-cards { overflow: visible; }
.table-wrap.is-cards .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.table-wrap.is-cards .table, .table-wrap.is-cards .table tbody, .table-wrap.is-cards .table tr, .table-wrap.is-cards .table td { display: block; width: 100%; }
.table-wrap.is-cards .table tr { padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.table-wrap.is-cards .table tr:last-child { border-bottom: 0; }
.table-wrap.is-cards .table td { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .3rem 0; border: 0; text-align: right !important; }
.table-wrap.is-cards .table td::before { content: attr(data-label); flex: none; max-width: 45%; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: left; }
.table-wrap.is-cards .table td[data-label=""]::before { content: none; }
.table-wrap.is-cards .table td:first-child { display: block; text-align: left !important; padding-bottom: .45rem; }
.table-wrap.is-cards .table td:first-child::before { content: none; }
.table-wrap.is-cards .table td.actions { justify-content: flex-end; flex-wrap: wrap; white-space: normal; }
.table-wrap.is-cards .table tbody tr:hover { background: transparent; }
.table-wrap.is-cards details.inline-form[open] .box { position: static; transform: none; margin-top: .5rem; }

/* Lista de verificación (Pasarela Wompi) */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .88rem; }
.checklist li { display: flex; gap: .5rem; align-items: flex-start; }
.checklist svg { width: 18px; height: 18px; flex: none; margin-top: .1rem; }
.checklist .is-ok svg { color: var(--success); }
.checklist .is-bad { color: var(--warning); }

/* ==========================================================================
   Editor visual de plantillas de certificado (v1.5.0)
   ========================================================================== */
.ce { overflow: visible; }
.ce-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border); background: var(--bg); border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: var(--appbar-h, 64px); z-index: 20; }
.ce-tools { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ce-tool { display: inline-flex; align-items: center; gap: .35rem; height: 34px; padding: 0 .75rem; border: 1px solid var(--border-strong); border-radius: 9px; background: #fff; color: var(--navy); font: 600 .84rem/1 var(--font); cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.ce-tool svg { width: 16px; height: 16px; }
.ce-tool:hover { background: #FAF4E6; border-color: var(--cyan); }
.ce-tool:active { transform: translateY(1px); }
.ce-tool.is-busy { opacity: .6; pointer-events: none; }
.ce-icon { width: 34px; padding: 0; justify-content: center; font-size: 1.1rem; }
.ce-check { display: inline-flex; align-items: center; gap: .3rem; font-size: .84rem; font-weight: 600; color: var(--muted); padding: 0 .3rem; }
.ce-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; }
.ce-stage { padding: 1.1rem; background: repeating-conic-gradient(#F1EEE8 0% 25%, #f7f9fc 0% 50%) 50% / 22px 22px; min-width: 0; border-radius: 0 0 0 var(--radius); }
.ce-page { position: relative; width: 100%; max-width: 980px; margin: 0 auto; background: #fff; box-shadow: 0 10px 30px rgba(10, 25, 47, .16), 0 0 0 1px rgba(10, 25, 47, .08); overflow: hidden; touch-action: none; user-select: none; outline: none; }
.ce-page:focus-visible { box-shadow: 0 0 0 3px rgba(197, 160, 89, .45), 0 10px 30px rgba(10, 25, 47, .16); }
.ce-bg { position: absolute; inset: 0; background: center / 100% 100% no-repeat; pointer-events: none; }
.ce-frame { position: absolute; inset: 0; pointer-events: none; }
.ce-frame i { position: absolute; display: block; box-sizing: border-box; }
.ce-layer { position: absolute; inset: 0; }
.ce-el { position: absolute; box-sizing: border-box; cursor: move; outline: 1px dashed transparent; outline-offset: 1px; transition: outline-color .12s; }
.ce-el:hover { outline-color: rgba(197, 160, 89, .7); }
.ce-el.is-sel { outline: 2px solid var(--cyan); outline-offset: 1px; z-index: 5; }
.ce-el.is-off { opacity: .28; }
.ce-el.is-empty { opacity: .45; outline: 1px dashed #9aa8bd; }
.ce-texto { white-space: pre-wrap; overflow-wrap: break-word; }
.ce-txt { display: block; }
.ce-imagen img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.ce-ph { display: grid; place-content: center; height: 100%; overflow: hidden; text-align: center; font: 600 10px/1.2 var(--font); color: #7b8aa3; background: rgba(240, 244, 250, .7); border: 1px dashed #b7c3d6; }
.ce-ph small { display: block; font-weight: 500; opacity: .8; }
.ce-linea { min-height: 1px; }
.ce-linea::after { content: ""; position: absolute; left: 0; right: 0; top: -5px; bottom: -5px; }
.ce-firma { text-align: center; }
.ce-sig-img { display: flex; align-items: center; justify-content: center; }
.ce-sig-img img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.ce-sig-img span { font: italic 600 10px var(--font); color: #a0adc0; }
.ce-sig-name, .ce-sig-role { white-space: nowrap; }
.ce-qr img { display: block; pointer-events: none; }
.ce-qr-cap { text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 1.3; white-space: nowrap; }
.ce-handle { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--cyan); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.ce-handle[data-handle="w"] { right: -8px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.ce-handle[data-handle="corner"], .ce-handle[data-handle="qr"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.ce-guide { position: absolute; pointer-events: none; z-index: 8; }
.ce-guide-v { top: 0; bottom: 0; width: 0; border-left: 1px dashed #BC2020; }
.ce-guide-h { left: 0; right: 0; height: 0; border-top: 1px dashed #BC2020; }
.ce-note { display: flex; gap: .4rem; align-items: flex-start; max-width: 980px; margin: .7rem auto 0; font-size: .8rem; color: var(--muted); }
.ce-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.ce-panel { border-left: 1px solid var(--border); background: #fff; display: flex; flex-direction: column; min-width: 0; border-radius: 0 0 var(--radius) 0; }
.ce-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.ce-tabs button { padding: .7rem; border: 0; background: none; font: 700 .85rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.ce-tabs button.is-on { color: var(--navy); border-bottom-color: var(--cyan); }
.ce-tabpane { padding: .9rem; overflow-y: auto; max-height: calc(100vh - 170px); position: sticky; top: calc(var(--appbar-h, 64px) + 56px); scrollbar-width: thin; }
.ce-empty p { font-size: .86rem; color: var(--muted); margin: .5rem 0 0; }
.ce-mini { font-size: .76rem; color: var(--muted); margin: .25rem 0 .6rem; line-height: 1.45; }
.ce-mini code, .ce-empty code { font-size: .72rem; background: #F3EFE7; padding: .05rem .25rem; border-radius: 4px; }
.ce-props-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.ce-type { font-weight: 800; color: var(--navy); font-size: .92rem; }
.ce-actions, .ce-quick { display: flex; gap: .35rem; flex-wrap: wrap; }
.ce-actions button, .ce-quick button { border: 1px solid var(--border-strong); background: #fff; border-radius: 8px; padding: .3rem .55rem; font: 600 .76rem var(--font); color: var(--navy); cursor: pointer; }
.ce-actions button:hover, .ce-quick button:hover { border-color: var(--cyan); background: #FAF4E6; }
.ce-actions .danger { color: var(--danger); }
.ce-actions .danger:hover { border-color: var(--danger); background: var(--danger-50); }
.ce-f { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .6rem; min-width: 0; flex: 1; }
.ce-f > span { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ce-f input[type=text], .ce-f input[type=number], .ce-f select, .ce-f textarea { width: 100%; padding: .42rem .55rem; border: 1px solid var(--border-strong); border-radius: 8px; font: 500 .86rem var(--font); background: #fff; color: var(--text); min-height: 34px; }
.ce-f textarea { resize: vertical; min-height: 70px; line-height: 1.4; }
.ce-f input:focus, .ce-f select:focus, .ce-f textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(197, 160, 89, .15); }
.ce-f input[type=color] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; cursor: pointer; }
.ce-num { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: #fff; }
.ce-num input[type=number] { border: 0 !important; box-shadow: none !important; min-width: 0; }
.ce-num em { font-style: normal; font-size: .72rem; color: var(--muted); padding: 0 .45rem; }
.ce-row { display: flex; gap: .5rem; }
.ce-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; height: 34px; }
.ce-seg button { min-width: 34px; border: 0; border-right: 1px solid var(--border); background: #fff; font: 600 .9rem var(--font); color: var(--navy); cursor: pointer; }
.ce-seg button:last-child { border-right: 0; }
.ce-seg button.is-on { background: var(--navy); color: #fff; }
.ce-seg button:disabled { opacity: .35; cursor: not-allowed; }
.ce-chk { display: flex; align-items: center; gap: .45rem; font-size: .86rem; margin: .35rem 0; cursor: pointer; }
.ce-chips { display: flex; flex-wrap: wrap; gap: .25rem; margin: -.25rem 0 .3rem; }
.ce-chips button { border: 1px solid #cfe4f3; background: #FBF8F1; color: #174A7C; border-radius: 99px; padding: .12rem .45rem; font: 600 .7rem var(--font); cursor: pointer; }
.ce-chips button:hover { background: var(--cyan); color: #fff; border-color: var(--cyan); }
.ce-pos { padding-top: .5rem; border-top: 1px solid var(--border); margin-top: .3rem; }
.ce-layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ce-layers li { display: flex; align-items: center; border-radius: 8px; }
.ce-layers li.is-sel { background: #e6f4fb; }
.ce-layers li.is-off .ce-layer-name { opacity: .5; text-decoration: line-through; }
.ce-layer-name { flex: 1; display: flex; gap: .5rem; align-items: center; border: 0; background: none; padding: .45rem .5rem; font: 600 .84rem var(--font); color: var(--text); text-align: left; cursor: pointer; border-radius: 8px; min-width: 0; }
.ce-layer-name small { color: var(--muted); font-weight: 500; }
.ce-layer-name span { width: 20px; text-align: center; color: var(--cyan); flex: none; }
.ce-layer-name:hover { background: var(--bg); }
.ce-eye { border: 0; background: none; padding: .35rem .55rem; cursor: pointer; color: var(--navy); font-size: .95rem; border-radius: 8px; }
.ce-eye:hover { background: var(--bg); }
@media (max-width: 1100px) {
  .ce-body { grid-template-columns: 1fr; }
  .ce-panel { border-left: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
  .ce-tabpane { max-height: none; position: static; }
  .ce-stage { padding: .6rem; border-radius: 0; }
}

/* ==========================================================================
   Barra superior de la plataforma (menú horizontal con grupos desplegables).
   ========================================================================== */
:root { --appbar-h: 68px; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 200; background: var(--gold); color: var(--navy-900); padding: .5rem 1rem; font-weight: 700; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
.appbar { position: sticky; top: 0; z-index: 70; background: linear-gradient(180deg, #0F2547 0%, var(--navy-900) 100%); color: #d6e2f2; box-shadow: 0 6px 22px rgba(10, 25, 47, .18); }
.appbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--flame) 0%, #E0742A 18%, var(--gold) 40%, var(--cyan) 100%); }
.appbar-inner { max-width: 1440px; margin: 0 auto; height: var(--appbar-h); padding: 0 clamp(16px, 2.4vw, 32px) 3px; display: flex; align-items: center; gap: 1.25rem; }
.appbar-brand { flex: none; display: flex; align-items: center; }
.appbar-brand img { height: 46px; width: auto; display: block; }
.appnav { display: flex; align-items: center; gap: .15rem; flex: 1; min-width: 0; }
.appnav-link { display: inline-flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .8rem; border: 0; border-radius: 10px; background: none; color: #E2D8C4; font: 600 .9rem/1 var(--font); white-space: nowrap; cursor: pointer; text-decoration: none; transition: background .18s ease, color .18s ease; }
.appnav-link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.appnav-link:hover, .appnav-group.is-open > .appnav-link { background: rgba(255, 255, 255, .08); color: #fff; }
.appnav-link.is-active, .appnav-group.is-current > .appnav-link { color: #fff; background: rgba(197, 160, 89, .18); box-shadow: inset 0 -2px 0 var(--cyan); }
.appnav-link:focus-visible, .appbar-user-btn:focus-visible, .appbar-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.appnav-link .count, .appnav-item .count { background: var(--gold); color: var(--navy-900); font-size: .7rem; font-weight: 800; border-radius: 99px; padding: .1rem .45rem; }
.appnav-chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .22s ease; flex: none; opacity: .8; }
.appnav-group.is-open .appnav-chev { transform: rotate(-135deg) translateY(-1px); }
.appnav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
.appnav-group { position: relative; }
.appnav-menu { position: absolute; top: calc(100% + 10px); left: 0; min-width: 250px; padding: .45rem; background: #fff; border-radius: 14px; box-shadow: 0 18px 44px rgba(10, 25, 47, .22), 0 0 0 1px rgba(10, 25, 47, .06); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 80; }
.appnav-menu::before { content: ""; position: absolute; top: -6px; left: 22px; width: 12px; height: 12px; background: #fff; transform: rotate(45deg); border-radius: 2px; }
.appnav-menu--end { left: auto; right: 0; }
.appnav-menu--end::before { left: auto; right: 22px; }
.appnav-group.is-open > .appnav-menu { opacity: 1; visibility: visible; transform: none; }
.appnav-item { position: relative; display: flex; align-items: center; gap: .65rem; width: 100%; padding: .62rem .75rem; border: 0; border-radius: 10px; background: none; color: var(--text); font: 600 .9rem/1.2 var(--font); text-align: left; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, padding .15s; }
.appnav-item svg { width: 18px; height: 18px; color: var(--cyan); flex: none; }
.appnav-item:hover { background: #FAF4E6; color: var(--navy); padding-left: .9rem; }
.appnav-item.is-active { background: var(--cyan-50, #e6f6fc); color: var(--navy); box-shadow: inset 3px 0 0 var(--cyan); }
.appnav-item .count { margin-left: auto; }
.appnav-item--danger { color: var(--danger); }
.appnav-item--danger svg { color: var(--danger); }
.appnav-item--danger:hover { background: var(--danger-50); color: var(--danger); }
.appnav-menu-head { padding: .55rem .75rem .65rem; margin-bottom: .3rem; border-bottom: 1px solid var(--border); }
.appnav-menu-head strong { display: block; color: var(--navy); font-size: .92rem; }
.appnav-menu-head span { font-size: .78rem; color: var(--muted); }
.appnav-mobile-user { display: none; }
.appbar-end { display: flex; align-items: center; gap: .5rem; margin-left: auto; flex: none; }
.appbar-user-btn { display: flex; align-items: center; gap: .6rem; height: 44px; padding: 0 .55rem 0 .3rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 99px; background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; transition: background .18s; }
.appbar-user-btn:hover, .appbar-user.is-open .appbar-user-btn { background: rgba(255, 255, 255, .13); }
.appbar-user-btn .avatar { width: 34px; height: 34px; font-size: .8rem; }
.appbar-user-btn .who { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.appbar-user-btn .who strong { font-size: .85rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar-user-btn .who small { font-size: .7rem; color: #B9C3D3; }
.appbar-toggle { display: none; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 11px; background: rgba(255, 255, 255, .06); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.appbar-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #fff; transition: transform .25s ease, opacity .2s; }
.appbar-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.appbar-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.appbar-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.app-shell { min-height: calc(100vh - var(--appbar-h)); background: var(--bg); }
.app-shell .app-main { max-width: 1440px; margin: 0 auto; padding: 1.75rem clamp(16px, 2.4vw, 32px) 3rem; width: 100%; }
.lesson-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 1.75rem; }
.lesson-layout .outline-card { top: calc(var(--appbar-h) + 1rem); max-height: calc(100vh - var(--appbar-h) - 2rem); }
.quiz-bar { top: calc(var(--appbar-h) + .5rem); }
@media (max-width: 1280px) {
  .appbar-user-btn .who { display: none; }
  .appnav-link { padding: 0 .6rem; font-size: .86rem; }
}
@media (max-width: 1199px) {
  :root { --appbar-h: 60px; }
  .appbar-brand img { height: 40px; }
  .appbar-toggle { display: flex; }
  .appbar-user { display: none; }
  .appnav { position: fixed; left: 0; right: 0; top: var(--appbar-h); max-height: calc(100vh - var(--appbar-h)); overflow-y: auto; flex-direction: column; align-items: stretch; gap: .2rem; padding: .75rem clamp(16px, 2.4vw, 32px) 1.25rem; background: var(--navy-900); box-shadow: 0 20px 40px rgba(10, 25, 47, .35); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: transform .22s ease, opacity .22s ease, visibility .22s; scrollbar-width: none; }
  .appnav::-webkit-scrollbar { display: none; }
  .appnav.is-open { transform: none; opacity: 1; visibility: visible; }
  .appnav-link { height: 46px; width: 100%; justify-content: flex-start; font-size: .95rem; }
  .appnav-btn .appnav-chev { margin-left: auto; }
  .appnav-menu, .appnav-menu--end { position: static; min-width: 0; padding: 0 0 0 .6rem; background: none; box-shadow: none; border-radius: 0; opacity: 1; visibility: visible; transform: none; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s ease; overflow: hidden; }
  .appnav-menu::before { display: none; }
  .appnav-menu > * { min-height: 0; }
  .appnav-group.is-open > .appnav-menu { grid-template-rows: 1fr; }
  .appnav-menu-inner { overflow: hidden; }
  .appnav-item { color: #E2D8C4; }
  .appnav-item:hover, .appnav-item.is-active { background: rgba(255, 255, 255, .07); color: #fff; }
  .appnav-mobile-user { display: block; margin-top: .4rem; padding-top: .6rem; border-top: 1px solid rgba(255, 255, 255, .1); }
  .appnav-mobile-user form { margin: 0; }
  .lesson-layout { grid-template-columns: 1fr; }
}
@media print { .appbar { display: none !important; } .app-shell .app-main { padding: 0; } }

/* v1.6.0 · Contraseña visible («ojito») */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-right: 2.9rem !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.pw-eye:hover { color: var(--navy); background: #F3EFE7; }
.pw-eye:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.pw-eye svg { width: 20px; height: 20px; }
/* Métricas clicables y enlaces en tablas */
a.kpi-link { position: relative; color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
a.kpi-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md, 0 10px 24px rgba(10, 25, 47, .12)); border-color: var(--cyan); }
.kpi-go { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--cyan); font-weight: 800; opacity: 0; transition: opacity .18s ease, right .18s ease; }
a.kpi-link:hover .kpi-go { opacity: 1; right: .8rem; }
a.cell-link { color: var(--navy); font-weight: 650; text-decoration: none; }
a.cell-link:hover { color: var(--cyan); text-decoration: underline; }
.narrow-form { max-width: 920px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .35rem 1rem; }
.profile-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 1.3rem; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }

/* v1.6.0 · Índice del curso en módulos desplegables (sin barras de desplazamiento) */
.lesson-layout .outline-card { position: static; max-height: none; overflow: visible; }
.outline-acc { display: flex; flex-direction: column; }
.outline-mod { border-top: 1px solid var(--border); }
.outline-mod:first-child { border-top: 0; }
.outline-mod > summary { list-style: none; display: flex; align-items: center; gap: .65rem; padding: .85rem 1.25rem; cursor: pointer; font-weight: 700; color: var(--navy); transition: background .15s; }
.outline-mod > summary::-webkit-details-marker { display: none; }
.outline-mod > summary:hover { background: #f6f9fd; }
.outline-mod > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.om-num { width: 26px; height: 26px; border-radius: 8px; background: #eaf3fb; color: var(--navy); display: grid; place-items: center; font-size: .78rem; flex: none; }
.om-title { flex: 1; min-width: 0; line-height: 1.3; }
.om-count { font-size: .74rem; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 99px; padding: .1rem .5rem; flex: none; }
.om-count.is-done { background: var(--success-50); color: #0b5c40; }
.om-chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s ease; flex: none; opacity: .7; }
.outline-mod[open] .om-chev { transform: rotate(-135deg) translateY(-1px); }
.outline-mod > ul { list-style: none; margin: 0; padding: 0 0 .35rem; }
.outline-acc.is-compact .outline-mod > summary { padding: .7rem 1rem; font-size: .9rem; }
.outline-acc.is-compact .lesson-item { padding: .55rem 1rem .55rem 1.35rem; }
.lesson-item.is-locked { color: #8D93A0; cursor: not-allowed; }
.lesson-item.is-locked .lesson-state { border-style: dashed; color: #8D93A0; }
.lesson-item.is-locked .lesson-state svg { width: 12px; height: 12px; }
/* Material complementario */
.materials { list-style: none; margin: 0; padding: .35rem; display: grid; gap: .25rem; }
.materials a { display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; border-radius: 10px; color: var(--text); text-decoration: none; transition: background .15s; }
.materials a:hover { background: #FBF8F1; }
.materials .mt-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--cyan-50); color: var(--cyan); display: grid; place-items: center; flex: none; }
.materials .mt-ico svg { width: 17px; height: 17px; }
.materials strong { display: block; color: var(--navy); font-size: .93rem; }
.materials small { color: var(--muted); }
.materials .mt-go { margin-left: auto; color: var(--cyan); font-weight: 800; }
/* Clase en vivo */
.live-card { border-color: #C7DAEE; background: linear-gradient(180deg, #f2faff, #fff); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #e0242d; box-shadow: 0 0 0 0 rgba(188, 32, 32, .5); animation: mpg-live 1.8s infinite; }
@keyframes mpg-live { 0% { box-shadow: 0 0 0 0 rgba(188, 32, 32, .5); } 70% { box-shadow: 0 0 0 9px rgba(188, 32, 32, 0); } 100% { box-shadow: 0 0 0 0 rgba(188, 32, 32, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.mat-rows { display: grid; gap: .5rem; margin-bottom: .6rem; }
.mat-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: .5rem; align-items: center; }
@media (max-width: 640px) { .mat-row { grid-template-columns: 1fr auto; } .mat-row input[type=text] { grid-column: 1 / -1; } }
.my-course { overflow: hidden; display: flex; flex-direction: column; }
.my-course-cover { display: block; aspect-ratio: 16 / 6; background: linear-gradient(135deg, var(--navy), #0a5aa8); overflow: hidden; }
.my-course-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.my-course:hover .my-course-cover img { transform: scale(1.04); }
.my-course-cover span { display: grid; place-items: center; height: 100%; color: rgba(255, 255, 255, .55); }
.my-course-cover span svg { width: 40px; height: 40px; }
.type-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.type-card { position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.35rem 1.25rem 1.1rem; color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.type-card:hover { transform: translateY(-3px); border-color: var(--cyan); box-shadow: 0 14px 30px rgba(16, 44, 84, .12); }
.type-card strong { color: var(--navy); font-size: 1.05rem; }
.type-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--cyan-50); color: var(--cyan); display: grid; place-items: center; }
.type-ico svg { width: 23px; height: 23px; }
.type-go { position: absolute; right: 1rem; top: 1.3rem; color: var(--cyan); opacity: 0; transition: opacity .18s, transform .18s; }
.type-go svg { width: 18px; height: 18px; }
.type-card:hover .type-go { opacity: 1; transform: translateX(3px); }
.table-compact th, .table-compact td { padding: .55rem .7rem; font-size: .85rem; }
.row-total td { font-weight: 800; background: #f4f7fb; color: var(--navy); }
.data-list.is-stacked { grid-template-columns: 1fr; gap: .1rem; }
.data-list.is-stacked dd { margin: 0 0 .7rem; overflow-wrap: anywhere; }

/* ===== v1.7.0 · Administración del sitio: slider y aliados ===== */
.banner-admin-list, .partner-admin-list { list-style: none; margin: 0; padding: 0; }
.banner-admin, .partner-admin { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: .5rem 1rem; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); }
.banner-admin:last-child, .partner-admin:last-child { border-bottom: 0; }
.banner-admin.is-off, .partner-admin.is-off { background: var(--surface-2); }
.banner-admin.is-off .banner-admin-thumb, .partner-admin.is-off .partner-admin-logo { opacity: .55; }
.banner-admin.is-editing { box-shadow: inset 4px 0 0 var(--gold); }
.banner-admin-thumb { aspect-ratio: 1200 / 430; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, var(--navy), var(--navy-800)); display: grid; place-items: center; }
.banner-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.banner-admin-thumb span, .partner-admin-logo span { font-size: .75rem; color: rgba(255,255,255,.75); }
.banner-admin-body, .partner-admin-body { min-width: 0; display: grid; gap: .25rem; }
.banner-admin-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.banner-admin-actions form { margin: 0; }
.partner-admin { grid-template-columns: 120px minmax(0, 1fr); }
.partner-admin-logo { height: 64px; border: 1px solid var(--border); border-radius: 10px; background: #fff; display: grid; place-items: center; padding: .4rem; }
.partner-admin-logo img { max-width: 100%; max-height: 52px; object-fit: contain; }
.partner-admin-logo span { color: var(--muted); }
.partner-admin details[open] form { margin-top: .5rem; }
@media (min-width: 900px) { .banner-admin { grid-template-columns: 168px minmax(0, 1fr) auto; } .banner-admin-actions { grid-column: auto; } .partner-admin { grid-template-columns: 120px minmax(0, 1fr) auto; } }
@media (max-width: 520px) { .banner-admin, .partner-admin { grid-template-columns: 1fr; } .banner-admin-actions { justify-content: flex-start; } }
.social-admin { grid-template-columns: 52px minmax(0, 1fr); }
.social-admin-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--navy); font-size: 1.15rem; border: 1px solid var(--border); }
@media (min-width: 900px) { .social-admin { grid-template-columns: 52px minmax(0, 1fr) auto; } }
.person-admin { grid-template-columns: 56px minmax(0, 1fr); }
.person-admin.is-editing { box-shadow: inset 4px 0 0 var(--gold); }
.person-admin-photo { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: var(--navy); display: grid; place-items: center; color: #fff; font-weight: 800; }
.person-admin-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .person-admin { grid-template-columns: 56px minmax(0, 1fr) auto; } }
.is-readonly, input[readonly] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* v1.10.0 · Pagar certificado (canal privado) y columna N.° de las tablas */
.pay-list { list-style: none; margin: 0; padding: 0; }
.pay-row { display: grid; gap: .75rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border, #e5e9f0); }
.pay-row:first-child { border-top: 0; }
.pay-row-info { display: grid; gap: .3rem; justify-items: start; min-width: 0; }
.pay-row-info h3 { margin: 0; font-size: 1rem; }
.pay-row-info p { margin: 0; }
.pay-row-price { display: grid; gap: .1rem; }
.pay-row-price strong { font-size: 1.05rem; }
.pay-row-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pay-row-actions form { margin: 0; }
.pay-row-actions p { margin: 0; }
@media (min-width: 860px) {
  .pay-row { grid-template-columns: minmax(0, 1fr) auto minmax(220px, auto); align-items: center; }
  .pay-row-price { text-align: right; }
  .pay-row-actions { justify-content: flex-end; }
}
.col-num { width: 3.5rem; text-align: center; color: var(--muted, #64748b); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.col-num { font-weight: 600; }

/* v1.10.0 · Búsqueda predictiva [data-live-search] */
.ls-wrap { position: relative; width: 100%; }
.ls-wrap > input { width: 100%; }
.ls-wrap.is-loading::after { content: ""; position: absolute; right: .8rem; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 2px solid var(--border-strong); border-top-color: var(--navy); border-radius: 50%; animation: ls-spin .7s linear infinite; }
@keyframes ls-spin { to { transform: rotate(360deg); } }
.ls-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem; list-style: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: 0 16px 36px rgba(10, 25, 47, .18); max-height: 340px; overflow: auto; text-align: left; }
.ls-list[hidden] { display: none; }
.ls-opt { display: grid; gap: .1rem; padding: .55rem .7rem; border-radius: 7px; cursor: pointer; }
.ls-opt strong { font-size: .92rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-opt small { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-opt[aria-selected="true"] { background: var(--navy-50); }
.ls-opt[aria-selected="true"] strong { color: var(--navy); }
.ls-empty { padding: .6rem .7rem; font-size: .88rem; color: var(--muted); }
.ls-all { margin-top: .2rem; padding: .55rem .7rem; border-top: 1px solid var(--border); font-size: .82rem; font-weight: 600; color: var(--info); cursor: pointer; }
.ls-all:hover { background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .ls-wrap.is-loading::after { animation: none; } }

/* v1.10.0 · Tablas: encabezados ordenables y botón «Generar reporte» */
.table th.th-sort { padding: 0; }
.table th.th-sort a { display: flex; align-items: center; gap: .35rem; padding: .7rem 1rem; color: inherit; text-decoration: none; }
.table th.th-sort.text-right a { justify-content: flex-end; }
.table th.th-sort a:hover { color: var(--navy); background: var(--navy-50); }
.table th.th-sort a:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.table th.th-sort .sort-ind { font-size: .7rem; opacity: .45; }
.table th.th-sort.is-sorted { color: var(--navy); }
.table th.th-sort.is-sorted .sort-ind { opacity: 1; color: var(--gold-600); }
.report-btns { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.btn-report--xls svg { color: #1d6f42; }
.btn-report--pdf svg { color: #c23a32; }
.filters-wrap .field { min-width: 150px; }
.filters-wrap .field input[type="date"] { min-width: 140px; }
.text-danger { color: var(--danger) !important; }
/* La búsqueda predictiva no se recorta dentro de las tarjetas de filtros */
.card.filters, form.filters { overflow: visible; position: relative; z-index: 5; }
.table-wrap.is-cards .table td.col-num { justify-content: flex-start; font-size: .8rem; }

/* v1.10.1 · Rol activo (menú de cuenta): lista desplegable compacta */
.appnav-role { display: grid; gap: .3rem; margin: .1rem 0 .35rem; padding: .55rem .75rem .7rem; border-bottom: 1px solid var(--border); }
.appnav-role label { display: flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.appnav-role label svg { width: 14px; height: 14px; }
.appnav-role select { width: 100%; min-height: 38px; padding: .35rem .6rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: .9rem; font-weight: 600; color: var(--navy); cursor: pointer; }
.appnav-role small { font-size: .74rem; color: var(--muted); }
.appnav-role--mobile { margin: .4rem 0; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-sm); }
.appnav-role--mobile label { color: rgba(255,255,255,.75); }

/* v1.10.1 · Matricular estudiante */
.enroll-top { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .enroll-top { grid-template-columns: 1fr 1fr; align-items: start; } }
.enroll-step { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: .35rem; border-radius: 50%; background: var(--navy); color: #fff; font-size: .75rem; font-weight: 700; }
.enroll-picked { display: flex; align-items: center; gap: .75rem; margin-top: .6rem; padding: .7rem .85rem; border: 1px solid #bfe5d4; border-radius: var(--radius-sm); background: var(--success-50); }
.enroll-picked[hidden] { display: none; }
.enroll-picked > div { flex: 1; min-width: 0; }
.enroll-picked strong { color: var(--navy); }
.enroll-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.enroll-chips .chip { cursor: pointer; font-weight: 600; }
.enroll-chips .chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.enroll-list-wrap { border: 0; padding: 0; margin: 0; }
.enroll-list-wrap legend { display: flex; gap: .6rem; align-items: baseline; font-weight: 700; color: var(--navy); margin-bottom: .5rem; }
.enroll-list { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.enroll-list li { border-top: 1px solid var(--border); }
.enroll-list li:first-child { border-top: 0; }
.enroll-list li[hidden] { display: none; }
.enroll-list label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .7rem .9rem; cursor: pointer; }
.enroll-list label:hover { background: var(--surface-2); }
.enroll-list input { width: 18px; height: 18px; accent-color: var(--navy); }
.enroll-list li:has(input:checked) label { background: var(--navy-50); }
.enroll-list li.is-enrolled label { cursor: not-allowed; opacity: .7; }
.enroll-course { display: grid; gap: .1rem; min-width: 0; }
.enroll-course strong { color: var(--text); }
.enroll-tags { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.enroll-tags [hidden] { display: none; }
@media (max-width: 640px) { .enroll-list label { grid-template-columns: auto minmax(0, 1fr); } .enroll-tags { grid-column: 2; justify-content: flex-start; } }
.enroll-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.enroll-actions [data-course-picked] { margin-right: auto; }
.filters-wrap .field.grow { flex: 2 1 300px; }
.filters-wrap .field:has(#curso) { flex: 1 1 220px; max-width: 320px; }
/* La lupa queda encima del campo cuando la búsqueda predictiva lo envuelve */
.input-icon > svg { z-index: 2; }

/* Tarjetas de selección (categoría de escuela, modo del certificado) y datos fijos del formulario */
@media (min-width: 980px) { .choice-cards { grid-template-columns: repeat(3, 1fr); } }
.edu-fixed { display: grid; gap: .2rem; margin: 0; padding: .65rem .8rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.edu-fixed strong { color: var(--navy); }
.edu-fixed strong[hidden] { display: none; }
.edu-fixed small { color: var(--muted); }

/* ==========================================================================
   Ministerios Palabra de Gloria · componentes de formación (v1.0)
   Escuelas → programas (rutas) → niveles → lecciones
   ========================================================================== */
h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.005em; }
.text-success { color: var(--success); }
.ico-inline { width: 1em; height: 1em; vertical-align: -.15em; display: inline-block; }
.step-num { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: .35rem; border-radius: 50%; background: var(--cyan-50); color: var(--cyan-600); font: 800 .8rem/1 var(--font); vertical-align: 2px; }
.section-title { font-size: 1.25rem; margin: 2rem 0 1rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sticky-aside { position: sticky; top: calc(var(--appbar-h, 68px) + 1rem); }
@media (max-width: 1020px) { .sticky-aside { position: static; } }
.cover-wide { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.check-list li { position: relative; padding-left: 1.6rem; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .2rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--cyan-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237E6025' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 70% no-repeat; }

/* Selector de íconos (escuelas) */
.icon-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.icon-option input { position: absolute; opacity: 0; pointer-events: none; }
.icon-option span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--navy); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.icon-option span svg { width: 22px; height: 22px; }
.icon-option input:checked + span { border-color: var(--cyan); background: var(--cyan-50); color: var(--cyan-600); box-shadow: 0 0 0 3px rgba(197, 160, 89, .25); }
.icon-option input:focus-visible + span { outline: 3px solid rgba(197, 160, 89, .55); outline-offset: 2px; }
.icon-option span:hover { transform: translateY(-1px); }

/* Pestañas de categoría (panel) */
.cat-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.cat-tab { display: flex; flex-direction: column; gap: .2rem; padding: .95rem 1.1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.cat-tab:hover { border-color: var(--cyan); text-decoration: none; transform: translateY(-1px); }
.cat-tab.is-active { border-color: var(--cyan); box-shadow: inset 0 -3px 0 var(--cyan), var(--shadow-sm); background: linear-gradient(180deg, #fff, var(--cyan-50)); }
.cat-tab-title { font-weight: 750; color: var(--navy); }
.cat-tab-meta { font-size: .8rem; color: var(--muted); }
.cat-intro { margin: 0 0 1.25rem; }
@media (max-width: 760px) { .cat-tabs { grid-template-columns: 1fr; } }

/* Escuela en el panel */
.school-card { --school-accent: var(--cyan); overflow: hidden; border-top: 4px solid var(--school-accent); }
.school-card.is-inactive { opacity: .72; }
.school-head { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.school-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: color-mix(in srgb, var(--school-accent, var(--cyan)) 16%, #fff); color: var(--navy); flex: none; }
.school-icon svg { width: 24px; height: 24px; }
.school-title { flex: 1; min-width: 220px; }
.school-title h2 { margin: 0; font-size: 1.15rem; }
.school-title p { margin: .15rem 0 0; }
.school-actions { gap: .4rem; }
.program-block { padding: 1rem 1.35rem 1.2rem; }
.program-block + .program-block { border-top: 1px dashed var(--border-strong); }
.program-block.is-archived { opacity: .6; }
.program-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.program-head h3 { margin: 0; font-size: 1.02rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.program-head h3 a { color: var(--navy); }
.program-head p { margin: .2rem 0 0; }
.program-empty { margin: 0; }

/* Ruta de niveles (panel): pasos conectados */
.route-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; counter-reset: route; }
.route-step a { position: relative; display: flex; gap: .7rem; height: 100%; padding: .8rem .85rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); transition: border-color .15s, background .15s, transform .15s; }
.route-step a:hover { border-color: var(--cyan); background: #fff; transform: translateY(-2px); text-decoration: none; }
.route-step.is-draft a { border-style: dashed; }
.route-step.is-archived a { opacity: .55; }
.route-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: .88rem; flex: none; }
.route-step.is-live .route-num { background: linear-gradient(135deg, var(--gold), var(--cyan)); color: var(--navy-900); }
.route-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.route-body strong { color: var(--navy); font-size: .93rem; line-height: 1.3; }
.route-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .15rem; }
.route-list { list-style: none; margin: 0; padding: .35rem 0; }
.route-row { display: flex; align-items: center; gap: .9rem; padding: .8rem 1.35rem; }
.route-row + .route-row { border-top: 1px solid var(--border); }
.route-main { flex: 1; min-width: 0; }
.route-row .actions, .lesson-admin-list .actions { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.route-row .actions form, .lesson-admin-list .actions form { margin: 0; }
@media (max-width: 640px) { .route-row { flex-wrap: wrap; } .route-row .actions { width: 100%; justify-content: flex-end; } }

/* Lecciones (panel) */
.lesson-admin-list { list-style: none; margin: 0; padding: .35rem 0; }
.lesson-admin-list li { display: flex; align-items: center; gap: .9rem; padding: .75rem 1.35rem; }
.lesson-admin-list li + li { border-top: 1px solid var(--border); }
.lesson-admin-main { flex: 1; min-width: 0; }
@media (max-width: 640px) { .lesson-admin-list li { flex-wrap: wrap; } .lesson-admin-list .actions { width: 100%; justify-content: flex-end; } }

/* Índice de lecciones del estudiante */
.lesson-path { list-style: none; margin: 0; padding: 0; }
.lesson-path .lesson-item { border-top: 1px solid var(--border); }
.lesson-path li:first-child .lesson-item { border-top: 0; }
.lesson-path .lesson-name { flex: 1; min-width: 0; }
.lesson-path .lesson-n { color: var(--muted); font-weight: 700; }
.lesson-path.is-compact .lesson-item { padding: .6rem 1rem; font-size: .9rem; }
.lesson-item.is-locked { color: var(--muted); }
.lesson-item.is-locked .lesson-state { border-style: dashed; }
.lesson-path.is-static .lesson-item { cursor: default; }
.next-level { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; padding: .9rem 1rem; border-radius: 12px; background: linear-gradient(135deg, var(--cyan-50), #fff); border: 1px solid #EBDDBF; }
.next-level strong { display: block; color: var(--navy); }

/* Catálogo de formación */
.formacion-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.5rem; align-items: end; margin-bottom: 1.25rem; }
.formacion-hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: .4rem; }
.formacion-hero h1 em { color: var(--cyan-600); }
.formacion-hero .lead { color: var(--muted); margin: 0; }
.formacion-search { display: flex; gap: .5rem; }
.formacion-search .input-icon { flex: 1; }
@media (max-width: 860px) { .formacion-hero { grid-template-columns: 1fr; } }
.cat-pills { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.cat-pills a { padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--navy); font-weight: 650; font-size: .9rem; }
.cat-pills a:hover { border-color: var(--cyan); text-decoration: none; }
.cat-pills a.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-section { margin-bottom: 2.25rem; }
.cat-section-head { margin-bottom: .9rem; }
.cat-section-head p { margin: 0; }
.school-public { --school-accent: var(--cyan); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.school-public + .school-public { margin-top: 1rem; }
.school-public-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.school-public-head h2 { margin: 0; font-size: 1.2rem; }
.school-public-head p { margin: .1rem 0 0; }
.program-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.program-card { display: flex; flex-direction: column; gap: .6rem; padding: 1.05rem 1.1rem; border-radius: 14px; border: 1px solid var(--border); background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%); color: var(--text); transition: transform .18s, box-shadow .18s, border-color .18s; }
.program-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--school-accent); text-decoration: none; }
.program-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.program-card h3 { margin: 0; font-size: 1.02rem; }
.program-card p { margin: 0; }
.program-cta { margin-top: auto; display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .88rem; color: var(--cyan-600); }
.program-cta svg { width: 16px; height: 16px; transition: transform .18s; }
.program-card:hover .program-cta svg { transform: translateX(3px); }
.mini-route { list-style: none; margin: 0; padding: 0; display: flex; gap: .3rem; flex-wrap: wrap; }
.mini-route li { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem .2rem .25rem; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: .76rem; color: var(--muted); max-width: 100%; }
.mini-route li span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--navy-50); color: var(--navy); font-weight: 800; font-size: .7rem; flex: none; }
.mini-route li em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-route li.is-done span { background: var(--success); color: #fff; }
.small-progress { height: 6px; }
.code-box { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.code-box h3 { margin: 0; }
.code-box p { margin: 0; }
.input-group { display: flex; gap: .5rem; }
.join-box { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; border-top: 4px solid var(--flame); }
.join-box h3, .join-box p { margin: 0; }
.program-mini { display: flex; flex-direction: column; gap: .25rem; color: var(--text); }
.program-mini:hover { border-color: var(--cyan); text-decoration: none; }

/* Programa: encabezado y anillo de avance */
.program-hero { --school-accent: var(--gold); position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding: 2rem; border-radius: var(--radius); color: #fff; margin-bottom: 1.5rem;
  background: radial-gradient(110% 140% at 100% 0%, color-mix(in srgb, var(--school-accent) 34%, transparent) 0%, transparent 50%), linear-gradient(135deg, var(--navy-900), var(--navy) 75%); }
.program-hero h1 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.4rem); margin: .2rem 0 .4rem; }
.program-hero .lead { color: #d9e1ec; max-width: 620px; }
.program-hero .eyebrow { color: var(--school-accent); }
.program-hero .chip { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #eef2f8; }
.chips-row { margin-top: 1rem; }
.progress-ring-card { text-align: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: 18px; padding: 1rem 1.25rem; min-width: 170px; }
.progress-ring-card p { margin: .5rem 0 0; color: #e8edf4; }
.progress-ring { --pct: 0; width: 104px; height: 104px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--pct) * 1%), rgba(255, 255, 255, .14) 0); position: relative; }
.progress-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--navy-900); }
.progress-ring span { position: relative; font-weight: 800; font-size: 1.35rem; color: #fff; }

/* Ruta del estudiante (programa) */
.journey { list-style: none; margin: 0; padding: 0; position: relative; }
.journey::before { content: ""; position: absolute; left: 21px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--gold), var(--border-strong)); }
.journey-step { position: relative; display: flex; gap: 1rem; padding-bottom: 1rem; }
.journey-node { position: relative; z-index: 1; display: grid; place-items: center; width: 45px; height: 45px; border-radius: 50%; background: #fff; border: 3px solid var(--border-strong); color: var(--navy); font-weight: 800; flex: none; transition: transform .2s; }
.journey-node svg { width: 20px; height: 20px; }
.journey-step.is-approved .journey-node { background: var(--success); border-color: var(--success); color: #fff; }
.journey-step.is-in_progress .journey-node { border-color: var(--gold); box-shadow: 0 0 0 6px rgba(212, 175, 55, .18); }
.journey-step.is-available .journey-node { border-color: var(--navy); }
.journey-step.is-locked .journey-node { color: var(--muted); border-style: dashed; }
.journey-card { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.15rem; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.journey-step:hover .journey-card { box-shadow: var(--shadow); transform: translateX(2px); }
.journey-step.is-locked .journey-card { background: var(--surface-2); }
.journey-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.journey-card h3 { margin: .2rem 0 .3rem; font-size: 1.08rem; }
.journey-card h3 a { color: var(--navy); }
.journey-card p { margin: 0 0 .4rem; }
.journey-meta { margin-bottom: .6rem; }
.journey-card .progress { margin-bottom: .6rem; }

/* Ficha del nivel: ruta lateral */
.side-route { list-style: none; margin: 0; padding: .4rem 0; }
.side-route a { display: flex; align-items: center; gap: .6rem; padding: .5rem 1.1rem; color: var(--text); font-size: .9rem; }
.side-route a span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy-50); color: var(--navy); font-weight: 800; font-size: .75rem; flex: none; }
.side-route a:hover { background: var(--surface-2); text-decoration: none; }
.side-route li.is-current a { background: var(--cyan-50); color: var(--navy); font-weight: 700; box-shadow: inset 3px 0 0 var(--cyan); }
.side-route li.is-current a span { background: var(--gold); color: var(--navy-900); }

/* Tarjeta de nivel */
.course-card { --school-accent: var(--gold); display: flex; flex-direction: column; overflow: hidden; height: 100%; position: relative; transition: transform .18s, box-shadow .18s; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.course-cover { position: relative; aspect-ratio: 16 / 8; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--school-accent) 45%, transparent), transparent 60%), linear-gradient(135deg, var(--navy-900), var(--navy)); }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-mark { display: flex; flex-direction: column; align-items: center; gap: .35rem; color: #fff; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; }
.cover-mark svg { width: 34px; height: 34px; color: var(--school-accent); }
.course-card .card-body { display: flex; flex-direction: column; gap: .35rem; flex: 1; padding: 1rem 1.15rem 1.1rem; }
.course-card .course-type { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan-600); }
.course-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.course-card h3 a { color: var(--navy); }
.course-card .course-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.course-card:focus-within { outline: 3px solid var(--cyan); outline-offset: 2px; }
.course-card .course-meta { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin: auto 0 0; padding-top: .6rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); font-weight: 600; }
.course-card .course-hours { display: inline-flex; align-items: center; gap: .3rem; }
.course-card .course-hours svg { width: 15px; height: 15px; }

/* Verificación y certificados (público) */
.verify-grid { align-items: start; }
.help-list, .steps-list { margin: 0; padding-left: 1.1rem; color: var(--muted); display: grid; gap: .45rem; }
.cert-list { list-style: none; margin: 0; padding: 0; }
.cert-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem 0; border-top: 1px solid var(--border); }
.otp-box { padding: 1rem; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.otp-box h3 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1rem; }
.otp-box h3 svg { width: 18px; height: 18px; color: var(--cyan-600); }

/* Microinteracciones con respeto por «reducir movimiento» */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
.minor-box { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 1rem 1.1rem; background: var(--surface-2); }
.minor-box legend { padding: 0 .4rem; font-weight: 750; color: var(--navy); }

/* ==========================================================================
   v1.1.0 · Experiencia del estudiante
   Ruta de crecimiento, «Continúa donde quedaste», logro, lecciones con formato y Mis apuntes.
   ========================================================================== */

/* ---- Contenido de la lección con formato ---- */
.lesson-prose { font-size: 1.05rem; line-height: 1.8; color: var(--text); }
.lesson-prose > :first-child { margin-top: 0; }
.lesson-prose > :last-child { margin-bottom: 0; }
.lesson-prose h2 { font-family: var(--font-display); font-size: 1.5rem; color: var(--navy-900); margin: 1.6em 0 .55em; line-height: 1.25; }
.lesson-prose h3 { font-size: 1.12rem; color: var(--navy); margin: 1.4em 0 .45em; }
.lesson-prose ul, .lesson-prose ol { margin: 0 0 1.05em; padding-left: 1.4rem; }
.lesson-prose li { margin: .3em 0; }
.lesson-prose li::marker { color: var(--cyan-600); font-weight: 700; }
.lesson-prose strong { color: var(--navy-900); }
.lesson-prose hr { border: 0; height: 1px; margin: 2em auto; width: 40%; background: linear-gradient(90deg, transparent, var(--cyan), transparent); }
.lesson-prose blockquote.verse {
  position: relative; margin: 1.6em 0; padding: 1.15rem 1.35rem 1.15rem 1.5rem;
  background: linear-gradient(135deg, var(--cyan-50), #fff); border-left: 4px solid var(--cyan); border-radius: 0 14px 14px 0;
  font-family: var(--font-display); font-size: 1.15rem; line-height: 1.6; color: var(--navy-900);
}
.lesson-prose blockquote.verse p { margin: 0; }
.lesson-prose blockquote.verse cite { display: block; margin-top: .55rem; font-family: var(--font); font-style: normal; font-size: .86rem; font-weight: 700; letter-spacing: .02em; color: var(--cyan-600); }
.lesson-prose blockquote.verse cite::before { content: "— "; }

/* ---- Editor de lecciones (barra de formato) ---- */
.md-editor { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.md-editor:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(197, 160, 89, .22); }
.md-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; padding: .35rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.md-btn { min-width: 36px; height: 34px; padding: 0 .55rem; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--navy-900); font: 700 .9rem/1 var(--font); cursor: pointer; }
.md-btn svg { width: 16px; height: 16px; }
.md-btn:hover { background: #fff; border-color: var(--border); }
.md-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.md-btn.md-sub { font-size: .78rem; }
.md-btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.md-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 .2rem; }
.md-grow { flex: 1; }
.md-editor textarea { display: block; width: 100%; border: 0; border-radius: 0; box-shadow: none; resize: vertical; min-height: 320px;
  padding: .9rem 1rem; font: .95rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.md-editor textarea:focus { outline: none; box-shadow: none; }
.md-preview { padding: 1rem 1.25rem; min-height: 320px; }
.md-help { margin-top: .5rem; }
.md-help summary { cursor: pointer; font-weight: 600; color: var(--cyan-600); }
.md-help ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.md-help code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0 .3rem; font-size: .85em; }
@media (max-width: 640px) { .md-preview-btn { width: 100%; margin-top: .2rem; } .md-grow { display: none; } }

/* ---- «Continúa donde quedaste» ---- */
.resume-card {
  --school-accent: var(--cyan);
  display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; padding: 1.5rem 1.75rem;
  border-radius: var(--radius); color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, rgba(197, 160, 89, .32), transparent 55%), linear-gradient(135deg, var(--navy-900), var(--navy));
  box-shadow: var(--shadow);
}
.resume-card::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; border: 22px solid rgba(255, 255, 255, .05); pointer-events: none; }
.resume-body { flex: 1; min-width: 0; }
.resume-card .eyebrow { color: var(--school-accent); display: inline-flex; align-items: center; gap: .35rem; }
.resume-card h2 { color: #fff; font-family: var(--font-display); font-size: 1.55rem; margin: .3rem 0 .35rem; }
.resume-meta { color: #d7deea; font-size: .9rem; margin: 0 0 .85rem; }
.resume-card .progress { background: rgba(255, 255, 255, .16); max-width: 520px; }
.resume-card .progress > span { background: linear-gradient(90deg, var(--school-accent), var(--gold)); }
.resume-go { flex: none; position: relative; z-index: 1; }
@media (max-width: 720px) {
  .resume-card { flex-direction: column; align-items: stretch; padding: 1.25rem; gap: 1rem; }
  .resume-card h2 { font-size: 1.3rem; }
  .resume-go { width: 100%; justify-content: center; }
}

/* ---- Logro pendiente en el panel ---- */
.achievement-banner { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; padding: .9rem 1.15rem; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold-50), #fff); border: 1px solid #ead9a4; color: var(--navy-900); box-shadow: var(--shadow-sm); }
.achievement-banner:hover { text-decoration: none; border-color: var(--gold); }
.achievement-banner > span:nth-child(2) { flex: 1; }
.achievement-banner-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #fff; }
.achievement-banner-icon svg { width: 20px; height: 20px; }
.achievement-banner > svg { width: 18px; height: 18px; flex: none; color: var(--cyan-600); }

/* ---- Ruta de crecimiento por programa ---- */
.route-card { --school-accent: var(--cyan); padding: 1.25rem 1.4rem 1.4rem; border-top: 3px solid var(--school-accent); }
.route-head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.1rem; }
.route-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--navy); color: var(--school-accent); }
.route-icon svg { width: 22px; height: 22px; }
.route-title { flex: 1; min-width: 0; }
.route-title h2 { margin: .1rem 0 0; font-size: 1.2rem; }
.route-title h2 a { color: var(--navy-900); }
.route-summary { text-align: right; line-height: 1.2; }
.route-summary strong { display: block; font-size: 1.15rem; color: var(--navy-900); }
.route-summary span { font-size: .78rem; color: var(--muted); }

.route-levels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--levels), minmax(0, 1fr)); gap: .75rem; position: relative; }
.route-levels::before { content: ""; position: absolute; top: 27px; left: calc(50% / var(--levels)); right: calc(50% / var(--levels)); height: 2px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 11px); }
.route-level { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem; min-width: 0; }
.route-node { display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--text); border-radius: 14px; padding: 0 .25rem .25rem; width: 100%; }
.route-node:hover { text-decoration: none; }
.route-node:hover .ring { transform: translateY(-2px); }
.route-node:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.ring { position: relative; width: 56px; height: 56px; flex: none; display: grid; place-items: center; transition: transform .2s ease; background: var(--bg); border-radius: 50%; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: #fff; stroke: var(--border); stroke-width: 4; }
.ring-value { fill: none; stroke: var(--school-accent); stroke-width: 4; stroke-linecap: round; }
.ring-label { position: relative; font-weight: 800; color: var(--navy-900); font-size: 1.05rem; display: grid; place-items: center; }
.ring-label svg { position: static; width: 20px; height: 20px; transform: none; }
.route-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.route-level .rl-num { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cyan-600); }
.route-text strong { font-size: .95rem; color: var(--navy-900); line-height: 1.3; }
.route-state { font-size: .8rem; color: var(--muted); }
.route-hint { font-size: .76rem; color: var(--muted); font-style: italic; }
.route-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }

.route-level.is-passed .ring-track { fill: var(--success-50); stroke: var(--success-50); }
.route-level.is-passed .ring-value { stroke: var(--success); }
.route-level.is-passed .ring-label { color: var(--success); }
.route-level.is-passed .route-state { color: var(--success); font-weight: 600; }
.route-level.is-in_progress .ring-track { stroke: #efe4c8; }
.route-level.is-in_progress .route-state { color: var(--cyan-600); font-weight: 600; }
.route-level.is-available .ring-track { stroke: var(--navy); stroke-width: 3; }
.route-level.is-locked .ring-track { fill: var(--surface-2); stroke: var(--border-strong); stroke-dasharray: 4 4; }
.route-level.is-locked .ring-label { color: var(--muted); }
.route-level.is-locked .route-text strong { color: var(--muted); }
.route-level.is-closed .ring-track { fill: var(--surface-2); }

.route-goal { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; align-items: center; margin-top: 1.3rem; padding: .9rem 1rem; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed var(--border-strong); }
.route-goal-icon { grid-row: span 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--border); color: var(--cyan-600); }
.route-goal-icon svg { width: 19px; height: 19px; }
.route-goal strong { display: block; color: var(--navy-900); }
.route-goal span { font-size: .85rem; color: var(--muted); }
.route-goal-bar { grid-column: 2; }
.route-goal.is-complete { background: var(--gold-50); border-style: solid; border-color: #ead9a4; }
.route-goal.is-complete .route-goal-icon { background: var(--gold); border-color: var(--gold); color: #fff; }

/* Un solo nivel: sin línea de unión */
.route-levels.is-single::before { display: none; }

/* Compacta (panel): menos texto, sin acciones */
.route-card.is-compact { padding: 1rem 1.1rem 1.15rem; }
.route-card.is-compact .route-head { margin-bottom: .85rem; }
.route-card.is-compact .route-icon { width: 38px; height: 38px; }
.route-card.is-compact .route-title h2 { font-size: 1.05rem; }
.route-card.is-compact .ring { width: 46px; height: 46px; }
.route-card.is-compact .route-levels::before { top: 22px; }
.route-card.is-compact .route-text strong { font-size: .84rem; }

/* Móvil: la ruta se vuelve vertical */
@media (max-width: 760px) {
  .route-levels { grid-template-columns: 1fr; gap: .2rem; }
  .route-levels::before { top: 28px; bottom: 28px; left: 27px; right: auto; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, var(--border-strong) 0 6px, transparent 6px 11px); }
  .route-level { flex-direction: row; align-items: center; text-align: left; flex-wrap: wrap; gap: .3rem .9rem; padding: .35rem 0; }
  .route-node { flex-direction: row; align-items: center; text-align: left; gap: .9rem; padding: 0; width: auto; flex: 1; }
  .route-actions { justify-content: flex-start; padding-left: calc(56px + .9rem); width: 100%; }
  .route-card.is-compact .route-levels::before { top: 24px; bottom: 24px; left: 22px; }
  .route-card.is-compact .route-actions { padding-left: calc(46px + .9rem); }
  .route-head { flex-wrap: wrap; }
  .route-summary { text-align: left; width: 100%; padding-left: calc(44px + .9rem); display: flex; gap: .35rem; align-items: baseline; }
  .route-summary strong { display: inline; font-size: 1rem; }
}

/* ---- Pantalla de logro ---- */
.achievement { --school-accent: var(--cyan); max-width: 980px; margin: 0 auto; display: grid; gap: 1.25rem; }
.achievement-hero { text-align: center; padding: 2.25rem 1.5rem 2rem; border-radius: calc(var(--radius) + 4px); color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(90% 120% at 50% 0%, rgba(197, 160, 89, .38), transparent 60%), linear-gradient(160deg, var(--navy), var(--navy-900)); box-shadow: var(--shadow-lg); }
.achievement-hero .eyebrow { color: var(--gold); }
.achievement-hero h1 { color: #fff; font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .35rem 0 .2rem; }
.achievement-level { font-size: 1.2rem; font-weight: 700; color: #f3e3b6; margin: 0; }
.achievement-score { margin: .75rem 0 0; color: #d7deea; }
.achievement-score strong { color: #fff; font-size: 1.35rem; }
.achievement-verse { margin: 1.1rem auto 0; max-width: 520px; font-family: var(--font-display); font-style: italic; color: #c9d3e3; font-size: .98rem; }
.achievement-ring { position: relative; width: 112px; height: 112px; margin: 0 auto 1rem; display: grid; place-items: center; }
.achievement-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.achievement-ring .ring-track { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .14); stroke-width: 6; }
.achievement-ring .ring-value { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 0; }
.achievement-check { position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--navy-900); }
.achievement-check svg { width: 32px; height: 32px; stroke-width: 3; }
.achievement-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; }
.achievement-step h2 { margin: 0; font-size: 1.25rem; }
.achievement-step .btn, .achievement-cert .btn { align-self: flex-start; }
.achievement-cert { border-top: 3px solid var(--gold); }
.achievement-back { text-align: center; color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) {
  .achievement-grid { grid-template-columns: 1fr; }
  .achievement-step .btn, .achievement-cert .btn { align-self: stretch; justify-content: center; }
}
@media (prefers-reduced-motion: no-preference) {
  .achievement-ring .ring-value { animation: ring-draw 1.1s cubic-bezier(.3, .7, .2, 1) .15s both; }
  .achievement-check { animation: check-pop .45s cubic-bezier(.3, 1.6, .5, 1) .9s both; }
  .achievement-hero h1, .achievement-level { animation: rise-in .6s ease .35s both; }
}
@keyframes ring-draw { from { stroke-dashoffset: 327; } to { stroke-dashoffset: 0; } }
@keyframes check-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Mis apuntes ---- */
.notes-card { border-top: 3px solid var(--cyan); }
.notes-card textarea { width: 100%; min-height: 150px; resize: vertical; line-height: 1.65; font: inherit; background: var(--surface-2); }
.notes-card textarea:focus { background: #fff; }
.notes-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notes-tile { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.15rem; color: var(--text); }
.notes-tile:hover { text-decoration: none; border-color: var(--cyan); }
.notes-tile > span:nth-child(2) { flex: 1; display: grid; }
.notes-tile strong { color: var(--navy-900); }
.notes-search { display: flex; gap: .5rem; margin-bottom: 1rem; max-width: 560px; }
.notes-search .input-icon { flex: 1; }
.notes-group { border-left: 3px solid var(--school-accent, var(--cyan)); }
.notes-group .card-header h2 { margin: .1rem 0 0; font-size: 1.1rem; }
.notes-list { list-style: none; margin: 0; padding: 0; }
.notes-list li { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.notes-list h3 { margin: 0; font-size: 1rem; }
.note-text { margin-top: .45rem; color: var(--text); line-height: 1.7; overflow-wrap: anywhere; }

/* ---- Panel ---- */
.kpi-row { margin-bottom: 1.5rem; }
.routes-head h2 { margin: 0; font-size: 1.2rem; }

/* ---- v1.2.0 · Certificado global ---- */
.global-cert { border-top: 3px solid var(--gold); background: linear-gradient(135deg, var(--gold-50), #fff 60%); }
.global-cert .card-body { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.global-cert-icon { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #fff; }
.global-cert-icon svg { width: 28px; height: 28px; }
.global-cert-text { flex: 1; min-width: 220px; }
.global-cert-text h2 { margin: .1rem 0 .25rem; font-size: 1.25rem; }
.global-cert-text p { margin: 0; }
.route-goal-go { grid-column: 2; justify-self: start; margin-top: .5rem; }
@media (max-width: 640px) { .global-cert-actions, .global-cert-actions .btn { width: 100%; justify-content: center; } }
