/* Plataforma de formación · marca Ultercore (la misma que la pantalla de entrada y que Ministudio).
   Patrones (los mismos en todas las pantallas):
   - Marco: menú lateral oscuro a la izquierda y el contenido en un panel blanco, como la pantalla de entrada.
   - Cabecera de página: ruta, título y explicación a la izquierda; botones de la página a la derecha;
     pestañas debajo si las hay.
   - Listas en tablas o filas con filete fino; acciones de fila a la derecha, pequeñas.
   - Borrar va aparte, en su recuadro, con lo que pasa explicado.
   - El estado se dice con un punto de color y texto, no con etiquetas rellenas.
   - Botón principal en tinta oscura. El rojo de marca no es para botones: solo para la sección activa,
     el foco y lo nuevo o pendiente de atender. */

:root {
  --ink: #1f1b1b;
  --ink-2: #2d2828;
  --ink-3: #3d3737;
  --brand-red: #e63232;

  --primary: var(--ink);
  --primary-hover: var(--ink-2);
  --primary-soft: #f3f0ed;
  --accent: var(--brand-red);
  --accent-soft: #fdecec;

  --bg: #f6f4f1;
  --surface: #ffffff;
  --surface-2: #f8f7f5;
  --border: #e7e3df;
  --hair: #efece8;
  --input: #d9d4cf;

  --text: #1c1a19;
  --text-2: #3d3936;
  --muted: #6f6964;

  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --private: #6d4bb5;
  --private-soft: #f5f1fb;

  /* Menú lateral oscuro */
  --side-text: #d6d1cc;
  --side-muted: #8d8680;
  --side-hover: rgba(255, 255, 255, .06);
  --side-line: rgba(255, 255, 255, .1);

  --sidebar-width: 264px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-brand: "Aldrich", var(--font);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.is-student { font-size: 16px; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--input); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--brand-red); }
