/* ============================================================
   Nasatya LMS · Sistema de diseño
   Paleta: morado #6C5DD3 · teal #4CA9BE · navy #152A4D · menta #DCF0EF
   Degradado firma: #6C5DD3 → #4CA9BE → #152A4D
   Tipografías: Poppins (títulos) / Inter (cuerpo)
   ============================================================ */
:root {
  /* Escala navy (base #152A4D) */
  --navy-deepest: #0E1B33;
  --navy-deep: #152A4D;
  --navy: #24406E;
  --navy-bright: #4CA9BE;
  --navy-light: #6FC2D2;
  --mint: #DCF0EF;
  --sky: #EEF6F6;

  /* Acento corporativo · morado (se conservan los nombres --gold-* como tokens de acento) */
  --gold-deep: #574BC0;
  --gold: #6C5DD3;
  --gold-bright: #8B7EE4;
  --gold-light: #BEB5EE;
  --gold-pale: #ECE9FB;

  --paper: #FCFBFF;
  --paper-warm: #F3F1FB;
  --ivory: #EFF7F7;

  --ink: #14233F;
  --ink-70: rgba(20, 35, 63, 0.7);
  --ink-50: rgba(20, 35, 63, 0.5);
  --ink-30: rgba(20, 35, 63, 0.3);
  --line: rgba(20, 35, 63, 0.1);
  --line-medium: rgba(20, 35, 63, 0.18);

  --grad-navy: linear-gradient(135deg, #0E1B33 0%, #152A4D 50%, #24406E 100%);
  --grad-navy-bright: linear-gradient(135deg, #152A4D 0%, #4CA9BE 100%);
  --grad-gold: linear-gradient(135deg, #6C5DD3 0%, #4CA9BE 100%);
  --grad-gold-shimmer: linear-gradient(120deg, #6C5DD3 0%, #8B7EE4 30%, #4CA9BE 50%, #8B7EE4 70%, #6C5DD3 100%);
  --grad-royal: linear-gradient(135deg, #6C5DD3 0%, #4CA9BE 55%, #152A4D 100%);

  --green: #2D7A4F;
  --red: #B83838;

  --font-display: 'Poppins', -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: Arial, 'Helvetica Neue', 'Inter', system-ui, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --shadow-soft: 0 10px 30px -14px rgba(21, 42, 77, 0.28);
  --shadow-elevated: 0 18px 50px -20px rgba(21, 42, 77, 0.45);
  --shadow-gold: 0 10px 28px -12px rgba(108, 93, 211, 0.5);
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(108, 93, 211, 0.06) 0%, transparent 35%),
    radial-gradient(circle at 85% 75%, rgba(76, 169, 190, 0.07) 0%, transparent 40%);
  z-index: 0;
}

.boot { display: grid; place-items: center; height: 100vh; font-family: var(--font-mono);
  color: var(--ink-50); letter-spacing: 0.1em; text-transform: uppercase; font-size: 12px; }

a { color: inherit; }
button { font-family: var(--font-body); }
::selection { background: var(--gold-light); }

/* ============ LOGIN ============ */
.login-wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.login-hero {
  background:
    radial-gradient(900px 520px at 12% 6%, rgba(108,93,211,0.18) 0%, transparent 55%),
    radial-gradient(820px 640px at 96% 104%, rgba(76,169,190,0.16) 0%, transparent 55%),
    linear-gradient(135deg, #FFFFFF 0%, #F3F1FB 55%, #E9F5F5 100%);
  color: var(--navy-deepest);
  padding: 64px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(21,42,77,0.08);
}
.login-hero::after {
  content: ""; position: absolute; top: -120px; right: -120px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(108,93,211,0.16) 0%, transparent 70%);
}
.login-hero-brand { display: flex; align-items: center; position: relative; }
.login-logo { height: 208px; width: auto; max-width: 100%; object-fit: contain;
  display: block; margin-left: -6px; }
.login-hero h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 42px;
  line-height: 1.14; letter-spacing: -0.02em; max-width: 13ch; position: relative;
  color: var(--navy-deepest);
}
.login-hero h1 .accent { color: var(--navy-deep); }
.login-hero h1 .hero-mint {
  background: linear-gradient(115deg, #6C5DD3 0%, #4CA9BE 55%, #152A4D 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.login-hero p { color: #5b7186; max-width: 42ch; margin-top: 18px; position: relative; }
.login-hero-foot { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--navy-bright); position: relative; }

.login-panel { display: grid; place-items: center; padding: 40px; position: relative; z-index: 1; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-family: var(--font-display); font-size: 27px; font-weight: 700;
  color: var(--navy-deepest); letter-spacing: -0.01em; }
html[data-theme="dark"] .login-card h2 { color: #ffffff; }
.login-card .sub { color: var(--ink-70); margin: 8px 0 28px; }
.login-card #login-btn { margin-top: 14px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-70); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); background: var(--paper); font-size: 15px; color: var(--ink);
  font-family: var(--font-body); transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--navy-bright);
  box-shadow: 0 0 0 3px rgba(30,91,184,0.12);
}
.field textarea { resize: vertical; min-height: 96px; }

.btn { padding: 12px 24px; border-radius: 999px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center;
  gap: 8px; transition: all 0.2s; justify-content: center; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--grad-royal); color: #ffffff; border-color: transparent; }
.btn-primary:hover { box-shadow: 0 12px 26px -10px rgba(21,42,77,0.55); transform: translateY(-2px); }
.btn-gold { background: var(--grad-gold); color: #ffffff; border-color: var(--gold-deep); font-weight: 700; }
.btn-gold:hover { box-shadow: var(--shadow-gold); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line-medium); }
.btn-ghost:hover { border-color: var(--navy); background: var(--sky); }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(184,56,56,0.4); }
.btn-danger:hover { background: rgba(184,56,56,0.08); border-color: var(--red); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.login-error { background: rgba(184,56,56,0.08); border: 1px solid rgba(184,56,56,0.3);
  color: var(--red); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px;
  margin-bottom: 16px; }

.login-link { background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  color: var(--navy); font-size: 13.5px; font-weight: 600; text-decoration: underline;
  text-underline-offset: 2px; }
.login-link:hover { color: var(--gold); }

.login-note { background: var(--gold-pale); border: 1px solid var(--line-medium);
  color: var(--ink-70, var(--ink-50)); padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 12px; line-height: 1.45; }

.forgot-panel { margin-top: 14px; padding: 16px; border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); background: var(--paper); }
.forgot-actions { display: flex; gap: 8px; margin-top: 12px; }
.forgot-actions .btn { flex: 1; }

.login-demos { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 20px; }
.login-demos .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-50); margin-bottom: 12px; font-weight: 600; }
.demo-row { display: flex; gap: 8px; }
.demo-chip { flex: 1; padding: 10px; border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  background: var(--paper); cursor: pointer; text-align: center; transition: all 0.18s; }
.demo-chip:hover { border-color: var(--gold); background: var(--gold-pale); transform: translateY(-2px); }
.demo-chip .r { font-size: 11px; font-weight: 700; color: var(--navy); text-transform: uppercase;
  letter-spacing: 0.06em; }
.demo-chip .n { font-size: 11px; color: var(--ink-50); margin-top: 3px; }

/* ============ SHELL ============ */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  /* Lienzo muy claro y tenue (como la primera versión): velo casi imperceptible
     morado -> menta sobre base casi blanca, con un brillo satinado apenas sugerido
     desde arriba para que no se aplane, sin perder la ligereza. */
  background:
    radial-gradient(120% 44% at 50% -8%, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0) 60%),
    radial-gradient(115% 55% at 0% 4%, rgba(108,93,211,0.05) 0%, transparent 58%),
    radial-gradient(120% 58% at 100% 100%, rgba(76,169,190,0.07) 0%, transparent 58%),
    linear-gradient(168deg, #FCFBFF 0%, #F8F5FD 46%, #F0F8F5 100%);
  color: var(--ink);
  padding: 20px 20px 24px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  border-right: 1px solid rgba(108,93,211,0.18);
  box-shadow:
    inset 0 24px 38px -34px rgba(255,255,255,0.85),
    6px 0 24px -12px rgba(21,42,77,0.16),
    1px 0 0 rgba(76,169,190,0.12);
  z-index: 2;
}
.sidebar::before { content: ""; position: absolute; top: 0; right: 0; width: 2px; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(108,93,211,0.55) 30%, rgba(76,169,190,0.55) 70%, transparent);
  opacity: 0.7; }
.sidebar::after { content: ""; position: absolute; top: -100px; left: -100px; width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(108,93,211,0.05) 0%, transparent 70%); pointer-events: none; }

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; position: relative; cursor: pointer; }
.brand-emblem { width: 38px; height: 38px; background: var(--grad-gold-shimmer); border-radius: 50%;
  display: grid; place-items: center; color: #ffffff; font-family: var(--font-display);
  font-weight: 800; font-size: 18px; box-shadow: var(--shadow-gold); position: relative; flex-shrink: 0; }
.brand-emblem::before { content: ""; position: absolute; inset: -3px; border: 1px solid var(--gold);
  border-radius: 50%; opacity: 0.4; }
.brand-text { display: flex; flex-direction: column; }
.brand-mark { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em;
  line-height: 1; color: var(--paper); text-transform: lowercase; }
.brand-tag { font-size: 9px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--gold-bright);
  margin-top: 4px; font-weight: 500; }

/* Logo de imagen (marca blanca): rellena el emblema circular y el avatar. */
.brand-emblem img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* Logo de Nasatya en la barra lateral: lockup a color mostrado completo, con un
   leve realce (saturación + halo morado suave) para que resalte sobre la barra
   clara sin recortarlo. */
.brand { justify-content: flex-start; }
.sidebar-logo { width: 100%; max-width: 200px; height: auto; object-fit: contain;
  display: block; margin: -34px 0 -60px;
  filter: saturate(1.12) drop-shadow(0 2px 10px rgba(108,93,211,0.32)); }

.nav-scroll { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.nav-scroll::-webkit-scrollbar { width: 0; }
.nav-section { margin-bottom: 22px; position: relative; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--ink-50); margin-bottom: 10px; padding: 0 10px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--ink-70); font-size: 14.5px; font-weight: 500; margin-bottom: 2px;
  transition: all 0.2s ease; cursor: pointer; position: relative; }
.nav-item:hover { background: rgba(108,93,211,0.08); color: var(--gold-deep); }
.nav-item.active { background: linear-gradient(90deg, rgba(108,93,211,0.14) 0%, rgba(76,169,190,0.08) 100%);
  color: var(--gold-deep); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -22px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; background: linear-gradient(180deg, var(--gold) 0%, var(--navy-bright) 100%);
  border-radius: 0 2px 2px 0; box-shadow: 0 0 10px rgba(108,93,211,0.45); }
.nav-icon { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; fill: none;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--grad-gold); color: #ffffff; font-size: 10px;
  padding: 2px 7px; border-radius: 10px; font-weight: 600; }

/* "Administrar cursos": bloque superior con el botón Crear curso */
.manage-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px;
  padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(108,93,211,0.06), rgba(76,169,190,0.05)); }
.manage-cta .btn-lg { font-size: 15px; padding: 12px 22px; }
.manage-cta-hint { color: var(--ink-70); font-size: 14.5px; }

/* Editar cursos: barra de búsqueda + "Ordenar por" */
.teach-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.teach-search { position: relative; flex: 1 1 240px; min-width: 200px; display: flex; align-items: center; }
.teach-search svg { position: absolute; left: 12px; width: 15px; height: 15px; stroke: var(--ink-50);
  stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.teach-search input { width: 100%; padding: 10px 14px 10px 34px; border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); font-size: 14.5px; color: var(--ink-90); background: var(--paper);
  transition: border-color 0.15s, box-shadow 0.15s; }
.teach-search input:focus { outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(108,93,211,0.12); }
.teach-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-70); white-space: nowrap; }
.teach-sort select { padding: 9px 30px 9px 12px; border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--ink-90);
  background: var(--paper) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 10px center;
  cursor: pointer; -webkit-appearance: none; appearance: none; }
.teach-sort select:focus { outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(108,93,211,0.12); }

/* "Mis cursos" (instructor): aviso de modo vista previa */
.preview-hint { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px;
  padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--sky); color: var(--ink-80); font-size: 14.5px; line-height: 1.5; }
.preview-hint-ic { flex: 0 0 auto; display: inline-flex; color: var(--gold-deep); margin-top: 1px; }
.preview-hint-ic svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }

