:root {
  --ink: #111827;
  --muted: #667085;
  --line: #d8dee8;
  --paper: #f7f9fc;
  --surface: #ffffff;
  --nav: #000000;
  --cyan: #11b8c6;
  --rose: #d9416f;
  --gold: #c98a16;
  --green: #35845b;
  --blue: #2463c7;
  --red: #c2413c;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: #f5f7fa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-container {
  width: min(1420px, calc(100% - 32px));
  margin-inline: auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 900;
  line-height: 1;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-word {
  display: inline-flex;
  align-items: baseline;
  color: #fff;
  font-size: 1.22rem;
  font-weight: 900;
}

.brand-word span {
  color: var(--cyan);
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #f5c842;
  color: #111827;
  font-size: .85rem;
}

.app-nav {
  gap: 4px;
  margin-inline: 24px;
}

.app-nav .nav-link {
  color: rgba(255, 255, 255, .78);
  font-weight: 650;
  border-radius: 8px;
  padding-inline: 12px;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 750;
}

.user-chip a {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  color: #fff;
}

.page-frame {
  padding: 28px 0 42px;
}

/* Página pública de solicitud de eliminación de cuenta. */
.account-deletion {
  width: min(100%, 820px);
  margin-inline: auto;
}

.account-deletion__intro,
.account-deletion__section,
.account-deletion__contact {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(17, 24, 39, .05);
}

.account-deletion__intro {
  padding: clamp(28px, 6vw, 52px);
  background: linear-gradient(135deg, rgba(17, 184, 198, .13), transparent 55%), var(--surface);
}

.account-deletion h1,
.account-deletion h2 {
  margin: 0;
  font-weight: 850;
  line-height: 1.1;
}

.account-deletion h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.account-deletion h2 {
  font-size: 1.2rem;
}

.account-deletion__intro > p:not(.eyebrow),
.account-deletion__section p,
.account-deletion__section li,
.account-deletion__contact p {
  color: var(--muted);
  line-height: 1.65;
}

.account-deletion__intro > p:not(.eyebrow) {
  max-width: 64ch;
  margin: 18px 0 12px;
}

.account-deletion__email,
.account-deletion__contact a {
  color: #087d88;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-deletion__content {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.account-deletion__section,
.account-deletion__contact {
  padding: 24px;
}

.account-deletion__section p,
.account-deletion__contact p {
  margin: 10px 0 0;
}

.account-deletion__section ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 22px;
}

.app-footer {
  padding: 22px 0 34px;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.page-heading {
  max-width: 880px;
  margin-bottom: 24px;
}

.page-heading h1,
.feed-sidebar h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: .98;
  font-weight: 850;
}

.page-heading p,
.feed-sidebar p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.feed-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.feed-sidebar {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.progress-block,
.streak-strip,
.sidebar-note {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.progress-label,
.streak-strip,
.video-topline,
.quiz-heading,
.panel-heading,
.catalog-head,
.certificate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
}

.progress-track.compact {
  min-width: 120px;
  height: 8px;
}

.streak-strip span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: #101820;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 850;
}

.streak-strip strong,
.streak-strip small {
  display: block;
}

.sidebar-note {
  color: var(--muted);
}

.sidebar-note strong {
  display: block;
  color: var(--ink);
}

.feed-rail {
  display: grid;
  gap: 24px;
  scroll-snap-type: y proximity;
}

.feed-experience {
  display: grid;
  gap: 18px;
}

.feed-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 18px;
  align-items: end;
  max-height: 180px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: opacity .45s ease, max-height .45s ease, padding .45s ease, border-color .45s ease;
}

.feed-status.is-hidden {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
  border-color: transparent;
}

.feed-status h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  line-height: 1;
  font-weight: 850;
}

.feed-status p {
  margin: 8px 0 0;
  color: var(--muted);
}

.feed-progress {
  display: grid;
  gap: 8px;
}

.feed-progress small {
  color: var(--muted);
  font-weight: 700;
}

.capsule-screen {
  display: grid;
  min-height: calc(100vh - 150px);
  grid-template-columns: minmax(260px, 430px) minmax(280px, 1fr);
  gap: 22px;
  align-items: stretch;
  scroll-snap-align: start;
}

.feed-experience .capsule-screen {
  grid-template-columns: minmax(280px, 430px);
  justify-content: center;
  align-items: center;
}

.video-stage,
.quiz-panel,
.panel,
.metric-card,
.report-card,
.timeline-content,
.catalog-card,
.certificate-card,
.path-strip article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(16, 24, 32, .07);
}

.video-stage {
  position: relative;
  display: grid;
  min-height: 680px;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  align-content: space-between;
  padding: 18px;
  color: #fff;
  isolation: isolate;
}

.feed-experience .video-stage {
  width: min(100%, 430px);
  min-height: 640px;
  margin-inline: auto;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
}

.video-stage.has-video {
  padding: 0;
  background: #000;
}

.video-stage.has-video::before,
.video-stage.has-video::after {
  display: none;
}

.capsule-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.video-stage.has-video .video-topline {
  position: relative;
  z-index: 2;
  margin: 18px;
}

.video-stage.has-video .video-center {
  min-height: 1px;
}

.video-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .18), transparent 38%),
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, .24), transparent 18%),
    linear-gradient(145deg, #18202d, #111827);
}

.video-stage::after {
  content: "";
  position: absolute;
  inset: 18% 16%;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .18);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 3px, transparent 3px 16px),
    rgba(255, 255, 255, .04);
  transform: skewY(-8deg);
}