.btn, .side-link, .course-picker-menu a, .tabs a, .session-card, .kpi, .logo, .cell-title, .crumbs a, .feed-item a { text-decoration: none; }
.cell-title:hover, .feed-item a:hover { text-decoration: underline; text-decoration-color: var(--brand-red); }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }
[data-lucide], .lucide { width: 1.15em; height: 1.15em; stroke-width: 2; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: .86em; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

/* ───────────── Marco ───────────── */

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 30;
  display: flex; flex-direction: column; background: var(--ink); color: var(--side-text);
}
.sidebar-top { padding: 24px 16px 0; display: flex; flex-direction: column; gap: 18px; }
/* Logo de producto: «ultercore» grande y el nombre del producto debajo, más pequeño, alineado a la izquierda. */
.logo { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 0 8px; color: #fff; }
.logo img { width: 150px; height: auto; display: block; }
.logo-brand { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.logo-product { font-family: var(--font-brand); font-size: 17px; line-height: 1; color: #fff; }
.logo small { display: block; font-family: var(--font); font-size: 11.5px; color: var(--side-muted); margin-top: 8px; }
.mobile-bar .logo { padding: 0; }
.mobile-bar .logo img { width: 112px; }
.mobile-bar .logo-product { font-size: 13px; }

.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 16px 16px; }
.side-heading {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 8px 8px; margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--side-muted);
}
.side-link {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 2px;
  border-radius: 8px; color: var(--side-text); font-weight: 500;
}
.side-link svg { color: var(--side-muted); }
.side-link:hover { background: var(--side-hover); color: #fff; }
.side-link:hover svg { color: #fff; }
.side-link[aria-current="page"] { background: rgba(255, 255, 255, .09); color: #fff; font-weight: 650; }
.side-link[aria-current="page"] svg { color: #fff; }
/* La sección activa lleva la raya roja de la marca, como el título de la pantalla de entrada. */
.side-link[aria-current="page"]::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-red);
}
.side-link .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 1px solid var(--input);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); flex-shrink: 0;
}
.sidebar .side-num { background: transparent; border-color: var(--side-line); color: var(--side-muted); }
.sidebar .side-link[aria-current="page"] .side-num { border-color: var(--brand-red); color: #fff; }
.side-num.done { background: var(--ink); border-color: var(--ink); color: #fff; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--side-line);
}
.sidebar-user .who { flex: 1; min-width: 0; }
.sidebar-user .who strong { display: block; font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .who span { display: block; font-size: 11.5px; color: var(--side-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .avatar { background: transparent; border-color: var(--side-line); color: #fff; }
.sidebar-user .btn.ghost { color: var(--side-muted); }
.sidebar-user .btn.ghost:hover { background: var(--side-hover); color: #fff; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; background: var(--surface); border: 1px solid var(--input); color: var(--text-2);
}
.avatar.course { background: var(--brand-red); border-color: var(--brand-red); color: #fff; border-radius: 9px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }

/* Selector de curso: el curso en el que se trabaja, arriba del menú. */
.course-picker { position: relative; }
.course-picker > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--side-line); border-radius: 10px; color: #fff;
}
.course-picker > summary::-webkit-details-marker { display: none; }
.course-picker > summary:hover { border-color: rgba(255, 255, 255, .25); }
.course-picker > summary .avatar:not(.course) { background: transparent; border-color: var(--side-line); color: var(--side-text); }
.course-picker > summary .muted { color: var(--side-muted); }
.course-picker .current { flex: 1; min-width: 0; }
.course-picker .current small { display: block; font-size: 11px; color: var(--side-muted); line-height: 1.2; }
.course-picker .current strong { display: block; font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-picker-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--input); border-radius: 11px; padding: 6px; color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}
.course-picker-menu a {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 7px; color: var(--text);
}
.course-picker-menu a:hover { background: var(--bg); }
.course-picker-menu a[aria-current="true"] { font-weight: 650; }
.course-picker-menu .sep { border-top: 1px solid var(--hair); margin: 5px 8px; }

.main {
  margin: 10px 10px 10px var(--sidebar-width); min-height: calc(100vh - 20px);
  background: var(--surface); border-radius: 16px;
  display: flex; flex-direction: column;
}
.content { flex: 1; padding: 30px 36px 44px; display: flex; flex-direction: column; gap: 22px; }
.content.narrow { max-width: 860px; }
body.is-student .content { max-width: 820px; }
.footer { display: flex; align-items: center; gap: 8px; padding: 14px 36px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--hair); }
.footer::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--brand-red); }

.mobile-bar { display: none; }
.backdrop { display: none; }

@media (max-width: 1023px) {
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20; padding: 12px 16px; background: var(--ink);
  }
  .mobile-bar .btn.ghost, .mobile-bar button.ghost { color: #fff; }
  .mobile-bar .btn.ghost:hover, .mobile-bar button.ghost:hover { background: var(--side-hover); }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .45); }
  .main { margin: 0 8px 8px; min-height: calc(100vh - 70px); }
  .content { padding: 22px 16px 32px; }
  .footer { padding: 12px 16px; }
}