/* Aviso de borrador recuperado en el modal "Nuevo curso" */
.draft-recovered { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--sky); color: var(--ink-80); font-size: 14px; }
.draft-recovered svg { flex: 0 0 auto; width: 16px; height: 16px; stroke: var(--gold-deep);
  stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.draft-recovered .link-btn { margin: 0 0 0 auto; }

/* Grupo desglosable "Mis cursos" en la barra lateral */
.nav-group { margin-bottom: 2px; }
.nav-group-head { display: flex; align-items: center; gap: 2px; }
.nav-group-head .nav-group-link { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.nav-group-head .nav-group-link span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-caret-btn { flex: 0 0 auto; width: 28px; height: 28px; display: inline-flex; align-items: center;
  justify-content: center; border: none; background: transparent; cursor: pointer; color: var(--ink-50);
  border-radius: var(--radius-sm); transition: background 0.2s ease, color 0.2s ease; }
.nav-caret-btn:hover { background: rgba(108,93,211,0.08); color: var(--gold-deep); }
.nav-caret { display: inline-flex; transition: transform 0.18s ease; }
.nav-caret svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.nav-group:not(.open) .nav-caret { transform: rotate(-90deg); }
.nav-sub { display: none; flex-direction: column; gap: 2px; margin: 3px 0 6px 16px;
  padding-left: 10px; border-left: 1px solid var(--line-medium); }
.nav-group.open .nav-sub { display: flex; }
.nav-sub-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: var(--radius-sm);
  color: var(--ink-70); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: all 0.18s ease; }
.nav-sub-item:hover { background: rgba(108,93,211,0.08); color: var(--gold-deep); }
.nav-sub-item.active { background: rgba(108,93,211,0.14); color: var(--navy); font-weight: 600; }
.nav-sub-dot { flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.nav-sub-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-sub-go { flex: 0 0 auto; display: inline-flex; color: var(--ink-50); opacity: 0; transition: opacity 0.15s ease; }
.nav-sub-go svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.7; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.nav-sub-item:hover .nav-sub-go, .nav-sub-item.active .nav-sub-go { opacity: 1; }
.nav-sub-empty, .nav-sub-loading { padding: 8px 9px; font-size: 12px; color: var(--ink-50); }
.nav-sub-new { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 4px; padding: 8px 9px;
  border-radius: var(--radius-sm); border: 1px dashed var(--line-medium); background: transparent;
  color: var(--navy); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all 0.18s ease; }
.nav-sub-new svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-sub-new:hover { background: var(--sky); border-color: var(--navy); }

.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  transition: background 0.2s ease; }
.user-card:hover { background: rgba(108,93,211,0.06); }
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(140deg, #6C5DD3 0%, #5B8FD1 52%, #4CA9BE 100%);
  display: grid; place-items: center; color: #ffffff; font-weight: 700; font-size: 14px;
  flex-shrink: 0; border: 2px solid rgba(76,169,190,0.35); overflow: hidden; }
.user-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.user-org { font-size: 11px; color: var(--gold-deep); opacity: 0.9; }
.logout-link { margin-top: 10px; font-size: 12px; color: var(--ink-50); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; }
.logout-link:hover { color: var(--gold-deep); }

/* ============ TEMA POR CAMPUS · NASATYA ============
   Barra lateral verde-menta -> azul en degradado, aplicada SOLO al campus de
   Nasatya. applyBrand() fija html[data-org-theme="nasatya"] según el slug de la
   organización activa; no afecta al campus por defecto ni a ningún otro. */
/* La barra de Nasatya ahora comparte el lienzo CLARO base (casi blanco con velo
   tenue morado -> menta), el logo a color y los acentos morados. No se fuerza el
   degradado oscuro; se mantiene el emblema circular a color por si algún día se
   usa la inicial en lugar del lockup de imagen. */
html[data-org-theme="nasatya"] .brand,
html[data-org-theme="nasatya"] .nav,
html[data-org-theme="nasatya"] .sidebar-bottom { position: relative; z-index: 1; }
html[data-org-theme="nasatya"] .brand-emblem {
  background: linear-gradient(140deg, #6C5DD3 0%, #4CA9BE 55%, #152A4D 100%);
  color: #ffffff;
  box-shadow: 0 8px 22px -10px rgba(21,42,77,0.6), inset 0 1px 2px rgba(255,255,255,0.5);
}
html[data-org-theme="nasatya"] .brand-emblem::before {
  border-color: rgba(180,235,245,0.7); opacity: 0.55;
}
html[data-org-theme="nasatya"] .sidebar-bottom { border-top-color: rgba(255,255,255,0.16); }

/* ---- Barra lateral · MODO OSCURO (cualquier campus) ----
   En oscuro la barra pasa a una superficie carbón con el mismo velo tenue
   morado/menta; el logo a color se vuelve blanco con filtro para legibilidad. */
html[data-theme="dark"] .sidebar {
  background:
    radial-gradient(115% 55% at 0% 0%, rgba(108,93,211,0.14) 0%, transparent 58%),
    radial-gradient(115% 55% at 100% 100%, rgba(76,169,190,0.10) 0%, transparent 58%),
    linear-gradient(168deg, #1b2130 0%, #171c27 52%, #141922 100%);
  color: var(--paper);
  border-right: 1px solid rgba(255,255,255,0.06);
}
html[data-theme="dark"] .sidebar-logo { filter: brightness(0) invert(1); }
html[data-theme="dark"] .nav-label { color: rgba(255,255,255,0.5); }
html[data-theme="dark"] .nav-item { color: rgba(255,255,255,0.82); }
html[data-theme="dark"] .nav-item:hover { background: rgba(108,93,211,0.18); color: #fff; }
html[data-theme="dark"] .nav-item.active {
  background: linear-gradient(90deg, rgba(108,93,211,0.30) 0%, rgba(76,169,190,0.14) 100%); color: #fff; }
html[data-theme="dark"] .nav-item.active::before {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--navy-bright) 100%);
  box-shadow: 0 0 12px rgba(139,126,228,0.7); }
html[data-theme="dark"] .sidebar-bottom { border-top-color: rgba(255,255,255,0.1); }
html[data-theme="dark"] .user-card:hover { background: rgba(108,93,211,0.14); }
html[data-theme="dark"] .user-name { color: #fff; }
html[data-theme="dark"] .user-org { color: var(--gold-bright); }
html[data-theme="dark"] .logout-link { color: rgba(255,255,255,0.6); }
html[data-theme="dark"] .logout-link:hover { color: var(--gold-bright); }

/* ---- Nasatya · MODO OSCURO ----
   La barra lateral conserva EXACTAMENTE el mismo degradado verde->azul del modo
   claro (heredado de la regla base de Nasatya). En modo oscuro solo cambia el
   ENTORNO: fondo y superficies pasan a gris oscuro (charcoal). */
html[data-theme="dark"][data-org-theme="nasatya"] {
  /* Gris Oxford oscuro: carbón slate frío con matiz azul-gris. */
  --paper:      #2a2f37;
  --paper-warm: #232830;
  --ivory:      #343b45;
  --sky:        #343b45;
}
html[data-theme="dark"][data-org-theme="nasatya"] body {
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(120,140,170,0.05), transparent 60%),
    radial-gradient(1000px 800px at -10% 110%, rgba(90,110,140,0.06), transparent 55%),
    linear-gradient(160deg, #2b313b 0%, #1c2027 100%);
  background-attachment: fixed;
}
html[data-theme="dark"][data-org-theme="nasatya"] .topbar {
  background: rgba(32,36,43,0.62);
}

/* ============ MAIN / TOPBAR ============ */
.main { overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 40px;
  border-bottom: 1px solid var(--line); background: rgba(252,251,247,0.7); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 40; }
.topbar-title { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--navy-deepest);
  letter-spacing: -0.01em; }
.topbar-sub { font-size: 13.5px; color: var(--ink-50); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.role-pill { font-family: var(--font-body); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 6px 12px; border-radius: 100px; background: var(--sky); color: var(--navy); font-weight: 600;
  border: 1px solid rgba(30,91,184,0.2); }

.content { padding: 34px 40px 60px; position: relative; z-index: 1; flex: 1; }
.page-enter { animation: fade 0.32s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ SECTIONS ============ */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--navy-deepest); }
.section-title .accent { color: var(--gold-deep); }
.section-link { font-size: 13.5px; color: var(--navy-bright); cursor: pointer; font-weight: 600; }
.section-link:hover { color: var(--navy); text-decoration: underline; }
.muted { color: var(--ink-50); }
.mono { font-family: var(--font-mono); }

/* ============ STAT CARDS ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 40px; }
.stat-card { background: var(--paper); border: 1px solid var(--line-medium); border-radius: var(--radius);
  padding: 22px; position: relative; overflow: hidden; transition: all 0.25s; }
.stat-card:hover { border-color: var(--navy); box-shadow: var(--shadow-soft); transform: translateY(-3px); }
.stat-card::after { content: ""; position: absolute; top: 0; right: 0; width: 60px; height: 60px;
  background: radial-gradient(circle at top right, rgba(76,169,190,0.14), transparent 70%); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: grid;
  place-items: center; margin-bottom: 16px;
  background:
    radial-gradient(120% 120% at 22% 14%, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 46%),
    linear-gradient(150deg, #5B4CC4 0%, #6C5DD3 55%, #8B7EE4 100%);
  box-shadow: 0 4px 12px -4px rgba(108,93,211,0.5); }
.stat-icon svg { width: 19px; height: 19px; stroke: #ffffff; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--navy-deepest);
  letter-spacing: -0.02em; line-height: 1; }
.stat-label { font-size: 12px; color: var(--ink-50); margin-top: 8px; text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 500; }

/* ============ COURSE GRID ============ */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.course-card { background: var(--paper); border: 1px solid var(--line-medium); border-radius: var(--radius);
  overflow: hidden; transition: all 0.3s ease; cursor: pointer; }
.course-card:hover { transform: translateY(-4px); border-color: var(--navy); box-shadow: var(--shadow-elevated); }
.course-cover { height: 160px; position: relative; overflow: hidden; background-color: #0B1A2A; }
/* Portada con imagen subida o por URL: cubre todo el área. El degradado va como
   capa (.cover-grad) POR ENCIMA, por lo que tiñe la imagen sin ocultarla. */
.course-cover.has-image { background-size: cover; background-position: center; background-repeat: no-repeat; }
/* Capa de degradado: se apila sobre el fondo (azul o imagen). Las etiquetas y
   estados van después en el DOM, así que se pintan por encima de esta capa. */
.cover-grad { position: absolute; inset: 0; pointer-events: none; }
/* Los 10 degradados usan background-image translúcido para que el color de
   fondo (azul) o la imagen subida se vean a través de las zonas transparentes. */
.course-cover-1 { background-image: radial-gradient(circle at 30% 40%, rgba(76,169,190,0.5), transparent 55%),
  linear-gradient(135deg, rgba(11,22,42,0.7) 0%, rgba(21,42,77,0.6) 100%); }
.course-cover-2 { background-image: radial-gradient(circle at 70% 30%, rgba(157,92,245,0.55), transparent 60%),
  linear-gradient(135deg, rgba(15,29,64,0.68) 0%, rgba(45,101,224,0.6) 100%); }
.course-cover-3 { background-image: radial-gradient(circle at 50% 80%, rgba(201,169,247,0.5), transparent 60%),
  linear-gradient(135deg, rgba(11,16,42,0.72) 0%, rgba(60,45,120,0.6) 100%); }
.course-cover-4 { background-image: radial-gradient(circle at 25% 30%, rgba(76,169,190,0.6), transparent 58%),
  linear-gradient(135deg, rgba(21,42,77,0.68) 0%, rgba(76,169,190,0.55) 100%); }
.course-cover-5 { background-image: radial-gradient(circle at 75% 25%, rgba(230,183,92,0.55), transparent 55%),
  linear-gradient(135deg, rgba(28,20,60,0.7) 0%, rgba(157,92,245,0.58) 100%); }
.course-cover-6 { background-image: radial-gradient(circle at 60% 70%, rgba(47,168,160,0.55), transparent 58%),
  linear-gradient(135deg, rgba(18,50,77,0.68) 0%, rgba(27,110,126,0.58) 100%); }
.course-cover-7 { background-image: radial-gradient(circle at 30% 30%, rgba(255,196,84,0.55), transparent 58%),
  linear-gradient(135deg, rgba(120,52,20,0.6) 0%, rgba(230,120,45,0.55) 100%); }
.course-cover-8 { background-image: radial-gradient(circle at 70% 35%, rgba(255,120,180,0.5), transparent 58%),
  linear-gradient(135deg, rgba(90,20,70,0.66) 0%, rgba(214,45,130,0.55) 100%); }
.course-cover-9 { background-image: radial-gradient(circle at 35% 70%, rgba(120,230,170,0.5), transparent 58%),
  linear-gradient(135deg, rgba(10,50,45,0.68) 0%, rgba(20,140,110,0.55) 100%); }
.course-cover-10 { background-image: radial-gradient(circle at 65% 40%, rgba(120,150,255,0.5), transparent 58%),
  linear-gradient(135deg, rgba(20,24,70,0.7) 0%, rgba(70,90,220,0.58) 100%); }
.cover-tag { position: absolute; top: 14px; left: 14px; background: var(--grad-gold-shimmer);
  color: #ffffff; padding: 5px 11px; border-radius: 4px; font-family: var(--font-body);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.cover-status { position: absolute; top: 14px; right: 14px; font-family: var(--font-body); font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 9px; border-radius: 4px; font-weight: 700;
  background: rgba(252,251,247,0.9); color: var(--navy-deepest); }
.cover-status.active { background: rgba(45,122,79,0.94); color: #fff; }
.cover-status.pending { background: rgba(214,158,46,0.96); color: #fff; }
.cover-status.inactive { background: rgba(184,56,56,0.94); color: #fff; }
.cover-status.draft { background: rgba(107,114,128,0.92); color: #fff; }
.cover-status.locked { background: rgba(15,23,42,0.82); color: #fff; display: inline-flex; align-items: center; gap: 5px; }
.cover-status.locked svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.cover-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: rgba(255,255,255,0.15); }
.cover-progress-bar { height: 100%; background: var(--grad-gold-shimmer); box-shadow: 0 0 8px rgba(157,92,245,0.6); }

/* --- Selector de portada (modal crear/editar curso) --- */
.cover-field > span { display: block; margin-bottom: 8px; }
.cover-picker { display: flex; flex-direction: column; gap: 12px; }
.cover-preview { position: relative; overflow: hidden; height: 120px; border-radius: var(--radius);
  border: 1px solid var(--line-medium); background-size: cover; background-position: center;
  background-repeat: no-repeat; background-color: #0B1A2A; }
.cover-preview .cover-grad { border-radius: calc(var(--radius) - 1px); }
.cover-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.cover-swatch { position: relative; overflow: hidden; width: 52px; height: 34px; border-radius: 8px;
  border: 2px solid transparent; cursor: pointer; padding: 0; background-color: #0B1A2A;
  background-size: cover; transition: transform 0.15s ease, border-color 0.15s ease; }
.cover-swatch:hover { transform: translateY(-2px); }
.cover-swatch.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-pale); }
.cover-image-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cover-image-row .cover-url { flex: 1 1 200px; }
.cover-image-row .cover-upload { position: relative; cursor: pointer; }
.cover-hint { font-size: 12px; margin: 0; }
.course-body { padding: 18px 20px 20px; }
.course-meta { display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--navy); margin-bottom: 10px; font-weight: 500; }
.course-meta-dot { width: 3px; height: 3px; background: var(--gold); border-radius: 50%; }
/* Mini barra de avance propio del usuario (sustituye al conteo de lecciones). */
.course-progress-mini { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cpm-track { flex: 1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.cpm-fill { height: 100%; border-radius: 999px; background: var(--grad-gold-shimmer);
  min-width: 0; transition: width 0.4s ease;
  transform-origin: left center; animation: barGrow 0.9s cubic-bezier(0.22,1,0.36,1) both; }
.cpm-label { font-family: var(--font-body); font-size: 11px; font-weight: 700; color: var(--gold-deep);
  letter-spacing: 0.02em; white-space: nowrap; }
.course-title { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; line-height: 1.35;
  letter-spacing: -0.01em; margin-bottom: 14px; color: var(--navy-deepest); }
.course-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px;
  border-top: 1px solid var(--line); }
.instructor { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-70); }
.instructor-avatar { width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #6C5DD3 0%, #8B7EE4 100%);
  display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #ffffff;
  border: 1.5px solid rgba(108,93,211,0.35); }
.progress-text { font-family: var(--font-body); font-size: 12px; color: var(--gold-deep); font-weight: 700;
  background: var(--gold-pale); padding: 3px 9px; border-radius: 4px; }
.progress-text.locked { color: var(--ink-70); background: var(--line); display: inline-flex; align-items: center; gap: 5px; }
.progress-text.locked svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.price-text { font-family: var(--font-mono); font-size: 14px; color: var(--navy); font-weight: 700; }

/* ============ CARDS / PANELS ============ */
.panel { background: var(--paper); border: 1px solid var(--line-medium); border-radius: var(--radius);
  padding: 24px; margin-bottom: 24px; }
.panel-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--navy-deepest);
  margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }

/* ============ TABLES ============ */
.table-wrap { background: var(--paper); border: 1px solid var(--line-medium); border-radius: var(--radius);
  overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data thead th { text-align: left; padding: 14px 20px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink-50); font-weight: 700; background: var(--paper-warm);
  border-bottom: 1px solid var(--line-medium); }
table.data tbody td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--ivory); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .avatar { width: 32px; height: 32px; font-size: 11px; }
.cell-user .nm { font-weight: 600; color: var(--navy-deepest); }
.cell-user .em { font-size: 11.5px; color: var(--ink-50); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-body); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 100px; font-weight: 700; }
.badge-navy { background: var(--sky); color: var(--navy); }
.badge-gold { background: var(--gold-pale); color: var(--gold-deep); }
.badge-green { background: rgba(45,122,79,0.12); color: var(--green); }
.badge-red { background: rgba(184,56,56,0.1); color: var(--red); }
.badge-gray { background: var(--line); color: var(--ink-70); }
.role-tag { text-transform: capitalize; }

/* Muestra de color de marca de una organización (panel del Dueño Nasatya) */
.org-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  vertical-align: middle; margin-right: 6px; border: 1px solid rgba(0,0,0,0.12); }

/* Fila desplegable de organización → sus administradores / instructores / alumnos */
.org-expand { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border: none; background: transparent; color: var(--ink-50); cursor: pointer; border-radius: 6px;
  transition: transform 0.15s ease, background 0.15s ease; flex: none; }
.org-expand:hover { background: var(--line); color: var(--navy); }
.org-expand.open { transform: rotate(90deg); }
.org-detail > td { background: var(--sky, #f4f7fb); padding: 0; }
.org-detail-inner { padding: 14px 18px 18px; }
.org-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.org-group h5 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13.5px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-70); }
.org-members { display: flex; flex-direction: column; gap: 8px; }
.org-member { display: flex; align-items: center; gap: 9px; }
.org-member .avatar { color: #fff; }
.org-member-txt { display: flex; flex-direction: column; line-height: 1.25; }
.org-member-txt .nm { font-weight: 600; color: var(--navy-deepest); font-size: 14px; }
.org-member-txt .em { font-size: 11.5px; color: var(--ink-50); }

/* Selector de logo del modal de organización (subir imagen o pegar URL) */
.logo-picker { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.logo-preview { width: 64px; height: 64px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center; overflow: hidden; background: #faf8f2;
  flex-shrink: 0; text-align: center; font-size: 11px; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ PROGRESS BARS ============ */
.pbar { height: 8px; background: var(--line); border-radius: 100px; overflow: hidden; }
.pbar > i { display: block; height: 100%; background: var(--grad-gold-shimmer); border-radius: 100px;
  transform-origin: left center; animation: barGrow 0.9s cubic-bezier(0.22,1,0.36,1) both; }
.pbar-lg { height: 10px; }

/* Crecimiento de las barras de progreso al aparecer (escala desde 0 al ancho fijado). */
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ============ COURSE PLAYER ============ */
/* Barra de vista previa del docente (verlo como alumno). */
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--gold-pale); border: 1px solid var(--gold); color: var(--navy); }
.preview-bar-info { display: flex; align-items: center; gap: 10px; }
.preview-bar-info svg { stroke: var(--navy); flex: none; }
.preview-bar-info b { color: var(--navy); }
.player-layout { display: grid; grid-template-columns: 1fr 350px; gap: 28px; align-items: start; }
.player-main { }
.player-video { aspect-ratio: 16/9; border-radius: var(--radius); background: var(--grad-navy);
  position: relative; overflow: hidden; display: grid; place-items: center; box-shadow: var(--shadow-elevated); }
.player-video::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(76,169,190,0.18), transparent 60%); }
.play-btn { width: 74px; height: 74px; border-radius: 50%; background: rgba(252,251,247,0.14);
  border: 2px solid var(--gold-bright); display: grid; place-items: center; cursor: pointer; position: relative;
  transition: transform 0.2s; }
.play-btn:hover { transform: scale(1.07); }
.play-btn svg { width: 26px; height: 26px; fill: var(--gold-bright); margin-left: 4px; }
.lesson-heading { margin: 22px 0 6px; font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--navy-deepest); letter-spacing: -0.01em; }
.lesson-desc { color: var(--ink-70); line-height: 1.65; }
.lesson-actions { display: flex; gap: 12px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }

.curriculum { background: var(--paper); border: 1px solid var(--line-medium); border-radius: var(--radius);
  overflow: hidden; }
.curriculum-head { padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--paper-warm); }
.curriculum-head .t { font-family: var(--font-display); font-weight: 700; color: var(--navy-deepest); font-size: 15px; }
.curriculum-head .s { font-size: 12px; color: var(--ink-50); margin-top: 4px; }
.mod-block { border-bottom: 1px solid var(--line); }
.mod-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mod-body { padding-bottom: 4px; }
.mod-title { padding: 12px 20px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--navy); background: var(--ivory);
  display: flex; align-items: center; }

/* ── Listas "Agregar" / "Acciones" / "Módulo" del Studio ─────────────────
   Agrupan las acciones del temario (antes amontonadas en una tira de botones)
   en un <select> nativo: responsive y desplazable por sí mismo, sin popovers. */
.mod-head-actions { display: inline-flex; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }
.st-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  display: inline-flex; align-items: center; white-space: nowrap; cursor: pointer;
  height: 32px; padding: 0 30px 0 14px; max-width: 210px;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  color: var(--ink); background-color: var(--paper);
  border: 1px solid var(--line-medium); border-radius: 999px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324406E' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 13px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease; }
.st-select:hover { border-color: var(--gold); }
.st-select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* Variante sólida (dorada) para el "Agregar" principal de Contenido. */
.st-select-solid { color: #fff; border-color: transparent; background-color: var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.st-select-solid:hover { border-color: transparent; background-color: var(--gold-deep); }
/* Opciones del desplegable. */
.st-select option { color: var(--ink); font-weight: 500; }
.st-select option[value=""] { color: var(--ink-50); }
.st-select option.st-opt-danger { color: var(--red); }
/* Tema oscuro: el <select> hereda --paper (ya oscuro); aclarar el chevron. */
html[data-theme="dark"] .st-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9d4e6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
html[data-theme="dark"] .st-select-solid { color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }

/* ===== Paneles desplegables del gestor del curso (details/summary) ===== */
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.mgr-sec { border-bottom: 1px solid var(--line); }
.mgr-sec:last-of-type { border-bottom: none; }
.mgr-sec-head { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 0; }
.mgr-sec-title { display: inline-flex; align-items: center; gap: 8px; }
.mgr-sec-title b { color: var(--navy); }
.mgr-sec-body { padding: 0 0 14px; }
/* Chevron que rota al abrir/cerrar el panel. */
.sec-caret { display: inline-flex; color: var(--ink-50); transition: transform 0.18s ease; }
.sec-caret svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
details[open] > summary .sec-caret { transform: rotate(90deg); }

/* Controles de reordenar módulos (subir/bajar) en el gestor del curso. Se usan
   los chevrons horizontales rotados para simular flechas verticales. */
.mod-reorder { display: inline-flex; gap: 2px; margin-right: 8px; vertical-align: middle; }
.icon-btn { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--line-medium); border-radius: 7px; background: var(--paper);
  color: var(--navy); cursor: pointer; transition: all 0.15s; }