.tone-teal .video-stage::before { background: linear-gradient(145deg, #0f766e, #101820); }
.tone-magenta .video-stage::before { background: linear-gradient(145deg, #b42359, #2b1622); }
.tone-amber .video-stage::before { background: linear-gradient(145deg, #a15c07, #172033); }
.tone-red .video-stage::before { background: linear-gradient(145deg, #a93636, #17191f); }
.tone-blue .video-stage::before { background: linear-gradient(145deg, #2457b8, #101820); }
.tone-green .video-stage::before { background: linear-gradient(145deg, #1f7a55, #101820); }

.video-topline {
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.video-topline span {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}

.video-center {
  align-self: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .36);
}

.play-token {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
}

.video-center h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: .93;
  font-weight: 900;
}

.video-center p {
  margin: 16px 0 0;
  font-size: 1.05rem;
}

.quiz-panel {
  align-self: center;
  padding: 24px;
}

/* NOTA (fix de scroll con zoom / pantallas bajas): el panel es un scroller
   (overflow-y:auto) confinado al rectangulo 9/16 de .video-stage. Con
   `align-content: center`, cuando el contenido es MAS ALTO que el panel el
   sobrante se reparte arriba y abajo; el sobrante de ARRIBA queda en
   coordenadas negativas y el scroll no puede alcanzarlo (el origen de scroll
   es 0), asi que se recorta de forma permanente y el contenido queda corrido:
   desaparecen alternativas y el boton "Siguiente" no se alcanza.
   `safe center` mantiene el centrado EXACTO cuando hay espacio y degrada a
   `start` solo cuando desborda, dejando todo el contenido dentro del rango
   scrolleable. Se conserva `center` como fallback para navegadores sin `safe`. */
.feed-experience .quiz-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-content: center;
  align-content: safe center;
  width: 100%;
  max-width: none;
  overflow-y: auto;
  /* el scroll del quiz no se encadena al feed-rail (scroll-snap) al llegar al tope */
  overscroll-behavior: contain;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, .9);
  color: #fff;
  box-shadow: none;
}

.capsule-screen:not(.quiz-ready) .quiz-panel {
  display: none;
}

.capsule-screen.quiz-ready .quiz-panel {
  display: grid;
}

.capsule-screen.quiz-ready .capsule-video {
  filter: blur(4px) brightness(.45);
}

.capsule-screen.quiz-ready .video-topline {
  opacity: 0;
  pointer-events: none;
}

.capsule-screen:not(.quiz-ready) .question-form,
.capsule-screen:not(.quiz-ready) .quiz-explanation,
.capsule-screen.quiz-ready .quiz-lock {
  display: none;
}

.quiz-lock {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #bdeef3;
  border-radius: 8px;
  background: #e9fbfd;
  color: #0b5963;
}

.feed-experience .quiz-panel .quiz-heading,
.feed-experience .quiz-panel h3,
.feed-experience .quiz-panel .quiz-explanation {
  color: #fff;
}

.feed-experience .quiz-panel h3 {
  font-size: 1.35rem;
  line-height: 1.15;
}

.feed-experience .quiz-panel .question-form {
  border-color: rgba(255, 255, 255, .18);
}

.quiz-flow {
  display: grid;
  gap: 14px;
}

.quiz-step {
  display: none;
}

.quiz-step.is-active {
  display: grid;
  gap: 14px;
}

.quiz-step.needs-answer .option-list {
  border: 1px solid #f7b4b4;
  border-radius: 8px;
  padding: 8px;
}

.quiz-step.needs-answer::after {
  content: "Selecciona una alternativa para continuar.";
  color: #ffd0d0;
  font-weight: 800;
}

.quiz-step-count {
  color: rgba(255, 255, 255, .68);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-weight: 800;
}

.secondary-action:disabled {
  opacity: .35;
}

.catalog-card .secondary-action {
  width: 100%;
  border-color: var(--ink);
  background: #000;
  color: #fff;
}

.feed-experience .quiz-panel .quiz-option {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.feed-experience .quiz-panel .quiz-option.selected {
  border-color: var(--cyan);
  background: rgba(17, 184, 198, .22);
}

.feed-experience .quiz-panel .primary-action {
  background: var(--cyan);
  color: #001114;
}

.completed-badge {
  position: absolute;
  left: 16px;
  top: 64px;
  z-index: 3;
  pointer-events: none;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .68);
  color: #fff;
  text-align: left;
}

.completed-badge strong,
.completed-badge span,
.quiz-result-summary strong,
.quiz-result-summary span {
  display: block;
}

.quiz-result-summary {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.quiz-lock strong,
.quiz-lock span {
  display: block;
}

.quiz-panel h3 {
  margin: 12px 0 18px;
  font-size: clamp(1.35rem, 2vw, 2.2rem);
  line-height: 1.08;
}

.option-list {
  display: grid;
  gap: 10px;
}

.question-form {
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--line);
}

.question-form:last-of-type {
  border-bottom: 0;
}

.quiz-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
  min-height: 54px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.quiz-option.selected {
  border-color: var(--cyan);
  background: #eaf8f6;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-weight: 800;
}

.primary-action:hover,
.primary-action:focus {
  color: #fff;
  background: #08333a;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 180px);
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 440px);
  gap: 28px;
  align-items: center;
}

.login-brand {
  display: grid;
  gap: 24px;
  align-content: center;
  min-height: 460px;
  padding: 34px;
  border-radius: 8px;
  background: #000;
  color: #fff;
}

.login-brand img {
  width: min(560px, 100%);
}

.login-brand p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-size: 1.2rem;
}

.login-card,
.user-form {
  display: grid;
  gap: 14px;
}

.login-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 32, .08);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 2rem;
  line-height: 1;
}

.login-card label,
.user-form label {
  display: grid;
  gap: 6px;
  font-weight: 750;
}

.login-card input,
.user-form input,
.user-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 1rem;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group > span {
  font-weight: 750;
}

.user-form .inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-weight: 650;
}

.user-form .inline-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
}

.form-help {
  color: var(--muted);
  line-height: 1.35;
}

.form-alert {
  padding: 12px 14px;
  border: 1px solid #f3c4c4;
  border-radius: 8px;
  background: #fff1f1;
  color: #9b1c1c;
  font-weight: 700;
}

.sso-options {
  display: grid;
  gap: 10px;
}

.sso-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.sso-button img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}

.sso-button:hover,
.sso-button:focus {
  border-color: #aab6c8;
  background: #f9fbfd;
}

.sso-button span,
.login-divider span {
  color: var(--ink);
  font-size: .92rem;
  font-weight: 800;
}

.login-divider span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  color: var(--muted);
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.inline-action {
  display: inline;
}

.inline-action .secondary-action,
.edit-domain.secondary-action {
  min-height: 36px;
  margin: 4px 4px 0 0;
  padding: 7px 10px;
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.muted-row {
  opacity: .58;
}

.result-pill,
.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .78rem;
  background: #edf2f7;
}

.result-pill.success,
.status-pill {
  color: #0f6b47;
  background: #e5f6ee;
}

.status-finalizada {
  color: #5f6673;
  background: #eef2f6;
}

.status-desactivada {
  color: #8a3c20;
  background: #ffe7dc;
}

.status-proxima {
  color: #8a5a10;
  background: #fff2d5;
}

.result-pill.warning {
  color: #9a5b00;
  background: #fff2d5;
}

.quiz-explanation {
  margin: 16px 0 0;
  color: var(--muted);
}

.metric-grid,
.report-grid,
.certificate-grid,
.catalog-grid,
.path-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-card,
.report-card,
.catalog-card,
.certificate-card,
.path-strip article,
.panel {
  padding: 18px;
}

.metric-card span,
.report-card span,
.catalog-head span,
.certificate-top span,
.path-strip span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 2.4rem;
  line-height: 1;
}

.metric-card p,
.report-card p,
.catalog-card p {
  margin: 0;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* Usuarios: la tabla es el area principal; el alta se despliega bajo demanda. */
.users-heading {
  max-width: none;
  margin-bottom: 18px;
}

.users-title-row,
.users-directory-heading,
.users-pagination,
.users-pagination > div,
.seat-usage,
.users-form-actions {
  display: flex;
  align-items: center;
}

.users-title-row,
.users-directory-heading,
.users-pagination {
  justify-content: space-between;
  gap: 16px;
}

.users-title-row h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.users-create-trigger {
  margin: 0;
}

.users-seat-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 18px;
}

.users-seat-card {
  min-height: 142px;
}

.users-seat-card strong {
  margin: 12px 0 14px;
  font-size: 2rem;
}

.users-seat-card strong small {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.seat-usage {
  gap: 9px;
}

.seat-usage > span {
  display: block;
  flex: 1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.seat-usage i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), #36c7d2);
}

.seat-usage small {
  color: var(--muted);
  white-space: nowrap;
}

.users-create-form {
  margin-bottom: 18px;
  padding: 18px;
}

.users-create-form[hidden] {
  display: none;
}

.users-close-form {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.users-form-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.users-form-actions {
  justify-content: flex-end;
}

.users-directory {
  padding: 20px;
}

.users-directory-heading {
  align-items: end;
  margin-bottom: 16px;
}

.users-directory-heading > div {
  display: grid;
  gap: 4px;
}

.users-directory-heading span,
.users-sort-label span {
  color: var(--muted);
}

.users-sort-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}

.users-sort-label select,
.users-filters select,
.users-filters input,
.users-pagination select,
.inline-group-form select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}

