/* ==========================================================================
   SAIGA LMS · Hoja de estilos institucional
   Paleta extraída del escudo y logotipo:
   Azul institucional #003570 · Cian #00A0DF · Dorado #F2A900 · Gris mapa #D3D4D9
   ========================================================================== */

:root {
  --navy: #003570;
  --navy-800: #002b5c;
  --navy-900: #001c3d;
  --navy-50: #e8eef7;
  --cyan: #00a0df;
  --cyan-600: #0089c0;
  --cyan-50: #e5f6fd;
  --gold: #f2a900;
  --gold-600: #d99700;
  --gold-50: #fff5d9;
  --map: #d3d4d9;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #13213a;
  --muted: #5b6880;
  --border: #e1e7ef;
  --border-strong: #cfd8e3;

  --success: #11805a;
  --success-50: #e4f5ee;
  --danger: #c23a32;
  --danger-50: #fcebea;
  --warning: #a86a00;
  --warning-50: #fff4dd;
  --info: #0b6fa4;
  --info-50: #e5f3fb;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 33, 64, .06);
  --shadow: 0 1px 2px rgba(16, 33, 64, .05), 0 8px 24px rgba(16, 33, 64, .06);
  --shadow-lg: 0 18px 50px rgba(0, 28, 61, .14);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-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); }
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(0, 160, 223, .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: minmax(0, 1fr); } }   /* v1.16.1 · sin desborde horizontal en celular */
@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: var(--cyan); color: #fff; }
.btn-accent:hover { background: var(--cyan-600); color: #fff; }
.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: #eef1f6; color: var(--muted); }
.badge-gold { background: var(--gold-50); color: #8a5f00; }
.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: #bfe0f2; color: #0a5480; }
.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(0, 160, 223, .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: #fafcff; }
.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: #a87400; }
.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 público
   ========================================================================== */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.topbar::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--navy) 0 50%, var(--cyan) 50% 82%, var(--gold) 82%); }
.topbar-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 66px; }
.brand { display: flex; align-items: center; gap: .6rem; flex: none; }
.brand img { height: 38px; width: auto; }
.brand-shield { height: 40px !important; }
.nav { display: flex; gap: .25rem; margin-left: auto; align-items: center; }
.nav a { padding: .5rem .85rem; border-radius: 9px; font-weight: 650; font-size: .94rem; color: var(--text); }
.nav a:hover, .nav a.is-active { background: var(--navy-50); color: var(--navy); }
.nav .btn { margin-left: .25rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border-strong); border-radius: 9px; width: 42px; height: 42px; color: var(--navy); cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; margin: auto; }
@media (max-width: 860px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: #fff; padding: .75rem 16px 1rem; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav.is-open { display: flex; }
  .nav .btn { margin: .35rem 0 0; }
  .brand img { height: 32px; }
}

.public-main { min-height: calc(100vh - 70px - 220px); padding: 2rem 0 3.5rem; }

.hero { position: relative; overflow: hidden; background: var(--navy); color: #fff; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 160, 223, .55), rgba(0, 160, 223, 0) 70%); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 2.5rem; align-items: center; padding-top: 3.5rem; padding-bottom: 3.75rem; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .6rem; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { color: #d3e2f5; font-size: 1.08rem; max-width: 560px; }
.hero .row { margin-top: 1.5rem; }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.hero .btn-ghost:hover { border-color: #fff; color: #fff; }
.hero-shield { justify-self: center; width: min(260px, 70%); filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35)); }
.hero-points { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 2rem; font-size: .92rem; color: #cfe0f4; }
.hero-points span { display: inline-flex; align-items: center; gap: .45rem; }
.hero-points svg { width: 18px; height: 18px; color: var(--gold); }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; padding-top: 2.5rem; padding-bottom: 2.5rem; } .hero-shield { display: none; } }