.icon-btn:hover:not(:disabled) { background: var(--gold-pale); border-color: var(--gold); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[data-dir="up"] svg,
.icon-btn[data-dir="down"] svg { transform: rotate(90deg); }
.btn-danger-ghost { color: var(--red); }
.btn-danger-ghost:hover { background: rgba(184,56,56,0.08); border-color: rgba(184,56,56,0.4); }
.btn-danger-ghost svg { stroke: currentColor; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; cursor: pointer;
  transition: background 0.15s; border-left: 3px solid transparent; }
.lesson-row:hover { background: var(--ivory); }
.lesson-row.active { background: var(--gold-pale); border-left-color: var(--gold); }
.lesson-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-medium);
  display: grid; place-items: center; flex-shrink: 0; transition: all 0.2s; }
.lesson-check.done { background: var(--grad-gold); border-color: var(--gold-deep); }
.lesson-check.done svg { width: 11px; height: 11px; stroke: var(--navy-deepest); stroke-width: 3; fill: none; }
.lesson-info { flex: 1; min-width: 0; }
.lesson-info .lt { font-size: 14px; color: var(--ink); font-weight: 500; }
.lesson-info .lm { font-size: 11px; color: var(--ink-50); font-family: var(--font-mono); margin-top: 2px; }
.lesson-type-ico { width: 15px; height: 15px; stroke: var(--ink-50); stroke-width: 1.6; fill: none; flex-shrink: 0; }

/* ============ ASSIGNMENTS ============ */
.assign-list { display: flex; flex-direction: column; gap: 14px; }
.assign-card { background: var(--paper); border: 1px solid var(--line-medium); border-radius: var(--radius);
  padding: 20px 22px; display: flex; align-items: center; gap: 18px; transition: all 0.2s; }
.assign-card:hover { border-color: var(--navy); box-shadow: var(--shadow-soft); }
.assign-icon { width: 46px; height: 46px; border-radius: 10px; background: var(--sky); display: grid;
  place-items: center; flex-shrink: 0; }
.assign-icon svg { width: 22px; height: 22px; stroke: var(--navy); stroke-width: 1.6; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.assign-main { flex: 1; min-width: 0; }
.assign-title { font-family: var(--font-display); font-weight: 600; color: var(--navy-deepest); font-size: 15px; }
.assign-meta { font-size: 12px; color: var(--ink-50); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.assign-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.grade-chip { font-family: var(--font-mono); font-weight: 700; font-size: 15px; color: var(--green); }

/* ============ TUTOR ============ */
.tutor-shell { display: grid; grid-template-rows: 1fr auto; height: calc(100vh - 165px);
  background: var(--paper); border: 1px solid var(--line-medium); border-radius: var(--radius); overflow: hidden; }
.tutor-stream { overflow-y: auto; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; max-width: 78%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-ava { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; }
.msg.bot .msg-ava { background: var(--grad-gold-shimmer); color: #ffffff; border: 2px solid rgba(76,169,190,0.3); }
.msg.user .msg-ava { background: var(--grad-navy); color: var(--gold-bright); }
.msg-bubble { padding: 13px 16px; border-radius: 14px; font-size: 14.5px; line-height: 1.6; }
.msg.bot .msg-bubble { background: var(--ivory); border: 1px solid var(--line); border-top-left-radius: 3px; }
.msg.user .msg-bubble { background: var(--grad-navy); color: var(--paper); border-top-right-radius: 3px; }
.msg-bubble strong { color: inherit; }
.msg.bot .msg-bubble strong { color: var(--navy-deepest); }
.tutor-input { display: flex; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line);
  background: var(--paper-warm); }
.tutor-input input { flex: 1; padding: 12px 16px; border: 1px solid var(--line-medium); border-radius: 100px;
  font-size: 15px; font-family: var(--font-body); background: var(--paper); }
.tutor-input input:focus { outline: none; border-color: var(--navy-bright); box-shadow: 0 0 0 3px rgba(30,91,184,0.12); }
.tutor-suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.suggestion { padding: 8px 14px; border: 1px solid var(--line-medium); border-radius: 100px; font-size: 13.5px;
  cursor: pointer; background: var(--paper); transition: all 0.18s; color: var(--navy); }
.suggestion:hover { border-color: var(--gold); background: var(--gold-pale); }
.tutor-typing { display: flex; gap: 4px; padding: 4px 0; }
.tutor-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  animation: blink 1.2s infinite; }
.tutor-typing span:nth-child(2){ animation-delay: 0.2s; } .tutor-typing span:nth-child(3){ animation-delay: 0.4s; }
@keyframes blink { 0%,60%,100%{opacity:0.25;transform:translateY(0);} 30%{opacity:1;transform:translateY(-3px);} }

/* ============ MODAL ============ */
.modal-host { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(6,22,51,0.55); backdrop-filter: blur(4px); animation: fade 0.2s; padding: 20px; }
.modal { background: var(--paper); border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  box-shadow: var(--shadow-elevated); border: 1px solid var(--gold); max-height: 90vh; overflow-y: auto;
  animation: pop 0.25s ease; }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 22px 26px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; }
.modal-head h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--navy-deepest); }
.modal-x { cursor: pointer; color: var(--ink-50); font-size: 22px; line-height: 1; padding: 0 4px; }
.modal-x:hover { color: var(--red); }
.modal-body { padding: 24px 26px; }
.modal-foot { padding: 18px 26px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 12px; }

/* ============ MISC ============ */
.empty { text-align: center; padding: 50px 20px; color: var(--ink-50); }
.empty svg { width: 46px; height: 46px; stroke: var(--ink-30); stroke-width: 1.4; fill: none; margin-bottom: 14px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.toast-host { position: fixed; bottom: 26px; right: 26px; z-index: 300; display: flex; flex-direction: column;
  gap: 10px; }
.toast { background: var(--navy-deepest); color: var(--paper); padding: 13px 18px; border-radius: var(--radius-sm);
  font-size: 14px; box-shadow: var(--shadow-elevated); border-left: 3px solid var(--gold); min-width: 240px;
  animation: slidein 0.28s ease; display: flex; align-items: center; gap: 10px; }
.toast-error { border-left-color: var(--red); }
.toast-success { border-left-color: var(--green); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.chart-bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%;
  justify-content: flex-end; }
.chart-fill { width: 100%; background: var(--grad-navy); border-radius: 6px 6px 0 0; position: relative;
  min-height: 6px; transition: height 0.6s ease; }
.chart-fill.gold { background: var(--grad-gold); }
.chart-val { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--navy-deepest); }
.chart-lbl { font-size: 11px; color: var(--ink-50); text-transform: uppercase; letter-spacing: 0.05em; }