.users-filters {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) repeat(4, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.users-filters input,
.users-filters select {
  width: 100%;
}

.users-table {
  min-width: 960px;
}

.users-table th,
.users-table td {
  padding: 13px 10px;
}

.users-table td:nth-child(1) {
  min-width: 220px;
}

.users-table td:nth-child(2) {
  min-width: 130px;
}

.users-table td:nth-child(3) {
  min-width: 150px;
}

.users-table td:nth-child(4) {
  min-width: 100px;
}

.users-table td:last-child {
  min-width: 210px;
}

.users-chip,
.users-status {
  display: inline-flex !important;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .78rem !important;
  font-weight: 750;
}

.users-chip {
  color: #165fb8 !important;
  background: #e8f2ff;
}

.users-status-active {
  color: #0f6b47 !important;
  background: #e5f6ee;
}

.users-status-inactive {
  color: #8a3c20 !important;
  background: #ffe7dc;
}

.users-actions-cell {
  white-space: nowrap;
}

.inline-group-form {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
}

.inline-group-form select {
  max-width: 120px;
}

.users-actions-cell .secondary-action,
.users-pagination .secondary-action {
  min-height: 40px;
  margin: 0;
}

.users-empty-state {
  margin: 18px 0 4px;
  color: var(--muted);
  text-align: center;
}

.users-pagination {
  margin-top: 16px;
}

.users-pagination > div {
  gap: 7px;
}

@media (max-width: 760px) {
  .users-title-row,
  .users-directory-heading,
  .users-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .users-title-row .primary-action {
    width: 100%;
  }

  .users-form-fields,
  .users-filters {
    grid-template-columns: 1fr;
  }

  .users-form-actions {
    justify-content: stretch;
  }

  .users-form-actions .primary-action {
    width: 100%;
  }

  .users-directory {
    padding: 16px;
  }

  .users-pagination > div {
    flex-wrap: wrap;
  }
}

.campaign-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.campaign-tab {
  padding: 10px 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.campaign-tab.is-active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

.muted-copy {
  margin: 0;
  color: var(--muted);
}

.panel-heading {
  margin-bottom: 14px;
}

.panel-heading h2,
.report-card h2,
.catalog-card h2,
.certificate-card h2,
.timeline-content h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.panel-heading span {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.data-table th {
  color: var(--muted);
  font-size: .76rem;
  text-align: left;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table td span {
  display: block;
  color: var(--muted);
  font-size: .88rem;
}

.progress-cell {
  display: grid;
  min-width: 150px;
  gap: 6px;
}

.weakness-list {
  display: grid;
  gap: 10px;
}

.weakness-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.weakness-list span,
.timeline-content small {
  display: block;
  color: var(--muted);
}

.report-card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: space-between;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fbfd;
  color: #3d4a5c;
  font-size: .85rem;
  font-weight: 650;
}

.compact-tags span {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
}

.timeline-date {
  padding-top: 18px;
  color: var(--muted);
}

.timeline-date strong {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
}

.timeline-content p {
  color: var(--muted);
}

.certificate-card {
  min-height: 300px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.certificate-holder {
  margin: 28px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.25rem;
  font-weight: 850;
}

.certificate-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.certificate-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.certificate-card dt {
  color: var(--muted);
}

.certificate-card dd {
  margin: 0;
  font-weight: 750;
}

.path-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.path-strip strong,
.path-strip small {
  display: block;
}

.catalog-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-manager-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.capsule-author-form,
.quiz-authoring {
  display: grid;
  gap: 16px;
}

.author-grid,
.option-author-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.author-grid label,
.option-author-grid label,
.question-author-card label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 750;
}

.author-grid input,
.author-grid select,
.option-author-grid input,
.option-author-grid select,
.question-author-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 1rem;
}

.span-2 {
  grid-column: 1 / -1;
}

.toggle-line {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
}

.toggle-line input {
  width: auto;
  min-height: auto;
}

.question-author-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.message-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  border-color: #bdeef3;
  background: #e9fbfd;
}

.message-list p {
  margin: 0;
  color: #0b5963;
  font-weight: 750;
}

.manager-scope ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .metric-grid,
  .report-grid,
  .certificate-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feed-layout,
  .dashboard-grid,
  .users-layout,
  .content-manager-layout {
    grid-template-columns: 1fr;
  }

  .feed-sidebar {
    position: static;
  }
}