.steps-band { background: #fff; border-bottom: 1px solid var(--border); }
.how { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; padding-top: 2rem; padding-bottom: 2rem; }
.how-item { display: flex; gap: .85rem; align-items: flex-start; }
.how-num { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--cyan-50); color: var(--cyan-600); }
.how-item:last-child .how-num { background: var(--gold-50); color: #a87400; }
.how-item h3 { margin: .1rem 0 .15rem; font-size: 1rem; }
.how-item p { margin: 0; font-size: .88rem; color: var(--muted); }
@media (max-width: 860px) { .how { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .how { grid-template-columns: 1fr; } }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: 2.75rem 0 1.25rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.5rem; font-weight: 800; }

/* Tarjeta de curso */
.course-card { display: flex; flex-direction: column; overflow: hidden; height: 100%; transition: transform .15s, box-shadow .15s; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.course-cover { position: relative; aspect-ratio: 16 / 8; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-800) 55%, var(--cyan) 140%); display: grid; place-items: center; overflow: hidden; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-cover .cover-mark { font-weight: 800; font-size: 1.15rem; color: rgba(255, 255, 255, .92); letter-spacing: .04em; text-align: center; padding: 0 1rem; }
.course-cover .cover-mark small { display: block; font-size: .72rem; font-weight: 700; color: var(--gold); letter-spacing: .12em; }
.course-cover .badge { position: absolute; top: .75rem; left: .75rem; }
.course-card .card-body { display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.course-card h3 { margin: 0; font-size: 1.05rem; }
.course-card h3 a { color: var(--navy); }
.course-card .meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .5rem; }
/* v1.8.0 · Tarjeta del catálogo: nombre arriba; tipo de formación e intensidad horaria en la línea inferior */
.course-card--simple { position: relative; }
.course-card--simple .card-body { padding: 1rem 1.15rem 1.05rem; gap: .65rem; }
.course-card--simple h3 { font-size: 1.05rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.course-card--simple .course-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.course-card--simple .course-link:focus-visible { outline: none; }
.course-card--simple:focus-within { outline: 3px solid var(--cyan); outline-offset: 2px; }
.course-card--simple h3 a, .course-card--simple h3 a:hover, .course-card--simple h3 a:focus, .course-card--simple h3 a:active, .course-card--simple h3 a:visited { text-decoration: none; }
.course-card--simple h3 a { transition: color .15s; }
.course-card--simple:hover h3 a, .course-card--simple:focus-within h3 a { color: var(--cyan-600); }
.course-card--simple .course-meta { display: flex; align-items: center; justify-content: space-between; gap: .4rem .75rem; flex-wrap: wrap; margin: auto 0 0; padding-top: .65rem; border-top: 1px solid var(--border); font-size: .8rem; font-weight: 650; color: var(--muted); min-width: 0; }
.course-card--simple .course-type { display: inline-block; max-width: 100%; padding: .2rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--navy); font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-card--simple .course-hours { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; margin-left: auto; }
.course-card--simple .course-hours svg { width: 15px; height: 15px; }
.price-tag { font-weight: 750; color: var(--navy); font-size: .9rem; }
.price-tag.free { color: var(--success); }

.footer { background: var(--navy-900); color: #b8c7dc; padding: 2.5rem 0 1.5rem; font-size: .9rem; }
.footer a { color: #e2ebf7; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer h4 { color: #fff; font-size: .95rem; margin-bottom: .6rem; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .35rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 2rem; padding-top: 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem; }
.footer-logo { height: 34px; width: auto; margin-bottom: .85rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   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: #c4d2e6; 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: #c4d2e6; 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(0, 160, 223, .22), rgba(0, 160, 223, .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: #8ea3c1; }
.sidebar-user button { background: none; border: 0; color: #8ea3c1; 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(0, 20, 45, .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); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side::before { content: ""; position: absolute; inset: auto -140px -160px auto; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 160, 223, .5), rgba(0, 160, 223, 0) 70%); }
.auth-side > * { position: relative; }
.auth-side img.logo { height: 44px; width: auto; }
.auth-side p { color: #cddcf0; max-width: 440px; }
.auth-side--welcome { background: linear-gradient(160deg, var(--navy-900, #002b5c) 0%, var(--navy) 55%, #0a5aa8 100%); align-items: stretch; }
.auth-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .75rem; flex: 1; padding: 1.5rem 0; }
.auth-figure { margin: 0 0 .75rem; }
.auth-figure img { margin-inline: auto; width: auto; }
.auth-figure.is-character img { width: 100%; max-width: 560px; height: auto; max-height: 52vh; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
.auth-figure.is-shield img { width: 130px; }
.auth-title { margin: 0; color: #fff; font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.auth-title em { font-style: normal; color: var(--gold); }
.auth-sub { margin: 0; max-width: 30rem; font-size: 1.05rem; line-height: 1.55; color: #cddcf0; }
.auth-copy { color: #9fb4d1; text-align: center; }
.auth-mobile-welcome { display: none; }
.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, .auth-card h2.auth-h { 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: 36px; width: auto; }
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand { display: block; }
  .auth-form-wrap { align-items: flex-start; padding: 1.5rem 16px 2.5rem; }
  .auth-mobile-welcome { display: flex; align-items: center; gap: .9rem; margin: 0 0 1.5rem; padding: 1rem 1.1rem; border-radius: 14px; background: linear-gradient(135deg, var(--navy), #0a5aa8); }
  .auth-mobile-welcome img { width: 110px; height: auto; max-height: 74px; object-fit: contain; flex: none; }
  .auth-mobile-welcome .auth-title { font-size: 1.25rem; }
  .auth-mobile-welcome .auth-sub { font-size: .88rem; margin-top: .2rem; }
}
@media (min-width: 901px) and (max-height: 700px) { .auth-figure.is-character img { max-height: 38vh; } }

/* ==========================================================================
   Aula virtual
   ========================================================================== */
.course-hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-800) 60%, #004f8f 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 rgba(242, 169, 0, .16); }
.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: #f7fbff; color: var(--navy); }
.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: #eef1f6; 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(0, 160, 223, .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: #8a5f00; 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(0, 53, 112, .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: #9fb3cf; 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 tcr-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.app-main > * { animation: tcr-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: tcr-rise .22s ease both; }
.alert { animation: tcr-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; overflow-x: clip; overflow-clip-margin: 4px; }   /* v1.16.1 · el encabezado oculto no desborda la página en 320 px */
.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-pages { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border); background: #f6f9fc; border-radius: var(--radius) var(--radius) 0 0; }
.ce-pages + .ce-toolbar { border-radius: 0; }
.ce-pages-tabs { display: flex; flex-wrap: wrap; gap: .35rem; flex: 1 1 100%; }
.ce-page-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: .35rem .7rem; border: 1px solid var(--border-strong); border-radius: 9px; background: #fff; color: var(--navy); font: 600 .82rem/1.2 var(--font); cursor: pointer; }
.ce-page-tab small { font-weight: 400; color: var(--muted); font-size: .72rem; }
.ce-page-tab.is-on { border-color: var(--cyan); background: #eef6fc; box-shadow: 0 0 0 2px rgba(0,160,220,.18); }
.ce-pageset { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .7rem; }
.ce-pageset .ce-f { min-width: 92px; }
.ce-pageset select[data-pg="tamano"] { min-width: 200px; }
.ce-pageset [hidden] { display: none !important; }
.ce-table td { line-height: 1; }
.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: #eef6fc; 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(#eef1f6 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(0, 30, 70, .16), 0 0 0 1px rgba(0, 30, 70, .08); overflow: hidden; touch-action: none; user-select: none; outline: none; }
.ce-page:focus-visible { box-shadow: 0 0 0 3px rgba(0, 160, 223, .45), 0 10px 30px rgba(0, 30, 70, .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(0, 160, 223, .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 #e0006c; }
.ce-guide-h { left: 0; right: 0; height: 0; border-top: 1px dashed #e0006c; }
.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: #eef3f9; 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: #eef6fc; }
.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(0, 160, 223, .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: #f1f8fd; color: #0a5480; 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 (v1.5.0): reemplaza el menú lateral.
   La pantalla queda en dos columnas (contenido + índice del curso).
   ========================================================================== */
:root { --appbar-h: 64px; }
.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, #002a5a 0%, var(--navy-900) 100%); color: #d6e2f2; box-shadow: 0 6px 22px rgba(0, 25, 60, .18); }
.appbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--cyan) 0%, var(--cyan) 62%, var(--gold) 62%, var(--gold) 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: 40px; width: auto; display: block; }
.appbar-brand { gap: .6rem; text-decoration: none; }
.appbar-product { color: #fff; font: 700 .78rem/1 var(--font); letter-spacing: .04em; padding: .32rem .5rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 6px; white-space: nowrap; }   /* v1.38.0 · SAIGA LMS */
.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: #c9d7ea; 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(0, 160, 223, .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(0, 25, 60, .22), 0 0 0 1px rgba(0, 25, 60, .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: #eef6fc; 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: #9fb3cf; }
.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 (min-width: 1200px) and (max-width: 1440px) { .appbar-product { display: none; } }   /* v1.38.0 · espacio para el menú */
@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: 34px; }
  .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(0, 20, 50, .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: #c9d7ea; }
  .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: #eef3f9; }
.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(0, 30, 70, .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: #8a96aa; cursor: not-allowed; }
.lesson-item.is-locked .lesson-state { border-style: dashed; color: #8a96aa; }
.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: #f1f8fd; }
.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: #bfe0f2; background: linear-gradient(180deg, #f2faff, #fff); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #e0242d; box-shadow: 0 0 0 0 rgba(224, 36, 45, .5); animation: tcr-live 1.8s infinite; }
@keyframes tcr-live { 0% { box-shadow: 0 0 0 0 rgba(224, 36, 45, .5); } 70% { box-shadow: 0 0 0 9px rgba(224, 36, 45, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 36, 45, 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(0, 40, 90, .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(16, 33, 64, .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; }
.btn-report--csv svg { color: #4a5a72; }   /* v1.31.0 */
.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; }

/* v1.10.4 · Tipos de educación: Continua · Formal (Asignatura) · ETDH (Módulo) */
@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); }

/* ==========================================================================
   Reportes y estadísticas (v1.13.0)
   ========================================================================== */
.dash-section { margin-bottom: 1.75rem; }
.dash-section > h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 175px), 1fr)); gap: .75rem; margin-bottom: .9rem; }
.kpi.kpi-sm { padding: .85rem 1rem; }
.kpi.kpi-sm .kpi-value { font-size: 1.35rem; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: .9rem; }
.chart-card { margin: 0; padding: 1rem 1.1rem; min-width: 0; }
.chart-card figcaption { font-weight: 700; color: var(--navy); margin-bottom: .6rem; display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.chart-card figcaption a { font-weight: 500; }
.chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.chart g:hover rect, .chart g:hover path { opacity: .82; }
.chart-donut { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.chart-donut svg { width: 160px; flex: none; }
.chart-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 180px; display: grid; gap: .3rem; font-size: .86rem; }
.chart-legend li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: .5rem; align-items: center; }
.chart-legend .dot { width: 12px; height: 12px; border-radius: 3px; }
.chart-legend .lbl { color: var(--ink, #1e2a3c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend .muted { font-size: .78rem; min-width: 3.4rem; text-align: right; }
.chart-empty { margin: .5rem 0; }
.report-colfilters { flex: 1 1 100%; border-top: 1px dashed var(--border); padding-top: .6rem; }
.report-colfilters summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: .9rem; }
.report-colfilters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem .75rem; margin-top: .6rem; }
.chart-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font-size: .84rem; }
.chart-bars li { display: grid; grid-template-columns: minmax(0, 38%) 1fr auto; gap: .6rem; align-items: center; }
.chart-bars .cb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink, #1e2a3c); }
.chart-bars .cb-track { height: 14px; display: block; }
.chart-bars .cb-bar { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.chart-bars li:hover .cb-bar { opacity: .82; }
.chart-bars .cb-val { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* v1.14.0 · Tablas con búsqueda, orden y paginación en el navegador ([data-table]) */
.dt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.dt-search.input { flex: 1 1 220px; max-width: 360px; width: auto; min-height: 38px; padding: .45rem .75rem; }
.table th.th-sort .th-btn { display: flex; align-items: center; gap: .35rem; width: 100%; padding: .7rem 1rem; border: 0; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; text-align: left; }
.table th.th-sort .th-btn:hover { color: var(--navy); background: var(--navy-50); }
.dt-pages { padding: .75rem 1rem; }
.dt-pages button { border: 0; background: none; font: inherit; cursor: pointer; }
.dt-pages button[disabled] { opacity: .45; cursor: default; }

/* v1.15.0 · Matricular estudiantes (curso) */
.picked-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; display: grid; gap: .35rem; }
.picked-list li { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; padding: .3rem 0; border-bottom: 1px solid var(--border); }
.picked-list li:last-child { border-bottom: 0; }
tr.is-enrolled td { color: var(--muted); }
[data-results] input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--navy); }

/* v1.16.0 · «MOSTRAR MÁS» (inicio y catálogo) */
.load-more{display:flex;flex-direction:column;align-items:center;gap:.6rem;margin:1.75rem auto 0;text-align:center}
.load-more-btn{min-width:220px;justify-content:center}
.load-more-btn.is-loading{opacity:.85;cursor:progress;pointer-events:none}
.load-more-status{margin:0;font-size:.9rem;color:var(--muted,#5b6b7d)}
.load-more.is-done .load-more-status{font-weight:600}
.load-more-spin{display:inline-block;width:1em;height:1em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:lm-spin .7s linear infinite;vertical-align:-.15em}
@keyframes lm-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.load-more-spin{animation-duration:2s}}
@media (max-width:480px){.load-more-btn{width:100%}}
/* v1.33.0 · «Mostrar más» unificado (sistema y portal): fondo amarillo institucional y texto azul */
.load-more .btn-more.load-more-btn{background:#F2A900;color:#003570;border-color:transparent;font-weight:700;letter-spacing:.02em}
.load-more .btn-more.load-more-btn:hover,.load-more .btn-more.load-more-btn:focus-visible{background:#D99700;color:#003570;transform:translateY(-2px)}
.load-more .btn-more.load-more-btn:focus-visible{outline:3px solid #003570;outline-offset:3px}
.load-more .btn-more.load-more-btn svg{color:#003570}

/* v1.17.0 · Reportes en tabla real: encabezados fijos al desplazar, filas alternas y sin cortes de palabra */
.table-wrap--report { overflow-x: auto; overflow-y: visible; position: relative; }   /* v1.18.2 · sin desplazamiento vertical interno (crece con los registros) */
.table-wrap--report:focus-visible { outline: 2px solid var(--cyan, #00a0df); outline-offset: 2px; }
.table-report { min-width: 100%; }
.table-report thead th { background: var(--surface, #fff); box-shadow: inset 0 -1px 0 var(--border, #d9e1ea); white-space: nowrap; }
.table-report tbody tr:nth-child(even) td { background: rgba(0, 53, 112, .025); }
.table-report td { vertical-align: top; }
.table-report td.small { min-width: 7rem; }
.table-report td.actions { white-space: nowrap; text-align: right; }

/* ==========================================================================
   v1.18.2 · Tablas de reportes compactas: letra algo menor, anchos proporcionales al contenido, textos largos en
   varias líneas y, en tabletas y celulares, columnas principales + «Detalle» por registro (sin barras internas)
   ========================================================================== */
.table-report { table-layout: fixed; width: 100%; }
.table-report th, .table-report td { font-size: .8rem; line-height: 1.35; padding: .45rem .55rem; }
.table-report thead th { font-size: .68rem; letter-spacing: .03em; white-space: normal; vertical-align: bottom; }
.table-report th.th-sort a { padding: .5rem .55rem; align-items: flex-end; }
.table-report td { overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.table-report td.small { min-width: 0; font-size: .8rem; }
.table-report td.nowrap { white-space: nowrap; overflow: hidden; text-overflow: clip; }
.table-report td.text-right.nowrap { overflow: visible; }
.table-report td .btn-sm { padding: .25rem .55rem; font-size: .76rem; }
.table-report .col-num { width: auto; white-space: nowrap; }
.table-report .col-more { display: none; width: 5.6rem; text-align: right; }
.table-report tr.row-detail td { background: #f6f9fd !important; padding: .55rem .75rem .75rem; }
.row-detail-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .35rem 1.25rem; margin: 0; }
.row-detail-list div { display: flex; flex-direction: column; min-width: 0; }
.row-detail-list dt { font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #64748b); }
.row-detail-list dd { margin: 0; font-size: .8rem; overflow-wrap: anywhere; }
@media (max-width: 1024px) {
  .table-report { table-layout: auto; }
  .table-report th { width: auto !important; }
  .table-report .col-p3 { display: none; }
  .table-report[data-report-detail] .col-more { display: table-cell; }
}
@media (max-width: 640px) {
  .table-report .col-p2 { display: none; }
  .table-report .col-num { display: none; }
  .table-report[data-report-detail] th.col-actions, .table-report[data-report-detail] td.actions { display: none; }   /* «Ver» pasa al detalle */
  .table-report td.nowrap { white-space: normal; }
}
.row-detail-actions { margin-top: .5rem; display: flex; gap: .5rem; flex-wrap: wrap; }
@media (min-width: 1025px) { .table-report tr.row-detail { display: none; } }

/* v1.19.0 · Modelo público del certificado (ficha del curso y Cursos Concurso Docente) */
.cert-model { display: grid; gap: .5rem; }
.cert-model-frame { position: relative; width: 100%; max-height: 80vh; border: 1px solid var(--border, #dce4ec); border-radius: 10px; background: #f4f6f9; overflow: hidden; display: grid; place-items: center; }
.cert-model--portrait .cert-model-frame { max-width: 30rem; margin-inline: auto; }
.cert-model-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.cert-model-fallback { display: inline-flex; gap: .5rem; align-items: center; padding: .7rem 1rem; border-radius: 10px; background: #fff; border: 1px solid var(--border, #dce4ec); font-weight: 700; text-decoration: none; text-align: center; }
.cert-model-fallback i { color: #c0392b; font-size: 1.3rem; }
.cert-model.is-embedded .cert-model-fallback { display: none; }
.cert-model-note { margin: 0; font-size: .82rem; color: var(--muted, #5a6270); }
.cert-model-open { justify-self: start; font-size: .85rem; font-weight: 600; }
/* v1.20.0 · Celulares y tabletas: el modelo se ajusta al ancho (proporción original) y se amplía al tocarlo */
.cert-model.is-canvas .cert-model-frame { max-height: none; background: #fff; }
.cert-model-zoom { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-in; }
.cert-model-zoom canvas { display: block; width: 100%; height: 100%; }
.cert-model-zoom:focus-visible { outline: 3px solid var(--navy, #003570); outline-offset: 2px; }
.cert-model-hint { position: absolute; right: .5rem; bottom: .5rem; padding: .25rem .55rem; border-radius: 999px; background: rgba(0, 43, 92, .85); color: #fff; font-size: .72rem; font-weight: 700; pointer-events: none; }
html.cert-zoom-open { overflow: hidden; }
.cert-zoom { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: rgba(10, 20, 35, .94); }
.cert-zoom-bar { display: flex; gap: .5rem; align-items: center; justify-content: center; padding: .6rem; padding-top: max(.6rem, env(safe-area-inset-top)); color: #fff; }
.cert-zoom-btn { min-width: 44px; min-height: 44px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 10px; background: transparent; color: #fff; font-size: 1.25rem; font-weight: 700; cursor: pointer; }
.cert-zoom-btn:disabled { opacity: .35; cursor: default; }
.cert-zoom-btn:focus-visible { outline: 3px solid #F2A900; outline-offset: 2px; }
.cert-zoom-close { margin-left: .75rem; }
.cert-zoom-lvl { min-width: 4.5rem; text-align: center; font-weight: 700; }
.cert-zoom-scroll { flex: 1; overflow: auto; padding: 12px; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
.cert-zoom-scroll canvas { display: block; margin: 0 auto; height: auto; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
/* v1.22.0 · Editor: módulos y lecciones del curso */
.ce-el.ce-temario { overflow: hidden; outline: 1px dashed rgba(0, 53, 112, .35); }
.ce-tm-cols { height: 100%; overflow: hidden; column-fill: auto; }
.ce-tm-note { position: absolute; right: 2px; bottom: 2px; padding: 1px 5px; border-radius: 4px; background: rgba(0, 53, 112, .75); color: #fff; line-height: 1.3; pointer-events: none; }
/* v1.22.0 · Visor de PDF incrustado (modelo de certificación) */
.pdfv { display: grid; border: 1px solid var(--border, #dce4ec); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 10px 30px rgba(0, 53, 112, .08); }
.pdfv-bar { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; justify-content: space-between; padding: .5rem .6rem; background: #003570; color: #fff; }
.pdfv-grp { display: flex; gap: .3rem; align-items: center; }
.pdfv-btn { display: inline-flex; gap: .35rem; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 .6rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 9px; background: transparent; color: #fff; font: 700 .82rem/1 inherit; text-decoration: none; cursor: pointer; }
.pdfv-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .12); color: #fff; }
.pdfv-btn:disabled { opacity: .4; cursor: default; }
.pdfv-btn:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }
.pdfv-pages, .pdfv-zoom { min-width: 4.2rem; text-align: center; font-size: .85rem; white-space: nowrap; }
.pdfv-view { position: relative; height: min(72vh, 640px); overflow: auto; padding: 14px; background: #e9eef4; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
.pdfv-view:focus-visible { outline: 3px solid #0077b6; outline-offset: -3px; }
.pdfv-page { display: block; margin: 0 auto 14px; background: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); }
.pdfv-page:last-child { margin-bottom: 0; }
.pdfv-loading { margin: 2rem 0; text-align: center; color: #5a6270; }
.pdfv-view iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 640px) { .pdfv-bar { justify-content: center; } .pdfv-view { height: 62vh; padding: 8px; } .pdfv-btn--txt span:not(.sr-only) { display: none; } }
/* v1.25.0 · Evaluaciones dentro del recorrido (al final de cada módulo y del curso) */
.assess-item { background: rgba(0, 160, 223, .06); }
.assess-item .assess-body { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; min-width: 0; }
.assess-item .assess-t { font-weight: 700; }
.assess-tag { display: inline-flex; padding: .05rem .45rem; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .02em; background: #eef2f7; color: #5a6270; }
.assess-tag.is-req { background: #fff4dd; color: #7a5200; }
.assess-st { font-size: .74rem; color: #5a6270; }
.assess-st.is-ok { color: #11805a; font-weight: 700; }
.outline-final > summary .om-num svg { width: 1rem; height: 1rem; }
.eval-step { margin-bottom: 1rem; }
.eval-step .btn svg { width: 1rem; height: 1rem; }

/* ==========================================================================
   v1.26.0 · Unificación visual del sistema interno (body.has-appbar)
   - Listados siempre en tabla: cada registro una fila; si no cabe, desplazamiento horizontal con la primera
     columna fija (ya no se convierten en tarjetas).
   - Tipografía más compacta y uniforme en tablas, encabezados, botones, etiquetas y tarjetas.
   ========================================================================== */
.table-wrap { overscroll-behavior-x: contain; }
.table-wrap.is-scroll { box-shadow: inset -10px 0 8px -10px rgba(0, 53, 112, .25); }
.table-wrap.is-scroll .table:not(.table-report) th:first-child:not(.col-num),
.table-wrap.is-scroll .table:not(.table-report) td:first-child:not(.col-num) { position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: inset -1px 0 0 var(--border); }
.table-wrap.is-scroll .table:not(.table-report) th:first-child:not(.col-num) { background: var(--surface-2); }
.table-wrap.is-scroll .table:not(.table-report) td:first-child { min-width: 11rem; max-width: 18rem; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.text-center, .table td.text-right { font-variant-numeric: tabular-nums; }
body.has-appbar { font-size: 14.5px; }
body.has-appbar h1 { font-size: clamp(1.3rem, 2vw, 1.65rem); }
body.has-appbar h2 { font-size: 1.12rem; }
body.has-appbar h3 { font-size: .98rem; }
body.has-appbar .page-head { margin-bottom: 1.15rem; }
body.has-appbar .page-head .lead { font-size: .92rem; }
body.has-appbar .eyebrow { font-size: .7rem; }
body.has-appbar .card-body { padding: 1.1rem 1.15rem; }
body.has-appbar .card-header { padding: .8rem 1.15rem; }
body.has-appbar .card-footer { padding: .75rem 1.15rem; }
body.has-appbar .btn { min-height: 38px; padding: .48rem .95rem; font-size: .88rem; }
body.has-appbar .btn-sm { min-height: 30px; padding: .28rem .65rem; font-size: .8rem; }
body.has-appbar .badge { font-size: .7rem; padding: .14rem .55rem; }
body.has-appbar .kpi-value { font-size: 1.4rem; }
body.has-appbar .field label, body.has-appbar .label { font-size: .85rem; }
body.has-appbar .hint { font-size: .8rem; }
:where(body.has-appbar) .table:not(.table-report) { font-size: .86rem; }
:where(body.has-appbar) .table:not(.table-report) th { font-size: .68rem; padding: .55rem .8rem; }
:where(body.has-appbar) .table:not(.table-report) td { padding: .58rem .8rem; }
:where(body.has-appbar) .table:not(.table-report) th.th-sort a { padding: .55rem .8rem; }
:where(body.has-appbar) .table:not(.table-report) .small { font-size: .78rem; }
/* Libro de calificaciones: una columna por evaluación */
.table-grades th.ga { min-width: 6.2rem; max-width: 9rem; white-space: normal; vertical-align: bottom; text-align: center; line-height: 1.25; }
.table-grades th.ga .ga-k { display: block; color: var(--cyan-600); letter-spacing: .04em; }
.table-grades th.ga .ga-t { display: block; text-transform: none; font-weight: 650; letter-spacing: 0; color: var(--navy); overflow-wrap: anywhere; }
.table-grades th.ga .ga-w { display: block; text-transform: none; font-weight: 600; letter-spacing: 0; }
.table-grades td.text-center { white-space: nowrap; }
/* Buscadores y campos sueltos (sin .field) con el mismo estilo que los formularios */
body.has-appbar main :is(input[type=search], input[type=text], input[type=number], input[type=date], input[type=email], select, textarea):not([class]):not(.field *):not(.ce *) {
  min-height: 38px; padding: .42rem .7rem; font: inherit; font-size: .86rem; color: var(--text); background: #fff;
  border: 1px solid var(--border-strong); border-radius: 9px; transition: border-color .15s, box-shadow .15s; max-width: 100%;
}
body.has-appbar main :is(input, select, textarea):not([class]):not(.field *):focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 160, 223, .15); }
body.has-appbar .field :is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], input[type=url], input[type=search], select), body.has-appbar .input { min-height: 40px; font-size: .9rem; padding: .5rem .75rem; }
body.has-appbar .field textarea { font-size: .9rem; }
/* Las columnas de las cuadrículas no se ensanchan por el contenido (las tablas se desplazan dentro de su recuadro) */
.grid > *, .grid-aside > *, .stack > *, .stack-lg > * { min-width: 0; }

/* v1.30.0 · Aviso de autorización de mensajes promocionales (una sola vez por estudiante) */
.consent-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0, 25, 60, .55); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.consent-card { max-width: 560px; width: 100%; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.consent-actions form, .consent-actions .btn { width: 100%; }
@media (max-width: 420px) { .consent-actions { grid-template-columns: 1fr; } }
.btn-link { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font: inherit; }

/* v1.33.0 · Verificador de certificados dentro del panel */
.verify-embedded .verify-card { max-width: none; }
.verify-embedded .verify-card h1 { font-size: 1.5rem; }

/* v1.33.0 · Vista del curso: requisitos de aprobación con su estado */
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.req-list li { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--ink, #1b2a3a); }
.req-ico { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-50); color: #a87400; }
.req-ico svg { width: 13px; height: 13px; }
.req-list li.is-done .req-ico { background: #e3f5ea; color: #1d7a46; }
.req-detail { display: block; font-size: .8rem; color: var(--muted); }

/* v1.34.0 · Notificaciones: campana, menú y centro de notificaciones */
.appbar-bell-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%; background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; transition: background .18s; }
.appbar-bell-btn svg { width: 20px; height: 20px; }
.appbar-bell-btn:hover, .appbar-bell.is-open .appbar-bell-btn { background: rgba(255, 255, 255, .13); }
.appbar-bell-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.appbar-bell-count { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--gold); color: var(--navy-900); font: 800 .7rem/20px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--navy-900); }
.notif-menu { width: 380px; max-width: calc(100vw - 16px); }
.notif-menu-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--border); }
.notif-menu-head strong { color: var(--navy); font-size: .95rem; }
.notif-menu-head form { margin: 0; }
.notif-empty { margin: 0; padding: 1rem .75rem; }
.notif-menu-all { display: block; padding: .6rem .75rem .35rem; text-align: center; font-weight: 700; font-size: .85rem; color: var(--navy); border-top: 1px solid var(--border); margin-top: .3rem; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item a { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1.1rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); transition: background .15s; }
.notif-item:last-child a { border-bottom: 0; }
.notif-item a:hover { background: #f4f8fc; }
.notif-item.is-unread a { background: #f2f8fd; }
.notif-item.is-unread a:hover { background: #e8f2fb; }
.notif-item.is-unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .45rem; border-radius: 50%; background: var(--cyan); vertical-align: .1em; }
.notif-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy); }
.notif-ico svg { width: 18px; height: 18px; }
.notif-ico--certificado, .notif-ico--curso { background: #e3f5ea; color: #1d7a46; }
.notif-ico--pago { background: var(--gold-50); color: #a87400; }
.notif-ico--aviso { background: #e6f6fc; color: #0077b6; }
.notif-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.notif-text strong { color: var(--navy); font-size: .92rem; line-height: 1.3; overflow-wrap: anywhere; }
.notif-body { font-size: .86rem; color: var(--text); overflow-wrap: anywhere; }
.notif-meta { font-size: .76rem; color: var(--muted); }
.notif-list--compact { max-height: min(420px, 60vh); overflow-y: auto; }
.notif-list--compact .notif-item a { padding: .6rem .7rem; border-radius: 10px; border-bottom: 0; }
.notif-list--compact .notif-ico { width: 30px; height: 30px; }
@media (max-width: 1199px) {
  .appbar-bell .notif-menu { position: fixed; top: calc(var(--appbar-h) + 6px); left: auto; right: 8px; width: min(380px, calc(100vw - 16px)); padding: .45rem; background: #fff; border-radius: 14px; box-shadow: 0 18px 44px rgba(0, 25, 60, .22), 0 0 0 1px rgba(0, 25, 60, .06); display: block; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s, transform .18s, visibility .18s; }
  .appbar-bell.is-open > .notif-menu { opacity: 1; visibility: visible; transform: none; }
  .appbar-bell .notif-menu .appnav-menu-inner { overflow: visible; }
}
.ann-admin { padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); }
.ann-admin:last-child { border-bottom: 0; }
/* v1.34.0 · Avisos del curso en el aula virtual */
.ann-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.ann-list li + li { padding-top: .85rem; border-top: 1px solid var(--border); }
.ann-list strong { color: var(--navy); font-size: .92rem; display: block; }
.ann-list p { margin: .3rem 0 .2rem; font-size: .88rem; white-space: pre-line; overflow-wrap: anywhere; }
.ann-list .ann-date { font-size: .76rem; color: var(--muted); }
.ann-card.is-new { border-top: 4px solid var(--cyan); }

/* v1.35.0 · Entrada orientadora: bienvenida al curso y «Continúa donde quedaste» */
.welcome-card > summary { list-style: none; cursor: pointer; }
.welcome-card > summary::-webkit-details-marker { display: none; }
.welcome-card > summary h2 { margin: 0; }
.welcome-toggle::after { content: "Ver"; font-weight: 600; color: var(--navy); }
.welcome-card[open] .welcome-toggle::after { content: "Ocultar"; }
.welcome-card:not([open]) > summary { border-bottom: 0; }
.welcome-desc { font-size: .95rem; }
.welcome-steps { counter-reset: ws; list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.welcome-steps li { counter-increment: ws; position: relative; padding-left: 2.2rem; font-size: .93rem; line-height: 1.45; }
.welcome-steps li::before { content: counter(ws); position: absolute; left: 0; top: -.05rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--navy-50); color: var(--navy); font-weight: 800; font-size: .8rem; }
.welcome-steps--center { max-width: 420px; margin: 0 auto 1rem; text-align: left; }
.resume-card { border-left: 4px solid var(--cyan); }
.resume-body { display: flex; align-items: center; gap: 1.5rem; }
.resume-text { flex: 1; min-width: 0; }
.resume-text h2 { margin: .15rem 0 .25rem; font-size: 1.2rem; }
@media (max-width: 640px) { .resume-body { flex-direction: column; align-items: stretch; } }

/* v1.36.0 · Lección por pasos */
.lesson-steps { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: .75rem .9rem; }
.lesson-steps-count { margin: 0 0 .55rem; font-size: .85rem; color: var(--muted); }
.lesson-steps-count strong { color: var(--navy); }
.lesson-steps ol { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.lesson-steps li { flex: 1 1 0; min-width: 0; }
.lesson-steps a { display: flex; align-items: center; gap: .45rem; padding: .45rem .55rem; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .82rem; line-height: 1.25; border: 1px solid transparent; transition: background .15s; }
.lesson-steps a:hover { background: #f1f8fd; }
.lesson-steps .ls-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-50); color: var(--navy); font-weight: 800; font-size: .75rem; }
.lesson-steps .ls-num svg { width: 13px; height: 13px; }
.lesson-steps .ls-label { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lesson-steps li.is-seen .ls-num { background: #e3f5ea; color: #1d7a46; }
.lesson-steps li.is-current a { background: var(--navy-50); border-color: rgba(0, 53, 112, .18); font-weight: 700; color: var(--navy); }
.lesson-steps li.is-current .ls-num { background: var(--navy); color: #fff; }
.lesson-steps-cur { display: none; }
.lesson-step-title { margin: 0 0 .6rem; font-size: 1.05rem; color: var(--navy); display: flex; align-items: center; gap: .4rem; }
.doc-viewer { position: relative; width: 100%; height: min(82vh, 1100px); min-height: 480px; border-radius: 14px; overflow: hidden; background: #e9eef4; border: 1px solid var(--border); }
.doc-viewer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.doc-viewer-help { margin: .5rem 0 0; }
@media (max-width: 760px) {
  .lesson-steps ol { flex-wrap: nowrap; gap: .3rem; }
  .lesson-steps li { flex: 0 0 auto; }
  .lesson-steps .ls-label { display: none; }
  .lesson-steps a { padding: .3rem; }
  .lesson-steps-cur { display: inline; }
  .doc-viewer { height: 72vh; min-height: 420px; }
  .lesson-next-label { display: none; }
}
@media (min-width: 761px) and (max-width: 1100px) { .lesson-next-label { display: none; } }
.res-block { border: 1px solid var(--border); border-radius: 14px; padding: .9rem 1rem 1rem; }
.res-block legend { padding: 0 .35rem; font-weight: 700; color: var(--navy); }
.res-block--main { background: #fffcf2; border-color: rgba(242, 169, 0, .45); }
.res-rows { display: grid; gap: .6rem; margin-bottom: .6rem; }
.res-row { display: flex; gap: .5rem; align-items: flex-start; padding: .55rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.res-row-main { flex: 1; min-width: 0; display: grid; gap: .45rem; }
.res-row-main--inline { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.res-row-tools { display: flex; gap: .15rem; flex: none; }
.res-promote { margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.res-promote p { flex-basis: 100%; }
@media (max-width: 640px) { .res-row { flex-direction: column; } .res-row-main--inline { grid-template-columns: 1fr; } .res-row-tools { align-self: flex-end; } }
.res-icons span { white-space: nowrap; } .res-icons .res-main { color: #a87400; font-weight: 600; }
.hours-box { margin: 0; display: flex; flex-direction: column; gap: .2rem; } .hours-box strong { font-size: 1.25rem; color: var(--navy); }

/* v1.37.0 · Vista general del curso: presentación, evaluaciones y columna lateral fija */
.course-presentation h2 { margin: 0 0 .75rem; font-size: 1.2rem; }
.course-presentation .video, .course-presentation .embed { margin: 0; width: 100%; }
.assess-list { list-style: none; margin: 0; padding: 0; }
.assess-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .5rem 1rem; align-items: center; padding: .9rem 1.25rem; border-top: 1px solid var(--border); }
.assess-item:first-child { border-top: 0; }
.assess-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy); }
.assess-ico svg { width: 18px; height: 18px; }
.assess-item.is-done .assess-ico { background: #e3f5ea; color: #1d7a46; }
.assess-item.is-locked .assess-ico { background: #f1f3f6; color: var(--muted); }
.assess-title { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.assess-meta { display: flex; flex-wrap: wrap; gap: .15rem .9rem; margin-top: .2rem; }
.assess-grade { text-align: center; min-width: 54px; display: flex; flex-direction: column; line-height: 1.2; }
.assess-grade strong { font-size: 1.1rem; color: var(--navy); }
.assess-action { text-align: right; min-width: 96px; }
@media (max-width: 640px) {
  .assess-item { grid-template-columns: auto minmax(0, 1fr) auto; padding: .85rem 1rem; }
  .assess-action { grid-column: 2 / -1; text-align: left; min-width: 0; }
}
@media (min-width: 1021px) and (max-width: 1240px) { .grid-aside:has(> .course-aside) { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (min-width: 1021px) {
  .course-aside { position: sticky; top: calc(var(--appbar-h, 64px) + 1rem); }
}

/* v1.37.0 · Vista de lección: barra única Anterior | Vista X de N | Siguiente */
.view-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .6rem .75rem; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.view-bar form { margin: 0; }
.view-count { text-align: center; font-size: .92rem; color: var(--muted); white-space: nowrap; }
.view-count strong { color: var(--navy); }
.view-bar .btn.is-disabled { opacity: .45; pointer-events: none; cursor: default; }
.lesson-step-title { margin: 0 0 .75rem; }
.lesson-step .video { margin-bottom: 0; }
@media (max-width: 420px) {
  .view-bar { gap: .35rem; padding: .5rem; }
  .view-bar .btn { padding-inline: .6rem; gap: .3rem; }
  .view-count { font-size: .82rem; white-space: normal; line-height: 1.25; }
}
@media (max-width: 359px) { .view-bar .btn > span:not(.sr-only) { display: none; } }

/* ==========================================================================
   v1.39.0 · Ajustes de interfaz
   ========================================================================== */

/* 1 y 2 · Buscador del catálogo: la lista desplegable queda siempre por encima y el texto no pisa la lupa */
.catalog-filters { position: relative; z-index: 30; overflow: visible; }
.catalog-filters:focus-within { z-index: 40; }
.type-chips, .catalog-filters ~ p, .catalog-filters ~ .grid { position: relative; z-index: 1; }
.input-icon > svg { z-index: 6; }
.ls-list { z-index: 90; max-height: min(340px, 55vh); overscroll-behavior: contain; }
body.has-appbar .field .input-icon input[type=search],
body.has-appbar .field .input-icon input[type=text],
.field .input-icon input[type=search], .field .input-icon input[type=text] { padding-left: 2.75rem; padding-right: 2.25rem; }
.input-icon > svg { left: .95rem; }
.input-icon input[type=search] { -webkit-appearance: none; appearance: none; }
.input-icon input[type=search]::-webkit-search-decoration, .input-icon input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.ls-opt strong, .ls-opt small { white-space: normal; overflow-wrap: anywhere; }
.ls-opt strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 759px) {
  .catalog-filters { padding: 0; }
  .catalog-filters .card-body, .catalog-filters.card-body { padding: 1rem; }
  .catalog-filters .field select, .catalog-filters .field input { font-size: 16px; }   /* evita el zoom automático de iOS */
  .catalog-filters-actions { justify-content: flex-end; }
  .ls-list { position: absolute; left: 0; right: 0; }
  .type-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px .35rem; scrollbar-width: none; }
  .type-chips::-webkit-scrollbar { display: none; }
  .type-chips a { flex: none; }
}

/* 3 · Tablas que en teléfono pasan a tarjetas verticales (Mis certificados): .cards-sm */
@media (max-width: 760px) {
  .table-wrap.cards-sm { overflow: visible; }
  .table-wrap.cards-sm .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap.cards-sm .table, .table-wrap.cards-sm .table tbody, .table-wrap.cards-sm .table tr, .table-wrap.cards-sm .table td { display: block; width: 100%; min-width: 0; }
  .table-wrap.cards-sm .table tbody tr { margin: 0 0 .75rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
  .table-wrap.cards-sm .table tbody tr:hover { background: var(--surface); }
  .table-wrap.cards-sm .table td { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .3rem 0; border: 0; text-align: right !important; white-space: normal; overflow-wrap: anywhere; position: static; }
  .table-wrap.cards-sm .table td::before { content: attr(data-label); flex: none; max-width: 42%; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .table-wrap.cards-sm .table td[data-label=""]::before, .table-wrap.cards-sm .table td.actions::before { content: none; }
  .table-wrap.cards-sm .table td:first-child { display: block; text-align: left !important; padding-bottom: .5rem; margin-bottom: .25rem; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .table-wrap.cards-sm .table td:first-child::before { content: none; }
  .table-wrap.cards-sm .table td.actions { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; padding-top: .7rem; text-align: left !important; }
  .table-wrap.cards-sm .table td.actions .btn { width: 100%; justify-content: center; }
  .table-wrap.cards-sm .table td.actions > div { text-align: left; }
  .table-wrap.cards-sm.is-scroll { box-shadow: none; }
  .table-wrap.cards-sm + .pagination, section.card > .table-wrap.cards-sm { border: 0; }
  section.card > .table-wrap.cards-sm { padding: .85rem .85rem .1rem; background: var(--bg); border-radius: var(--radius); }
}

/* 4 · Avisos unificados: una sola pila, arriba a la derecha, con el mismo diseño en toda la plataforma */
.toasts { position: fixed; z-index: 3000; top: 72px; right: 16px; width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: .6rem; pointer-events: none; }
.toasts .alert { pointer-events: auto; margin: 0; box-shadow: 0 12px 30px rgba(16, 33, 64, .18); align-items: center; animation: tcr-toast-in .28s ease both; background-clip: padding-box; }
.toasts .alert.is-leaving { opacity: 0; transform: translateY(-8px); transition: opacity .25s ease, transform .25s ease; }
.toasts .alert > div { min-width: 0; overflow-wrap: anywhere; }
.toasts .alert-success { background: #eaf8f1; }
.toasts .alert-error { background: #fdeceb; }
.toasts .alert-warning { background: #fff6e0; }
.toasts .alert-info { background: #e9f5fc; }
@keyframes tcr-toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.app-main > .toasts { animation: none; }
@media (max-width: 640px) { .toasts { top: 64px; right: 12px; left: 12px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .toasts .alert { animation: none; } .toasts .alert.is-leaving { transition: none; } }

/* 5 y 10 · Sin desbordes: textos y botones se ajustan al ancho disponible */
.alert > div, .card-body, .page-head > div, .eval-step > div { min-width: 0; overflow-wrap: anywhere; }
.alert .btn, .eval-step .btn { max-width: 100%; height: auto; white-space: normal; text-align: left; }
@media (max-width: 640px) {
  .btn { white-space: normal; text-align: center; max-width: 100%; }
  .page-head { align-items: stretch; }
  .page-head > .btn, .page-head > form, .page-head > a.btn { width: 100%; }
  .eval-step { flex-wrap: wrap; }
  .eval-step .btn { width: 100%; justify-content: center; text-align: center; }
  .grid-4 .kpi-value { overflow-wrap: anywhere; }
  .card, .box, .table-wrap, .prose, .prose img, .prose iframe, .prose table { max-width: 100%; }
  .prose { overflow-wrap: anywhere; }
  .prose table { display: block; overflow-x: auto; }
  .row, .row-between { flex-wrap: wrap; }
}
.app-main { overflow-wrap: break-word; }
.app-main img, .app-main video, .app-main iframe { max-width: 100%; }

/* 12 · Baja voluntaria del estudiante */
.my-course .btn-quiet { background: none; border: 0; padding: .35rem .2rem; min-height: 0; color: var(--muted); font-weight: 600; font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.my-course .btn-quiet:hover { color: var(--danger, #b3261e); }
.btn-danger-ghost { background: var(--surface); color: var(--danger, #b3261e); border-color: #f2c9c6; }
.btn-danger-ghost:hover { background: #fdeceb; border-color: var(--danger, #b3261e); color: var(--danger, #b3261e); }

/* 11 · Plantilla del curso: acción de eliminar junto al selector */
.tpl-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .5rem; }