.split-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint { font-size: 12px; color: var(--ink-50); margin-top: 6px; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .player-layout, .grid-2, .grid-3, .split-form, .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

/* ============================================================
   Helpers adicionales (íconos, estrellas, cargas, estados)
   ============================================================ */
.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.nav-item .icon { opacity: 0.9; }

.stars { display: inline-flex; gap: 1px; font-size: 14px; letter-spacing: 1px; }
.stars .star { color: var(--line-medium); }
.stars .star.on { color: var(--gold); }

.loading { display: flex; align-items: center; gap: 12px; padding: 40px; color: var(--ink-50);
  font-size: 15px; justify-content: center; }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--line-medium);
  border-top-color: var(--gold); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { padding: 44px 24px; text-align: center; color: var(--ink-50); font-size: 15px;
  background: var(--paper); border: 1px dashed var(--line-medium); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-ico { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%;
  background: var(--grad-royal, linear-gradient(150deg, rgba(108,93,211,0.16), rgba(47,169,184,0.16)));
  color: var(--navy-bright, #2f6fd6); box-shadow: inset 0 0 0 1px var(--line);
  animation: emptyPulse 3.2s ease-in-out infinite; }
.empty-ico .icon { width: 30px; height: 30px; }
.empty-text { max-width: 340px; line-height: 1.5; }
.empty-action { margin-top: 4px; text-decoration: none; }
@keyframes emptyPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* --- Esqueletos de carga con brillo (shimmer) --- */
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.sk-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.sk-line { position: relative; overflow: hidden; border-radius: 8px;
  background: var(--ivory, #eef1f6); }
.sk-line::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  transform: translateX(-100%); animation: skShimmer 1.3s ease-in-out infinite; }
.sk-cover { height: 118px; border-radius: 10px; }
.sk-title { height: 16px; width: 72%; }
.sk-text  { height: 12px; width: 90%; }
.sk-bar   { height: 10px; width: 100%; border-radius: 999px; }
@keyframes skShimmer { 100% { transform: translateX(100%); } }
html[data-theme="dark"] .sk-line::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent); }

/* --- Celebración de logros: confeti + insignia --- */
.celebrate-host { position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center;
  background: rgba(15,26,45,0.42); backdrop-filter: blur(2px);
  animation: fadeIn 0.25s ease both; }
.celebrate-host.closing { animation: fadeOut 0.3s ease both; }
.confetti-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti { position: absolute; top: -16px; display: block;
  animation-name: confettiFall; animation-timing-function: cubic-bezier(0.4,0.1,0.6,1);
  animation-iteration-count: 1; animation-fill-mode: forwards; }
@keyframes confettiFall {
  0%   { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.9; }
}
.celebrate-card { position: relative; background: var(--paper); border-radius: var(--radius-lg, 18px);
  padding: 30px 34px; text-align: center; max-width: 360px; width: calc(100% - 48px);
  box-shadow: var(--shadow-elevated, 0 24px 60px rgba(15,26,45,0.35));
  border: 1px solid var(--line); animation: celebratePop 0.5s cubic-bezier(0.22,1.4,0.5,1) both; }
.celebrate-badge { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: var(--grad-gold, linear-gradient(150deg, #E8B44A, #d69a2b));
  box-shadow: 0 10px 26px rgba(232,180,74,0.5);
  animation: badgeSpin 0.7s cubic-bezier(0.22,1,0.36,1) both; }
.celebrate-badge .icon { width: 42px; height: 42px; }
.celebrate-card h3 { margin: 0 0 6px; font-family: var(--font-title, 'Poppins', sans-serif);
  color: var(--ink); font-size: 20px; }
.celebrate-card p { margin: 0 0 16px; color: var(--ink-70); font-size: 15px; line-height: 1.5; }
@keyframes celebratePop {
  0% { opacity: 0; transform: scale(0.86) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes badgeSpin {
  0% { transform: rotate(-30deg) scale(0.4); opacity: 0; }
  100% { transform: rotate(0) scale(1); opacity: 1; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }

.modal-wide { max-width: 760px; }

/* Modal maximizado: la evaluación ocupa casi toda la pantalla (estilo Moodle),
   con la lista de preguntas a lo ancho y su propio desplazamiento interno, en
   lugar de quedar confinada en un cuadro pequeño. */
.modal-full { max-width: min(1180px, 96vw); width: 100%;
  height: 94vh; max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-full .modal-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.modal-full .modal-head { flex: none; }
.modal-full .quiz-attempt { grid-template-columns: 1fr 260px; }
/* Estudio del curso: página independiente con barra lateral. En vez de amontonar
   todo en un modal, el profesor elige una sección (General, Información,
   Contenido, Alumnos) y sólo esa se muestra, con mucho más aire. */
.studio { display: flex; gap: 22px; align-items: flex-start; }
.studio-nav { flex: 0 0 252px; position: sticky; top: 84px; display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line-medium); border-radius: var(--radius); padding: 16px; }
.studio-back { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0;
  color: var(--navy); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px 2px; margin-bottom: 6px; }
.studio-back:hover { color: var(--gold); }
.studio-course { padding: 4px 2px 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.studio-course-title { font-weight: 700; color: var(--ink); font-size: 15px; line-height: 1.3; }
.studio-course-meta { font-size: 12px; color: var(--ink-70); margin-top: 7px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.studio-links { display: flex; flex-direction: column; gap: 4px; }
.studio-link { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 12px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--navy); font-weight: 600; font-size: 14.5px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.studio-link svg { flex: none; opacity: 0.85; }
.studio-link:hover { background: var(--sky); }
.studio-link.active { background: var(--navy); color: var(--paper); }
.studio-link.active svg { opacity: 1; }
.studio-nav-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.studio-preview { width: 100%; justify-content: center; }
.studio-panel { flex: 1 1 auto; min-width: 0; background: var(--paper);
  border: 1px solid var(--line-medium); border-radius: var(--radius); padding: 24px 26px; }
.studio-sec { display: none; }
.studio-sec.active { display: block; }
.studio-h { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0; }
/* Separa la caja de módulos del botón "Agregar" para que no queden pegados. */
#mgr-modules { margin-top: 16px; }
.studio-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.studio-tools .btn { justify-content: flex-start; padding: 15px 18px; font-size: 15px; }
/* Dentro del estudio la columna es más angosta que el modal antiguo: las filas
   de lección conservan el título legible y sus botones bajan a otra línea en vez
   de exprimir el texto en una tira vertical. */
.studio-panel .lesson-row { flex-wrap: wrap; }
.studio-panel .lesson-info { flex: 1 1 240px; min-width: 200px; }
@media (max-width: 860px) {
  .studio { flex-direction: column; }
  .studio-nav { flex: none; width: 100%; position: static; }
  .studio-links { flex-direction: row; flex-wrap: wrap; }
  .studio-link { width: auto; }
}
@media (max-width: 900px) {
  .modal-full { width: 100%; height: 94vh; }
  .modal-full .quiz-attempt { grid-template-columns: 1fr; }
}
/* La evaluación se abre en su propia pestaña y ocupa toda la pantalla. */
.modal-full.maximized { max-width: 100vw; width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }

/* ============================================================
   Detalle de tarea estilo Moodle (pantalla completa)
   ============================================================ */
.asg-page { display: flex; flex-direction: column; gap: 20px; max-width: 1040px; }
.asg-block { display: block; }
.asg-course { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600;
  color: var(--ink-70); }
.asg-course .icon { color: var(--gold); }

/* Miga de pan (breadcrumb) */
.asg-crumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-50); flex-wrap: wrap; }
.asg-crumb a { display: inline-flex; align-items: center; gap: 5px; color: var(--gold-deep);
  text-decoration: none; }
.asg-crumb a:hover { text-decoration: underline; }
.asg-crumb a .icon { color: var(--gold); }
.asg-crumb-sep { display: inline-flex; color: var(--ink-30); }
.asg-crumb-cur { color: var(--navy-deepest); }

/* Encabezado hero: icono + título grande */
.asg-hero { display: flex; align-items: center; gap: 16px; padding: 20px 22px;
  background: var(--grad-gold); border: 1px solid var(--gold-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-gold); }
.asg-hero-icon { flex: 0 0 auto; width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: 16px; background: rgba(255,255,255,0.85); color: var(--gold-deep); }
.asg-hero-body { min-width: 0; }
.asg-hero-title { font-family: var(--font-display); font-size: 24px; font-weight: 800;
  color: #fff; line-height: 1.15; margin: 0 0 4px; }
.asg-hero .asg-course { color: rgba(255,255,255,0.92); }
.asg-hero .asg-course .icon { color: rgba(255,255,255,0.92); }

/* Fila de fechas Abrió / Cierre */
.asg-dates { display: flex; flex-wrap: wrap; gap: 12px; }
.asg-date { flex: 1 1 200px; display: flex; flex-direction: column; gap: 3px; padding: 12px 16px;
  background: var(--paper-warm); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.asg-date-k { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-50); }
.asg-date-k .icon { color: var(--gold); }
.asg-date-v { font-size: 15px; font-weight: 600; color: var(--navy-deepest); }

/* Caja de descripción (gris) */
.asg-desc-box { background: var(--paper-warm); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; }

/* Filas de estado resaltadas: positivas (verde) / negativas (rojo) */
.asg-status tr.pos > th, .asg-status tr.pos > td { background: rgba(45, 122, 79, 0.10); }
.asg-status tr.pos > td { color: var(--green); font-weight: 600; }
.asg-status tr.neg > th, .asg-status tr.neg > td { background: rgba(184, 56, 56, 0.09); }
.asg-status tr.neg > td { color: var(--red); font-weight: 600; }

/* Pie con acciones */
.asg-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.asg-h { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--navy-deepest);
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--line); }
.asg-h .icon { color: var(--gold); }
.asg-status { width: 100%; border-collapse: collapse; border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden; }
.asg-status th, .asg-status td { text-align: left; padding: 11px 14px; font-size: 14px;
  vertical-align: top; border-bottom: 1px solid var(--line); }
.asg-status tr:last-child th, .asg-status tr:last-child td { border-bottom: 0; }
.asg-status th { width: 210px; background: var(--paper-warm); color: var(--ink-70); font-weight: 600; }
.asg-status td { color: var(--navy-deepest); }
.asg-inline-text { white-space: pre-wrap; background: var(--paper-warm); padding: 10px 12px;
  border-radius: 8px; border: 1px solid var(--line); max-height: 220px; overflow: auto; line-height: 1.5; }
.asg-desc { line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.asg-grade { background: var(--gold-pale); border: 1px solid var(--gold-light); border-radius: var(--radius);
  padding: 16px 18px; }
.asg-grade .asg-h { border-bottom-color: rgba(108, 93, 211, 0.22); }
.asg-grade-score { font-family: var(--font-display); font-size: 30px; font-weight: 800;
  color: var(--navy-deepest); line-height: 1; }
.asg-grade-max { font-size: 16px; color: var(--ink-50); font-weight: 600; }
.asg-feedback { margin-top: 8px; line-height: 1.55; white-space: pre-wrap; color: var(--ink); }
.asg-late { color: var(--red); font-weight: 700; }
.asg-soon { color: var(--gold-deep); font-weight: 700; }
.asg-ok { color: var(--green); font-weight: 700; }
.asg-page .modal-foot { margin-top: 4px; padding: 16px 0 0; }

/* En pantallas pequeñas: el modal llega borde a borde y la tabla de estado
   se apila (etiqueta arriba, valor abajo) para una lectura cómoda. */
@media (max-width: 640px) {
  .modal-host { padding: 0; }
  .modal-full { height: 100vh; max-height: 100vh; border-radius: 0; border-left: 0; border-right: 0; }
  .asg-hero { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 18px; }
  .asg-hero-title { font-size: 20px; }
  .asg-dates { flex-direction: column; }
  .asg-status, .asg-status tbody, .asg-status tr, .asg-status th, .asg-status td { display: block; width: 100%; }
  .asg-status tr { border-bottom: 1px solid var(--line); padding: 4px 0; }
  .asg-status tr:last-child { border-bottom: 0; }
  .asg-status th { background: transparent; border-bottom: 0; padding: 6px 14px 0; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-50); }
  .asg-status td { border-bottom: 0; padding: 2px 14px 8px; }
}

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap; }
.section-head h1 { font-family: var(--font-display); font-size: 24px; font-weight: 800;
  color: var(--navy-deepest); letter-spacing: -0.01em; }
.section-head p { color: var(--ink-50); font-size: 14.5px; margin-top: 2px; }
.section-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.filters { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; padding: 7px 15px; border: 1px solid var(--line-medium);
  border-radius: 100px; font-size: 13.5px; font-weight: 600; color: var(--ink-70); background: var(--paper);
  cursor: pointer; transition: all 0.15s; }
.filter-chip:hover { border-color: var(--gold); color: var(--navy); }
.filter-chip.active { background: var(--grad-gold); color: #ffffff; border-color: transparent;
  box-shadow: 0 4px 12px -4px rgba(108,93,211,0.45); }
.chip-dot { width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; flex: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) inset; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.meta-row { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--ink-50);
  flex-wrap: wrap; }
.meta-row .icon { vertical-align: -2px; }

.pill-inline { display: inline-flex; align-items: center; gap: 6px; }
.muted { color: var(--ink-50); }
.right { text-align: right; }
.mono { font-family: var(--font-mono); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tag-inline { font-family: var(--font-body); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--gold-deep); background: var(--gold-pale); padding: 3px 8px; border-radius: 5px; }

/* ============================================================
   Etapa 1 · Evaluaciones, constancias y reportes (Anexo C.5)
   ============================================================ */

/* ---- Lista de evaluaciones ---- */
.quiz-list { display: flex; flex-direction: column; gap: 10px; }
.quiz-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: all 0.15s; }
.quiz-item:hover { border-color: var(--gold); box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.quiz-item-ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius-sm); background: var(--sky); color: var(--navy); }
.quiz-item-main { flex: 1; min-width: 0; }
.quiz-item-title { font-weight: 600; color: var(--navy-deepest); }
.quiz-item-meta { font-size: 12px; color: var(--ink-50); margin-top: 3px; }
.quiz-item-right { flex: none; }

/* ---- Presentación del cuestionario ---- */
.quiz-meta-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.quiz-meta-bar .pill-inline { font-size: 11px; font-weight: 600; color: var(--navy);
  background: var(--sky); padding: 5px 10px; border-radius: 20px; }
.quiz-locked { background: var(--gold-pale); border: 1px solid var(--gold-light);
  color: var(--gold-deep); padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 14px; }
.quiz-q { padding: 16px 0; border-top: 1px solid var(--line); }
.quiz-q:first-child { border-top: none; }
.quiz-q-head { display: flex; align-items: flex-start; gap: 10px; }
.quiz-q-num { flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: var(--grad-navy); color: var(--paper);
  font-size: 12px; font-weight: 700; }
.quiz-q-text { flex: 1; font-weight: 600; color: var(--navy-deepest); line-height: 1.4; }
.quiz-q-pts { flex: none; font-size: 11px; color: var(--gold-deep); background: var(--gold-pale);
  padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.quiz-q-hint { font-size: 12px; color: var(--ink-50); margin: 6px 0 0 34px; font-style: italic; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0 34px; }
.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.12s; }
.quiz-opt:hover { border-color: var(--navy-light); background: var(--sky); }
.quiz-opt input { accent-color: var(--navy); width: 16px; height: 16px; flex: none; }
.quiz-opt input:checked + span { font-weight: 600; color: var(--navy); }
/* Letra a), b), c)… delante del texto de cada opción (vista del alumno). */
.quiz-opt-letter { color: var(--navy); margin-right: 2px; }

/* ---- Vista previa del instructor: revelado de respuestas correctas ---- */
.quiz-preview-note { background: var(--sky); color: var(--navy); padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px; }
.quiz-opt.is-correct { border-color: var(--green); background: rgba(45,122,79,0.08); }
.quiz-opt.is-correct span { color: var(--green); font-weight: 600; }
.quiz-opt.is-wrong { border-color: var(--red); background: rgba(184,56,56,0.07); }
.quiz-opt.is-wrong span { color: var(--red); }
.quiz-preview-verdict { margin: 8px 0 0 34px; font-size: 13.5px; font-weight: 600; }
.quiz-preview-verdict.ok { color: var(--green); }
.quiz-preview-verdict.bad { color: var(--red); }
.asg-preview-body { margin-top: 6px; font-size: 15px; line-height: 1.6; color: var(--ink-90); }
.asg-preview-body p { margin: 0 0 8px; }

/* ---- Resultado y revisión ---- */
.quiz-result { text-align: center; padding: 24px; border-radius: var(--radius-lg);
  margin-bottom: 18px; color: var(--paper); }
.quiz-result.pass { background: linear-gradient(135deg, #1f6b45 0%, #2D7A4F 100%); }
.quiz-result.fail { background: linear-gradient(135deg, #8a2b2b 0%, #B83838 100%); }
.quiz-result-score { font-size: 52px; font-weight: 800; line-height: 1; font-family: var(--font-display); }
.quiz-result-label { font-size: 15px; margin-top: 8px; opacity: 0.95; }
.quiz-review-list { display: flex; flex-direction: column; gap: 10px; }
.quiz-review { border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  padding: 12px 14px; border-left-width: 4px; }
.quiz-review.ok { border-left-color: var(--green); }
.quiz-review.bad { border-left-color: var(--red); }
.quiz-review-head { display: flex; align-items: flex-start; gap: 10px; }
.quiz-review-badge { flex: none; font-size: 11px; font-weight: 700; margin-left: auto; }
.quiz-review.ok .quiz-review-badge { color: var(--green); }
.quiz-review.bad .quiz-review-badge { color: var(--red); }
.quiz-review-body { margin: 8px 0 0 34px; font-size: 14px; color: var(--ink-70);
  display: flex; flex-direction: column; gap: 4px; }
.quiz-feedback { background: var(--sky); color: var(--navy); padding: 8px 10px;
  border-radius: var(--radius-sm); margin-top: 4px; font-size: 13.5px; }
.quiz-feedback .icon { vertical-align: -2px; }

/* ---- Vista de intento estilo Moodle (alumno) ---- */
.quiz-attempt { display: grid; grid-template-columns: 1fr 232px; gap: 18px; align-items: start; }
/* Tarjeta de pregunta a dos columnas (sobrescribe la presentación básica). */
.quiz-attempt .quiz-q { display: grid; grid-template-columns: 158px 1fr; gap: 0;
  padding: 0; border-top: none; border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; background: var(--paper); }
.quiz-attempt .quiz-q:first-child { border-top: 1px solid var(--line-medium); }
.quiz-q-side { background: var(--sky); border-right: 1px solid var(--line-medium);
  padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.quiz-q-sidenum { font-weight: 700; color: var(--navy-deepest); font-size: 14px; }
.quiz-q-status { font-size: 12px; color: var(--ink-50); }
.quiz-q-status.is-answered { color: var(--green); font-weight: 600; }
.quiz-q-pts2 { font-size: 11.5px; color: var(--ink-50); }
.quiz-flag { margin-top: auto; display: inline-flex; align-items: flex-start; gap: 6px;
  background: none; border: none; padding: 6px 0 0; cursor: pointer; text-align: left;
  color: var(--navy); font-size: 12px; font-weight: 600; }
.quiz-flag:hover { text-decoration: underline; }
.quiz-flag-glyph { color: var(--ink-30); flex: none; }
.quiz-flag.on .quiz-flag-glyph { color: var(--red); }
.quiz-q-main { padding: 14px 16px; min-width: 0; }
.quiz-q-main .quiz-opts { margin: 10px 0 0; }
.quiz-q-main .quiz-q-hint { margin: 6px 0 0; }
.quiz-clear { display: inline-block; margin-top: 12px; font-size: 13.5px; color: var(--navy);
  text-decoration: underline; cursor: pointer; }
.quiz-clear:hover { color: var(--gold-deep); }

/* Panel de navegación */
.quiz-nav { position: sticky; top: 8px; background: var(--grad-navy); color: var(--paper);
  border-radius: var(--radius-sm); padding: 14px; }
.quiz-nav-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.quiz-nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.quiz-nav-cell { width: 100%; aspect-ratio: 1; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.28); border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06); color: var(--paper); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.12s; position: relative; }
.quiz-nav-cell:hover { background: rgba(255,255,255,0.18); }
.quiz-nav-cell.answered { background: var(--green); border-color: var(--green); }
.quiz-nav-cell.flagged::after { content: '⚑'; position: absolute; top: -4px; right: -2px;
  font-size: 11px; color: var(--gold); }
.quiz-nav-legend { display: flex; flex-direction: column; gap: 5px; margin-top: 12px;
  font-size: 11px; color: rgba(255,255,255,0.85); }
.quiz-nav-legend-item { display: flex; align-items: center; gap: 7px; }
.quiz-nav-swatch { width: 13px; height: 13px; border-radius: 3px; flex: none;
  border: 1px solid rgba(255,255,255,0.28); background: rgba(255,255,255,0.06); }
.quiz-nav-swatch.answered { background: var(--green); border-color: var(--green); }
.quiz-nav-swatch.flagged { background: var(--gold); border-color: var(--gold); }

/* Resumen "Terminar intento…" */
.quiz-summary { grid-column: 1 / -1; }
.quiz-summary-title { font-size: 18px; font-weight: 700; color: var(--navy-deepest);
  font-family: var(--font-display); margin-bottom: 8px; }
.quiz-summary-counts { font-size: 14px; color: var(--ink-70); margin-bottom: 14px; }
.quiz-summary-counts.warn { color: var(--gold-deep); font-weight: 600; }
.quiz-summary-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.quiz-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; padding: 10px 14px; border: 1px solid var(--line-medium);
  border-left-width: 4px; border-left-color: var(--ink-30); border-radius: var(--radius-sm);
  background: var(--paper); cursor: pointer; transition: background 0.12s; }
.quiz-summary-row:hover { background: var(--sky); }
.quiz-summary-row.ok { border-left-color: var(--green); }
.quiz-summary-row-num { font-weight: 600; color: var(--navy-deepest); font-size: 14px; }
.quiz-summary-row-state { font-size: 13.5px; color: var(--ink-50); }
.quiz-summary-row.ok .quiz-summary-row-state { color: var(--green); }
.quiz-summary-foot { display: flex; justify-content: flex-end; gap: 10px; }
/* Al entrar al resumen se oculta el intento (no se destruye). */
.modal.quiz-in-summary #quiz-body,
.modal.quiz-in-summary #quiz-nav,
.modal.quiz-in-summary #quiz-finish { display: none; }

@media (max-width: 720px) {
  .quiz-attempt { grid-template-columns: 1fr; }
  .quiz-attempt .quiz-q { grid-template-columns: 1fr; }
  .quiz-q-side { border-right: none; border-bottom: 1px solid var(--line-medium);
    flex-direction: row; flex-wrap: wrap; align-items: center; }
  .quiz-flag { margin: 0 0 0 auto; padding: 0; }
  .quiz-nav { position: static; order: -1; }
}

/* ---- Constancias ---- */
.cert-list { display: flex; flex-direction: column; gap: 10px; }
.cert-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.cert-row-ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius-sm); background: var(--gold-pale); color: var(--gold-deep); }
.cert-row-main { flex: 1; min-width: 0; }
.cert-row-title { font-weight: 600; color: var(--navy-deepest); }
.cert-row-meta { font-size: 12px; color: var(--ink-50); margin-top: 3px; }
.cert-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cert-pill-wait { color: #8a6d1a; background: rgba(212,175,55,0.14);
  border: 1px solid rgba(212,175,55,0.35); }
.cert-pill-wait svg { stroke: #8a6d1a; }

.cert-preview { display: flex; justify-content: center; padding: 8px 0 18px; }
.cert-face { width: 100%; max-width: 720px; background: var(--ivory);
  border: 2px solid var(--gold); border-radius: var(--radius);
  box-shadow: var(--shadow-elevated); padding: 8px; }
.cert-face-inner { border: 1px solid var(--gold-light); border-radius: var(--radius-sm);
  padding: 34px 40px; text-align: center; background:
    radial-gradient(circle at 50% 0%, rgba(76,169,190,0.06), transparent 60%); }
.cert-logo { display: block; max-height: 56px; max-width: 190px; object-fit: contain;
  margin: 0 auto 10px; }
.cert-brand { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.28em;
  font-size: 22px; color: var(--navy-deep); }
.cert-kicker { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 11px; color: var(--gold-deep); margin-top: 6px; }
.cert-recipient-label { margin-top: 24px; font-size: 14px; color: var(--ink-50); }
.cert-recipient { font-family: var(--font-display); font-size: 32px; font-weight: 700;
  color: var(--navy-deepest); margin: 6px 0; border-bottom: 2px solid var(--gold-light);
  display: inline-block; padding: 0 20px 6px; }
.cert-body-text { margin-top: 16px; font-size: 14px; color: var(--ink-70); }
.cert-course { font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--navy); margin-top: 6px; }
.cert-subtitle { font-size: 14px; color: var(--ink-50); margin-top: 2px; }
.cert-hours { font-size: 14px; color: var(--ink-70); margin-top: 10px; }
.cert-signatures { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-top: 34px; }
.cert-sign { flex: 1; }
.cert-sign-line { border-top: 1.5px solid var(--navy-deep); padding-top: 6px;
  font-weight: 600; color: var(--navy-deepest); font-size: 15px; }
.cert-sign-role { font-size: 11px; color: var(--ink-50); margin-top: 2px; }
.cert-seal { flex: none; width: 72px; height: 72px; display: grid; place-items: center;
  border-radius: 50%; background: var(--grad-gold); color: #ffffff;
  box-shadow: var(--shadow-gold); }
.cert-folio { margin-top: 22px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.05em; color: var(--ink-50); }
.cert-org { font-size: 12px; color: var(--ink-70); margin-top: 4px; }

/* ---- Reportes de finalización ---- */
.report-course-list { display: flex; flex-direction: column; gap: 8px; }
.report-course { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; }
.report-course:hover { border-color: var(--gold); }
.report-course.active { border-color: var(--navy); background: var(--sky); }
.report-course-ico { flex: none; color: var(--navy); }
.report-course-info { flex: 1; min-width: 0; }
.report-course-title { font-weight: 600; color: var(--navy-deepest); display: block; }
.report-course-meta { font-size: 12px; color: var(--ink-50); }
.report-course-arrow { flex: none; color: var(--gold-deep); font-weight: 700; }
.cell-avatar { flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: var(--grad-navy); color: var(--paper);
  font-size: 11px; font-weight: 700; }

/* ============================================================
   Etapa 2 · Subida de videos y entrega de archivos
   ============================================================ */

/* ---- Video de la lección en el reproductor ---- */
.lesson-video { width: 100%; height: 100%; display: block; border-radius: var(--radius);
  background: #000; object-fit: contain; position: relative; z-index: 1; }
/* Oculta el degradado decorativo cuando hay un video real para no tapar los controles. */
.player-video:has(.lesson-video)::after { display: none; }
.player-hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center;
  font-size: 13.5px; color: var(--paper); opacity: 0.85; z-index: 1; }

/* ---- Clase en vivo · escenario 16:9 tipo YouTube ---- */
.live-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius);
  overflow: hidden; background: var(--grad-navy); box-shadow: var(--shadow-elevated);
  display: grid; place-items: center; }
.live-stage.is-embed { background: #000; }
.live-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.live-expand { position: absolute; top: 12px; right: 12px; z-index: 3; display: grid;
  place-items: center; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  background: rgba(14,27,51,0.72); color: #fff; border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(4px); transition: background 0.15s; }
.live-expand:hover { background: rgba(14,27,51,0.94); }
.live-expand svg { fill: currentColor; }
.live-stage:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; }
.live-stage:-webkit-full-screen { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; }

/* Portada "Sesión virtual" (marca Nasatya sobre fondo oscuro). */
.live-cover { position: relative; z-index: 1; text-align: center; padding: 30px 24px;
  display: grid; gap: 12px; place-items: center; max-width: 580px; }
.live-cover-logo { max-height: 46px; max-width: 200px; object-fit: contain; margin-bottom: 2px; }
.live-cover-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper);
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.28);
  padding: 5px 13px; border-radius: 100px; }
.live-cover-badge svg { width: 13px; height: 13px; fill: currentColor; }
.live-cover-badge.is-live { background: rgba(76,169,190,0.30); border-color: rgba(76,169,190,0.65);
  animation: livePulse 2.2s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.62; } }
.live-cover-title { font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--paper); line-height: 1.25; }
.live-cover-when { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px;
  color: var(--paper); opacity: 0.9; }
.live-cover-when svg { width: 13px; height: 13px; fill: currentColor; }
.live-cover-desc { font-size: 14.5px; color: var(--paper); opacity: 0.82; line-height: 1.5;
  max-width: 480px; }