@media (max-width: 820px) {
  .app-container {
    width: min(100% - 20px, 720px);
  }

  .capsule-screen {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .feed-status {
    grid-template-columns: 1fr;
  }

  .feed-experience .capsule-screen {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .video-stage {
    width: min(100%, 420px);
    min-height: auto;
    margin-inline: auto;
  }

  .feed-experience .video-stage {
    width: min(100%, 420px);
    min-height: auto;
    aspect-ratio: 9 / 16;
  }

  .feed-experience .quiz-panel {
    inset: 0;
    max-width: none;
    margin-inline: 0;
  }

  .metric-grid,
  .report-grid,
  .certificate-grid,
  .catalog-grid,
  .path-strip {
    grid-template-columns: 1fr;
  }

  .author-grid,
  .option-author-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-date {
    padding-top: 0;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 260px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 640px) {
  .app-container {
    width: min(100% - 16px, 540px);
  }

  .page-frame {
    padding-top: 18px;
  }

  .page-heading {
    margin-bottom: 16px;
  }

  .page-heading h1,
  .feed-sidebar h1 {
    font-size: 2rem;
    line-height: 1.02;
  }

  .panel,
  .metric-card,
  .report-card,
  .catalog-card,
  .certificate-card,
  .path-strip article,
  .login-card,
  .feed-sidebar,
  .quiz-panel {
    padding: 14px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .user-form {
    gap: 12px;
  }

  .user-form .primary-action,
  .login-card .primary-action {
    width: 100%;
  }

  .data-table {
    min-width: 0;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .data-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f6;
    overflow-wrap: anywhere;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .login-brand {
    min-height: 190px;
    padding: 20px;
  }

  .login-brand p {
    font-size: 1rem;
  }

  .user-chip {
    margin: 0;
  }

  .user-chip > span {
    display: none;
  }
}

/* ===== Barra superior + menu lateral off-canvas ===== */
.app-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.app-topbar .user-chip {
  margin-left: auto;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 40px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.nav-toggle:hover,
.nav-toggle:focus {
  background: rgba(255, 255, 255, .1);
}

.side-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

body.nav-open .side-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  max-width: 84vw;
  background: #0b0b0b;
  color: #fff;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 18px rgba(0, 0, 0, .4);
  overflow-y: auto;
}

body.nav-open .side-nav {
  transform: translateX(0);
}

.side-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-weight: 800;
  letter-spacing: .04em;
}

.side-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.side-nav-body {
  padding: 8px 0 24px;
}

.side-section {
  padding: 16px 20px 6px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cyan);
}

.side-link {
  display: block;
  padding: 10px 20px;
  color: rgba(255, 255, 255, .82);
  font-weight: 650;
}

.side-link:hover,
.side-link:focus {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

/* ===== Gestion de modulos (panel ?modulesFor=) ===== */
/* Formulario de alta en linea: campo + boton de tamaño normal, alineados a la izquierda. */
.inline-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.inline-form label {
  display: grid;
  gap: 6px;
  font-weight: 750;
}

.inline-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 1rem;
}

/* Boton de ancho segun contenido (no estirado como en .user-form grid). */
.inline-form .primary-action,
.table-actions .primary-action {
  margin-top: 0;
  width: auto;
}

.campaign-action-form {
  margin: 0;
}

.campaign-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 104px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.campaign-action-danger {
  border-color: #a93632;
  background: var(--red);
}

.campaign-action-success {
  border-color: #267047;
  background: var(--green);
}

.table-actions {
  margin-top: 16px;
}

#modules-panel .data-table input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .95rem;
}

#modules-panel .data-table td:nth-child(2) input {
  max-width: 90px;
}

/* ===========================================================================
   Feed inmersivo estilo Reels/TikTok — SOLO en /Index (body.feed-immersive).
   Bloque puramente visual: NO toca el flujo del quiz, el gating ni el envio.
   Se ubica al final del archivo para ganar por orden y especificidad sobre las
   media queries de arriba (que ponian min-height:auto en .capsule-screen).
   =========================================================================== */

/* 1) La barra superior (header + menu hamburguesa) SI debe verse sobre el feed
      (para navegar y salir). Solo ocultamos el footer. El menu lateral off-canvas
      y su backdrop quedan disponibles (los abre el hamburguesa). */
body.feed-immersive .app-footer {
  display: none;
}

/* Reservamos el alto de la barra superior y evitamos doble scroll: el feed-rail
   es el unico scroller. --feed-top = alto fijo de la barra (la barra es sticky y
   queda en flujo, asi que el video vive debajo restandole ese alto al 100vh). */
body.feed-immersive {
  --feed-top: 64px;
  /* Ancho del indice lateral (.course-index). Fuente unica: la usan el grid de
     .feed-experience y el gutter que reserva el overlay de resultado, para que
     no se descentren entre si si cambia el ancho del indice. */
  --course-index-width: 320px;
  background: #000;
  overflow: hidden;
}

/* Alto deterministico de la barra para que --feed-top coincida exacto. */
body.feed-immersive .app-topbar {
  min-height: var(--feed-top);
}

body.feed-immersive .brand-icon {
  width: 36px;
  height: 36px;
}

/* Frame a sangre completa: sin ancho maximo ni padding del .app-container/.page-frame. */
body.feed-immersive .page-frame {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* 2) El contenedor del feed deja de ser grid con gap. */
body.feed-immersive .feed-experience {
  display: block;
  gap: 0;
}

/* feed-status: cabecera flotante sobre el video (no consume una pantalla).
   Conserva su auto-hide por JS (.is-hidden -> opacity:0). */
body.feed-immersive .feed-status {
  position: fixed;
  top: var(--feed-top);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent);
  color: #fff;
}