/* ───────────── Cabecera de página ───────────── */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.page-head .titles { min-width: 0; }
.crumbs { margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.page-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.page-title h1 { font-size: 20px; font-weight: 700; }
body.is-student .page-title h1 { font-size: 24px; }
.page-sub { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.tabs { display: flex; gap: 20px; margin-top: -10px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; }
.tabs a {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 0; border-bottom: 2px solid transparent;
  color: var(--muted); white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { border-bottom-color: var(--brand-red); color: var(--text); font-weight: 650; }

/* Ayuda plegada tras un botón de la cabecera. */
.help { position: relative; }
.help > summary { list-style: none; }
.help > summary::-webkit-details-marker { display: none; }
.help-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 26rem; max-width: calc(100vw - 2rem);
  background: var(--surface); border: 1px solid var(--input); border-radius: 12px; padding: 16px;
  box-shadow: 0 12px 32px rgba(28, 27, 26, .14); font-size: 13px; color: var(--text-2);
}

/* ───────────── Botones ───────────── */

.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px;
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
  border-radius: 8px; border: 1px solid var(--input); background: var(--surface); color: var(--text);
}
.btn:hover, button:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary, button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover, button.primary:hover { background: var(--primary-hover); }
.btn.ghost, button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover, button.ghost:hover { background: var(--bg); }
.btn.danger, button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost.danger, button.ghost.danger { background: transparent; border-color: transparent; color: var(--danger); }
.btn.ghost.danger:hover, button.ghost.danger:hover { background: #fdf0f0; }
.btn.sm, button.sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn.icon, button.icon { width: 34px; padding: 0; }
.btn.sm.icon, button.sm.icon { width: 28px; }
.inline { display: inline; margin: 0; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }

/* ───────────── Formularios ───────────── */

.form { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.form.wide { max-width: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.field-help { font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--input); border-radius: 8px; padding: 8px 11px;
}
input[type=text], input[type=email], input[type=password], input[type=date], select { height: 36px; }
input:focus, textarea:focus, select:focus { outline: 3px solid #fbe3e3; border-color: var(--ink); }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 380px; }
textarea.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--primary); }
.check strong { display: block; font-size: 13px; }
.check span { display: block; font-size: 12px; color: var(--muted); }
.choice { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.fields-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .fields-2 { grid-template-columns: 1fr; } }

.group-heading {
  margin: 8px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.group-heading:first-child, input[type=hidden]:first-child + .group-heading { margin-top: 0; }
.group-heading .grow { flex: 1; }
.group-heading .btn, .group-heading button { text-transform: none; letter-spacing: 0; }

/* ───────────── Contenido ───────────── */

.cols { display: grid; gap: 24px 40px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.cols.main-side { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 1100px) { .cols, .cols.main-side { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.panel { border: 1px solid var(--border); border-radius: 11px; padding: 16px 18px; }
.panel.private { border-color: #ddd2f2; background: var(--private-soft); }
.panel-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.panel-title .grow { flex: 1; }
.panel-danger { border: 1px solid var(--hair); border-radius: 11px; padding: 16px 18px; }
.panel-danger .t { font-weight: 700; color: var(--danger); font-size: 13px; }
.panel-danger p { font-size: 12.5px; color: var(--muted); margin: 4px 0 12px; }

.table-wrap { border: 1px solid var(--border); border-radius: 11px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 9px 14px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.table td { border-bottom: 1px solid var(--hair); padding: 11px 14px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #faf9f7; }
.table .right { text-align: right; }
.table .shrink { width: 1%; white-space: nowrap; }
.cell-title { font-weight: 650; color: var(--text); }
.cell-sub { display: block; font-size: 12px; color: var(--muted); }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; color: var(--text-2); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); }
.dot.accent { background: var(--accent); }
.dot.primary { background: var(--primary); }
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 650;
  border: 1px solid var(--border); color: var(--text-2); white-space: nowrap;
}
.tag.private { border-color: #ddd2f2; color: var(--private); background: var(--surface); }

.flash { padding: 10px 14px; border: 1px solid var(--hair); border-left: 3px solid var(--primary); border-radius: 9px; color: var(--text-2); }
.flash.ok { border-left-color: var(--ok); }
.flash.error { border-left-color: var(--danger); }
.flash.accent { border-left-color: var(--accent); }

.note { padding: 2px 0 2px 12px; border-left: 2px solid var(--input); color: var(--text-2); font-size: 13px; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; text-align: center;
  border: 1px dashed var(--input); border-radius: 12px; color: var(--muted);
}
.empty p { max-width: 46ch; margin: 0; }

/* Ventana para formularios cortos (nuevo curso, nueva sesión, añadir asistentes). */
dialog.modal {
  width: 34rem; max-width: calc(100vw - 2rem); max-height: calc(100dvh - 4rem); padding: 0;
  border: 1px solid var(--input); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .2); color: var(--text);
}
dialog.modal::backdrop { background: rgba(28, 27, 26, .35); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--hair); }
.modal-head h2 { flex: 1; font-size: 16px; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--hair); }

/* ───────────── Texto con formato (Markdown) ───────────── */

.prose { line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .3em; }
.prose h1, .prose h2, .prose h3 { margin: 1.3em 0 .5em; }
.prose h1 { font-size: 1.35em; }
.prose h2 { font-size: 1.2em; }
.prose h3 { font-size: 1.05em; }
.prose blockquote {
  margin: 0 0 1em; padding: 10px 14px; border-left: 3px solid var(--brand-red); background: var(--surface-2);
  border-radius: 0 8px 8px 0; color: var(--text-2);
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.prose pre { background: var(--bg); padding: 12px 14px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; margin-bottom: 1em; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.prose img { max-width: 100%; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em 0; }

/* ───────────── Ejercicios, respuestas y mensajes ───────────── */

.exercise { border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; scroll-margin-top: 20px; }
.exercise-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px; }
.exercise-head h3 { flex: 1; font-size: 1.05em; }
.exercise .prose { margin-bottom: 14px; }
.feedback { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--ok); background: #f0f8f2; border-radius: 0 8px 8px 0; }
.feedback strong { display: block; font-size: .86em; color: var(--ok); margin-bottom: 2px; }

.answer { padding: 14px 0; border-bottom: 1px solid var(--hair); scroll-margin-top: 20px; }
.answer:last-child { border-bottom: 0; padding-bottom: 0; }
.answer-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.answer-text { white-space: pre-wrap; word-wrap: break-word; margin: 8px 0 10px 36px; }
.answer form { margin-left: 36px; display: flex; flex-direction: column; gap: 8px; }
.answer textarea { min-height: 64px; }

.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); white-space: pre-wrap; word-wrap: break-word;
}
.bubble.mine { align-self: flex-end; background: var(--primary-soft); border-color: transparent; }
.bubble .meta { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; white-space: normal; }
@media (max-width: 600px) { .bubble { max-width: 94%; } }

.progress { display: inline-flex; gap: 3px; vertical-align: middle; }
.progress i { width: 16px; height: 5px; border-radius: 3px; background: var(--border); }
.progress i.on { background: var(--primary); }

/* Tarjetas de sesión en el inicio del asistente. */
.session-card {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; color: var(--text);
}
.session-card:hover { border-color: var(--primary); text-decoration: none; }
.session-card .n {
  width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
}
.session-card .grow { flex: 1; min-width: 0; }
.session-card strong { display: block; }

/* ───────────── Resumen del curso ───────────── */

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 11px; color: var(--text); }
.kpi:hover { border-color: var(--primary); text-decoration: none; }
.kpi-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-value.accent, .kpi-note.accent { color: var(--accent); }
.kpi-note { font-size: 12px; color: var(--muted); }

.table .center { text-align: center; }
.mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: 1.5px dashed var(--input); vertical-align: middle; }
.mark.done { border: 0; background: var(--primary); color: #fff; }
.mark.done svg { width: 14px; height: 14px; stroke-width: 3; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item a { color: var(--text-2); }
.feed-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg); color: var(--muted); }
.feed-icon svg { width: 14px; height: 14px; }
.feed-icon.diary { background: var(--accent-soft); color: var(--accent); }
.feed-icon.answer { background: var(--primary-soft); color: var(--primary); }
.feed-time { display: block; font-size: 11.5px; color: var(--muted); }

/* ───────────── Diario ───────────── */

.diary-entry { border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.diary-entry.unseen { border-color: var(--accent); }
.diary-fields { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 14px; margin: 12px 0 0; }
.diary-fields dt { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.diary-fields dd { margin: 0; white-space: pre-wrap; word-wrap: break-word; }
@media (max-width: 600px) { .diary-fields { grid-template-columns: 1fr; } .diary-fields dd { margin-bottom: 8px; } }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choices .choice { padding: 8px 12px; align-items: center; }

/* ───────────── Guion (dar la clase) ───────────── */

.side-sticky { position: sticky; top: 20px; }
@media (max-width: 1100px) { .side-sticky { position: static; } }
.block { display: flex; gap: 18px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; scroll-margin-top: 20px; }
.block-time { width: 52px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.block-time strong { font-size: 15px; }
.block-time span { font-size: 11.5px; color: var(--muted); }
.block-body { flex: 1; min-width: 0; }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.block-head h2 { flex: 1; font-size: 16px; }
.block-now { display: none; }
.block.now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.block.now .block-now { display: inline-flex; }
.block.past { opacity: .55; }
.block.past:hover { opacity: 1; }
.prose pre { position: relative; padding-right: 84px; }
.guion-prose pre { border-left: 3px solid var(--primary); }
.prose pre .copy { position: absolute; top: 8px; right: 8px; font-family: var(--font); }
.guion-prose li:has(input[type=checkbox]) { list-style: none; margin-left: -1.4em; }
/* La casilla va fuera del texto, a la izquierda, para que una palabra en negrita no parta la línea en columnas. */
.guion-prose li:has(input[type=checkbox]) { position: relative; padding-left: 26px; }
.guion-prose input[type=checkbox] { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.timer { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: 34px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.timer[hidden] { display: none; }
.timer .muted { font-weight: 500; }
.timer.over { background: var(--accent-soft); color: var(--accent); }

/* ───────────── Entrada ───────────── */

/* Marca Ultercore (la misma que Ministudio): tinta oscura y el rojo solo como acento. */
.login-page {
  --ink: #1f1b1b;
  --ink-2: #2d2828;
  --brand-red: #e63232;
  background: var(--surface);
  font-size: 15px;
}
.login-split { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  gap: 40px; padding: 48px 56px; background: var(--ink); color: #fff;
}
/* Un brillo rojo muy suave en una esquina, para que el panel no sea un bloque plano. */
.login-brand::before {
  content: ""; position: absolute; right: -180px; bottom: -180px; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 50, 50, .22), transparent 65%); pointer-events: none;
}
.login-logo { position: relative; padding: 0; }
.login-logo img { width: 170px; }
.login-logo .logo-product { font-size: 19px; }
.login-pitch { position: relative; max-width: 460px; }
.login-kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: #d6d1cc;
}
.login-kicker::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--brand-red); }
.login-pitch h2 { font-family: "Aldrich", var(--font); font-weight: 400; font-size: 40px; line-height: 1.15; letter-spacing: 0; margin: 0 0 36px; }
.login-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.login-features li { display: flex; gap: 14px; align-items: flex-start; color: #bdb6b0; font-size: 14px; line-height: 1.5; }
.login-features li > span {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: #fff;
}
.login-features strong { display: block; color: #fff; font-size: 15px; margin-bottom: 1px; }
.login-foot { position: relative; margin: 0; font-size: 12px; color: #8d8680; }

.login-main { display: flex; flex-direction: column; background: var(--surface); }
.login-mobile-head { display: none; }
.login-form-wrap { flex: 1; display: grid; place-items: center; padding: 48px 24px; }
.login-form { width: 100%; max-width: 380px; }
.login-form h1 { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin-bottom: 6px; }
.login-form > .muted { margin-bottom: 26px; }
.login-form .flash { margin-bottom: 18px; }
.login-form input[type=email], .login-form input[type=password], .login-form input[type=text] { height: 46px; font-size: 15px; }
.login-form input:focus { outline-color: #fbe3e3; border-color: var(--ink); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 84px; }
.password-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.caps { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); font-weight: 600; }
.login-submit {
  width: 100%; height: 48px; margin-top: 4px; font-size: 15px; border: 0;
  background: var(--ink); color: #fff;
}
.login-submit:hover { background: var(--ink-2); }
.login-help { margin-top: 22px; font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-mobile-head { display: flex; padding: 16px 20px; background: var(--ink); }
  .login-mobile-head .logo { padding: 0; }
  .login-mobile-head .logo img { width: 118px; }
  .login-mobile-head .logo-product { font-size: 14px; }
  .login-form-wrap { place-items: start center; padding: 36px 20px; }
}