.live-cover-join { margin-top: 6px; text-decoration: none; }
.live-cover-note { font-size: 12px; color: var(--paper); opacity: 0.72; }

/* Transmisión nativa (WebRTC): el <video> ocupa la caja y la portada se
   superpone; `mountLiveBroadcast` la oculta cuando hay señal. */
.live-stage.is-native { background: var(--grad-navy); }
.live-native { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  background: #000; z-index: 0; }
.live-native-cover { position: absolute; inset: 0; z-index: 2; align-content: center;
  max-width: none; background: var(--grad-navy); }
.live-ctrls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.live-ctrls:empty { display: none; }
.live-live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--teal);
  background: rgba(76,169,190,0.16); border: 1px solid rgba(76,169,190,0.5);
  padding: 5px 12px; border-radius: 100px; }
.live-live-pill svg { width: 13px; height: 13px; fill: currentColor;
  animation: livePulse 2.2s ease-in-out infinite; }

/* ---- Clase en vivo · sala de participación ---- */
.live-room { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); padding: 16px 18px; }
.live-room-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display);
  font-weight: 700; color: var(--navy-deepest); font-size: 15px; }
.live-room-head svg { fill: var(--navy); }
.live-room-count { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px;
  font-weight: 600; color: var(--ink-50); letter-spacing: 0.02em; }
.live-room-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.live-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.live-col-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-50); }
.live-col-title svg { fill: var(--gold-deep); }
.live-hand-btn, .live-checkin-btn { width: 100%; }
.live-hands { display: flex; flex-direction: column; gap: 6px; }
.live-hand-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--sky); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.live-hand-name { font-size: 14px; font-weight: 600; color: var(--navy-deepest); }
.live-av { flex: none; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.live-av-ph { display: grid; place-items: center; background: var(--grad-navy); color: #fff;
  font-size: 11px; font-weight: 700; }
.live-tag { margin-left: auto; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--gold-deep); background: var(--gold-light);
  padding: 2px 7px; border-radius: 100px; }
.live-empty { font-size: 13.5px; margin: 4px 0; }
.live-roster { display: flex; flex-direction: column; gap: 3px; max-height: 280px; overflow-y: auto; }
.live-roster-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: var(--radius-sm); }
.live-roster-row:hover { background: var(--sky); }
.live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line-medium); }
.live-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(45,122,79,0.18); }
.live-roster-name { flex: 1; min-width: 0; font-size: 14px; color: var(--navy-deepest);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: inline-flex; align-items: center; gap: 4px; }
.live-roster-name svg { flex: none; fill: var(--gold-deep); }
.live-roster-actions { flex: none; display: flex; gap: 4px; }
.live-att-btn { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 100px;
  border: 1px solid var(--line-medium); background: var(--paper); color: var(--ink-70);
  cursor: pointer; transition: all 0.13s; }
.live-att-btn:hover { border-color: var(--navy); }
.live-att-btn.is-on { background: var(--green); border-color: var(--green); color: #fff; }
.live-att-btn.is-off { background: var(--red); border-color: var(--red); color: #fff; }
.live-notes { width: 100%; min-height: 116px; resize: vertical; padding: 10px 12px;
  border: 1px solid var(--line-medium); border-radius: var(--radius-sm); font: inherit;
  font-size: 14px; color: var(--navy-deepest); background: var(--paper); }
.live-notes:focus { outline: none; border-color: var(--gold); }
.live-notes-hint { font-size: 11px; margin-top: -2px; }
@media (max-width: 720px) { .live-room-grid { grid-template-columns: 1fr; } }

/* ---- Barra de progreso de subida ---- */
.upload-progress { margin-top: 12px; }
.upload-bar { height: 10px; background: var(--line); border-radius: 100px; overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0%; border-radius: 100px;
  background: var(--grad-gold); transition: width 0.2s ease; }
.upload-label { font-size: 12px; color: var(--ink-70); margin-top: 6px; font-family: var(--font-mono); }

/* ---- Indicador de lección con video ---- */
.video-tag { font-size: 10.5px; font-weight: 700; color: var(--green);
  letter-spacing: 0.02em; }

/* ---- Chip de archivo adjunto (entrega) ---- */
.file-chip { display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--sky); border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  margin: 8px 0; font-size: 14px; }
.file-chip .file-ico { flex: none; color: var(--navy); display: grid; place-items: center; }
.file-chip a { color: var(--navy); font-weight: 600; text-decoration: none; word-break: break-all; }
.file-chip a:hover { text-decoration: underline; }

/* Previsualización incrustada de entregas (sin descargar) */
.sub-preview-wrap { margin: 10px 0 4px; }
.sub-preview { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line-medium);
  background: var(--paper); display: block; }
.sub-preview-doc { height: 520px; }
.sub-preview-img { max-height: 520px; object-fit: contain; height: auto; }
.sub-preview-video { max-height: 480px; background: #000; }
.sub-preview-audio { width: 100%; margin: 10px 0 4px; display: block; }

/* Los inputs de archivo heredan el estilo de campo del formulario */
.field input[type="file"] { font-size: 14px; padding: 8px; border: 1px dashed var(--line-medium);
  border-radius: var(--radius-sm); background: var(--paper); cursor: pointer; width: 100%; }

@media print {
  .sidebar, .topbar, .modal-foot, .section-actions { display: none !important; }
  .cert-face { box-shadow: none; border-color: var(--gold-deep); }
}

/* ============================================================
   TEMA OSCURO PREMIUM  ·  activo solo con html[data-theme="dark"]
   Fondo azul noche profundo + acentos dorados con brillo.
   El color de marca del cliente (--gold-*) se respeta siempre.
   El tema claro es el :root base del inicio del archivo.
   ============================================================ */
html[data-theme="dark"] {
  /* Superficies -> gris Oxford oscuro (carbón slate frío) */
  --paper:        #2a2f37;
  --paper-warm:   #232830;
  --ivory:        #343b45;
  --sky:          #343b45;

  /* Texto -> claro */
  --ink:      #e9eefb;
  --ink-70:   rgba(233, 238, 251, 0.74);
  --ink-50:   rgba(233, 238, 251, 0.55);
  --ink-30:   rgba(233, 238, 251, 0.36);

  /* Líneas -> claras y sutiles */
  --line:         rgba(255, 255, 255, 0.09);
  --line-medium:  rgba(255, 255, 255, 0.16);

  /* Acento/enlace más luminoso (periwinkle morado-teal) para leerse sobre lo oscuro */
  --navy: #8FA6E8;

  /* Antes casi negro; ahora claro para que TODO el texto que lo usa
     (títulos, foros, mensajería, matrículas…) se lea sobre el fondo oscuro.
     Los pocos usos como FONDO o sobre oro se re-parchean más abajo. */
  --navy-deepest: #e9eefb;

  /* Sombras -> más profundas para dar sensación premium */
  --shadow-soft:     0 4px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-elevated: 0 16px 40px -18px rgba(0, 0, 0, 0.7);
  --shadow-gold:     0 8px 28px -10px rgba(76, 169, 190, 0.5);
}

/* Fondo general: degradado azul noche fijo con un halo dorado tenue */
html[data-theme="dark"] body {
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(120, 140, 170, 0.05), transparent 60%),
    radial-gradient(1000px 800px at -10% 110%, rgba(90, 110, 140, 0.06), transparent 55%),
    linear-gradient(160deg, #2b313b 0%, #1c2027 100%);
  background-attachment: fixed;
  color: var(--ink);
}

/* Barra superior translúcida sobre el fondo oscuro */
html[data-theme="dark"] .topbar { background: rgba(32, 36, 43, 0.55); backdrop-filter: blur(8px); }

/* Placeholders legibles */
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--ink-30); }

/* --- Textos claros que van sobre fondos oscuros (se mantienen claros) --- */
html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .user-name,
html[data-theme="dark"] .msg.user .msg-bubble,
html[data-theme="dark"] .filter-chip.active,
html[data-theme="dark"] .quiz-q-num,
html[data-theme="dark"] .quiz-result,
html[data-theme="dark"] .cell-avatar,
html[data-theme="dark"] .player-hint,
html[data-theme="dark"] .live-title,
html[data-theme="dark"] .live-when,
html[data-theme="dark"] .live-hint {
  color: #f4f7fd !important;
}

/* --- Excepciones al remap: texto/íconos oscuros SOBRE oro o superficies
   claras que se mantienen claras en ambos temas -> deben seguir oscuros --- */