body.feed-immersive .feed-status h1,
body.feed-immersive .feed-status p,
body.feed-immersive .feed-status small {
  color: #fff;
}

/* 3) feed-rail = contenedor de scroll con snap PEGAJOSO (mandatory), sin gap.
      Fondo negro para las bandas a los lados de la columna 9/16. */
body.feed-immersive .feed-rail {
  height: calc(100vh - var(--feed-top));
  height: calc(100dvh - var(--feed-top));
  margin: 0;
  gap: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  background: #000;
}

/* 4) Cada capsula = una pantalla completa del viewport, con fondo negro y la
      columna del video centrada horizontalmente (estilo TikTok). */
body.feed-immersive .capsule-screen,
body.feed-immersive .feed-experience .capsule-screen {
  width: 100%;
  height: calc(100vh - var(--feed-top));
  height: calc(100dvh - var(--feed-top));
  min-height: calc(100vh - var(--feed-top));
  min-height: calc(100dvh - var(--feed-top));
  margin: 0;
  grid-template-columns: 1fr;
  place-items: center;
  background: #000;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* 5) video-stage = columna vertical 9/16 (formato telefono) centrada, NO a
      sangre completa. A los lados queda el fondo negro de la capsula. */
body.feed-immersive .video-stage,
body.feed-immersive .feed-experience .video-stage {
  position: relative;
  width: min(100%, calc((100vh - var(--feed-top)) * 9 / 16));
  width: min(100%, calc((100dvh - var(--feed-top)) * 9 / 16));
  max-width: none;
  height: auto;
  max-height: calc(100vh - var(--feed-top));
  max-height: calc(100dvh - var(--feed-top));
  min-height: 0;
  margin-inline: auto;
  border: 0;
  border-radius: 0;
  aspect-ratio: 9 / 16;
  background: #000;
  box-shadow: none;
}

/* El <video> usa object-fit: contain para NO recortarse: se ve completo dentro
   de su columna 9/16; si su proporcion real difiere, deja bandas negras. */
body.feed-immersive .capsule-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer; /* tap/clic sobre el video = play/pausa (lo maneja site.js) */
}

/* (Se elimino el caption sobre el video: .video-bottom / .video-caption / .video-meta
   y su auto-hide por .caption-hidden. Se quitaron titulo y chips por pedido; el titulo
   de cada capsula sigue en el indice "Contenido del curso" del panel lateral.) */

/* Control propio pegado al borde derecho del video (estilo TikTok): dos botones
   directos y siempre visibles, play/pausa y sonido on/off. El JS vive en site.js
   (bloque aislado). z-index 4 = por debajo del overlay del quiz (z-5), para no
   estorbar cuando aparece el quiz. */
.video-controls {
  display: none;
}

body.feed-immersive .video-controls {
  position: absolute;
  right: 10px;
  bottom: 130px;
  z-index: 4;
  display: flex;
  flex-direction: column; /* play arriba, sonido abajo */
  align-items: center;
  gap: 16px;
}

body.feed-immersive .vc-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

body.feed-immersive .vc-btn:hover,
body.feed-immersive .vc-btn:focus {
  background: rgba(0, 0, 0, .68);
}

/* Barra de progreso/scrub del video (estilo Reels). Hermana del <video> dentro
   de .video-stage; NO reutiliza .progress-track/.feed-progress (avance del curso).
   z-index 4 = sobre el degradado del caption (.video-bottom, z-3) y bajo el quiz
   (.quiz-panel, z-5). No colisiona con .video-controls (right:10px; bottom:130px):
   el scrubber vive pegado al borde inferior full-width. El JS (site.js) actualiza
   .vs-fill en timeupdate y hace seek con pointer events (mouse + touch). */
.video-scrubber {
  display: none;
}

body.feed-immersive .video-scrubber {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  height: 22px;            /* barra fina en reposo, area tactil comoda */
  padding: 0 12px 6px;
  cursor: pointer;
  touch-action: none;      /* el drag horizontal NO dispara el scroll-snap vertical del feed */
}

body.feed-immersive .vs-track {
  position: relative;
  width: 100%;
  height: 3px;             /* delgada en reposo */
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  transition: height .15s ease;
}

