/* =========================================================================
   WeClass · Design System P1 "Certificado en curso"
   Fuente de verdad: Figma "P1 · UI Kit" (3867:32) y "P1 · Design System" (3870:1568).
   Regla: toda pantalla usa estas clases. No se inventan colores ni radios nuevos.
   ========================================================================= */

:root {
  /* Acción (azul cliente) */
  --azul: #006EB1;
  --azul-hover: #005A96;
  --azul-presionado: #0B3A7E;
  --azul-suave: #EAF6FC;
  --azul-texto: #005A96;
  --noche: #121A69;
  /* Registrado (Sea Serpent) */
  --registrada: #47CED7;
  --registrada-borde: #329299;
  --registrada-texto: #277176;
  --registrada-suave: #E6F8F9;
  /* Grafito */
  --texto: #141B22;
  --texto-2: #4B5966;
  --texto-3: #8494A2; /* solo deshabilitado / decorativo */
  --borde: #E4EAEF;
  --hoja: #F1F5F8;
  --superficie: #FFFFFF;
  /* Estados */
  --riesgo: #A51212;
  --riesgo-suave: #FDECEC;
  --exito: #157A41;
  --exito-suave: #E8F7EE;
  --aviso: #6E5C0C;
  --aviso-suave: #FDF9E4;
  /* Radios */
  --r-doc: 4px;
  --r-campo: 12px;
  --r-tarjeta: 16px;
  --r-hoja: 24px;
  --r-pildora: 999px;
  /* Sombras teñidas de azul noche */
  --sombra-tarjeta: 0 1px 3px rgba(18, 26, 105, .08);
  --sombra-hover: 0 12px 28px -8px rgba(18, 26, 105, .18);
  --sombra-hoja: 0 24px 56px -12px rgba(18, 26, 105, .25);
  --sombra-modal: 0 32px 64px -16px rgba(18, 26, 105, .35);
  /* Tipografía */
  --f-texto: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --escala: 1; /* accesibilidad: 1 · 1.15 · 1.3 */
  /* Degradado del shell: transformación exacta de Figma (3862:33) → CSS: va de azul a la derecha a noche a la izquierda */
  --gradiente: linear-gradient(254deg, #006EB1 9.6%, #005A96 37.9%, #121A69 90.4%);
  --gradiente-hero: linear-gradient(238deg, #006EB1 21.7%, #005A96 47.2%, #121A69 78.3%);
  --rayado: repeating-linear-gradient(135deg, #006EB1 0 2px, #EAF6FC 2px 6px);
  --dur: 160ms;
}
html[data-texto="115"] { --escala: 1.15; }
html[data-texto="130"] { --escala: 1.3; }
html[data-movimiento="reducido"] * { transition: none !important; animation: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(16px * var(--escala)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--f-texto); color: var(--texto); background: var(--hoja);
  font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--azul); text-underline-offset: 3px; }
a:hover { color: var(--azul-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Tipografía (estilos P1/*) ---------- */
.t-display { font-size: 2.5rem; line-height: 3rem; font-weight: 600; color: var(--noche); letter-spacing: -.01em; margin: 0; }
.t-h1 { font-size: 1.75rem; line-height: 2.25rem; font-weight: 600; color: var(--noche); margin: 0; }
.t-h2 { font-size: 1.375rem; line-height: 1.875rem; font-weight: 600; color: var(--noche); margin: 0; }
.t-h3 { font-size: 1.125rem; line-height: 1.625rem; font-weight: 600; color: var(--texto); margin: 0; }
.t-cuerpo { font-size: 1rem; line-height: 1.5rem; margin: 0; }
.t-cuerpo-sm { font-size: .875rem; line-height: 1.375rem; margin: 0; }
.t-etiqueta { font-size: .9375rem; font-weight: 600; line-height: 1.375rem; }
.t-etiqueta-sm { font-size: .8125rem; font-weight: 600; line-height: 1.125rem; }
.t-caption { font-size: .8125rem; line-height: 1.125rem; color: var(--texto-2); margin: 0; }
.t-overline { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-2); margin: 0; }
.t-dato, .mono { font-family: var(--f-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.t-dato { font-size: .875rem; }
.t-2 { color: var(--texto-2); }
.t-riesgo { color: var(--riesgo); }
.t-registrada { color: var(--registrada-texto); }
.t-exito { color: var(--exito); }
.t-azul { color: var(--azul); }
.t-noche { color: var(--noche); }
.t-centro { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- Layout utilitario ---------- */
.pila { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.fila { display: flex; align-items: center; gap: var(--gap, 12px); }
.fila-arriba { display: flex; align-items: flex-start; gap: var(--gap, 12px); }
.envolver { flex-wrap: wrap; }
.entre { justify-content: space-between; }
.fin { justify-content: flex-end; }
.crece { flex: 1 1 0; min-width: 0; }
.g2 { --gap: 2px; } .g6 { --gap: 6px; } .g20 { --gap: 20px; } .g4 { --gap: 4px; } .g8 { --gap: 8px; } .g12 { --gap: 12px; } .g16 { --gap: 16px; } .g24 { --gap: 24px; } .g32 { --gap: 32px; }
.rejilla { display: grid; gap: var(--gap, 24px); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.rejilla-auto { display: grid; gap: var(--gap, 24px); grid-template-columns: repeat(auto-fill, minmax(var(--min, 260px), 1fr)); }
.col-2-1 { display: grid; gap: 24px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.col-1-2 { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.ancho-texto { max-width: 64ch; }

/* ---------- Shell (desktop): gradiente + sidebar 272 + hoja ---------- */
.shell { min-height: 100vh; background: var(--gradiente); display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.sidebar { color: #fff; padding: 28px 20px 24px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none; }
.sidebar .logo { display: block; padding: 0 0 20px 12px; }
.sidebar .logo img { width: 132px; height: 26px; }
.nav-grupo { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; }
.nav-grupo .t-overline { color: #fff; font-size: 12px; line-height: 16px; letter-spacing: .08em; padding: 0 0 6px 14px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px 0 14px; border-radius: var(--r-pildora);
  color: #fff; text-decoration: none; font-weight: 400; font-size: 14px; line-height: 20px; transition: background var(--dur);
}
.nav-item:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.nav-item .i { width: 22px; height: 22px; flex: none; }
.nav-item .nav-texto { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item[aria-current="page"] { background: #fff; color: var(--noche); font-weight: 600; font-size: 15px; }
.nav-item[aria-current="page"] .i { color: var(--noche); }
.nav-contador { font-size: 13px; font-weight: 600; line-height: 16px; min-width: 24px; height: 24px; padding: 4px 8px; border-radius: var(--r-pildora); background: var(--registrada); color: var(--texto); display: inline-grid; place-items: center; }
.sidebar-espacio { flex: 1; min-height: 16px; }
.sidebar-semana { margin: 8px 0 12px; padding: 14px 16px; border-radius: var(--r-tarjeta); background: var(--noche); border: 1px solid rgba(255, 255, 255, .18); display: flex; flex-direction: column; gap: 10px; }
.sidebar-semana strong { font-size: 13px; font-weight: 500; line-height: 16px; }
.sidebar-semana .dias { display: flex; justify-content: space-between; }
.sidebar-semana .dia { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .9); }
.sidebar-semana .dia i { width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .10); border: 1.5px solid rgba(255, 255, 255, .5); }
.sidebar-semana .dia i.si { background: var(--registrada); border-color: var(--registrada); }
.sidebar-semana .dia i.hoy { border: 2.5px solid #fff; }
.sidebar-semana p { font-size: 12px; line-height: 15px; margin: 0; }
.sidebar-empresa { display: flex; align-items: center; gap: 12px; padding: 4px 0 8px 12px; }
.sidebar-empresa .siglas { width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--noche); font-weight: 700; font-size: 15px; display: grid; place-items: center; flex: none; }
.sidebar-empresa strong { display: block; font-size: 15px; font-weight: 600; line-height: 20px; }
.sidebar-empresa span { font-size: 13px; line-height: 18px; }
.sidebar-pie { position: relative; }
.sidebar-pie > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 0 0; }
.sidebar-pie > summary::-webkit-details-marker { display: none; }
.sidebar-empresa-caja { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 0 8px; border-radius: 12px; background: rgba(255, 255, 255, .12); }
.sidebar-empresa-caja .siglas { width: 36px; height: 36px; border-radius: 8px; background: #fff; color: var(--noche); font-weight: 700; font-size: 14px; display: grid; place-items: center; flex: none; }
.sidebar-empresa-caja strong { display: block; font-size: 15px; font-weight: 600; line-height: 20px; }
.sidebar-empresa-caja span { display: block; font-size: 13px; line-height: 18px; }
.avatar.a44 { width: 44px; height: 44px; }
.sidebar-pie .avatar, .sidebar-pie img.avatar { box-shadow: inset 0 0 0 2px #fff; border: 2px solid #fff; }
.sidebar-pie .quien { min-width: 0; flex: 1; text-decoration: none; color: #fff; }
.sidebar-pie .quien strong { display: block; font-size: 15px; font-weight: 600; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-pie .quien span { display: block; font-size: 13px; line-height: 18px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-pie a, .sidebar-pie button { color: #fff; }

.hoja {
  margin: 16px 16px 16px 0; background: var(--hoja); border-radius: var(--r-hoja); box-shadow: var(--sombra-hoja);
  padding: 28px 36px 36px; display: flex; flex-direction: column; gap: 24px; min-width: 0;
}
.barra-superior { display: flex; align-items: center; gap: 16px; }
.barra-superior .titulo { flex: 1; min-width: 0; }
.barra-superior .titulo .t-caption { margin-bottom: 2px; font-size: 13px; line-height: 16px; }
.barra-superior h1 { font-size: 28px; line-height: 36px; font-weight: 600; color: var(--noche); margin: 0; }
.barra-superior { gap: 12px; }

/* Mobile header y barra inferior (≤ 768) */
.mobile-header, .barra-inferior { display: none; }
@media (max-width: 860px) {
  .shell { display: block; background: var(--hoja); }
  .sidebar { display: none; }
  .mobile-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--gradiente); color: #fff;
    padding: 16px 16px 28px; border-radius: 0 0 var(--r-hoja) var(--r-hoja); min-height: 96px;
  }
  .mobile-header img { width: 112px; }
  .hoja { margin: -12px 0 0; border-radius: var(--r-hoja) var(--r-hoja) 0 0; box-shadow: none; padding: 20px 16px 104px; }
  .barra-superior .buscador, .barra-superior .solo-desktop { display: none; }
  .barra-inferior {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: 1px solid var(--borde);
  }
  html[data-glass="no"] .barra-inferior { background: #fff; backdrop-filter: none; }
  .barra-inferior a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center; border-radius: var(--r-pildora); color: var(--texto-2); text-decoration: none; font-size: .75rem; font-weight: 500; }
  .barra-inferior a .i { width: 22px; height: 22px; }
  .barra-inferior a[aria-current="page"] { background: var(--azul-suave); color: var(--azul-texto); font-weight: 600; }
  .rejilla, .col-2-1, .col-1-2 { grid-template-columns: minmax(0, 1fr); }
  .t-display { font-size: 2rem; line-height: 2.5rem; }
  .solo-desktop { display: none !important; }
}
@media (min-width: 861px) { .solo-mobile { display: none !important; } }

/* ---------- Íconos ---------- */
.i { width: 20px; height: 20px; flex: none; fill: currentColor; }
.i-16 { width: 16px; height: 16px; } .i-24 { width: 24px; height: 24px; } .i-32 { width: 32px; height: 32px; } .i-48 { width: 48px; height: 48px; }

/* ---------- Botones (P1/Botón: Variante × Tamaño × Estado) ---------- */
.btn {
  --alto: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--alto);
  padding: 0 24px; border-radius: var(--r-pildora); border: 1.5px solid transparent; font-weight: 600; font-size: 15px; line-height: 20px;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background var(--dur), color var(--dur), border-color var(--dur), box-shadow var(--dur);
  background: var(--azul); color: #fff;
}
.btn:hover { background: var(--azul-hover); color: #fff; }
.btn:active { background: var(--azul-presionado); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--borde); color: var(--texto-3); cursor: not-allowed; border-color: transparent; }
.btn .i { width: 18px; height: 18px; }
.btn-m { --alto: 40px; padding: 0 18px; }
.btn-s { --alto: 40px; padding: 0 14px; font-size: 13px; } /* el kit tiene S=32; en pantallas nunca bajo 40 px */
.btn-s .i { width: 14px; height: 14px; }
.btn-l { --alto: 56px; padding: 0 28px; } /* botón SENCE mobile */
.btn-bloque { width: 100%; }
.btn-secundario { background: transparent; color: var(--azul); border-color: var(--azul); }
.btn-secundario:hover { background: var(--azul-suave); color: var(--azul-hover); }
.btn-terciario { background: transparent; color: var(--azul); padding: 0 4px; }
.btn-terciario:hover { background: var(--azul-suave); color: var(--azul-hover); }
.btn-peligro { background: var(--riesgo); color: #fff; }
.btn-peligro:hover { background: #870E0E; }
.btn-sobre-azul { background: #fff; color: var(--noche); }
.btn-sobre-azul:hover { background: var(--azul-suave); color: var(--noche); }
.btn-contorno-azul { background: rgba(255, 255, 255, .14); color: #fff; border-color: #fff; }
.btn-contorno-azul:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.btn-icono {
  width: 44px; height: 44px; border-radius: var(--r-pildora); display: inline-grid; place-items: center; border: 0; cursor: pointer;
  background: #fff; color: var(--noche); box-shadow: var(--sombra-tarjeta); position: relative; text-decoration: none;
}
.btn-icono:hover { background: var(--azul-suave); color: var(--noche); }
.btn-icono.suave { background: var(--azul-suave); box-shadow: none; }
.btn-icono.fantasma { background: transparent; box-shadow: none; color: var(--texto-2); }
.btn-icono.fantasma:hover { background: var(--borde); }
.btn-icono .punto { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--riesgo); border: 2px solid #fff; }
.enlace { background: none; border: 0; padding: 0; color: var(--azul); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Campos ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > label, .campo .etiqueta { font-size: .9375rem; font-weight: 600; color: var(--texto); }
.campo .ayuda { font-size: .8125rem; color: var(--texto-2); }
.campo .error-texto { font-size: .8125rem; color: var(--riesgo); display: flex; gap: 6px; align-items: flex-start; font-weight: 500; }
.control {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; background: #fff; border: 1px solid var(--texto-3);
  border-radius: var(--r-campo); transition: border-color var(--dur), box-shadow var(--dur);
}
.control:focus-within { border-color: var(--azul); box-shadow: 0 0 0 4px rgba(0, 110, 177, .14); }
.control input, .control select, .control textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 12px 0; font-size: 1rem; }
.control textarea { resize: vertical; min-height: 120px; }
.control input::placeholder, .control textarea::placeholder { color: var(--texto-2); opacity: .85; }
.control .i { color: var(--texto-2); }
.control.mono input { font-family: var(--f-mono); }
.campo.con-error .control { border-color: var(--riesgo); }
.campo.con-error .control:focus-within { box-shadow: 0 0 0 4px rgba(165, 18, 18, .12); }
.campo.valido .control { border-color: var(--registrada-borde); }
.control.deshabilitado { background: var(--hoja); color: var(--texto-3); }
select.select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%234B5966'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; border: 1.5px solid var(--borde); border-radius: var(--r-campo); min-height: 48px; padding: 0 40px 0 14px; font-size: 1rem; }
select.select { border: 1px solid var(--texto-3); }
select.select:focus { border-color: var(--azul); outline: 0; box-shadow: 0 0 0 4px rgba(0, 110, 177, .14); }
.buscador { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px 0 16px; background: #fff; border: 1px solid var(--texto-3); border-radius: var(--r-campo); width: 360px; max-width: 100%; }
.buscador:focus-within { border-color: var(--azul); box-shadow: 0 0 0 4px rgba(0, 110, 177, .14); }
.buscador .i { width: 18px; height: 18px; color: var(--texto-2); }
.buscador input { border: 0; outline: 0; flex: 1; background: transparent; font-size: 14px; line-height: 20px; min-width: 0; }
.buscador input::placeholder { color: var(--texto-2); opacity: 1; }
.buscador kbd { font-family: var(--f-texto); font-size: 16px; font-weight: 700; line-height: 20px; color: var(--texto-2); background: var(--borde); border-radius: 6px; padding: 1px 7px; }
.barra-filtros .buscador { width: auto; }
.otp { display: flex; gap: 8px; }
.otp input { width: 48px; height: 56px; text-align: center; font-family: var(--f-mono); font-size: 22px; font-weight: 700; border: 1px solid var(--texto-3); border-radius: var(--r-campo); }
.otp input:focus { border-color: var(--azul); outline: 0; box-shadow: 0 0 0 4px rgba(0, 110, 177, .14); }

/* Casilla, radio, interruptor */
.casilla, .radio { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0; cursor: pointer; }
.casilla input, .radio input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--azul); flex: none; }
.casilla input[type=checkbox] { appearance: none; border: 1.5px solid var(--texto-3); border-radius: 6px; background: #fff; display: grid; place-items: center; cursor: pointer; }
.casilla input[type=checkbox]:checked { background: var(--azul) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='white'%3E%3Cpath d='M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--azul); }
.casilla { font-size: 16px; line-height: 26px; }
.interruptor { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.interruptor input { appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--texto-3); position: relative; flex: none; cursor: pointer; transition: background var(--dur); margin: 0; }
.interruptor input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform var(--dur); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.interruptor input:checked { background: var(--azul); }
.interruptor input:checked::after { transform: translateX(20px); }

/* Pestañas segmentadas + subrayadas */
.segmentado { display: inline-flex; gap: 4px; padding: 4px; background: var(--borde); border-radius: var(--r-pildora); flex-wrap: wrap; }
.segmentado a, .segmentado button { min-height: 44px; padding: 0 18px; border-radius: var(--r-pildora); border: 0; background: transparent; color: var(--texto-2); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer; }
.segmentado [aria-selected="true"], .segmentado [aria-current="page"] { background: #fff; color: var(--noche); font-weight: 600; box-shadow: var(--sombra-tarjeta); }
.pestanas { display: flex; gap: 24px; border-bottom: 1.5px solid var(--borde); overflow-x: auto; }
.pestanas a, .pestanas button { padding: 12px 0; min-height: 44px; border: 0; background: none; color: var(--texto-2); font-weight: 500; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; cursor: pointer; }
.pestanas [aria-selected="true"], .pestanas [aria-current="page"] { color: var(--noche); font-weight: 600; border-bottom-color: var(--azul); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; margin: 5px 0; padding: 8px 14px; border-radius: var(--r-pildora); border: 1px solid var(--texto-3); background: #fff; color: var(--texto); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--azul); color: var(--texto); }
.chip[aria-pressed="true"], .chip.activo { background: var(--azul-suave); border-color: var(--azul); color: var(--azul-texto); font-weight: 600; }
.chip .mono { font-size: .8125rem; }

/* Insignias */
.insignia { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 4px 12px 4px 10px; border-radius: var(--r-pildora); font-size: 13px; line-height: 16px; font-weight: 600; white-space: nowrap; background: var(--borde); color: var(--texto-2); }
.insignia .i { width: 14px; height: 14px; }
.insignia.registrada { background: var(--registrada); color: var(--texto); }
.insignia.al-dia, .insignia.aprobado, .insignia.valido, .insignia.respondido, .insignia.exito, .insignia.conectada { background: var(--exito-suave); color: var(--exito); }
.insignia.publicado { background: #EDFAFB; color: var(--registrada-texto); }
.insignia.sin-registrar, .insignia.abierto, .insignia.info { background: var(--azul-suave); color: var(--azul-texto); }
.insignia.riesgo, .insignia.reprobado, .insignia.revocado, .insignia.rechazado { background: var(--riesgo-suave); color: var(--riesgo); }
.insignia.bajo-minimo { background: var(--riesgo); color: #fff; }
.insignia.borrador, .insignia.neutro, .insignia.archivado { background: var(--borde); color: var(--texto-2); }
.insignia.aviso { background: var(--aviso-suave); color: var(--aviso); }
.contador { font-size: 13px; font-weight: 600; line-height: 16px; min-width: 24px; height: 24px; padding: 4px 8px; border-radius: var(--r-pildora); background: var(--registrada); color: var(--texto); display: inline-grid; place-items: center; }

/* ---------- Tarjetas ---------- */
.tarjeta { background: #fff; border-radius: var(--r-tarjeta); box-shadow: var(--sombra-tarjeta); padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
:where(.tarjeta > h2, .tarjeta-cabecera > h2) { font-size: 20px; line-height: 25px; font-weight: 600; color: var(--noche); margin: 0; }
/* P1/Fila de certificado y P1/Ticket: filas sobre #F1F5F8 r12 */
.fila-cert { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-radius: 12px; background: var(--hoja); flex-wrap: wrap; }
.fila-cert .miniatura { width: 56px; height: 42px; flex: none; border-radius: 4px; background: #fff; border: 1px solid #CBD4DC; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.fila-cert .miniatura i { height: 3px; border-radius: 2px; background: #CBD4DC; }
.fila-cert .miniatura i:first-child { width: 30px; background: var(--azul); }
.fila-cert .miniatura i:nth-child(2) { width: 40px; } .fila-cert .miniatura i:nth-child(3) { width: 22px; }
.fila-cert .datos { flex: 1; min-width: 160px; }
.fila-cert .datos strong { display: block; font-size: 15px; font-weight: 600; line-height: 20px; }
.fila-cert .datos span { font-family: var(--f-mono); font-weight: 500; font-size: 14px; color: var(--texto-2); }
.ticket-fila { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--hoja); text-decoration: none; color: var(--texto); }
.ticket-fila strong { font-size: 15px; font-weight: 600; line-height: 20px; }
.tarjeta.compacta { padding: 16px; gap: 12px; }
.tarjeta.sin-padding { padding: 0; overflow: hidden; gap: 0; }
.tarjeta-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
a.tarjeta { text-decoration: none; color: inherit; transition: box-shadow var(--dur), transform var(--dur); }
a.tarjeta:hover { box-shadow: var(--sombra-hover); transform: translateY(-2px); color: inherit; }
.separador { height: 1px; background: var(--borde); border: 0; margin: 0; }

/* Tarjeta de curso */
.tarjeta-curso { background: #fff; border-radius: var(--r-tarjeta); box-shadow: var(--sombra-tarjeta); padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; position: relative; transition: box-shadow var(--dur); }
.tarjeta-curso:hover { box-shadow: var(--sombra-hover); color: inherit; }
.tarjeta-curso .foto { height: 180px; border-radius: 12px; background: var(--gradiente); position: relative; overflow: hidden; flex: none; }
.tarjeta-curso .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tarjeta-curso .foto .portada { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .9); }
.tarjeta-curso .foto .categoria, .tarjeta-curso .foto .etiqueta-categoria { position: absolute; top: 10px; left: 10px; }
.tarjeta-curso .categoria { display: inline-flex; align-self: flex-start; align-items: center; height: 24px; padding: 4px 10px; border-radius: var(--r-pildora); background: var(--noche); color: #fff; font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.tarjeta-curso .cuerpo { padding: 0; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.tarjeta-curso h3 { font-size: 18px; line-height: 24px; font-weight: 600; margin: 0; color: var(--texto); }
.tarjeta-curso .relator { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; color: var(--texto-2); }
.tarjeta-curso .meta { font-size: 13px; line-height: 16px; font-weight: 600; color: var(--registrada-texto); margin-top: auto; }
.favorito { position: absolute; top: 10px; right: 10px; z-index: 1; }

/* ---------- Regleta (P1/Segmento): un segmento por clase, todos del mismo ancho ---------- */
.regleta { display: flex; gap: 4px; width: 100%; }
.regleta .seg { flex: 1 1 0; min-width: 14px; height: 24px; border-radius: var(--r-doc); display: grid; place-items: center; border: 1.5px solid var(--texto-3); background: #fff; color: var(--noche); }
.regleta.mini { gap: 3px; }
.regleta.mini .seg { height: 10px; }
.regleta .seg .i { width: 14px; height: 14px; }
.regleta.mini .seg .i { display: none; }
.seg.registrada { background: var(--registrada); border-color: var(--registrada-borde); color: var(--noche); }
.seg.sin-registrar { background: repeating-linear-gradient(135deg, rgba(0, 110, 177, .9) 0 1.5px, #EAF6FC 1.5px 5px); border: 1.5px dashed var(--azul); }
.seg.pendiente { background: #fff; border-color: var(--texto-3); }
.seg.actual { background: #fff; border-color: var(--noche); position: relative; }
.regleta:not(.mini) .seg.actual::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--noche); }
.regleta.mini .seg.actual::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--noche); }
.seg.bajo-minimo { background: var(--riesgo-suave); border-color: var(--riesgo); }
.sobre-azul .seg.sin-registrar, .franja-sence .seg.sin-registrar { background: repeating-linear-gradient(135deg, rgba(132, 222, 228, .9) 0 1.5px, rgba(255, 255, 255, .08) 1.5px 5px); border-color: #84DEE4; }
.sobre-azul .seg.pendiente { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .6); }
.sobre-azul .seg.actual { background: rgba(255, 255, 255, .22); border-color: #fff; }
.sobre-azul .seg.actual::after { background: #fff !important; }
.leyenda { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .8125rem; color: var(--texto-2); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid var(--texto-3); }
.leyenda i.registrada { background: var(--registrada); border-color: var(--registrada-borde); }
.leyenda i.sin-registrar { background: repeating-linear-gradient(135deg, rgba(0, 110, 177, .9) 0 1.5px, #EAF6FC 1.5px 5px); border: 1px dashed var(--azul); }
.leyenda i.riesgo { background: var(--riesgo); border-color: var(--riesgo); }
.leyenda i.al-dia { background: var(--registrada-borde); border-color: var(--registrada-borde); }

/* Barra apilada proporcional (agregados) */
.apilada { display: flex; height: 12px; border-radius: var(--r-doc); overflow: hidden; background: var(--borde); width: 100%; }
.apilada > span { height: 100%; }
.apilada .riesgo { background: var(--riesgo); }
.apilada .sin-registrar { background: var(--rayado); }
.apilada .al-dia { background: var(--registrada-borde); }
.apilada .pendiente { background: var(--borde); }

/* Barra de avance con marca del mínimo */
div.avance { position: relative; height: 8px; background: var(--borde); border-radius: 4px; overflow: visible; }
div.avance > span { display: block; height: 100%; border-radius: 4px; background: var(--azul); }
.avance.ok > span { background: var(--registrada-borde); }
.avance.riesgo > span { background: var(--riesgo); }
.avance .minimo { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--noche); }

/* ---------- Certificado en curso ---------- */
.certificado {
  background: #fff; border-radius: var(--r-doc); box-shadow: 0 28px 56px -16px rgba(18, 26, 105, .30); padding: 20px 22px; color: var(--texto);
  display: flex; flex-direction: column; gap: 10px; position: relative; min-width: 0;
}
.certificado .cert-tipo { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-2); margin: 0; }
.certificado .cert-barras { display: flex; gap: 3px; }
.certificado .cert-barras i { flex: 1; height: 4px; border-radius: 2px; background: var(--borde); }
.certificado .cert-barras i.registrada { background: var(--registrada-borde); }
.certificado .cert-barras i.sin-registrar { background: #84DEE4; }
.hero .certificado { transform: rotate(-2deg); }
.certificado .cert-cabecera { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.certificado .cert-cabecera img { width: 38px; height: 26px; }
.certificado .cert-titulo { font-size: 18px; font-weight: 600; color: var(--noche); line-height: 24px; margin: 0; }
.certificado .cert-nombre { font-size: 13px; line-height: 18px; color: var(--texto-2); margin: 0; }
.certificado .cert-pie { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-family: var(--f-mono); font-weight: 500; font-size: 12px; color: var(--texto-2); }
.certificado .cert-pie .avance { color: var(--registrada-texto); }
.certificado.no-emitido { filter: grayscale(1); }
.certificado .sello { position: absolute; right: 18px; top: 18px; }
.firma { border-top: 1px solid var(--texto-2); padding-top: 4px; font-size: .75rem; color: var(--texto-2); min-width: 160px; }

/* ---------- Hero (Inicio estudiante) ---------- */
.hero { background: var(--gradiente-hero); color: #fff; border-radius: var(--r-hoja); padding: 36px 48px 36px 40px; display: grid; grid-template-columns: minmax(0, 652fr) minmax(0, 300fr); gap: 40px; align-items: center; box-shadow: var(--sombra-hover); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 520px; height: 520px; right: -120px; top: -160px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 172, 232, .25), rgba(0, 172, 232, 0)); pointer-events: none; }
.hero > * { position: relative; }
.hero .t-overline { color: #fff; }
.hero h2 { color: #fff; font-size: 40px; line-height: 48px; margin: 0; font-weight: 600; }
.hero p { color: #fff; margin: 0; }
.hero .relator { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.hero .relator .avatar { width: 32px; height: 32px; border: 2px solid #fff; }
.hero .hero-cuenta { font-size: 16px; font-weight: 700; letter-spacing: .12em; }
.hero .certificado { align-self: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding: 20px; } .hero h2 { font-size: 1.5rem; line-height: 2rem; } }

/* ---------- Franja SENCE ---------- */
.franja-sence { display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 20px; min-height: 68px; border-radius: var(--r-tarjeta); background: var(--noche); color: #fff; }
.franja-sence .icono { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); flex: none; }
.franja-sence .evidencia { display: flex; gap: 4px; flex: none; }
.franja-sence .evidencia .seg { width: 16px; height: 28px; border-radius: 4px; border: 1.5px dashed #84DEE4; background: repeating-linear-gradient(135deg, rgba(132, 222, 228, .9) 0 1.5px, rgba(255, 255, 255, .08) 1.5px 5px); }
.franja-sence .texto { flex: 1; min-width: 0; }
.franja-sence .texto strong { display: block; font-weight: 600; font-size: 18px; line-height: 24px; }
.franja-sence .texto span { color: #fff; font-size: 14px; line-height: 20px; }
.franja-sence .btn { background: #fff; color: var(--noche); }
.franja-sence .btn:hover { background: var(--azul-suave); color: var(--noche); }
.franja-sence.registrada .icono { background: var(--registrada); color: var(--noche); }
.franja-sence.error { background: #fff; color: var(--texto); box-shadow: var(--sombra-tarjeta); border-left: 4px solid var(--riesgo); }
.franja-sence.error .texto span { color: var(--texto-2); }
.franja-sence.error .icono { background: var(--riesgo-suave); color: var(--riesgo); }
@media (max-width: 860px) { .franja-sence { flex-wrap: wrap; } .franja-sence .btn { width: 100%; min-height: 56px; } }

/* ---------- Tablas densas (filas de 52 px) ---------- */
.tabla-contenedor { position: relative; background: #fff; border-radius: var(--r-tarjeta); box-shadow: var(--sombra-tarjeta); overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tabla th { text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--texto-2); padding: 14px 16px; border-bottom: 1.5px solid var(--borde); white-space: nowrap; background: #fff; }
.tabla th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.tabla td { padding: 0 16px; height: 52px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: #FAFCFD; }
.tabla tr.seleccionada { background: var(--azul-suave); box-shadow: inset 3px 0 0 var(--azul); }
.tabla .num { text-align: right; font-family: var(--f-mono); }
.tabla .acciones { text-align: right; white-space: nowrap; }
.persona { display: flex; align-items: center; gap: 10px; min-width: 0; }
.persona strong { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.persona span { font-size: .8125rem; color: var(--texto-2); }
.barra-filtros { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.barra-filtros .buscador { flex: 1 1 240px; min-width: 200px; }
.barra-lote { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--noche); color: #fff; border-radius: var(--r-tarjeta); }
.paginacion { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: .875rem; color: var(--texto-2); }

/* Avatar */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--azul-suave); color: var(--azul-texto); display: inline-grid; place-items: center; font-weight: 600; font-size: .875rem; overflow: hidden; }
.avatar.a28 { width: 28px; height: 28px; font-size: .6875rem; } .avatar.a36 { width: 36px; height: 36px; font-size: .8125rem; } .avatar.a40 { width: 40px; height: 40px; } .avatar.a72 { width: 72px; height: 72px; font-size: 1.375rem; }
.avatar.a24 { width: 24px; height: 24px; font-size: .625rem; } .avatar.a32 { width: 32px; height: 32px; font-size: .75rem; } .avatar.a56 { width: 56px; height: 56px; font-size: 1.125rem; } .avatar.a96 { width: 96px; height: 96px; font-size: 1.75rem; }
.sobre-azul .avatar, .sidebar .avatar { background: rgba(255, 255, 255, .18); color: #fff; }

/* Lecciones (temario) */
.leccion { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-campo); text-decoration: none; color: inherit; min-height: 56px; }
.leccion:hover { background: var(--hoja); color: inherit; }
.leccion .estado { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1.5px solid var(--texto-3); color: var(--texto-2); font-family: var(--f-mono); font-size: .75rem; font-weight: 700; }
.leccion.registrada .estado { background: var(--registrada); border-color: var(--registrada-borde); color: var(--noche); }
.leccion.sin-registrar .estado { background: var(--rayado); border: 1.5px dashed var(--azul); color: var(--noche); }
.leccion.en-curso { background: var(--azul-suave); }
.leccion.en-curso .estado { border: 2px solid var(--azul); color: var(--azul); background: #fff; }
.leccion.bloqueada { color: var(--texto-2); }
.leccion .titulo { flex: 1; min-width: 0; }
.leccion .titulo strong { display: block; font-weight: 500; font-size: .9375rem; }
.leccion .titulo span { font-size: .8125rem; color: var(--texto-2); }

/* ---------- Feedback: avisos, toasts, banners, vacíos ---------- */
.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-campo); background: var(--azul-suave); color: var(--texto); font-size: .9375rem; }
.aviso .i { color: var(--azul); margin-top: 2px; }
.aviso.riesgo { background: var(--riesgo-suave); } .aviso.riesgo .i { color: var(--riesgo); }
.aviso.exito { background: var(--exito-suave); } .aviso.exito .i { color: var(--exito); }
.aviso.aviso-amarillo { background: var(--aviso-suave); } .aviso.aviso-amarillo .i { color: var(--aviso); }
.resumen-errores { border: 2px solid var(--riesgo); border-radius: var(--r-campo); padding: 16px; background: #fff; }
.resumen-errores h2 { font-size: 1rem; margin: 0 0 8px; color: var(--riesgo); }
.resumen-errores ul { margin: 0; padding-left: 20px; }
.banner-sistema { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--noche); color: #fff; font-size: .875rem; flex-wrap: wrap; }
.banner-sistema.riesgo { background: var(--riesgo); }
.banner-sistema.aviso-amarillo { background: var(--aviso-suave); color: var(--aviso); }
.banner-sistema .crece { min-width: 200px; }
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; gap: 12px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-tarjeta); background: var(--noche); color: #fff; box-shadow: var(--sombra-modal); animation: entra 240ms ease-out; }
.toast .i { color: var(--registrada); margin-top: 2px; }
.toast.error { background: var(--riesgo); } .toast.error .i { color: #fff; }
.toast.info .i { color: #fff; }
.toast strong { display: block; }
.toast span { font-size: .875rem; color: rgba(255, 255, 255, .88); }
@media (max-width: 860px) { .toasts { left: 16px; right: 16px; bottom: 88px; } }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.vacio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 40px 24px; border: 1.5px dashed var(--texto-3); border-radius: var(--r-tarjeta); color: var(--texto-2); }
.vacio .i { width: 40px; height: 40px; color: var(--azul); }
.vacio h3 { color: var(--texto); }
.skeleton { background: linear-gradient(90deg, var(--borde) 25%, #F5F8FA 50%, var(--borde) 75%); background-size: 200% 100%; animation: brillo 1.4s infinite; border-radius: var(--r-doc); min-height: 14px; }
@keyframes brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Modal / scrim / drawer / hoja inferior ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-hoja); box-shadow: var(--sombra-modal); width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--texto); }
dialog.modal.s { width: min(480px, calc(100vw - 32px)); } dialog.modal.l { width: min(880px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(18, 26, 105, .48); }
.modal-cuerpo { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.modal-cabecera { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-pie { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 28px 24px; flex-wrap: wrap; }
.scrim-pagina { position: fixed; inset: 0; background: rgba(18, 26, 105, .48); display: grid; place-items: center; padding: 16px; z-index: 60; }
.panel-modal { background: #fff; border-radius: var(--r-hoja); box-shadow: var(--sombra-modal); width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.panel-modal.s { width: min(480px, 100%); }
dialog.drawer { border: 0; padding: 0; margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(480px, 100vw); border-radius: var(--r-hoja) 0 0 var(--r-hoja); box-shadow: var(--sombra-modal); }
dialog.drawer::backdrop { background: rgba(18, 26, 105, .48); }
.drawer-cuerpo { display: flex; flex-direction: column; height: 100%; }
.drawer-cuerpo > .contenido { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.drawer-cuerpo > header, .drawer-cuerpo > footer { padding: 20px 24px; display: flex; gap: 12px; align-items: center; }
.drawer-cuerpo > header { border-bottom: 1px solid var(--borde); justify-content: space-between; }
.drawer-cuerpo > footer { border-top: 1px solid var(--borde); justify-content: flex-end; }
@media (max-width: 860px) {
  dialog.drawer, dialog.modal { margin: auto 0 0; width: 100vw; max-width: 100vw; height: auto; max-height: 90vh; border-radius: var(--r-hoja) var(--r-hoja) 0 0; }
  dialog.modal::before, dialog.drawer::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--borde); margin: 10px auto 0; }
}

/* Menú de acciones, tooltip */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .menu-lista { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: #fff; border-radius: var(--r-campo); box-shadow: var(--sombra-modal); padding: 6px; min-width: 220px; display: flex; flex-direction: column; }
.menu-lista a, .menu-lista button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 0; background: none; text-align: left; color: var(--texto); text-decoration: none; font-size: .9375rem; cursor: pointer; width: 100%; }
.menu-lista a:hover, .menu-lista button:hover { background: var(--hoja); }
.menu-lista .peligro { color: var(--riesgo); }
.menu-lista hr { border: 0; height: 1px; background: var(--borde); margin: 6px 0; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--noche); color: #fff; font-size: .8125rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; z-index: 50; pointer-events: none; }

/* Stepper */
.stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; counter-reset: paso; }
.stepper li { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: .8125rem; color: var(--texto-2); counter-increment: paso; }
.stepper li::before { content: ""; height: 6px; border-radius: 3px; background: var(--borde); }
.stepper li.hecho::before { background: var(--registrada-borde); }
.stepper li.actual::before { background: var(--azul); }
.stepper li.actual { color: var(--noche); font-weight: 600; }

/* Breadcrumbs, acordeón */
.migas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .875rem; color: var(--texto-2); list-style: none; padding: 0; margin: 0; }
.migas { font-size: 13px; font-weight: 600; }
.migas a { color: var(--azul); text-decoration: none; }
.migas [aria-current] { color: var(--texto); }
.migas li + li::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; background: #8494A2; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z'/%3E%3C/svg%3E") center/contain no-repeat; }
details.acordeon { background: #fff; border-radius: var(--r-campo); box-shadow: var(--sombra-tarjeta); }
details.acordeon > summary { min-height: 56px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 600; list-style: none; }
details.acordeon > summary::-webkit-details-marker { display: none; }
details.acordeon > summary::after { content: "+"; font-size: 1.25rem; color: var(--azul); }
details.acordeon[open] > summary::after { content: "–"; }
details.acordeon > .contenido { padding: 0 20px 20px; color: var(--texto-2); }

/* Subida de archivo */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 28px; border-radius: var(--r-tarjeta); background: #fff; border: 1.5px solid var(--borde); }
.dropzone.arrastrando { border-color: var(--azul); background: var(--azul-suave); }
.dropzone .i { width: 36px; height: 36px; color: var(--azul); }

/* Quiz */
.opcion { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px; border-radius: var(--r-campo); border: 1.5px solid var(--borde); background: #fff; cursor: pointer; }
.opcion:hover { border-color: var(--azul); }
.opcion:has(input:checked) { border-color: var(--azul); background: var(--azul-suave); }
.opcion input { width: 20px; height: 20px; accent-color: var(--azul); }
.opcion.correcta { border-color: var(--registrada-borde); background: var(--registrada-suave); }
.opcion.incorrecta { border-color: var(--riesgo); background: var(--riesgo-suave); }

/* Calendario */
.calendario { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--borde); border-radius: var(--r-tarjeta); overflow: hidden; }
.calendario > div { background: #fff; min-height: 96px; padding: 8px; font-size: .8125rem; display: flex; flex-direction: column; gap: 4px; }
.calendario .dia-nombre { min-height: 0; font-weight: 600; color: var(--texto-2); text-align: center; text-transform: uppercase; font-size: .75rem; }
.calendario .fuera { background: var(--hoja); color: var(--texto-2); }
.calendario .hoy .num { background: var(--azul); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; }
.evento { border-radius: 6px; padding: 2px 6px; font-size: .75rem; font-weight: 500; background: var(--azul-suave); color: var(--azul-texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evento.plazo { background: var(--aviso-suave); color: var(--aviso); }
.evento.evaluacion { background: var(--registrada-suave); color: var(--registrada-texto); }

/* Chat */
.chat { display: grid; grid-template-columns: 340px minmax(0, 1fr); background: #fff; border-radius: var(--r-tarjeta); box-shadow: var(--sombra-tarjeta); overflow: hidden; min-height: 640px; }
.chat-lista { border-right: 1px solid var(--borde); display: flex; flex-direction: column; }
.chat-lista a { display: flex; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--borde); }
.chat-lista a[aria-current="page"] { background: var(--azul-suave); }
.chat-hilo { display: flex; flex-direction: column; }
.chat-mensajes { flex: 1; padding: 24px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; background: var(--hoja); }
.burbuja { max-width: 354px; padding: 12px 16px; border-radius: 18px 18px 18px 4px; background: #fff; border: 1px solid var(--borde); font-size: 14px; line-height: 20px; }
.burbuja.mia { align-self: flex-end; background: var(--azul); color: #fff; border-color: var(--azul); border-radius: 18px 18px 4px 18px; }
.burbuja .hora { font-family: var(--f-mono); font-size: .75rem; opacity: .75; margin-top: 4px; }
.chat-campo { display: flex; gap: 12px; padding: 16px; border-top: 1px solid var(--borde); }
@media (max-width: 860px) { .chat { grid-template-columns: 1fr; } .chat-lista.oculta-mobile { display: none; } }

/* Video */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-tarjeta); overflow: hidden; background: #0B1240; color: #fff; }
.video video, .video img { width: 100%; height: 100%; object-fit: cover; }
.video .controles { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-tarjeta); background: rgba(18, 26, 105, .55); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
html[data-glass="no"] .video .controles { background: var(--noche); backdrop-filter: none; }
.transcripcion { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.transcripcion a { display: flex; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--texto); text-decoration: none; }
.transcripcion a.actual { background: var(--azul-suave); }
.transcripcion .mono { color: var(--azul-texto); font-size: .8125rem; }

/* Páginas de acceso (login etc.) */
.acceso { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--hoja); }
.acceso-marca { background: var(--gradiente); color: #fff; padding: 48px; display: flex; flex-direction: column; gap: 32px; justify-content: space-between; }
.acceso-marca img.logo { width: 148px; }
.acceso-marca h1 { color: #fff; font-size: 2.25rem; line-height: 2.75rem; font-weight: 600; margin: 0; }
.acceso-marca p { color: rgba(255, 255, 255, .9); }
.acceso-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.acceso-form .caja { width: min(440px, 100%); display: flex; flex-direction: column; gap: 20px; }
.divisor-o { display: flex; align-items: center; gap: 12px; color: var(--texto-2); font-size: .875rem; }
.divisor-o::before, .divisor-o::after { content: ""; flex: 1; height: 1px; background: var(--borde); }
@media (max-width: 860px) { .acceso { grid-template-columns: 1fr; } .acceso-marca { padding: 24px 20px 32px; border-radius: 0 0 var(--r-hoja) var(--r-hoja); gap: 16px; } .acceso-marca .solo-desktop { display: none; } .acceso-marca h1 { font-size: 1.5rem; line-height: 2rem; } }

/* Sitio público */
.publico-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--borde); }
.publico-header .interior, .publico-seccion .interior, .publico-pie .interior { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.publico-header .interior { display: flex; align-items: center; gap: 24px; min-height: 80px; }
.publico-header nav { display: flex; gap: 4px; flex: 1; }
.publico-header nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; color: var(--texto); text-decoration: none; font-weight: 500; border-radius: var(--r-pildora); }
.publico-header nav a[aria-current="page"] { color: var(--azul); font-weight: 600; }
.publico-seccion { padding: 64px 0; }
.publico-seccion.azul { background: var(--gradiente); color: #fff; }
.publico-seccion.azul h1, .publico-seccion.azul h2 { color: #fff; }
.publico-pie { background: var(--noche); color: rgba(255, 255, 255, .85); padding: 48px 0 32px; font-size: .875rem; }
.publico-pie a { color: #fff; }
@media (max-width: 860px) { .publico-header nav { display: none; } .publico-seccion { padding: 40px 0; } }

/* Estados globales */
.estado-pagina { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--hoja); }
.estado-pagina .caja { max-width: 520px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.estado-pagina .ilustracion { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--azul-suave); color: var(--azul); }
.estado-pagina .ilustracion .i { width: 48px; height: 48px; }
.estado-pagina .codigo { font-family: var(--f-mono); color: var(--texto-2); }

/* Documento imprimible (certificado PDF A4, comprobante) */
.documento-a4 { width: 297mm; min-height: 210mm; margin: 24px auto; background: #fff; padding: 18mm; box-shadow: var(--sombra-hoja); color: #141B22; display: flex; flex-direction: column; gap: 10mm; }
.documento-a4.vertical { width: 210mm; min-height: 297mm; }
.qr svg { width: 25mm; height: 25mm; }
@media print {
  body { background: #fff; }
  .no-imprimir { display: none !important; }
  .documento-a4 { margin: 0; box-shadow: none; }
  @page { size: A4 landscape; margin: 0; }
}

/* Correos (600 px) */
.correo { width: 600px; max-width: 100%; margin: 24px auto; background: #fff; font-family: var(--f-texto); }