html[data-theme="dark"] .btn-gold,
html[data-theme="dark"] .brand-emblem,
html[data-theme="dark"] .nav-badge,
html[data-theme="dark"] .avatar,
html[data-theme="dark"] .cover-tag,
html[data-theme="dark"] .cover-status,
html[data-theme="dark"] .msg.bot .msg-ava {
  color: #14233F;
}
html[data-theme="dark"] .lesson-check.done svg { stroke: #14233F; }

/* --- Vista de intento (Moodle): el panel de navegación se mantiene navy con
   texto claro (como .quiz-result); las celdas conservan bordes translúcidos. --- */
html[data-theme="dark"] .quiz-nav,
html[data-theme="dark"] .quiz-nav-title,
html[data-theme="dark"] .quiz-nav-cell,
html[data-theme="dark"] .quiz-nav-legend { color: #f4f7fd; }
html[data-theme="dark"] .quiz-nav-cell.answered { color: #14233F; }

/* Las portadas usan un fondo azul fijo (#0B1A2A) + degradado translúcido, así
   que se ven consistentes en ambos temas sin overrides específicos. */

/* Realces al pasar el cursor / activos -> brillo dorado translúcido */
html[data-theme="dark"] .demo-chip:hover,
html[data-theme="dark"] .suggestion:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .lesson-row.active { background: rgba(76, 169, 190, 0.14); border-left-color: var(--gold); }

/* Notificación (toast) como tarjeta oscura elevada */
html[data-theme="dark"] .toast {
  background: #17294c; color: var(--ink);
  border: 1px solid var(--line-medium); box-shadow: var(--shadow-elevated);
}

/* Efecto de elevación con borde luminoso en tarjetas clave */
html[data-theme="dark"] .stat-card:hover,
html[data-theme="dark"] .course-card:hover,
html[data-theme="dark"] .assign-card:hover {
  box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(76, 169, 190, 0.25);
}

/* --- El certificado se mantiene claro en ambos temas (documento imprimible) --- */
.cert-face {
  background: #faf6ec;
  border-color: var(--gold);
}
.cert-face-inner { background:
  radial-gradient(circle at 50% 0%, rgba(76, 169, 190, 0.08), transparent 60%), #ffffff; }
.cert-brand { color: #152A4D; }
.cert-recipient { color: #14233F; }
.cert-course { color: #574BC0; }
.cert-sign-line { color: #14233F; }
.cert-recipient-label, .cert-body-text, .cert-hours,
.cert-subtitle, .cert-sign-role, .cert-folio, .cert-org {
  color: rgba(20, 35, 63, 0.62);
}
.cert-seal { color: #152A4D; }

/* ============================================================
   MEJORAS DE LEGIBILIDAD + GADGETS
   Tipografía más nítida, mayor contraste de texto, scrollbar
   personalizada, animaciones suaves y calendario.
   (Este bloque va al final para tener prioridad.)
   ============================================================ */

/* --- Tipografía: base más grande y legible (ambos temas) --- */
:root {
  --font-display: 'Sora', 'Montserrat', -apple-system, sans-serif;
}

/* Texto secundario con mayor contraste sobre el fondo oscuro */
html[data-theme="dark"] {
  --ink-70: rgba(233, 238, 251, 0.86);
  --ink-50: rgba(233, 238, 251, 0.68);
  --ink-30: rgba(233, 238, 251, 0.48);
}

html, body {
  font-size: 16.5px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.1px;
}

/* Títulos con la fuente display y un poco más de peso/espaciado */
.login-card h2, .topbar-title, .section-title, .section-head h1,
.stat-value, .course-title, .panel-title, .lesson-heading,
.curriculum-head .t, .assign-title, .modal-head h3, .brand-mark,
.chart-val, .report-course-title, .cal-title {
  font-family: var(--font-display);
  letter-spacing: -0.2px;
}

.section-title, .section-head h1 { font-weight: 700; }
.panel-title { font-weight: 600; }

/* Nombres de curso: tipografía destacada y legible */
.course-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.28;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-top: 2px;
}

/* Cuerpo de texto secundario un punto más grande */
.course-meta, .stat-label, .nav-item, .user-role,
.panel-sub, .section-sub { font-size: 0.95rem; }

/* Enlaces y valores destacados: contraste reforzado (solo tema oscuro) */
html[data-theme="dark"] .stat-value { color: #f4f7fd; }
.course-meta, .topbar-sub, .section-sub { color: var(--ink-70); }

/* --- Scroll suave en toda la plataforma --- */
html { scroll-behavior: smooth; }

/* --- Scrollbar personalizada (WebKit + Firefox) --- */
* { scrollbar-width: thin; scrollbar-color: rgba(76,169,190,0.5) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(76,169,190,0.55), rgba(21,42,77,0.55));
  border-radius: 20px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(157,92,245,0.85), rgba(76,143,224,0.85));
  background-clip: padding-box;
}

/* --- Animaciones de entrada para tarjetas --- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stat-card, .course-card, .assign-card, .panel, .cal-gadget {
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.18s; }

.stat-card, .course-card, .assign-card {
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), box-shadow 0.25s ease;
}
.stat-card:hover, .course-card:hover, .assign-card:hover {
  transform: translateY(-4px);
}

/* --- Layout de escritorio: contenido + barra lateral con gadgets --- */
.dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.dash-main { min-width: 0; }
.dash-side { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 1080px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-side { order: -1; max-width: 380px; }
}

/* --- Panel de acciones rápidas (barra lateral del instructor) --- */
.side-actions { display: flex; flex-direction: column; gap: 8px; }
.side-actions .panel-title { margin-bottom: 6px; }
.quick-action {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-medium); background: var(--paper);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.quick-action:hover { border-color: var(--navy); background: var(--sky); }
.quick-action:active { transform: translateY(1px); }
.quick-action .qact-ic { display: inline-flex; color: var(--navy); flex: 0 0 auto; }
.quick-action .qact-label { flex: 1 1 auto; min-width: 0; }
.quick-action .qact-badge {
  flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--gold); color: #fff;
  font-size: 13.5px; font-weight: 700;
}
.quick-action .qact-go { display: inline-flex; color: var(--ink-50); flex: 0 0 auto; }

/* --- Gadget: Calendario --- */
.cal-gadget {
  background: var(--paper);
  border: 1px solid var(--line-medium);
  border-top: 3px solid #4CA9BE;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
html[data-theme="dark"] .cal-gadget {
  background: linear-gradient(160deg, rgba(23,41,76,0.9), rgba(16,31,63,0.9));
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title { font-size: 1.02rem; font-weight: 700; color: var(--ink); text-transform: capitalize; }
.cal-nav { display: flex; gap: 6px; }
.cal-btn {
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--line-medium);
  background: rgba(255,255,255,0.04); color: var(--ink);
  cursor: pointer; font-size: 15px; line-height: 1;
  display: grid; place-items: center;
  transition: background 0.2s ease, transform 0.15s ease;
}
.cal-btn:hover { background: rgba(76,169,190,0.18); transform: translateY(-1px); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-dow {
  text-align: center; font-size: 0.72rem; font-weight: 700;
  color: var(--ink-50); text-transform: uppercase; letter-spacing: 0.5px;
  padding-bottom: 6px;
}
.cal-day {
  position: relative;
  height: 40px; display: grid; place-items: center;
  border-radius: 9px; font-size: 0.86rem; color: var(--ink-70);
  transition: background 0.18s ease, color 0.18s ease;
  cursor: default;
}
.cal-num { line-height: 1; }
.cal-day.other { color: var(--ink-30); }
.cal-day:not(.cal-blank):hover { background: rgba(255,255,255,0.06); }
.cal-day.cal-blank { padding: 0; pointer-events: none; }
.cal-day.today {
  background: var(--grad-gold); color: #ffffff; font-weight: 700;
  box-shadow: var(--shadow-gold);
}
/* Día con evento: se posiciona para colgar un punto abajo */
.cal-day.has-event { position: relative; font-weight: 600; color: var(--ink); }
.cal-dot {
  width: 6px; height: 6px; border-radius: 50%;
  position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  background: var(--gold-bright);
}
.cal-day.today .cal-dot { bottom: 4px; background: #ffffff; }
.cal-dot-task { background: var(--gold-bright); }
.cal-dot-live { background: #6C5DD3; }
.cal-dot-done { background: var(--green); }

/* Puntos por evento dentro del día (hasta 3) + contador "+N" */
.cal-pips {
  position: absolute; bottom: 5px; left: 0; right: 0;
  display: flex; justify-content: center; align-items: center; gap: 3px;
  pointer-events: none;
}
.cal-pip { width: 6px; height: 6px; border-radius: 50%; }
.cal-more { font-size: 0.6rem; font-weight: 700; color: var(--ink-50); line-height: 1; }
.cal-day.today .cal-pip { box-shadow: 0 0 0 1px rgba(255,255,255,0.85); }
.cal-day.today .cal-more { color: #ffffff; }

/* Día seleccionable / seleccionado en la agenda */
.cal-day.cal-clickable { cursor: pointer; }
.cal-day.cal-clickable:hover { background: rgba(76,169,190,0.16); }
.cal-day.selected {
  outline: 2px solid var(--gold-bright); outline-offset: -2px;
  background: rgba(108,93,211,0.12);
}
.cal-day.today.selected { outline-color: #ffffff; }

/* Leyenda de tipos */
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.cal-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; color: var(--ink-70);
}
.cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* Lista de notificaciones: próximas entregas */
.cal-notes { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.cal-notes-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--ink-70); margin-bottom: 10px;
}
.cal-notes-head svg { color: var(--gold-bright); }
.cal-ev-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cal-ev {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}
.cal-ev-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.cal-ev-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cal-ev-title {
  font-size: 0.86rem; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-ev-sub {
  font-size: 0.74rem; color: var(--ink-50);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-ev-when {
  font-size: 0.72rem; font-weight: 700; color: var(--gold-bright);
  flex: 0 0 auto; white-space: nowrap;
}
.cal-ev-empty { font-size: 0.82rem; color: var(--ink-50); text-align: center; padding: 6px 0; }

/* --- Vista Agenda (página completa) --- */
.agenda-page {
  display: grid; grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 18px; align-items: start;
}
/* En la página, el calendario muestra su cuadrícula; la lista completa va aparte. */
.agenda-cal .cal-notes { display: none; }
.agenda-list-panel { min-width: 0; }
.panel-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--ink-70); margin-bottom: 12px;
}
.panel-head svg { color: var(--gold-bright); }
.agenda-past-head { margin-top: 18px; }
.agenda-sel-head { justify-content: space-between; }
.agenda-sel-head > span { display: inline-flex; align-items: center; gap: 8px; text-transform: none; }
.chip-reset {
  border: 1px solid var(--line-medium); background: transparent;
  color: var(--gold-bright); font-size: 0.72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  text-transform: none; letter-spacing: 0; transition: background .15s, border-color .15s;
}
.chip-reset:hover { background: rgba(108,93,211,0.12); border-color: var(--gold-bright); }
.chip-reset:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.agenda-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.agenda-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 11px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  cursor: pointer; transition: border-color .15s, transform .15s, background .15s;
}
.agenda-row:hover { border-color: var(--line-medium); transform: translateX(2px); }
.agenda-row:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.agenda-row .cal-ev-dot { width: 9px; height: 9px; }
.agenda-row-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.agenda-row-title {
  font-size: 0.9rem; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agenda-row-sub {
  font-size: 0.76rem; color: var(--ink-50);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agenda-row-when {
  font-size: 0.74rem; font-weight: 700; color: var(--gold-bright);
  flex: 0 0 auto; white-space: nowrap;
}
.agenda-past .agenda-row { opacity: 0.72; }
.agenda-past .agenda-row-when { color: var(--ink-50); }
@media (max-width: 860px) {
  .agenda-page { grid-template-columns: 1fr; }
}

/* --- Libro de calificaciones (gradebook) --- */
.gb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.gb-wrap { max-height: 62vh; overflow: auto; }
.gb-table th, .gb-table td { white-space: nowrap; }
.gb-table th { vertical-align: bottom; }
.gb-th-sub { display: block; font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-50); margin-top: 2px; }
.gb-sticky { position: sticky; left: 0; z-index: 2; background: var(--paper); }
.gb-table thead .gb-sticky { z-index: 3; background: var(--paper-warm); }
.gb-val { font-weight: 700; }
.gb-max { font-weight: 400; color: var(--ink-50); font-size: 0.82em; }
.gb-pass { color: var(--ok, #2e9e5b); }
.gb-fail { color: var(--danger, #d1495b); }
.gb-empty { color: var(--ink-40, var(--ink-50)); }
.gb-table td.center, .gb-table th.center { text-align: center; }

/* --- Rúbricas por criterios --- */
/* Editor (define criterios) */
.rubric-edit-row { display: grid; grid-template-columns: 1fr 110px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.rubric-edit-row .re-del { padding: 6px; }
.re-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.re-total { font-size: 0.85rem; color: var(--ink-70); }
.re-total b { color: var(--gold-bright); }
/* Calificación por criterios (en la bandeja de calificar) */
.rubric-grade { margin-top: 14px; border: 1px solid var(--line-medium); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--paper-warm); }
.rubric-grade-head { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-70); margin-bottom: 10px; }
.rubric-grade-head svg { color: var(--gold-bright); }
.rubric-row { padding: 8px 0; border-top: 1px solid var(--line); }
.rubric-row:first-of-type { border-top: none; }
.rubric-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rubric-label { font-weight: 600; font-size: 0.9rem; }
.rubric-input { display: inline-flex; align-items: center; gap: 6px; }
.rubric-input .rubric-pts { width: 80px; text-align: right; }
.rubric-max { color: var(--ink-50); font-size: 0.85rem; }
.rubric-comment { width: 100%; margin-top: 6px; font-size: 0.85rem; }
.rubric-total-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--line-medium); font-weight: 700; }
.rubric-total-row b { color: var(--gold-bright); font-size: 1.05rem; }

/* --- Prerrequisitos de curso --- */
.prq-list { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; max-height: 46vh; overflow: auto; }
.prq-opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.prq-opt:hover { background: var(--paper-warm); }
.prq-opt input { width: 16px; height: 16px; }
.prq-req { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-medium); background: var(--paper-warm); }
.prq-req.prq-block { border-color: #d8a33020; background: #fbf3e0; }
html[data-theme="dark"] .prq-req.prq-block { background: #3a3320; border-color: #6a5a2a; }
.prq-req-head { font-weight: 700; display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.prq-req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.prq-req-list li { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; }
.prq-req-list li.met { color: var(--ink-70); }
.prq-req-list li.met .prq-mark { color: #2e9e5b; font-weight: 800; }
.prq-req-list li.unmet .prq-mark { color: var(--ink-50); font-weight: 800; }

/* --- Gamificación: logros (puntos e insignias) --- */
.ach-page { display: flex; flex-direction: column; gap: 18px; }
.ach-head { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; }
.ach-points-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 22px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-medium);
  background: linear-gradient(150deg, rgba(30,91,184,0.10), rgba(216,163,48,0.12));
  flex: 1 1 240px;
}
.ach-points-ico { color: var(--gold-bright); display: grid; place-items: center; }
.ach-points-num { font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--ink); }
.ach-points-lbl { font-size: 0.85rem; color: var(--ink-70); }
.ach-badge-count {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 16px 22px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-medium); background: var(--paper-warm); min-width: 120px;
}
.ach-badge-num { font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.ach-badge-lbl { font-size: 0.82rem; color: var(--ink-70); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 4px; }
.badge-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 16px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--paper);
}
.badge-card.earned { border-color: var(--gold-bright); background: linear-gradient(160deg, rgba(216,163,48,0.10), transparent); }
.badge-card.locked { opacity: 0.6; filter: grayscale(0.6); }
.badge-ico { color: var(--gold-bright); }
.badge-card.locked .badge-ico { color: var(--ink-50); }
.badge-name { font-weight: 700; font-size: 0.95rem; }
.badge-desc { font-size: 0.78rem; color: var(--ink-70); line-height: 1.25; }
.badge-state { margin-top: 2px; font-size: 0.75rem; }
.badge-got { color: #2e9e5b; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.badge-pending { color: var(--ink-50); }
.ach-list { list-style: none; margin: 0; padding: 0; }
.ach-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.ach-row:last-child { border-bottom: 0; }
.ach-row-title { font-weight: 600; display: block; }
.ach-row-sub { font-size: 0.8rem; color: var(--ink-70); }
.ach-row-pts { font-weight: 800; color: var(--gold-bright); white-space: nowrap; }

/* --- Tabla de posiciones por curso (en el reproductor) --- */
.lb-slot { margin-top: 16px; }
.lb-card { border: 1px solid var(--line-medium); border-radius: var(--radius-sm); background: var(--paper-warm); overflow: hidden; }
.lb-head { font-weight: 700; display: flex; align-items: center; gap: 7px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; font-size: 0.9rem; }
.lb-row + .lb-row { border-top: 1px solid var(--line); }
.lb-row.me { background: rgba(216,163,48,0.14); font-weight: 700; }
.lb-rank { width: 22px; text-align: center; font-weight: 800; color: var(--ink-70); }
.lb-rank.lb-medal-1 { color: #d8a330; }
.lb-rank.lb-medal-2 { color: #9aa3ad; }
.lb-rank.lb-medal-3 { color: #b07a3a; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-you { color: var(--ink-70); font-weight: 500; font-size: 0.82rem; }
.lb-pts { font-weight: 800; color: var(--gold-bright); }
.lb-mine { padding: 8px 12px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--ink-70); }

/* --- Gadget: Botón "volver arriba" --- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line-medium);
  background: linear-gradient(160deg, rgba(30,91,184,0.95), rgba(10,33,83,0.95));
  color: #f4f7fd; font-size: 20px; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--shadow-elevated);
  opacity: 0; transform: translateY(16px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
.to-top.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.to-top:hover { background: linear-gradient(160deg, rgba(76,143,224,1), rgba(30,91,184,1)); }

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stat-card, .course-card, .assign-card, .panel, .cal-gadget, .to-top,
  .pbar > i, .prog-fill, .cpm-fill, .empty-ico, .confetti,
  .celebrate-card, .celebrate-badge, .sk-line::after, .spark-draw {
    animation: none !important; transition: none !important;
  }
  /* Sin animación de escala, las barras deben quedar completas. */
  .pbar > i, .prog-fill, .cpm-fill { transform: scaleX(1) !important; }
  .confetti { display: none !important; }
  .spark-draw { stroke-dashoffset: 0 !important; }
}

/* ============================================================
   FUNCIONES SOCIALES · foro, comentarios, mensajería,
   campanita de notificaciones y menú de usuario
   ============================================================ */

/* Tamaños de avatar auxiliares */
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.xs { width: 24px; height: 24px; font-size: 10px; }

/* Utilidades compartidas */
.link-btn { background: none; border: none; padding: 0; margin-top: 4px; cursor: pointer;
  color: var(--navy-bright); font-size: 12px; font-weight: 600; }
.link-btn:hover { color: var(--navy); text-decoration: underline; }
.modal-form .field:last-of-type { margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---- Campanita de notificaciones + menú de usuario -------- */
.tb-bell, .tb-menu { position: relative; }
.tb-icon-btn, .tb-user { position: relative; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid var(--line-medium); border-radius: 50%;
  width: 40px; height: 40px; color: var(--navy); transition: all 0.18s; padding: 0; }
.tb-icon-btn:hover, .tb-user:hover { border-color: var(--navy); background: var(--sky); }
.tb-user { border: none; width: auto; height: auto; }
.tb-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 100px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--paper); }

.tb-pop { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: 340px; max-width: 82vw; background: var(--paper); border: 1px solid var(--line-medium);
  border-radius: var(--radius); box-shadow: var(--shadow-elevated); overflow: hidden;
  animation: fade 0.18s ease; }
.tb-pop-right { right: 0; width: 260px; }
.tb-pop-head { display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--paper-warm);
  font-weight: 700; font-size: 14px; color: var(--navy-deepest); }
.tb-pop-clear { background: none; border: none; cursor: pointer; font-size: 11.5px; font-weight: 600;
  color: var(--navy-bright); }
.tb-pop-clear:hover { text-decoration: underline; }
.tb-pop-list { max-height: 400px; overflow-y: auto; }

.tb-notif { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink); transition: background 0.15s; }
.tb-notif:hover { background: var(--sky); }
.tb-notif.unread { background: rgba(30,91,184,0.06); }
.tb-notif.unread:hover { background: rgba(30,91,184,0.1); }
.tb-notif-ico { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sky); color: var(--navy); }
.tb-notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tb-notif-title { font-size: 14px; font-weight: 600; color: var(--navy-deepest); }
.tb-notif-sub { font-size: 12px; color: var(--ink-70); line-height: 1.4; }
.tb-notif-when { font-size: 10.5px; color: var(--ink-50); margin-top: 2px; }
.tb-empty { padding: 26px 16px; text-align: center; font-size: 13.5px; color: var(--ink-50); }

.tb-user-info { display: flex; align-items: center; gap: 11px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); background: var(--paper-warm); }
.tb-user-meta { display: flex; flex-direction: column; min-width: 0; }
.tb-user-meta .n { font-size: 14px; font-weight: 700; color: var(--navy-deepest);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-user-meta .e { font-size: 11.5px; color: var(--ink-50);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 16px; background: none; border: none; cursor: pointer; font-size: 14px;
  color: var(--ink); text-decoration: none; transition: background 0.15s; }
.tb-menu-item:hover { background: var(--sky); }
.tb-menu-item.danger { color: var(--red); border-top: 1px solid var(--line); }
.tb-menu-item.danger:hover { background: rgba(184,56,56,0.08); }

/* ---- Vista de mensajes (asesor + compañeros) ------------- */
.msg-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px;
  height: calc(100vh - 210px); min-height: 460px; }
.msg-contacts { background: var(--paper); border: 1px solid var(--line-medium);
  border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.msg-contacts-head { padding: 12px; border-bottom: 1px solid var(--line); background: var(--paper-warm); }
.msg-contacts-head input { width: 100%; padding: 9px 12px; border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); background: var(--paper); font-size: 14px; color: var(--ink); }
.msg-contacts-head input:focus { outline: none; border-color: var(--navy-bright); }
.msg-contacts-list { overflow-y: auto; flex: 1; }
.msg-contact { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 12px 14px; background: none; border: none; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background 0.15s; }
.msg-contact:hover { background: var(--sky); }
.msg-contact.active { background: rgba(30,91,184,0.08); box-shadow: inset 3px 0 0 var(--navy-bright); }
.msg-contact-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.msg-contact-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.msg-contact-name { font-size: 14px; font-weight: 600; color: var(--navy-deepest);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-unread { flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px;
  background: var(--navy-bright); color: #fff; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; line-height: 1; }
.msg-contact-role { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gold-deep); font-weight: 700; }
.msg-contact-last { font-size: 12px; color: var(--ink-50);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.msg-chat { background: var(--paper); border: 1px solid var(--line-medium); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden; }
.msg-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--ink-30); text-align: center; padding: 30px; }
.msg-empty p { color: var(--ink-50); font-size: 14.5px; max-width: 260px; }
.msg-chat-head { display: flex; align-items: center; gap: 11px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); background: var(--paper-warm); }
.msg-chat-who { display: flex; flex-direction: column; }
.msg-chat-name { font-size: 15px; font-weight: 700; color: var(--navy-deepest); }
.msg-chat-role { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gold-deep); font-weight: 700; }
.msg-stream { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.msg-empty-hint { margin: auto; color: var(--ink-50); font-size: 14px; }
.dm { display: flex; flex-direction: column; max-width: 74%; }
.dm.mine { align-self: flex-end; align-items: flex-end; }
.dm.their { align-self: flex-start; align-items: flex-start; }
.dm-bubble { padding: 9px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5;
  word-wrap: break-word; }
.dm.their .dm-bubble { background: var(--sky); color: var(--ink); border-bottom-left-radius: 4px; }
.dm.mine .dm-bubble { background: var(--grad-navy); color: var(--paper); border-bottom-right-radius: 4px; }
.dm-time { font-size: 10px; color: var(--ink-30); margin-top: 3px; padding: 0 4px; }
.msg-input { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line);
  background: var(--paper-warm); }
.msg-input input { flex: 1; padding: 11px 14px; border: 1px solid var(--line-medium);
  border-radius: 100px; background: var(--paper); font-size: 14.5px; color: var(--ink); }
.msg-input input:focus { outline: none; border-color: var(--navy-bright); }
.msg-input button { flex-shrink: 0; width: 44px; padding: 0; }

/* ---- Foro + comentarios (bajo el reproductor) ------------ */
.lesson-social { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 20px; }
.social-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.social-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px;
  border: 1px solid var(--line-medium); border-radius: 100px; background: var(--paper);
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-70); transition: all 0.18s; }
.social-tab:hover { border-color: var(--navy); color: var(--navy); }
.social-tab.active { background: var(--grad-gold); color: #ffffff; border-color: transparent; }

/* Comentarios */
.comment-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.comment-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); background: var(--paper); font-size: 14.5px; color: var(--ink);
  font-family: inherit; resize: vertical; min-height: 60px; }
.comment-form textarea:focus { outline: none; border-color: var(--navy-bright); }
.comment-form button { align-self: flex-end; }
.comment-list { display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 12px; }
.comment-body { flex: 1; min-width: 0; }
.comment-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.comment-top b { color: var(--navy-deepest); }
.comment-when { font-size: 11px; color: var(--ink-50); }
.comment-text { font-size: 14.5px; line-height: 1.6; color: var(--ink); margin-top: 4px;
  word-wrap: break-word; }
.comment-replies { margin-top: 12px; display: flex; flex-direction: column; gap: 14px;
  padding-left: 14px; border-left: 2px solid var(--line); }
.comment.reply { gap: 10px; }
.reply-form { display: flex; gap: 8px; margin-top: 10px; }
.reply-form input { flex: 1; padding: 8px 12px; border: 1px solid var(--line-medium);
  border-radius: 100px; background: var(--paper); font-size: 14px; color: var(--ink); }
.reply-form input:focus { outline: none; border-color: var(--navy-bright); }

/* Foro */
.forum-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; }
.forum-list { display: flex; flex-direction: column; gap: 10px; }
.forum-thread { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 16px; background: var(--paper); border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.16s; }
.forum-thread:hover { border-color: var(--navy); box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.forum-thread-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.forum-thread-title { font-size: 15px; font-weight: 600; color: var(--navy-deepest);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forum-thread-meta { font-size: 11.5px; color: var(--ink-50); }
.forum-thread-count { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--navy); }

/* Detalle del hilo (modal) */
.thread-detail { display: flex; flex-direction: column; gap: 16px; }
.thread-op { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.thread-posts { display: flex; flex-direction: column; gap: 16px; max-height: 44vh; overflow-y: auto; }
.thread-post { display: flex; gap: 12px; }
.thread-reply { display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.thread-reply input { flex: 1; padding: 10px 14px; border: 1px solid var(--line-medium);
  border-radius: 100px; background: var(--paper); font-size: 14.5px; color: var(--ink); }
.thread-reply input:focus { outline: none; border-color: var(--navy-bright); }
/* Clip para adjuntar archivo en la respuesta del foro */
.thread-clip { display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-medium); background: var(--paper); color: var(--ink-50);
  transition: all 0.16s; }
.thread-clip:hover { color: var(--navy); border-color: var(--navy-bright); }
.thread-file-name { font-size: 12px; color: var(--ink-50); padding: 6px 4px 0; }
/* Adjuntos mostrados dentro del hilo/respuesta */
.forum-attach { display: inline-block; margin-top: 8px; }
.forum-attach-img { max-width: 100%; max-height: 320px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-medium); display: block; }
.forum-attach-media { margin-top: 8px; max-width: 100%; border-radius: var(--radius-sm); }
video.forum-attach-media { max-height: 360px; }
.forum-attach-file { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px;
  padding: 8px 12px; border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  background: var(--surface, var(--paper)); color: var(--navy); font-size: 14px;
  font-weight: 600; text-decoration: none; transition: all 0.16s; }
.forum-attach-file:hover { border-color: var(--navy-bright); box-shadow: var(--shadow-soft); }

/* ---- Preguntas y respuestas del curso (Q&A general) ---- */
.qa-ask { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.qa-ask textarea { width: 100%; resize: vertical; padding: 10px 12px; font: inherit;
  border: 1px solid var(--line-medium); border-radius: var(--radius-sm); background: var(--paper);
  color: var(--ink); }
.qa-ask textarea:focus { outline: none; border-color: var(--navy-bright); }
.qa-ask button { align-self: flex-end; }
.qa-list { display: flex; flex-direction: column; gap: 14px; }
.qa-item { border: 1px solid var(--line-soft); border-radius: var(--radius-md); padding: 14px;
  background: var(--paper); transition: border-color 0.15s; }
.qa-item.resolved { border-color: var(--green, #2e7d5b); background: var(--green-pale, var(--paper)); }
.qa-q, .qa-answer { display: flex; gap: 10px; align-items: flex-start; }
.qa-badge { margin-left: 6px; display: inline-flex; align-items: center; gap: 3px; }
.qa-tools { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.qa-count { font-size: 12px; color: var(--ink-50); display: inline-flex; align-items: center; gap: 4px; }
.qa-link { background: none; border: none; padding: 0; font-size: 13.5px; font-weight: 600;
  color: var(--navy); cursor: pointer; }
.qa-link:hover { text-decoration: underline; }
.qa-link.qa-del { color: var(--red, #c0392b); }
.qa-answers { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 0 34px; }
.qa-answer { padding-top: 10px; border-top: 1px dashed var(--line-soft); }
.qa-reply { display: flex; gap: 8px; margin: 10px 0 0 34px; }
.qa-reply input { flex: 1; padding: 8px 12px; font: inherit; border: 1px solid var(--line-medium);
  border-radius: 100px; background: var(--paper); color: var(--ink); }
.qa-reply input:focus { outline: none; border-color: var(--navy-bright); }

/* --- Antiplagio (panel dentro del modal de calificación) --- */
.plag-box { margin: 14px 0 4px; border: 1px solid var(--line-medium); border-radius: 12px;
  background: var(--paper-warm); overflow: hidden; }
.plag-head { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.plag-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.plag-body { padding: 12px 14px; }
.plag-score { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.plag-gauge { display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 62px; border-radius: 50%; font-weight: 700; font-size: 17px;
  color: #fff; background: var(--ok, #2e7d51); flex: none; }
.plag-score.mid .plag-gauge { background: #C9862B; }
.plag-score.high .plag-gauge { background: #C0392B; }
.plag-score.none .plag-gauge { background: #6b7280; }
.plag-meta { display: flex; flex-direction: column; gap: 2px; }
.plag-matches { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plag-match { display: grid; grid-template-columns: 120px 44px 1fr; align-items: center; gap: 10px; }
.plag-bar { height: 8px; border-radius: 100px; background: var(--line-soft); overflow: hidden; }
.plag-fill { display: block; height: 100%; background: #2e7d51; }
.plag-fill.mid { background: #C9862B; }
.plag-fill.high { background: #C0392B; }
.plag-fill.low { background: #2e7d51; }
.plag-pct { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.plag-who { font-size: 14px; color: var(--ink); }
.plag-when { display: block; margin-top: 10px; font-size: 12px; }

/* --- Cuotas / cupos (panel admin + lista de organizaciones) --- */
.quota-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 18px; }
.quota-card { border: 1px solid var(--line-medium); border-radius: 14px; padding: 14px 16px;
  background: var(--paper); }
.quota-card.near { border-color: #C9862B; }
.quota-card.full { border-color: #C0392B; }
.quota-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.quota-card-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.quota-card-num { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.quota-track { height: 9px; border-radius: 100px; background: var(--line-soft); overflow: hidden; }
.quota-bar { display: block; height: 100%; background: var(--navy-bright, #2e7d51); transition: width .3s ease; }
.quota-card.near .quota-bar { background: #C9862B; }
.quota-card.full .quota-bar { background: #C0392B; }
.quota-hint { display: block; margin-top: 7px; font-size: 12px; }
.quota-pair { display: inline-flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.quota-pair > span { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; }
.quota-chip { font-variant-numeric: tabular-nums; }
.quota-chip.full { color: #C0392B; font-weight: 600; }

/* ============================================================
   WIDGET FLOTANTE DE CHAT (Lumi + mensajería) · esquina inf. der.
   ============================================================ */
.chat-dock { position: fixed; right: 22px; bottom: 22px; z-index: 900;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

.chat-fab { width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad-royal); color: #fff; box-shadow: var(--shadow-elevated);
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: transform .15s ease, box-shadow .15s ease; }
.chat-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: var(--shadow-gold); }
.chat-dock.open .chat-fab { transform: scale(0.92); opacity: 0.96; }
.chat-fab-badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 100px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--paper); }

.chat-panel { width: 360px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 120px);
  background: var(--paper); border: 1px solid var(--line-medium); border-radius: 18px;
  box-shadow: var(--shadow-elevated); display: flex; flex-direction: column; overflow: hidden;
  animation: chatIn .18s ease; }
/* El atributo [hidden] debe ganar al display:flex de arriba para que el botón
   de chat (FAB / cerrar) realmente oculte el panel. */
.chat-panel[hidden] { display: none; }
/* Estado maximizado: la ventana crece (anclada abajo-derecha por el dock). */
.chat-dock.maximized .chat-panel { width: min(920px, calc(100vw - 32px));
  height: calc(100vh - 96px); max-height: calc(100vh - 32px); }
@keyframes chatIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.chat-panel-head { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper-warm); }
.chat-panel-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.chat-tabs { display: flex; gap: 4px; }
.chat-tab { display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer;
  background: transparent; color: var(--ink-50); font: inherit; font-weight: 600; font-size: 14px;
  padding: 6px 12px; border-radius: 100px; transition: all .15s; }
.chat-tab:hover { color: var(--ink); background: var(--line); }
.chat-tab.active { color: #fff; background: var(--navy-bright); }
.chat-panel-actions { display: inline-flex; align-items: center; gap: 2px; }
.chat-min { border: none; background: transparent; color: var(--ink-50); cursor: pointer;
  padding: 5px; border-radius: 8px; display: flex; }
.chat-min:hover { color: var(--ink); background: var(--line); }
#chat-close:hover { color: #fff; background: var(--danger, #d64545); }

.chat-body { flex: 1; min-height: 0; display: flex; }
.chat-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-pane[hidden] { display: none; }

.chat-stream { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line);
  background: var(--paper-warm); }
.chat-input input { flex: 1; border: 1px solid var(--line-medium); border-radius: 100px;
  padding: 9px 14px; background: var(--paper); color: var(--ink); font: inherit; outline: none; }
.chat-input input:focus { border-color: var(--navy-bright); }
.chat-input .btn { flex: 0 0 auto; border-radius: 50%; width: 38px; height: 38px; padding: 0;
  display: flex; align-items: center; justify-content: center; }

/* Lista de contactos dentro del widget */
.chat-peers { flex: 1; overflow-y: auto; padding: 6px; }
.chat-peer { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: none; background: transparent; cursor: pointer; padding: 9px 10px; border-radius: 12px;
  color: var(--ink); transition: background .15s; }
.chat-peer:hover { background: var(--line); }
.chat-peer-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-peer-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-peer-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-peer-last { font-size: 12px; color: var(--ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Conversación abierta dentro del widget */
.chat-convo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-convo[hidden] { display: none; }
.chat-convo-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: var(--paper-warm); }
.chat-back { border: none; background: transparent; color: var(--ink-50); cursor: pointer;
  padding: 4px; border-radius: 8px; display: flex; }
.chat-back:hover { color: var(--ink); background: var(--line); }
.chat-convo-who { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.chat-convo-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .quota-cards { grid-template-columns: 1fr; }
  .msg-layout { grid-template-columns: 1fr; height: auto; }
  .msg-contacts { max-height: 300px; }
  .msg-chat { min-height: 440px; }
  .tb-pop { width: 300px; }
  .chat-dock { right: 14px; bottom: 14px; }
  .chat-panel { width: calc(100vw - 28px); height: 70vh; }
}

/* Colores de texto seguros para el tema oscuro:
   los títulos que usaban navy profundo pasan a texto claro adaptable,
   y el texto de mis mensajes se mantiene claro sobre el degradado navy. */
.tb-pop-head, .tb-notif-title, .tb-user-meta .n,
.msg-contact-name, .msg-chat-name, .forum-thread-title,
.comment-top b { color: var(--ink); }
.dm.mine .dm-bubble { color: #f3f7fd; }

/* ============================================================
   Etapa 3 · Checklist e-learning (Anexo C.5)
   Control de velocidad, materiales de lección (archivo/enlace/audio).
   ============================================================ */

/* Barra de velocidad de reproducción */
.speed-bar { display: flex; align-items: center; gap: 6px; margin: 10px 0 2px;
  flex-wrap: wrap; }
.speed-label { font-size: 12px; font-weight: 600; color: var(--ink-50); margin-right: 4px; }
.speed-btn { padding: 4px 11px; border: 1px solid var(--line-medium); border-radius: 100px;
  background: var(--paper); color: var(--ink); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; }
.speed-btn:hover { border-color: var(--navy); }
.speed-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Materiales de la lección (bajo el video) */
.materials { margin: 18px 0 4px; padding: 16px; background: var(--paper);
  border: 1px solid var(--line-medium); border-radius: var(--radius-sm); }
.materials-title { display: flex; align-items: center; gap: 8px; font-size: 15px;
  font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.materials-list { display: flex; flex-direction: column; gap: 10px; }
.material-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); text-decoration: none; transition: all 0.15s; }
a.material-item:hover { border-color: var(--navy); box-shadow: var(--shadow-soft);
  transform: translateY(-1px); }
.material-title { flex: 1; font-size: 14.5px; font-weight: 600; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.material-ext { flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--ink-50);
  text-transform: uppercase; letter-spacing: 0.03em; }
.material-audio { flex-direction: column; align-items: stretch; gap: 8px; }
.material-head { display: flex; align-items: center; gap: 8px; }
.material-player { width: 100%; height: 38px; }
.material-embed { flex-direction: column; align-items: stretch; gap: 10px; }
.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.material-doc { flex-direction: column; align-items: stretch; gap: 10px; }
.material-doc .material-head { justify-content: space-between; flex-wrap: wrap; }
.material-doc .material-title { flex: 1 1 auto; min-width: 0; }
.material-dl { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.doc-embed { width: 100%; height: 600px; border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--paper); }
.doc-embed iframe { width: 100%; height: 100%; border: 0; }

/* Gestión de materiales (modal del instructor) */
.mat-existing { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.mat-row { padding: 9px 12px; border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); background: var(--paper); }
.mat-info { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.mat-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.tabbtns { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.mat-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.mat-pane { margin-bottom: 8px; }

/* Ajustes tema oscuro (texto claro adaptable) */
.materials-title, .material-title { color: var(--ink); }

/* Contenido interactivo SCORM / H5P (Anexo C.5 · 7 y 15) */
.scorm-slot { margin: 4px 0 2px; }
.scorm-box { border: 1px solid var(--line-medium); border-radius: var(--radius);
  overflow: hidden; background: var(--paper); }
.scorm-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: var(--grad-gold); color: #fff; font-size: 13.5px; }
.scorm-bar b { font-weight: 700; }
.scorm-bar .scorm-note { margin-left: auto; opacity: 0.8; font-size: 11.5px; }
/* Botón "Ampliar" (pantalla completa) */
.scorm-fs { display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  padding: 5px 11px; border: 1px solid rgba(255,255,255,0.35); border-radius: 999px;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.scorm-fs:hover { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.6); }
.scorm-fs svg { display: block; }
/* Altura relativa al viewport: el contenido se ve completo sin scroll interno. */
.scorm-frame { border: 0; width: 100%; height: 82vh; min-height: 560px;
  display: block; background: linear-gradient(140deg, #24406E 0%, #152A4D 55%, #33265F 100%); }
/* Con SCORM activo se conserva el temario a la derecha (lecciones, tareas y
   exámenes siempre visibles). Para ver el SCORM a todo lo ancho, el alumno usa
   el botón "Ampliar" (pantalla completa) de la barra del SCORM. */
/* Pantalla completa: la caja ocupa todo el viewport y el iframe crece con ella. */
.scorm-box:fullscreen, .scorm-box.is-fs { display: flex; flex-direction: column;
  width: 100vw; height: 100vh; border: 0; border-radius: 0; }
.scorm-box:fullscreen .scorm-frame, .scorm-box.is-fs .scorm-frame {
  flex: 1 1 auto; height: auto; min-height: 0; }
.h5p-mount { min-height: 320px; }
.h5p-mount .h5p-iframe-wrapper { background: var(--paper); }

/* ============================================================
   Etapa 3 · Glosario y Wiki del curso (Anexo C.5 · 6 y 10)
   ============================================================ */

/* Glosario */
.glossary-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px;
  flex-wrap: wrap; }
.glossary-bar input[type="search"] { flex: 1; min-width: 180px;
  padding: 9px 13px; border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font-size: 14.5px; }
.glossary-list { display: flex; flex-direction: column; gap: 10px; }
.gloss-item { position: relative; padding: 13px 15px; border: 1px solid var(--line-medium);
  border-radius: var(--radius-sm); background: var(--paper); }
.gloss-term { font-size: 14.5px; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.gloss-def { font-size: 14.5px; color: var(--ink); line-height: 1.5; }
.gloss-def p { margin: 0 0 6px; }
.gloss-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }

/* Wiki */
.wiki-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; }
.wiki-index { display: flex; flex-direction: column; gap: 8px; }
.wiki-link { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); cursor: pointer; font-size: 14.5px;
  font-weight: 600; transition: all 0.15s; }
.wiki-link:hover { border-color: var(--navy); box-shadow: var(--shadow-soft);
  transform: translateY(-1px); }
.wiki-link > span:first-of-type { flex: 1; }
.wiki-meta { flex-shrink: 0; font-size: 11px; font-weight: 500; color: var(--ink-50); }
.wiki-page-head { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; }
.wiki-page-actions { display: flex; gap: 6px; }
.wiki-title { font-size: 20px; font-weight: 700; color: var(--ink); margin: 6px 0 12px; }
.wiki-content { font-size: 15px; color: var(--ink); line-height: 1.6; }
.wiki-content h1, .wiki-content h2, .wiki-content h3 { color: var(--navy); margin: 14px 0 8px; }
.wiki-content p { margin: 0 0 10px; }
.wiki-content ul, .wiki-content ol { margin: 0 0 10px 20px; }
.wiki-foot { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line-medium);
  font-size: 12px; }

/* Ajustes tema oscuro para glosario/wiki */
.gloss-def, .wiki-content, .wiki-title { color: var(--ink); }

/* ---------------------------------------------------------------
   Etapa 3 · Encuestas del curso (Anexo C.5 · 5)
   --------------------------------------------------------------- */
.surveys-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 14px; }
.survey-list { display: flex; flex-direction: column; gap: 10px; }
.survey-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px; border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  background: var(--paper); flex-wrap: wrap; }
.survey-main { flex: 1; min-width: 200px; }
.survey-title { font-weight: 700; color: var(--ink); display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; }
.survey-state { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.survey-state.open { background: rgba(46, 160, 90, 0.15); color: #2ea05a; }
.survey-state.closed { background: rgba(150, 150, 150, 0.18); color: var(--ink-50); }
.survey-anon { font-size: 11px; color: var(--ink-50); font-style: italic; }
.survey-default { border-color: #24406E; background: rgba(36, 64, 110, 0.04); }
.survey-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: rgba(36, 64, 110, 0.12); color: #24406E; }
.survey-desc { font-size: 14px; color: var(--ink-50); margin: 4px 0; }
.survey-meta { font-size: 12px; color: var(--ink-50); }
.survey-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.survey-done { font-size: 12px; color: #2ea05a; font-weight: 600; }

/* Editor de preguntas */
.sq-list-head { font-weight: 700; color: var(--ink); margin: 6px 0 4px; }
.sq-row { border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 8px; }
.sq-head { display: flex; gap: 8px; align-items: center; }
.sq-head .sq-text { flex: 1; }
.sq-opts { width: 100%; margin-top: 8px; }
.field-check { flex-direction: row; align-items: center; gap: 8px; }
.field-check input { width: auto; }

/* Formulario de respuesta */
.respond-desc { margin-bottom: 8px; }
.respond-anon { font-size: 12px; color: var(--ink-50); font-style: italic; margin-bottom: 8px; }
.respond-q { margin-bottom: 14px; }
.respond-qtext { font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.respond-text { width: 100%; }
.respond-scale { display: flex; gap: 14px; }
.respond-scale label { display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; font-size: 14px; }
.respond-opts { display: flex; flex-direction: column; gap: 6px; }
.respond-opt { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.respond-select { width: 100%; padding: 9px 12px; border: 1px solid var(--line-medium);
  border-radius: 10px; background: var(--surface); color: inherit; font: inherit; }
.respond-select:focus { outline: none; border-color: var(--gold); }

/* Resultados agregados */
.survey-results { display: flex; flex-direction: column; gap: 4px; }
.res-total { font-size: 14px; color: var(--ink-50); margin-bottom: 8px; }
.res-q { margin-bottom: 16px; }
.res-qtext { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.res-avg { font-size: 12px; color: var(--gold); font-weight: 600; margin-left: 6px; }
.res-text { margin: 0 0 0 18px; font-size: 14px; color: var(--ink); }
.res-text li { margin-bottom: 4px; }
.res-bar-row { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.res-bar-lbl { flex: 0 0 130px; font-size: 14px; color: var(--ink); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.res-bar { flex: 1; height: 12px; background: var(--line-medium); border-radius: 999px; overflow: hidden; }
.res-bar-fill { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.res-bar-n { flex: 0 0 32px; text-align: right; font-size: 12px; color: var(--ink-50); }

/* Tema oscuro: textos legibles */
.survey-title, .respond-qtext, .res-qtext, .res-bar-lbl, .res-text { color: var(--ink); }

/* Herramientas del reporte (exportar/imprimir) */
.report-tools { display: flex; gap: 6px; }
@media print { .report-tools { display: none; } }

/* ===== Perfil de usuario ================================= */
.profile-page { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.profile-hero { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.profile-photo { flex: 0 0 auto; width: 96px; height: 96px; font-size: 34px; }
.profile-photo.avatar img { border-radius: 50%; }
.profile-id { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.profile-name { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.profile-title { font-size: 15px; color: var(--ink); opacity: .85; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 4px;
  font-size: 12px; color: var(--ink-50); }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-role { display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--gold-soft, rgba(76,169,190,.15)); color: var(--gold);
  font-size: 11px; font-weight: 600; width: fit-content; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.profile-progress { margin-top: 10px; }
.profile-bio-title { font-size: 14px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-50); margin-bottom: 8px; }
.profile-bio-body { color: var(--ink); font-size: 15px; line-height: 1.6; }
.profile-bio-body.is-empty { color: var(--ink-50); font-style: italic; }

/* La tarjeta lateral de usuario es un enlace al perfil */
.user-card { text-decoration: none; color: inherit; }
.user-card:hover { background: var(--line-soft, rgba(0,0,0,.04)); }

/* Enlaces al perfil en el chat */
.msg-chat-who-link { display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: inherit; }
.msg-chat-who-link:hover .msg-chat-name { text-decoration: underline; }
.msg-chat-profile { flex: 0 0 auto; }

/* Tema oscuro: textos del perfil legibles */
.profile-name, .profile-title, .profile-bio-body { color: var(--ink); }

/* ===== Examen cronometrado (alumno) ===================== */
.quiz-timer { display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 0 16px; padding: 10px 16px; border-radius: var(--radius-md, 12px);
  background: var(--sky); border: 1px solid var(--line-medium);
  font-family: var(--font-mono); font-weight: 700; color: var(--navy); }
.quiz-timer svg { width: 16px; height: 16px; stroke: var(--navy); fill: none; }
.quiz-timer #quiz-timer-val { font-size: 20px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.quiz-timer.urgent { background: rgba(184,56,56,0.12); border-color: var(--red);
  color: var(--red); animation: quizPulse 1s ease-in-out infinite; }
.quiz-timer.urgent svg { stroke: var(--red); }
@keyframes quizPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
.quiz-exam-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 16px;
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.5;
  background: var(--gold-pale); border: 1px solid var(--gold); color: var(--gold-deep); }
.quiz-exam-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px;
  stroke: var(--gold-deep); fill: none; }

/* Examen enviado, pendiente de revisión del instructor */
.quiz-result.pending { color: #ffffff;
  background:
    radial-gradient(80% 90% at 50% -10%, rgba(76,169,190,0.28) 0%, transparent 60%),
    linear-gradient(140deg, #24406E 0%, #152A4D 55%, #33265F 100%); }
.quiz-result.pending .quiz-result-label { color: #ffffff; font-weight: 700; opacity: 1; }
.quiz-pending-ico { display: inline-flex; margin-bottom: 10px; }
.quiz-pending-ico svg { width: 46px; height: 46px; stroke: #7FD4E0; fill: none; stroke-width: 1.6;
  filter: drop-shadow(0 2px 10px rgba(76,169,190,0.45)); }
/* El subtítulo hereda .muted (oscuro); sobre el navy hay que forzar texto claro. */
.quiz-result.pending .quiz-pending-text { font-size: 15px; line-height: 1.55; max-width: 420px;
  margin: 0 auto; color: rgba(255,255,255,0.9); opacity: 1; }

/* ===== Constructor de evaluaciones (instructor) ========= */
.qb-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .qb-grid3 { grid-template-columns: 1fr; } }
.qb-questions { display: flex; flex-direction: column; gap: 14px; margin: 6px 0 16px; }
.qb-card { border: 1px solid var(--line-medium); border-radius: var(--radius-md, 12px);
  padding: 16px; background: var(--paper-warm); }
.qb-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.qb-qnum { font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold-deep); }
.qb-q-del { color: var(--red); }
.qb-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.qb-opt { display: flex; align-items: center; gap: 10px; }
.qb-correct { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--ink-70); white-space: nowrap; }
.qb-correct input { width: auto; margin: 0; }
.qb-opt-text { flex: 1; }
.qb-opt-text input { margin: 0; }
.qb-opt-del { flex: 0 0 auto; color: var(--red); }
.qb-opt-add { margin-top: 4px; align-self: flex-start; }
.qb-bool-row { display: flex; gap: 18px; margin-top: 6px; }
.qb-bool { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.qb-bool input { width: auto; margin: 0; }
.qb-shuffle-field { display: flex; align-items: center; gap: 8px; margin: 6px 0 16px; font-size: 14px; }
.qb-shuffle-field input { width: auto; margin: 0; }
.qb-opts-label { font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-50); margin: 8px 0 2px; }
/* Letra a), b), c)… delante de cada opción de opción múltiple (editor). */
.qb-opt-letter { flex: 0 0 auto; width: 20px; text-align: center; font-weight: 700;
  color: var(--navy); }

/* Selector Manual vs Banco de preguntas al crear una evaluación. */
.qc-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 4px; }
.qc-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-align: left; padding: 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.qc-choice:hover { border-color: var(--teal); background: var(--sky); transform: translateY(-1px); }
.qc-choice-ic { color: var(--teal); }
.qc-choice-tt { font-weight: 700; color: var(--navy); font-size: 15px; }
.qc-choice-sub { font-size: 13.5px; color: var(--ink-70); line-height: 1.4; }
@media (max-width: 560px) { .qc-choices { grid-template-columns: 1fr; } }

/* ===== Gestor de evaluaciones / revisión (instructor) === */
.qm-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line-medium); border-radius: var(--radius-sm); margin-bottom: 10px;
  background: var(--paper); }
.qm-main { flex: 1; min-width: 0; }
.qm-title { font-weight: 600; color: var(--ink); }
.qm-meta { font-size: 12px; color: var(--ink-50); margin-top: 3px;
  display: flex; flex-wrap: wrap; gap: 4px 12px; }
.qm-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }
.qm-del { color: var(--red); }
.qm-results-list { display: flex; flex-direction: column; gap: 8px; }

/* Detalle de intento en revisión */
.rev-open { font-size: 12px; color: var(--navy-bright); cursor: pointer; }
.rev-release { margin-top: 4px; }

/* Tema oscuro: legibilidad de textos nuevos */
.qm-title, .qb-bool, .quiz-pending-text { color: var(--ink); }

/* ============================================================
   Actividades por módulo · ventanas de fecha · reautorización
   ============================================================ */

/* Aviso de estado de ventana dentro de tareas/exámenes del alumno */
.win-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; margin: 10px 0; line-height: 1.4; }
.win-note.closed { background: rgba(184,56,56,0.08); color: var(--red); }
.win-note.upcoming { background: var(--sky); color: var(--navy); }
.win-note.open { background: rgba(45,122,79,0.1); color: var(--green); }

/* Actividades (tarea/evaluación) dentro del gestor del curso, por módulo */
.mgr-acts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px;
  padding-top: 8px; border-top: 1px dashed var(--line); }
.mgr-act { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--ivory); border-radius: 10px; }
.mgr-act-ico { display: inline-flex; color: var(--navy-bright); flex: 0 0 auto; }
.mgr-act-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.mgr-act-title { font-weight: 600; color: var(--ink); display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap; }
.mgr-act-meta { font-size: 12px; color: var(--ink-50); }
.mgr-act-btns { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }

/* Filas de actividad en el temario del reproductor (alumno) */
.act-row { cursor: pointer; }
.act-row .lt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Modal de reautorización: listado de alumnos */
.reauth-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); }
.reauth-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.reauth-name { font-weight: 600; color: var(--ink); display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap; }
.reauth-meta { font-size: 12px; color: var(--ink-50); }

/* Tema oscuro: legibilidad */
.mgr-act-title, .reauth-name { color: var(--ink); }

/* ============================================================
   Dashboard: tarjetas enlazables + anillo + gráfico de avance
   ============================================================ */

/* Tarjetas de estadística que redirigen */
a.stat-card-link { text-decoration: none; color: inherit; display: block; cursor: pointer; }
.stat-card-link:hover { border-color: var(--navy); }
.stat-card-link .stat-go { position: absolute; top: 18px; right: 16px; color: var(--ink-50);
  opacity: 0; transform: translateX(-4px); transition: all 0.22s; }
.stat-card-link:hover .stat-go { opacity: 1; transform: translateX(0); color: var(--navy-bright); }
.stat-sub { font-size: 11.5px; color: var(--navy-bright); margin-top: 6px; font-weight: 500;
  display: flex; align-items: center; gap: 4px; }

/* Anillo de progreso (SVG) dentro de la tarjeta */
.stat-ring { line-height: 0; }
.stat-ring .ring-bg { stroke: var(--line-medium); }
.stat-ring .ring-fg { stroke: var(--gold-bright); transition: stroke-dashoffset 0.9s ease; }
.stat-ring .ring-txt { font-family: var(--font-display); font-size: 15px; font-weight: 700;
  fill: var(--ink); }

/* Mini gráfico: avance por curso */
.prog-chart { display: flex; flex-direction: column; gap: 12px; }
.prog-row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 12px; }
.prog-name { font-size: 14px; color: var(--ink); font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.prog-track { height: 10px; background: var(--ivory); border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line); }
.prog-fill { display: block; height: 100%; border-radius: 999px; background: var(--grad-gold-shimmer);
  box-shadow: 0 0 8px rgba(157,92,245,0.5); transition: width 0.9s ease;
  transform-origin: left center; animation: barGrow 1s cubic-bezier(0.22,1,0.36,1) both; }
.prog-pct { font-size: 12px; color: var(--ink-50); text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .prog-row { grid-template-columns: 110px 1fr 40px; gap: 8px; }
}

/* Legibilidad de nuevos elementos sobre fondo oscuro */
.prog-name { color: var(--ink-70); }

/* --- Micro-gráficos SVG: sparkline --- */
.prog-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prog-spark { flex: 0 0 auto; color: var(--morado, #6C5DD3); line-height: 0; }
.spark { display: block; overflow: visible; }
.spark-dot { filter: drop-shadow(0 0 3px currentColor); }
.spark-draw { stroke-dasharray: 420; stroke-dashoffset: 420;
  animation: sparkDraw 1.2s cubic-bezier(0.22,1,0.36,1) forwards; }
.spark-area { opacity: 0; animation: sparkFade 0.6s ease 0.5s forwards; }
@keyframes sparkDraw { to { stroke-dashoffset: 0; } }
@keyframes sparkFade { to { opacity: 1; } }
/* Sparkline dentro de una tarjeta de estadística */
.stat-spark { margin-top: 10px; color: var(--morado, #6C5DD3); line-height: 0; }
html[data-theme="dark"] .prog-spark, html[data-theme="dark"] .stat-spark { color: var(--menta, #8fd6e0); }

/* Bandeja "Por calificar": cabecera con filtro por materia */
.gi-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.gi-filter { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.gi-filter > span { font-size: 12px; color: var(--ink-70); font-weight: 600; }
.gi-filter select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--ivory); color: var(--ink); font: inherit; cursor: pointer; }
.gi-row { cursor: pointer; }
.gi-row .assign-right { display: flex; align-items: center; gap: 8px; }
.gi-none { padding: 6px 0; }
@media (max-width: 620px) {
  .gi-head { flex-direction: column; align-items: stretch; }
  .gi-filter { min-width: 0; }
}

/* ---- Publicación de cursos y autorización de inscripciones ---- */
.pub-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; margin: 12px 0; border: 1px solid var(--line-medium);
  border-left: 4px solid var(--navy-bright); border-radius: var(--radius-sm);
  background: var(--sky, #f2f6fc); }
.pub-bar.pub-review { border-left-color: var(--gold); background: var(--gold-pale); }
.pub-bar.pub-ok { border-left-color: #1a9d5a; background: rgba(26,157,90,0.08); }
.pub-info b { display: block; color: var(--navy-deepest); }
.pub-actions { display: flex; gap: 8px; flex-shrink: 0; }

.enroll-pending { border-left: 4px solid var(--gold); }

.req-row { display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--line); }
.req-row:last-child { border-bottom: 0; }
.req-av { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--grad-navy); color: var(--gold-bright); }
.req-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.req-name { font-weight: 600; color: var(--navy-deepest); }
.req-btns { display: flex; gap: 8px; flex-shrink: 0; }
td.nowrap { white-space: nowrap; }
td.nowrap .btn { margin-left: 6px; }

@media (max-width: 620px) {
  .pub-bar { flex-direction: column; align-items: stretch; }
  .req-row { flex-wrap: wrap; }
}

/* ---- Configuración (tuerca del topbar) ---- */
.settings-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.st-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--ink-70); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.st-tab:hover { background: var(--sky, #f2f6fc); }
.st-tab.active { background: var(--grad-gold); color: #ffffff; border-color: transparent; }
.st-panel { display: none; }
.st-panel.active { display: block; }
.st-hint { color: var(--ink-70); font-size: 14px; margin: 0 0 12px; }
.st-choice { display: flex; gap: 16px; }
.st-choice label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.st-account { display: flex; align-items: center; gap: 14px; padding: 4px 0 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.st-account-name { font-weight: 700; color: var(--navy-deepest); }
.st-account-meta, .st-account-org { font-size: 14px; color: var(--ink-70); }
.st-account-org { margin-top: 2px; }
.st-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.st-about { border-top: 1px solid var(--line); padding-top: 12px; }
.st-about-brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
  color: var(--navy-deepest); margin-bottom: 4px; }

/* Círculo dorado del temario clickeable (marcar/desmarcar la lección activa) */
.lesson-check.check-clickable { cursor: pointer; }
.lesson-check.check-clickable:hover { box-shadow: 0 0 0 3px rgba(76, 169, 190, 0.35); }

/* ---- Panel de inscripciones (#/requests) ---- */
.enr-wrap { display: flex; flex-direction: column; gap: 18px; }
.enr-card { background: var(--paper); border: 1px solid var(--line-medium);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-soft); }
.enr-card-focus { border-color: var(--gold); box-shadow: var(--shadow-gold); }
.enr-card-head { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line); }
.enr-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.enr-title h2 { font-size: 18px; margin: 0; color: var(--navy-deepest); }
.enr-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.enr-chip { font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: var(--sky); color: var(--navy);
  border: 1px solid var(--line-medium); }
.enr-chip-gold { background: var(--gold-pale); color: var(--gold-deep); border-color: var(--gold); }
.enr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.enr-col-h { display: flex; align-items: center; gap: 7px; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-50);
  font-weight: 700; margin: 0 0 8px; }
.enr-col-h svg { width: 14px; height: 14px; stroke: var(--gold-deep); stroke-width: 1.8; fill: none; }
.enr-list { display: flex; flex-direction: column; }
.enr-row { display: flex; align-items: center; gap: 11px; padding: 9px 0;
  border-bottom: 1px solid var(--line); }
.enr-row:last-child { border-bottom: 0; }
.enr-av { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 13.5px;
  background: var(--grad-navy); color: var(--gold-bright); }
.enr-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.enr-name { font-weight: 600; color: var(--navy-deepest); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.enr-when { font-size: 11px; flex-shrink: 0; }
.enr-btns { display: flex; gap: 7px; flex-shrink: 0; }
.enr-prog { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 120px; }
.enr-prog .pbar { flex: 1; }
.enr-pct { font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--gold-deep); min-width: 34px; text-align: right; }
.enr-empty { padding: 12px 0; font-size: 14px; }
@media (max-width: 760px) {
  .enr-cols { grid-template-columns: 1fr; gap: 16px; }
  .enr-row { flex-wrap: wrap; }
}

/* ---- Información general del curso (tabla estilo Nasatya) ------------------
   Columna clave (izquierda) en degradado azul marino con icono turquesa y
   etiqueta blanca; columna de valor (derecha) sobre papel. Reemplaza el
   naranja/gris del diseño de referencia por la identidad Nasatya. */
.cinfo-section { margin: 22px 0 4px; }
.cinfo-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--ink); margin-bottom: 12px; }
.cinfo-title .icon { color: var(--gold); }

.cinfo-table {
  border: 1px solid var(--line-medium); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--shadow-soft); background: var(--paper); }
.cinfo-row { display: grid; grid-template-columns: 210px 1fr; }
.cinfo-row + .cinfo-row { border-top: 1px solid var(--line); }

.cinfo-key {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(155deg, #43379A 0%, #2C2568 100%); color: #fff;
  padding: 16px 18px; font-family: var(--font-display);
  font-weight: 600; font-size: 15px; line-height: 1.3; }
.cinfo-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.16); color: #8FD5E2; }
.cinfo-ico .icon { color: #8FD5E2; }

.cinfo-val {
  padding: 15px 20px; color: var(--ink-70); font-size: 15px;
  line-height: 1.55; background: var(--paper); }
.cinfo-val .cinfo-p { margin: 0; }
.cinfo-list { list-style: none; margin: 0; padding: 0; }
.cinfo-list li { position: relative; padding-left: 18px; margin: 3px 0; }
.cinfo-list li::before {
  content: ""; position: absolute; left: 2px; top: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); }
.cinfo-temario li::before { top: 9px; background: var(--gold-bright); }
.cinfo-temario li b { color: var(--ink); font-family: var(--font-display); }

@media (max-width: 560px) {
  .cinfo-row { grid-template-columns: 1fr; }
  .cinfo-key { padding: 12px 16px; }
}

/* Vista previa dentro del editor de información general */
.cinfo-preview-wrap { margin: 6px 0 4px; }
.cinfo-preview-wrap > #ci-preview { margin-top: 6px; }

/* Preferencias de accesibilidad aplicadas al documento */
html[data-fontsize="lg"] { font-size: 18px; }
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