body.feed-immersive .video-scrubber:hover .vs-track,
body.feed-immersive .video-scrubber.is-scrubbing .vs-track {
  height: 6px;             /* engrosa al interactuar */
}

body.feed-immersive .vs-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: #fff;
}

/* Con el quiz visible (.quiz-panel z-5 opaco cubre inset:0), ocultamos el
   scrubber para que no capture eventos por debajo del panel. */
body.feed-immersive .capsule-screen.quiz-ready .video-scrubber {
  display: none;
}

/* Ocultamientos pedidos (solo visual; la funcionalidad/estado vive en el
   servidor: gating, intentos y avance no se tocan):
   - .video-topline  => "Programa general" + duracion "X min"
   - .completed-badge => badge flotante "Aprobado/Reforzar · Quiz registrado"
   - .quiz-heading .result-pill => pill de estado (Aprobado/Reforzar/Bloqueado);
     el estado "Bloqueado" sigue explicado por el .form-alert del panel. */
body.feed-immersive .video-topline,
body.feed-immersive .completed-badge,
body.feed-immersive .quiz-heading .result-pill {
  display: none;
}

/* ===========================================================================
   Estado vacio del feed ("Estas al dia / Sin capsulas pendientes") en immersive.
   El .panel (Index.cshtml L190) reutiliza el estilo base de tarjeta (blanca,
   borde, sombra), que desentona sobre el negro del feed y no ocupa el alto de un
   slide. Aqui lo integramos: sin tarjeta, texto claro, centrado a pantalla.
   Selector acotado a body.feed-immersive .feed-rail .panel => SOLO el feed de
   /Index (unica pagina con feed-immersive) y SOLO paneles dentro del rail; NO
   afecta .panel de reports/dashboard/otras vistas. Cosmetico minimo (se
   redisenara con el dashboard). El residuo de .feed-status se resuelve por markup
   (hasCurrentCapsule + is-hidden), no aqui. */
body.feed-immersive .feed-rail .panel {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  min-height: calc(100vh - var(--feed-top));
  min-height: calc(100dvh - var(--feed-top));
  margin: 0;
  padding: 48px 24px;
  border: 0;
  border-radius: 0;
  background: transparent;     /* deja ver el negro del .feed-rail */
  box-shadow: none;
  color: #fff;
  text-align: center;
}

/* La cabecera base es flex space-between; aqui la apilamos centrada. */
body.feed-immersive .feed-rail .panel .panel-heading {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 0;
}

body.feed-immersive .feed-rail .panel .panel-heading h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: #fff;
}

body.feed-immersive .feed-rail .panel .panel-heading span {
  color: rgba(255, 255, 255, .55);
}

body.feed-immersive .feed-rail .panel p {
  max-width: 34ch;
  margin: 0;
  color: rgba(255, 255, 255, .72);
  line-height: 1.5;
}

/* ===========================================================================
   Fin de campana: desglose que reemplaza el panel "Estas al dia" dentro del
   feed negro. Vive en la col-1 de .feed-experience (junto al indice en desktop;
   el indice se oculta <=1024px, aqui queda a ancho completo). Ocupa un slide
   completo, centrado, texto claro; la lista de modulos scrollea con el feed-rail
   si son muchos. 100% presentacion, integrado al fondo negro.
   =========================================================================== */
body.feed-immersive .feed-rail .campaign-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: calc(100vh - var(--feed-top));
  min-height: calc(100dvh - var(--feed-top));
  margin: 0;
  padding: 40px 20px;
  color: #fff;
  text-align: center;
  scroll-snap-align: start;
}

body.feed-immersive .campaign-summary .cs-head {
  display: grid;
  justify-items: center;
  gap: 8px;
}

body.feed-immersive .campaign-summary h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  font-weight: 900;
  line-height: 1.15;
  color: #fff;
}

body.feed-immersive .campaign-summary .cs-route {
  margin: 0;
  font-weight: 700;
  color: rgba(255, 255, 255, .78);
}

body.feed-immersive .campaign-summary .cs-global {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

body.feed-immersive .campaign-summary .cs-stat {
  display: grid;
  gap: 2px;
  min-width: 130px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
}

body.feed-immersive .campaign-summary .cs-stat strong {
  font-size: 1.4rem;
  font-weight: 900;
}

body.feed-immersive .campaign-summary .cs-stat span {
  font-size: .8rem;
  color: rgba(255, 255, 255, .7);
}

body.feed-immersive .campaign-summary .cs-modules {
  list-style: none;
  width: min(100%, 420px);
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

body.feed-immersive .campaign-summary .cs-module {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid transparent;
  background: rgba(255, 255, 255, .06);
  text-align: left;
}

body.feed-immersive .campaign-summary .cs-module-name {
  font-weight: 700;
}

body.feed-immersive .campaign-summary .cs-module-count {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  opacity: .9;
}

/* Estado por color: verde=aprobado, rojo=reprobado definitivo, neutro=incompleto. */
body.feed-immersive .campaign-summary .cs-module.state-green {
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, .16);
}

body.feed-immersive .campaign-summary .cs-module.state-red {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, .16);
}

body.feed-immersive .campaign-summary .cs-module.state-neutral {
  border-left-color: rgba(255, 255, 255, .3);
}

/* ===========================================================================
   Overlay de resultado post-quiz (3 estados: passed / retry / final).
   Confinado al MISMO rectangulo 9/16 del reel (como .quiz-panel), centrado con
   bandas negras a los lados en desktop (NO a pantalla completa). No se puede
   anclar al .video-stage (en passed/final la capsula se filtra del DOM), asi que
   REPLICA su geometria con la formula del stage immersive (ver body.feed-immersive
   .video-stage). Altura = top:--feed-top -> bottom:0 (= alto util del feed).
   z-index 21 = por encima de .feed-status (z-20, fixed) mientras el overlay esta
   visible; sigue bajo el header/nav (z-30). No colisiona con .course-index (z-25,
   columna aparte) ni con .video-controls/.video-scrubber/.quiz-panel.
   Alimentado por TempData; solo presentacion.
   =========================================================================== */
.quiz-result-overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--feed-top, 0);
  bottom: 0;
  /* Ancho del reel 9/16 (misma formula que el stage immersive), centrado: con
     left:0/right:0 + width + margin-inline:auto la caja fija se centra en el
     espacio entre sus bordes; los lados quedan en negro (fondo del feed-rail). */
  width: min(100%, calc((100vh - var(--feed-top)) * 9 / 16));
  width: min(100%, calc((100dvh - var(--feed-top)) * 9 / 16));
  margin-inline: auto;
  z-index: 21;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .78);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* Desktop con indice lateral (>1024px): .feed-experience es grid de 2 columnas
   (feed | --course-index-width de .course-index). El reel se centra dentro de la
   col-1, no del viewport. Reservamos ese gutter para que el overlay (position:fixed)
   se centre sobre la col-1 y coincida con el reel. Misma variable que el grid =>
   un solo cambio propaga a ambos. Complementa el breakpoint existente
   @media (max-width:1024px), que oculta el indice; a <=1024px el overlay queda con
   right:0 (ancho util completo del reel). */
@media (min-width: 1025px) {
  .quiz-result-overlay {
    right: var(--course-index-width);
  }
}

.qr-card {
  display: grid;
  gap: 14px;
  width: min(100%, 360px);
  padding: 28px 24px;
  border-radius: 14px;
  background: rgba(17, 24, 39, .94);
  color: #fff;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.qr-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
}

.qr-text {
  margin: 0;
  color: rgba(255, 255, 255, .82);
}

.qr-hint {
  margin: 0;
  font-size: .9rem;
  color: rgba(255, 255, 255, .66);
}

.qr-actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

/* Reutiliza .primary-action / .secondary-action (ya estilados). Dentro del
   overlay: ancho completo y sin el margin-top que arrastran de su uso en el quiz.
   El primario va en cyan para destacar sobre la tarjeta oscura. */
.qr-actions .primary-action,
.qr-actions .secondary-action {
  width: 100%;
  margin-top: 0;
}

.qr-actions .primary-action {
  background: var(--cyan);
  color: #001114;
}

.qr-actions .primary-action:hover,
.qr-actions .primary-action:focus {
  background: #0e9aa6;
  color: #001114;
}

/* ===========================================================================
   Fase 4: indice "Contenido del curso" — panel derecho (solo web/anchas).
   Grid de 2 columnas (feed | panel) envolviendo .feed-rail + el <aside>.
   En <=1024px se oculta (en movil ira al menu hamburguesa, bloque posterior).
   =========================================================================== */

/* El contenedor del feed pasa a grid de 2 columnas. feed-status es position:fixed
   (fuera de flujo) -> no ocupa celda; quedan feed-rail (col 1) y .course-index (col 2). */
body.feed-immersive .feed-experience {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--course-index-width);
  gap: 0;
  align-items: start;
}

/* Panel con su propio scroll; z-index entre feed-status (20) y header (30) para
   no chocar (el menu off-canvas z-40+ queda por delante). position:relative para
   que el z-index aplique y tape la barra .feed-status fija que cruza por arriba. */
body.feed-immersive .course-index {
  position: relative;
  z-index: 25;
  height: calc(100vh - var(--feed-top));
  height: calc(100dvh - var(--feed-top));
  overflow-y: auto;
  padding: 18px 16px 28px;
  background: #0b0b0b;
  border-left: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
  -webkit-overflow-scrolling: touch;
}

body.feed-immersive .course-index .ci-head {
  margin-bottom: 12px;
}

body.feed-immersive .course-index .eyebrow {
  margin: 0;
}

/* Acordeon: encabezado de modulo + chevron. */
body.feed-immersive .ci-module {
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

body.feed-immersive .ci-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 4px;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 800;
  font-size: .92rem;
  text-align: left;
  cursor: pointer;
}

body.feed-immersive .ci-chevron {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(255, 255, 255, .6);
  border-bottom: 2px solid rgba(255, 255, 255, .6);
  transform: rotate(45deg); /* abierto: apunta hacia abajo */
  transition: transform .2s ease;
}

body.feed-immersive .ci-module.is-collapsed .ci-chevron {
  transform: rotate(-45deg); /* colapsado: apunta hacia arriba */
}

body.feed-immersive .ci-capsules {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0 0 8px;
  list-style: none;
}

body.feed-immersive .ci-module.is-collapsed .ci-capsules {
  display: none;
}

/* Fila de capsula: misma maqueta para navegable (button) y estatica (span). */
body.feed-immersive .ci-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, .85);
  font-size: .86rem;
  line-height: 1.25;
  text-align: left;
}

body.feed-immersive button.ci-link {
  cursor: pointer;
}

body.feed-immersive button.ci-link:hover,
body.feed-immersive button.ci-link:focus {
  background: rgba(255, 255, 255, .06);
}

body.feed-immersive .ci-static {
  cursor: default;
}

body.feed-immersive .ci-title {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.feed-immersive .ci-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .4);
}

/* Estado 1: completada -> punto verde, navegable. */
body.feed-immersive .ci-capsule.is-done .ci-dot {
  background: var(--green);
}

/* Estado 2: actual -> fila resaltada (borde/fondo), navegable. */
body.feed-immersive .ci-capsule.is-current .ci-link {
  border-color: var(--cyan);
  background: rgba(17, 184, 198, .16);
  color: #fff;
  font-weight: 700;
}

body.feed-immersive .ci-capsule.is-current .ci-dot {
  background: var(--cyan);
}

/* Estado 3: no aprobada (agoto intentos) -> rojo, NO navegable. */
body.feed-immersive .ci-capsule.is-failed .ci-dot {
  background: var(--red);
}

body.feed-immersive .ci-capsule.is-failed .ci-title {
  color: rgba(255, 170, 170, .85);
}

/* Estado 4: bloqueada futura -> gris atenuado con candado, NO navegable. */
body.feed-immersive .ci-capsule.is-locked .ci-link {
  color: rgba(255, 255, 255, .4);
}

body.feed-immersive .ci-capsule.is-locked .ci-dot {
  background: rgba(255, 255, 255, .25);
}

body.feed-immersive .ci-lock {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: rgba(255, 255, 255, .4);
}

/* Rotulos literales de estado del manual en el indice "Contenido del curso".
   Aprobado (verde) / Pendiente-Reforzar (cyan) / Bloqueado (rojo). La capsula futura
   NO lleva badge: conserva el candado gris (.ci-lock), para que "Bloqueado" (intentos
   agotados, rojo) y "no llegaste todavia" (candado gris) NO se vean iguales. */
body.feed-immersive .ci-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .85);
}

body.feed-immersive .ci-capsule.is-done .ci-badge {
  background: rgba(46, 204, 113, .18);
  color: var(--green);
}

body.feed-immersive .ci-capsule.is-current .ci-badge {
  background: rgba(17, 184, 198, .20);
  color: var(--cyan);
}

body.feed-immersive .ci-capsule.is-failed .ci-badge {
  background: rgba(231, 76, 60, .20);
  color: var(--red);
}

/* Estado de la capsula en el feed: PERSISTENTE sobre el video. Hijo directo de .video-stage
   (NO de .video-bottom/.video-caption), por lo que NO lo alcanza el auto-hide (.caption-hidden)
   ni el fade del quiz: el indicador queda siempre visible. Posicion fija arriba-izquierda (la
   .video-topline ahi esta oculta en immersive). Solo la capsula actual se monta como slide =>
   solo aplica Pendiente / Reforzar (Aprobado/Bloqueado viven en el indice lateral). Clase propia
   (NO .result-pill, oculto en immersive por diseno). pointer-events:none para no tapar el tap. */
body.feed-immersive .capsule-state {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

body.feed-immersive .capsule-state.capsule-state-pendiente {
  background: rgba(17, 184, 198, .28);
  color: #d6fbff;
}

body.feed-immersive .capsule-state.capsule-state-reforzar {
  background: rgba(240, 173, 78, .30);
  color: #ffe9c7;
}

/* Solo web/pantallas anchas: a <=1024px el panel se oculta y el feed vuelve a
   una sola columna (en movil el indice ira al menu hamburguesa, bloque posterior). */
@media (max-width: 1024px) {
  body.feed-immersive .feed-experience {
    grid-template-columns: 1fr;
  }

  body.feed-immersive .course-index {
    display: none;
  }
}

/* ===== Pestañas internas de pagina fusionada (hub) — ej. Cumplimiento ===== */
.hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.hub-tab {
  padding: 10px 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.hub-tab:hover,
.hub-tab:focus {
  color: var(--ink);
  background: rgba(17, 24, 39, .04);
}

/* ===== Mi Progreso ========================================================= */
.my-progress-shell {
  display: grid;
  gap: 22px;
  width: min(100%, 760px);
  margin-inline: auto;
  padding: clamp(20px, 4vw, 34px);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(17, 184, 198, .1), transparent 34%),
    #071015;
  color: #fff;
  box-shadow: 0 20px 54px rgba(8, 15, 22, .18);
}

.my-progress-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.my-progress-avatar {
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #16becb, #675ee8);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
}

.my-progress-hero .eyebrow {
  margin-bottom: 4px;
}

.my-progress-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1;
  font-weight: 900;
}

.my-progress-user,
.my-progress-route {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, .76);
  line-height: 1.35;
}

.my-progress-route {
  max-width: 44ch;
  font-weight: 750;
}

.my-progress-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.my-progress-stat {
  min-height: 116px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .075);
}

.my-progress-stat strong,
.my-progress-stat span {
  display: block;
}

.my-progress-stat strong {
  color: #20f0f6;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 950;
  line-height: 1;
}

.my-progress-stat span {
  margin-top: 10px;
  color: rgba(255, 255, 255, .72);
  font-weight: 750;
}

.my-route-section {
  display: grid;
  gap: 14px;
}

.my-route-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.my-route-heading h2 {
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font-size: .88rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.my-route-heading span {
  color: rgba(255, 255, 255, .5);
  font-size: .86rem;
  font-weight: 800;
}

.my-route-list {
  display: grid;
  gap: 12px;
}

.my-route-card,
.my-route-empty {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
}

.my-route-empty {
  grid-template-columns: 1fr;
  color: rgba(255, 255, 255, .72);
}

.my-route-empty strong,
.my-route-empty span {
  display: block;
}

.my-route-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.2;
}

.my-route-card p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, .64);
  font-weight: 700;
}

.my-route-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-weight: 900;
}

.my-route-card.is-completed .my-route-icon {
  background: rgba(45, 170, 104, .22);
  color: #49d98d;
}

.my-route-card.is-in-progress .my-route-icon {
  background: rgba(17, 184, 198, .22);
  color: #20f0f6;
}

.my-route-card.is-pending .my-route-icon,
.my-route-card.is-blocked .my-route-icon {
  background: rgba(255, 255, 255, .09);
  color: rgba(255, 255, 255, .6);
}

@media (max-width: 640px) {
  .my-progress-shell {
    width: 100%;
    padding: 20px;
  }

  .my-progress-hero {
    align-items: flex-start;
  }

  .my-progress-avatar {
    width: 54px;
    height: 54px;
    font-size: 1rem;
  }

  .my-progress-stats {
    grid-template-columns: 1fr;
  }
}

.hub-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  margin-bottom: -1px; /* solapa el borde inferior para el efecto de pestaña activa */
}
