/* =====================================================================
   Habeas · sistema visual v2
   Plataforma multiempresa para solicitudes de titulares (Ley 1581 de 2012).
   Verde azulado = marca · azul marino = texto · azul = acción.
   Marca distintiva: el tachón (.tachon) para los datos que la IA no vio.

   Índice
    1. Tokens            9. Pasos               17. Calendario
    2. Base             10. Chat del asistente  18. Dona y barras
    3. Utilidades       11. Datos protegidos    19. Días hábiles
    4. Marco de app     12. Línea de tiempo     20. Estados de página
    5. Encabezado       13. Tabla               21. Responsive
    6. Tarjetas/rejilla 14. Cajón, modal, velo  22. Movimiento reducido
    7. KPI y botones    15. Aviso (toast)
    8. Formularios/OTP  16. Pestañas
   ===================================================================== */
@import url("/recursos/fuentes/fuentes.css"); /* servidas localmente: la demo no depende de Google Fonts */

/* ---------- 1. Tokens ---------- */
:root {
  /* Marca */
  --marca: #0E9384;
  --marca-600: #0B7A6E;        /* texto y botones sobre blanco (AA) */
  --marca-700: #09665C;
  --marca-100: #C7ECE7;
  --marca-50: #E6F6F4;

  /* Texto */
  --marino: #0F1B3D;           /* títulos y cifras */
  --texto: #1E293B;            /* cuerpo */
  --texto-2: #5F6E85;          /* secundario (#64748B oscurecido un punto para AA sobre fondos tintados) */
  --texto-3: #94A3B8;          /* solo decorativo / marcadores de posición */

  /* Acción */
  --accion: #2563EB;
  --accion-hover: #1D4ED8;
  --accion-100: #D6E4FF;
  --accion-50: #EAF1FF;

  /* Superficies */
  --fondo: #F5F8FC;
  --superficie: #FFFFFF;
  --suave: #F1F6FD;
  --suave-borde: #E1EAF6;
  --borde: #E2E8F0;
  --borde-fuerte: #CBD5E1;
  --borde-control: #C9D3E0;
  --linea-tabla: #EDF1F6;

  /* Estados: color vivo (íconos, rellenos) · texto (AA sobre su fondo) · fondo */
  --ok: #16A34A;      --ok-texto: #15803D;      --ok-50: #E8F7EE;      --ok-borde: #C9EBD5;
  --alerta: #D97706;  --alerta-texto: #92400E;  --alerta-50: #FEF3E2;  --alerta-borde: #F8DDB4;
  --peligro: #DC2626; --peligro-texto: #B91C1C; --peligro-50: #FDECEC; --peligro-borde: #F6CACA;
  --info-texto: #1D4ED8;                                                --info-borde: #D3E1FD;
  --neutro-texto: #475569; --neutro-50: #EEF2F7;

  /* Tachón */
  --tachon-fondo: #0F1B3D;
  --tachon-texto: #7EE0D3;

  /* Tipografía */
  --fuente: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Radios */
  --r-tarjeta: 14px;
  --r-control: 10px;
  --r-chico: 6px;
  --r-pildora: 999px;

  /* Sombras con jerarquía: reposo < elevada < superpuesta */
  --sombra-1: 0 1px 2px rgba(15, 27, 61, .04), 0 1px 3px rgba(15, 27, 61, .04);
  --sombra-2: 0 2px 4px rgba(15, 27, 61, .04), 0 8px 20px -6px rgba(15, 27, 61, .12);
  --sombra-3: 0 12px 24px -8px rgba(15, 27, 61, .18), 0 32px 64px -16px rgba(15, 27, 61, .28);
  --sombra-boton: 0 1px 2px rgba(15, 27, 61, .10), inset 0 1px 0 rgba(255, 255, 255, .14);

  --anillo: 0 0 0 3px rgba(37, 99, 235, .20);
  --anillo-error: 0 0 0 3px rgba(220, 38, 38, .18);

  --lateral-ancho: 252px;
  --topbar-alto: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Íconos en línea para estados (sin depender de Lucide) */
  --svg-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --svg-exclamacion: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M12 6v8M12 18.5v.01'/%3E%3C/svg%3E");
  --svg-flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6E85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  color-scheme: light;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 400 15px/1.55 var(--fuente); color: var(--texto); background: var(--fondo);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0; color: var(--marino); line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15.5px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }
p, ul, ol, dl, figure { margin: 0; }
a { color: var(--accion); text-decoration: none; }
a:hover { color: var(--accion-hover); text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
code, kbd, samp, pre { font-family: var(--mono); font-size: .92em; }
hr, .separador { border: 0; border-top: 1px solid var(--borde); margin: 20px 0; }
::selection { background: var(--marca-100); color: var(--marino); }
[hidden] { display: none !important; }

/* Foco visible en todo lo interactivo */
:focus-visible { outline: 2px solid var(--accion); outline-offset: 2px; }

/* Íconos Lucide: el <i data-lucide> reserva espacio y el <svg> hereda el tamaño */
i[data-lucide] { display: inline-block; width: 1.15em; height: 1.15em; flex: none; }
svg.lucide { width: 1.15em; height: 1.15em; flex: none; stroke-width: 2; }

/* ---------- 3. Utilidades ---------- */
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.oculto { display: none !important; }
.tenue { color: var(--texto-2); }                       /* texto secundario */
.nota { font-size: 13px; color: var(--texto-2); line-height: 1.5; }
.mono { font-family: var(--mono); }
.cifra { font-variant-numeric: tabular-nums; }          /* números alineados */
.radicado { font: 500 13px/1.4 var(--mono); color: var(--marino); white-space: nowrap; letter-spacing: -.01em; }
.huella { font: 400 11.5px/1.5 var(--mono); color: var(--texto-2); word-break: break-all; }
.antetitulo { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--marca-600); margin-bottom: 6px; }
.enlace { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--accion); white-space: nowrap; }
.enlace svg.lucide { width: 16px; height: 16px; }

/* Pilas (vertical) y filas (horizontal) */
.pila { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pila.junta { gap: 8px; }
.pila.amplia { gap: 24px; }
.fila { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.fila.entre { justify-content: space-between; }
.fila.fin { justify-content: flex-end; }
.fila.arriba { align-items: flex-start; }
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 24px; } .mt-6 { margin-top: 32px; }

/* Enlace "Saltar al contenido" (primer elemento del body) */
.saltar {
  position: absolute; left: 16px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: var(--r-control);
  background: var(--marino); color: #fff; font-weight: 600; transition: top .15s;
}
.saltar:focus { top: 12px; color: #fff; }

/* Tachón: dato personal que la IA nunca vio */
.tachon {
  position: relative; display: inline-block; overflow: hidden; vertical-align: 1px;
  padding: 0 9px; margin: 0 1px; border-radius: var(--r-pildora);
  background: var(--tachon-fondo); color: var(--tachon-texto);
  font: 500 11.5px/1.8 var(--mono); letter-spacing: .02em; white-space: nowrap;
}
.tachon::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .09) 0 2px, transparent 2px 6px);
}
/* Bloque "lo que vio la IA" */
.texto-ia {
  padding: 12px 14px; border-radius: 12px; background: var(--suave); border: 1px solid var(--suave-borde);
  font-size: 14.5px; line-height: 1.95; color: var(--texto);
}

/* Distintivo "Datos de demostración" */
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; white-space: nowrap;
  border: 1px dashed #BFCADA; border-radius: var(--r-pildora); background: var(--superficie);
  color: var(--texto-2); font-size: 12px; font-weight: 600; line-height: 1.5;
}
.demo-badge svg.lucide, .demo-badge i[data-lucide] { width: 13px; height: 13px; }

/* Insignia (contador) */
.insignia {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px;
  border-radius: var(--r-pildora); background: var(--neutro-50); color: var(--neutro-texto);
  font-size: 12px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.insignia.alerta { background: var(--alerta-50); color: var(--alerta-texto); }
.insignia.peligro { background: var(--peligro); color: #fff; }

/* Avatar de persona o inicial de empresa (--color = color de la empresa) */
.avatar {
  --color: var(--marca-600);
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--marca-50); background: color-mix(in srgb, var(--color) 13%, #fff);
  color: var(--color); font-size: 13px; font-weight: 700; letter-spacing: -.01em; overflow: hidden;
}
.avatar.cuadro { border-radius: 10px; }
.avatar.grande { width: 44px; height: 44px; font-size: 16px; }
.avatar.lleno { background: var(--color); color: #fff; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Botón de solo ícono (campana, cerrar, más) */
.icono-btn {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px;
  border: 0; border-radius: var(--r-control); background: transparent; color: var(--texto-2); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icono-btn:hover { background: var(--fondo); color: var(--marino); }
.icono-btn svg.lucide, .icono-btn i[data-lucide] { width: 20px; height: 20px; }
.icono-btn .punto {
  position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--peligro); box-shadow: 0 0 0 2px var(--superficie);
}

/* ---------- 4. Marco de aplicación ---------- */
/* <div class="app"><aside class="lateral">…</aside><div class="principal"><header class="topbar">…</header><main class="contenido">…</main></div></div> */
.app { display: grid; grid-template-columns: var(--lateral-ancho) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.principal { display: flex; flex-direction: column; min-width: 0; }

.lateral {
  position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px; padding: 18px 14px 16px;
  background: var(--superficie); border-right: 1px solid var(--borde);
}
/* Logotipo + nombre (también sirve dentro de .topbar en páginas sin barra lateral) */
:is(.lateral, .topbar) > .marca {
  display: flex; align-items: center; gap: 11px; min-width: 0; padding: 4px 8px 6px;
  color: var(--marino); text-decoration: none;
}
:is(.lateral, .topbar) > .marca img { width: 36px; height: 36px; flex: none; border-radius: 10px; }
:is(.lateral, .topbar) > .marca b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
:is(.lateral, .topbar) > .marca small {
  display: block; font-size: 12px; font-weight: 500; color: var(--texto-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:is(.lateral, .topbar) > .marca span { min-width: 0; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-titulo { padding: 14px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-2); }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-control);
  color: var(--texto-2); font-size: 14.5px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.nav a svg.lucide, .nav a i[data-lucide] { width: 18px; height: 18px; }
.nav a:hover { background: var(--fondo); color: var(--marino); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accion-50); color: var(--accion); font-weight: 600; }
.nav a .insignia { margin-left: auto; }
.nav a[aria-current="page"] .insignia { background: var(--accion); color: #fff; }

/* Tarjeta al pie de la barra lateral (p. ej. "Tratamiento conforme a la Ley 1581") */
.lateral-pie {
  margin-top: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px;
  border-radius: 12px; background: var(--suave); border: 1px solid var(--suave-borde);
  font-size: 12.5px; line-height: 1.45; color: var(--texto-2);
}
.lateral-pie b { display: block; color: var(--marino); font-size: 13px; }
.lateral-pie svg.lucide, .lateral-pie i[data-lucide] { width: 20px; height: 20px; color: var(--marca-600); margin-top: 1px; }

/* Barra superior */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  min-height: var(--topbar-alto); padding: 10px 32px;
  background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--borde);
}
.topbar-titulo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-titulo b { display: block; color: var(--marino); font-size: 15px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-titulo small { display: block; color: var(--texto-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-titulo > div { min-width: 0; }
.topbar-acciones { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

/* Cuenta del usuario con avatar (botón en la barra superior) */
.cuenta {
  display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; max-width: 260px;
  border: 1px solid var(--borde); border-radius: var(--r-pildora); background: var(--superficie);
  text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.cuenta:hover { border-color: var(--borde-fuerte); box-shadow: var(--sombra-1); }
.cuenta b { display: block; font-size: 13.5px; font-weight: 600; color: var(--marino); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cuenta small { display: block; font-size: 12px; color: var(--texto-2); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cuenta > span:not(.avatar) { min-width: 0; }
.cuenta svg.lucide, .cuenta i[data-lucide] { width: 16px; height: 16px; color: var(--texto-2); }

/* Contenido */
.contenido { width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px 32px 72px; }
.contenido.angosto { max-width: 960px; }

/* ---------- 5. Encabezado de página ---------- */
.encabezado {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 14px 24px; margin-bottom: 24px;
}
.encabezado > div:first-child { min-width: 0; flex: 1 1 360px; }
.encabezado p { margin-top: 6px; color: var(--texto-2); font-size: 15px; max-width: 72ch; }

/* ---------- 6. Tarjetas y rejilla ---------- */
.tarjeta {
  min-width: 0; padding: 20px; background: var(--superficie);
  border: 1px solid var(--borde); border-radius: var(--r-tarjeta); box-shadow: var(--sombra-1);
}
.tarjeta.suave { background: var(--suave); border-color: var(--suave-borde); box-shadow: none; }
.tarjeta.plana { box-shadow: none; }
.tarjeta.sin-relleno { padding: 0; overflow: hidden; }
.tarjeta.interactiva { cursor: pointer; transition: box-shadow .2s, border-color .2s, transform .2s; }
.tarjeta.interactiva:hover { border-color: var(--borde-fuerte); box-shadow: var(--sombra-2); transform: translateY(-1px); }
.tarjeta-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tarjeta-cab > * { min-width: 0; }
.tarjeta-cab > :not(:first-child) { flex: none; }   /* enlaces, píldoras y botones no se encogen */
.tarjeta-cab h2, .tarjeta-cab h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.tarjeta-cab h2 svg.lucide, .tarjeta-cab h2 i[data-lucide], .tarjeta-cab h3 svg.lucide, .tarjeta-cab h3 i[data-lucide] { width: 18px; height: 18px; color: var(--marca-600); }
.tarjeta-cab p { margin-top: 3px; font-size: 13.5px; color: var(--texto-2); }
.tarjeta.sin-relleno > .tarjeta-cab { padding: 18px 20px 0; margin-bottom: 14px; }
.tarjeta-pie {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--borde);
}
.tarjeta.sin-relleno > .tarjeta-pie { margin: 0; padding: 12px 20px; }

/* .rejilla: se acomoda sola (mín. 240px por columna). Variantes:
   .c2 .c3 .c4 = columnas fijas · .c12 = 12 columnas con hijos .s3 … .s12 */
.rejilla { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.rejilla.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rejilla.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rejilla.c12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.rejilla.c12 > * { grid-column: span 12; }
.rejilla.c12 > .s3 { grid-column: span 3; }
.rejilla.c12 > .s4 { grid-column: span 4; }
.rejilla.c12 > .s5 { grid-column: span 5; }
.rejilla.c12 > .s6 { grid-column: span 6; }
.rejilla.c12 > .s7 { grid-column: span 7; }
.rejilla.c12 > .s8 { grid-column: span 8; }
.rejilla.c12 > .s9 { grid-column: span 9; }
.rejilla.junta { gap: 12px; }

/* Lista de filas (pendientes, empresas, documentos) */
.lista { list-style: none; padding: 0; }
/* En pantallas angostas lo que sigue al texto (píldora, botón) baja a otra línea */
.lista > li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 0; border-top: 1px solid var(--linea-tabla); min-width: 0; }
.lista > li:first-child { border-top: 0; padding-top: 2px; }
.lista > li:last-child { padding-bottom: 2px; }
.lista-texto { flex: 1 1 200px; min-width: 0; }
.lista-texto b { display: block; color: var(--marino); font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.lista-texto small { display: block; color: var(--texto-2); font-size: 12.5px; margin-top: 2px; }
.lista > li.clic { cursor: pointer; margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.lista > li.clic:hover { background: var(--fondo); border-radius: 10px; border-top-color: transparent; }
.lista > li.clic:hover + li { border-top-color: transparent; }

/* Pares etiqueta: valor */
.pares { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 18px; font-size: 14px; }
.pares dt { display: flex; align-items: center; gap: 8px; color: var(--texto-2); }
.pares dt svg.lucide, .pares dt i[data-lucide] { width: 16px; height: 16px; }
.pares dd { margin: 0; color: var(--marino); font-weight: 500; min-width: 0; }

/* Aviso en línea (banda informativa) */
.aviso {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 12px;
  background: var(--accion-50); border: 1px solid var(--info-borde); color: var(--info-texto); font-size: 14px; line-height: 1.5;
}
.aviso > svg.lucide, .aviso > i[data-lucide] { width: 19px; height: 19px; margin-top: 1px; }
.aviso > div { flex: 1; min-width: 0; }
.aviso b { font-weight: 700; }
.aviso p { color: inherit; }
.aviso.ok { background: var(--ok-50); border-color: var(--ok-borde); color: var(--ok-texto); }
.aviso.alerta { background: var(--alerta-50); border-color: var(--alerta-borde); color: var(--alerta-texto); }
.aviso.peligro { background: var(--peligro-50); border-color: var(--peligro-borde); color: var(--peligro-texto); }
.aviso.marca { background: var(--marca-50); border-color: var(--marca-100); color: var(--marca-700); }

/* ---------- 7. Indicadores (KPI) ---------- */
.kpi {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 12px;
  min-width: 0; padding: 18px 20px; background: var(--superficie);
  border: 1px solid var(--borde); border-radius: var(--r-tarjeta); box-shadow: var(--sombra-1);
}
.kpi.suave { background: var(--suave); border-color: var(--suave-borde); box-shadow: none; }
.kpi-icono {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accion-50); color: var(--accion);
}
.kpi-icono svg.lucide, .kpi-icono i[data-lucide] { width: 20px; height: 20px; }
.kpi-icono.ok { background: var(--ok-50); color: var(--ok); }
.kpi-icono.alerta { background: var(--alerta-50); color: var(--alerta); }
.kpi-icono.peligro { background: var(--peligro-50); color: var(--peligro); }
.kpi-icono.marca { background: var(--marca-50); color: var(--marca-600); }
.kpi-etiqueta { font-size: 13.5px; font-weight: 600; color: var(--marino); line-height: 1.3; }
.kpi-valor { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.kpi-cifra { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--marino); font-variant-numeric: tabular-nums; }
.kpi-cifra small { font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--texto-2); margin-left: 2px; }
.kpi-cifra.alerta { color: var(--alerta); }
.kpi-cifra.peligro { color: var(--peligro); }
.kpi-cifra.ok { color: var(--ok-texto); }
.kpi-pie { grid-column: 1 / -1; font-size: 12.5px; color: var(--texto-2); line-height: 1.4; }
/* Sin ícono: la etiqueta ocupa todo el ancho */
.kpi > .kpi-etiqueta:first-child { grid-column: 1 / -1; }

/* Variación: sube/baja pone la flecha; el color por defecto es sube=verde, baja=rojo.
   Use .bien o .mal cuando el sentido sea el contrario (p. ej. el tiempo que baja es bueno). */
.delta {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pildora);
  font-size: 12.5px; font-weight: 700; line-height: 1.5; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.delta::before { font-size: 8px; line-height: 1; }
.delta.sube::before { content: "▲"; }
.delta.baja::before { content: "▼"; }
.delta.sube { background: var(--ok-50); color: var(--ok-texto); }
.delta.baja { background: var(--peligro-50); color: var(--peligro-texto); }
.delta.bien { background: var(--ok-50); color: var(--ok-texto); }
.delta.mal { background: var(--peligro-50); color: var(--peligro-texto); }
.delta.neutra { background: var(--neutro-50); color: var(--neutro-texto); }

/* Variantes pedidas por las páginas (v2.1) */
.btn.largo { white-space: normal; text-align: left; line-height: 1.3; }
.msg-tarjeta.ancha { max-width: none; width: 100%; }
.cuenta.estatica { cursor: default; }
.cuenta.estatica:hover { background: transparent; border-color: transparent; box-shadow: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-control);
  background: var(--accion); color: #fff; box-shadow: var(--sombra-boton);
  font: 600 14.5px/1.2 var(--fuente); letter-spacing: -.005em; white-space: nowrap; text-decoration: none;
  cursor: pointer; user-select: none; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--accion-hover); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg.lucide, .btn i[data-lucide] { width: 18px; height: 18px; }
.btn.marca { background: var(--marca-600); }
.btn.marca:hover { background: var(--marca-700); }
.btn.sec { background: var(--superficie); color: var(--marino); border-color: var(--borde-control); box-shadow: 0 1px 2px rgba(15, 27, 61, .05); }
.btn.sec:hover { background: var(--fondo); border-color: #AEBBCC; color: var(--marino); }
.btn.suave { background: var(--accion-50); color: var(--info-texto); box-shadow: none; }
.btn.suave:hover { background: var(--accion-100); color: var(--info-texto); }
.btn.ok { background: var(--ok-texto); }
.btn.ok:hover { background: #166534; }
.btn.peligro { background: var(--peligro); }
.btn.peligro:hover { background: var(--peligro-texto); }
.btn.fantasma { background: transparent; color: var(--accion); box-shadow: none; }
.btn.fantasma:hover { background: var(--accion-50); color: var(--accion-hover); }
.btn.chico { min-height: 34px; padding: 0 12px; gap: 6px; border-radius: 8px; font-size: 13.5px; }
.btn.chico svg.lucide, .btn.chico i[data-lucide] { width: 16px; height: 16px; }
.btn.bloque { display: flex; width: 100%; }
.btn.icono { width: 42px; padding: 0; }
.btn.chico.icono { width: 34px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
/* Cargando: <button class="btn" aria-busy="true">Enviando…</button> */
.btn[aria-busy="true"] { pointer-events: none; cursor: progress; }
.btn[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: girar .7s linear infinite;
}
.btn[aria-busy="true"] svg.lucide, .btn[aria-busy="true"] i[data-lucide] { display: none; }

/* ---------- 8. Formularios ---------- */
/* <div class="campo"><label for="x">Etiqueta</label><input id="x"><p class="ayuda">…</p><p class="error-campo">…</p></div> */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > label, .etiqueta { font-size: 13.5px; font-weight: 600; color: var(--marino); line-height: 1.35; }
.opcional { font-weight: 500; color: var(--texto-2); }
.ayuda { font-size: 13px; color: var(--texto-2); line-height: 1.45; }
.error-campo { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; font-weight: 500; color: var(--peligro-texto); line-height: 1.45; }
.error-campo::before {
  content: ""; flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%;
  background: var(--peligro) var(--svg-exclamacion) center / 12px no-repeat;
}
/* Varios campos en una fila que se apilan en pantallas angostas */
.grupo { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"]), select, textarea) {
  width: 100%; min-height: 44px; padding: 10px 12px; margin: 0;
  font: inherit; font-size: 15px; color: var(--texto); background: var(--superficie);
  border: 1px solid var(--borde-control); border-radius: var(--r-control);
  transition: border-color .15s, box-shadow .15s;
}
:where(input, select, textarea):hover { border-color: #AEBBCC; }
:where(input, select, textarea):focus { outline: none; border-color: var(--accion); box-shadow: var(--anillo); }
:where(input, select, textarea)::placeholder { color: #8391A6; opacity: 1; }
:where(input, select, textarea)[aria-invalid="true"], .campo.invalido :where(input, select, textarea) { border-color: var(--peligro); }
:where(input, select, textarea)[aria-invalid="true"]:focus, .campo.invalido :where(input, select, textarea):focus { box-shadow: var(--anillo-error); }
:where(input, select, textarea):disabled { background: var(--fondo); color: var(--texto-2); cursor: not-allowed; }
:where(textarea) { min-height: 110px; resize: vertical; line-height: 1.5; }
:where(select) {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: var(--svg-flecha); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accion); cursor: pointer; flex: none; }

/* Campo con ícono al inicio (buscador) */
.con-icono { position: relative; }
.con-icono > svg.lucide, .con-icono > i[data-lucide] {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px;
  color: var(--texto-2); pointer-events: none;
}
.con-icono > input { padding-left: 40px; }

/* Casilla con texto */
.casilla { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--texto); line-height: 1.45; cursor: pointer; }
.casilla input { margin-top: 1px; }

/* Interruptor: <input type="checkbox" class="interruptor" role="switch"> */
input[type="checkbox"].interruptor {
  appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: var(--r-pildora); cursor: pointer;
  background: #CBD5E1 radial-gradient(circle at center, #fff 0 8px, transparent 8.6px) no-repeat left 0 center / 24px 24px;
  transition: background-color .2s, background-position .2s;
}
input[type="checkbox"].interruptor:checked { background-color: var(--marca-600); background-position: right 0 center; }
input[type="checkbox"].interruptor:disabled { opacity: .5; cursor: not-allowed; }

/* Contador de caracteres */
.contador { font-size: 12px; color: var(--texto-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Casillas de código (OTP). H.otp(el) crea/gestiona los 6 inputs. */
.otp { display: flex; align-items: center; gap: 8px; max-width: 340px; }
.otp input {
  flex: 1 1 0; min-width: 0; max-width: 48px; height: 54px; min-height: 0; padding: 0;
  text-align: center; font: 600 22px/1 var(--mono); color: var(--marino); caret-color: var(--accion);
}
.otp input::placeholder { color: #C5CFDC; }
.otp input:not(:placeholder-shown) { border-color: var(--marca); background: var(--marca-50); }
.otp input:focus { border-color: var(--accion); background: var(--superficie); }
.otp.ok input { border-color: var(--ok); background: var(--ok-50); color: var(--ok-texto); }
.otp.error input { border-color: var(--peligro); background: var(--peligro-50); animation: sacudir .35s; }
.otp .icono-ok {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--ok) var(--svg-check) center / 18px no-repeat;
}

/* ---------- Píldoras de estado ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pildora);
  background: var(--neutro-50); color: var(--neutro-texto);
  font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle;
}
.pill svg.lucide, .pill i[data-lucide] { width: 14px; height: 14px; }
.pill.ok { background: var(--ok-50); color: var(--ok-texto); }
.pill.alerta { background: var(--alerta-50); color: var(--alerta-texto); }
.pill.peligro { background: var(--peligro-50); color: var(--peligro-texto); }
.pill.info { background: var(--accion-50); color: var(--info-texto); }
.pill.marca { background: var(--marca-50); color: var(--marca-700); }
.pill.neutro { background: var(--neutro-50); color: var(--neutro-texto); }
.pill.con-punto::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* Ruta del agente: color + forma + texto (círculo verde, triángulo amarillo, rombo rojo) */
.punto-ruta { display: inline-block; flex: none; width: 9px; height: 9px; background: var(--texto-3); vertical-align: middle; }
.punto-ruta.verde { background: var(--ok); border-radius: 50%; }
.punto-ruta.amarilla { background: var(--alerta); width: 10px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.punto-ruta.roja { background: var(--peligro); width: 8px; height: 8px; border-radius: 1px; transform: rotate(45deg); }
.ruta {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 9px; border-radius: var(--r-pildora);
  font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle;
  background: var(--neutro-50); color: var(--neutro-texto);
}
.ruta::before { content: ""; flex: none; width: 9px; height: 9px; background: currentColor; }
.ruta.verde { background: var(--ok-50); color: var(--ok-texto); }
.ruta.verde::before { background: var(--ok); border-radius: 50%; }
.ruta.amarilla { background: var(--alerta-50); color: var(--alerta-texto); }
.ruta.amarilla::before { background: var(--alerta); width: 10px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ruta.roja { background: var(--peligro-50); color: var(--peligro-texto); }
.ruta.roja::before { background: var(--peligro); width: 8px; height: 8px; border-radius: 1px; transform: rotate(45deg); }

/* ---------- 9. Paso a paso ---------- */
/* <ol class="pasos"><li class="hecho">…</li><li class="actual" aria-current="step">…</li><li>…</li></ol> */
.pasos { list-style: none; padding: 0; display: flex; counter-reset: paso; }
.pasos > li {
  position: relative; flex: 1 1 0; min-width: 0; counter-increment: paso;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--texto-2);
}
.pasos > li::before {
  content: counter(paso); position: relative; z-index: 1; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--borde-fuerte); background: var(--superficie);
  color: var(--texto-2); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.pasos > li + li::after {
  content: ""; position: absolute; top: 15px; right: calc(50% + 22px); width: calc(100% - 44px); height: 2px;
  border-radius: 2px; background: var(--borde-fuerte);
}
.pasos > li small { display: block; font-size: 12px; font-weight: 500; color: var(--texto-2); }
.pasos > li.hecho { color: var(--marino); }
.pasos > li.hecho::before { content: ""; border-color: var(--ok); background: var(--ok) var(--svg-check) center / 16px no-repeat; }
.pasos > li.hecho + li::after { background: var(--ok); }
.pasos > li.actual, .pasos > li[aria-current="step"] { color: var(--marino); }
.pasos > li.actual::before, .pasos > li[aria-current="step"]::before {
  border-color: var(--accion); color: var(--accion); box-shadow: 0 0 0 4px var(--accion-50);
}

/* ---------- 10. Chat del asistente ---------- */
.chat {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--r-tarjeta); box-shadow: var(--sombra-1);
}
.chat-cab { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--borde); }
.chat-cab .msg-avatar { width: 42px; height: 42px; }
.chat-cab b { display: block; color: var(--marino); font-size: 15px; line-height: 1.3; }
.chat-cab small { display: flex; align-items: center; gap: 6px; color: var(--texto-2); font-size: 12.5px; }
.conectado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-50); }
.chat-hilo {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 20px 18px; background: linear-gradient(180deg, #FAFCFE, var(--suave));
}
.msg { display: flex; align-items: flex-start; gap: 10px; max-width: min(600px, 92%); }
.msg.usuario { align-self: flex-end; flex-direction: row-reverse; }
.msg.ancho, .msg:has(> .msg-tarjeta) { max-width: 100%; }
.msg-avatar {
  flex: none; width: 34px; height: 34px; padding: 3px; border-radius: 50%;
  background: var(--accion-50); box-shadow: inset 0 0 0 1px var(--accion-100);
}
.burbuja { min-width: 0; padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.burbuja p + p { margin-top: 6px; }
.msg.asistente .burbuja { background: var(--superficie); border: 1px solid var(--borde); border-bottom-left-radius: 6px; color: var(--texto); box-shadow: var(--sombra-1); }
.msg.usuario .burbuja { background: var(--accion); color: #fff; border-bottom-right-radius: 6px; }
.msg.usuario .tachon { background: rgba(15, 27, 61, .55); }
.autor { display: block; margin-bottom: 3px; font-size: 12px; font-weight: 700; color: var(--marca-600); }
.hora { display: block; margin-top: 4px; font-size: 11.5px; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.msg.usuario .hora { color: rgba(255, 255, 255, .85); text-align: right; }
/* "Escribiendo…" */
.puntos { display: inline-flex; align-items: center; gap: 4px; height: 20px; }
.puntos i { width: 7px; height: 7px; border-radius: 50%; background: #94A3B8; animation: rebote 1.2s ease-in-out infinite; }
.puntos i:nth-child(2) { animation-delay: .15s; }
.puntos i:nth-child(3) { animation-delay: .3s; }
/* Tarjeta segura dentro del chat: documento, código, decisiones (nunca se piden en texto libre) */
.msg-tarjeta {
  width: min(400px, 100%); min-width: 0; padding: 16px 18px 18px; border-radius: var(--r-tarjeta);
  background: var(--superficie); border: 1px solid var(--borde); border-top: 3px solid var(--marca);
  box-shadow: var(--sombra-2);
}
.msg-tarjeta-cab { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.msg-tarjeta-cab h3 { font-size: 15px; }
.msg-tarjeta-cab p { font-size: 13px; color: var(--texto-2); margin-top: 2px; }
.msg-tarjeta-cab > svg.lucide, .msg-tarjeta-cab > i[data-lucide] {
  width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--marca-50); color: var(--marca-600);
}
.sello-seguro { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--marca-700); }
.sello-seguro svg.lucide, .sello-seguro i[data-lucide] { width: 14px; height: 14px; }

/* Opciones del asistente (tipo de solicitud) */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.chip {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; min-width: 0;
  border: 1px solid var(--borde); border-radius: var(--r-control); background: var(--superficie);
  color: var(--marino); font: 600 14px/1.25 var(--fuente); text-align: left; cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.chip svg.lucide, .chip i[data-lucide] { width: 18px; height: 18px; color: var(--marca-600); }
.chip:hover { border-color: var(--marca); background: #F7FCFB; }
.chip[aria-pressed="true"], .chip[aria-checked="true"] {
  border-color: var(--marca); background: var(--marca-50); color: var(--marca-700); box-shadow: inset 0 0 0 1px var(--marca);
}
/* Dentro del hilo, las opciones se alinean con las burbujas del asistente */
.chat-hilo > .chips { margin-left: 44px; }
/* Respuestas rápidas en una línea */
.chips.en-linea { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.en-linea .chip { min-height: 36px; padding: 6px 14px; border-radius: var(--r-pildora); font-size: 13.5px; }

/* Barra para escribir */
.chat-barra { display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--borde); background: var(--superficie); }
.chat-barra textarea { min-height: 46px; max-height: 160px; padding: 11px 14px; border-radius: 12px; resize: none; }
.chat-barra .btn, .chat-barra .icono-btn { flex: none; }
.chat-barra .btn.icono { width: 46px; min-height: 46px; border-radius: 12px; }
.chat-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px 12px; font-size: 12px; color: var(--texto-2); }
.chat-pie span { display: inline-flex; align-items: center; gap: 6px; }
.chat-pie svg.lucide, .chat-pie i[data-lucide] { width: 14px; height: 14px; color: var(--marca-600); }

/* ---------- 11. Sus datos (protegidos) ---------- */
.protegidos {
  padding: 16px 18px; background: var(--superficie);
  border: 1px solid var(--borde); border-radius: var(--r-tarjeta); box-shadow: var(--sombra-1);
}
.protegidos h3 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.protegidos h3 svg.lucide, .protegidos h3 i[data-lucide] { width: 17px; height: 17px; color: var(--marca-600); }
.protegidos h3 small { font-size: 12px; font-weight: 500; color: var(--texto-2); }
.protegidos dl { margin-top: 10px; }
.protegidos dl > div { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--linea-tabla); font-size: 14px; }
.protegidos dt { display: flex; align-items: center; gap: 9px; color: var(--texto-2); }
.protegidos dt svg.lucide, .protegidos dt i[data-lucide] { width: 16px; height: 16px; }
.protegidos dd { margin: 0 0 0 auto; font: 500 13px/1.4 var(--mono); color: var(--marino); letter-spacing: .02em; text-align: right; }
.protegidos .nota { margin-top: 8px; }

/* ---------- 12. Línea de tiempo ---------- */
/* <ol class="linea"><li class="hecho"><span class="linea-titulo">…</span><span class="linea-meta">…</span></li>…</ol>
   Estados: .hecho (verde con ✓) · .actual (azul) · .pendiente (gris) · .alerta · .peligro */
.linea { list-style: none; padding: 0; }
.linea > li { position: relative; min-width: 0; padding: 0 0 18px 32px; }
.linea > li:last-child { padding-bottom: 0; }
.linea > li::before {
  content: ""; position: absolute; z-index: 1; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--borde-fuerte); background: var(--superficie);
}
.linea > li::after { content: ""; position: absolute; left: 9px; top: 23px; bottom: 1px; width: 2px; border-radius: 2px; background: var(--borde); }
.linea > li:last-child::after { display: none; }
.linea-titulo { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--marino); }
.linea-meta { display: block; margin-top: 1px; font-size: 12.5px; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.linea > li > p { margin-top: 4px; font-size: 13.5px; color: var(--texto); }
.linea > li.hecho::before { border-color: var(--ok); background: var(--ok) var(--svg-check) center / 12px no-repeat; }
.linea > li.hecho::after { background: var(--ok); }
.linea > li.actual::before { border-color: var(--accion); background: radial-gradient(circle, var(--accion) 0 4px, #fff 4.6px); box-shadow: 0 0 0 4px var(--accion-50); }
.linea > li.alerta::before { border-color: var(--alerta); background: var(--alerta) var(--svg-exclamacion) center / 12px no-repeat; }
.linea > li.peligro::before { border-color: var(--peligro); background: var(--peligro) var(--svg-exclamacion) center / 12px no-repeat; }
.linea > li.pendiente .linea-titulo { font-weight: 500; color: var(--texto-2); }
/* Variante bitácora (registro inmutable con huella) */
.linea.bitacora > li { padding-left: 26px; padding-bottom: 16px; }
.linea.bitacora > li:last-child { padding-bottom: 0; }
.linea.bitacora > li::before { left: 4px; top: 5px; width: 12px; height: 12px; border: 0; background: var(--marca); box-shadow: 0 0 0 3px var(--marca-50); }
.linea.bitacora > li::after { left: 9px; top: 21px; background: var(--marca-100); }
.linea.bitacora .huella { display: block; margin-top: 3px; }

/* ---------- 13. Tabla ---------- */
/* <div class="tabla-caja"><table class="tabla">…</table></div> */
.tabla-caja {
  overflow-x: auto; background: var(--superficie);
  border: 1px solid var(--borde); border-radius: var(--r-tarjeta); box-shadow: var(--sombra-1);
}
.tarjeta .tabla-caja { border: 0; border-radius: 0; box-shadow: none; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th {
  padding: 10px 16px; text-align: left; white-space: nowrap; background: #F8FAFD;
  border-bottom: 1px solid var(--borde); font-size: 12.5px; font-weight: 600; color: var(--texto-2);
}
.tabla td { padding: 13px 16px; border-bottom: 1px solid var(--linea-tabla); color: var(--texto); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover td { background: #F8FAFE; }
.tabla tr.clic:focus-visible { outline: 2px solid var(--accion); outline-offset: -2px; }
.tabla tr[aria-selected="true"] td { background: var(--accion-50); }
.tabla tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accion); }
.tabla td.vacia { padding: 36px 16px; text-align: center; color: var(--texto-2); }
.tabla.compacta th { padding: 8px 12px; }
.tabla.compacta td { padding: 9px 12px; }
.celda-doble b { display: block; color: var(--marino); font-weight: 600; line-height: 1.35; }
.celda-doble small { display: block; color: var(--texto-2); font-size: 12.5px; line-height: 1.4; }

/* ---------- 14. Cajón, modal y velo ---------- */
/* Estados con la clase .abierto. H.abrir(el) / H.cerrar(el) se encargan del velo, Esc y el foco. */
.velo {
  position: fixed; inset: 0; z-index: 40; background: rgba(15, 27, 61, .36);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.velo.abierto { opacity: 1; visibility: visible; }
.cajon {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  display: flex; flex-direction: column; background: var(--superficie); box-shadow: var(--sombra-3);
  transform: translateX(100%); visibility: hidden; transition: transform .3s var(--ease), visibility .3s;
}
.cajon.ancho { width: min(900px, 100%); }
.cajon.abierto { transform: none; visibility: visible; }
.cajon-cab { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 16px 24px; border-bottom: 1px solid var(--borde); }
.cajon-cab > div { flex: 1; min-width: 0; }
.cajon-cab h2 { font-size: 18px; }
.cajon-cab p { margin-top: 4px; font-size: 13.5px; color: var(--texto-2); }
.cajon-cuerpo { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cajon-pie { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--borde); background: var(--superficie); }
.cajon-seccion + .cajon-seccion { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--borde); }
.cajon-seccion > h3 { margin-bottom: 12px; font-size: 14.5px; }

.modal {
  position: fixed; z-index: 55;   /* por encima de un cajón abierto; H.abrir sube el velo */ left: 50%; top: 50%; width: min(520px, calc(100% - 32px));
  max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto;
  background: var(--superficie); border-radius: 16px; box-shadow: var(--sombra-3);
  opacity: 0; visibility: hidden; transform: translate(-50%, -46%) scale(.98);
  transition: opacity .2s, transform .25s var(--ease), visibility .25s;
}
.modal.abierto { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
.modal-cab { display: flex; align-items: flex-start; gap: 14px; padding: 22px 20px 0 24px; }
.modal-cab > div { flex: 1; min-width: 0; }
.modal-cab h2 { font-size: 18px; }
.modal-cab p { margin-top: 4px; font-size: 14px; color: var(--texto-2); }
.modal-cuerpo { padding: 18px 24px; }
.modal-pie { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 24px 20px; }
.modal-icono {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--accion-50); color: var(--accion);
}
.modal-icono.peligro { background: var(--peligro-50); color: var(--peligro); }
.modal-icono.alerta { background: var(--alerta-50); color: var(--alerta); }
.modal-icono.ok { background: var(--ok-50); color: var(--ok); }
.modal-icono svg.lucide, .modal-icono i[data-lucide] { width: 20px; height: 20px; }

/* ---------- 15. Aviso emergente (toast) ---------- */
.toasts {
  position: fixed; z-index: 60; right: 20px; bottom: 20px; width: min(400px, calc(100% - 32px));
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px 12px 14px;
  border-radius: 12px; background: var(--marino); color: #fff; box-shadow: var(--sombra-3);
  font-size: 14px; line-height: 1.45; animation: entrar .25s var(--ease);
  transition: opacity .2s, transform .2s;
}
.toast > svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: #93C5FD; }
.toast > span { flex: 1; min-width: 0; padding-top: 1px; }
.toast.ok > svg { color: #4ADE80; }
.toast.alerta > svg { color: #FBBF24; }
.toast.peligro > svg { color: #F87171; }
.toast .icono-btn { width: 28px; height: 28px; margin: -3px 0 -3px 4px; color: rgba(255, 255, 255, .75); }
.toast .icono-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.toast .icono-btn svg { width: 16px; height: 16px; }
.toast.saliendo { opacity: 0; transform: translateY(6px); }

/* ---------- 16. Pestañas ---------- */
/* <div class="tabs" role="tablist"><button role="tab" aria-selected="true">…</button>…</div>
   Variante .segmentos (botones en cápsula, para filtros con aria-pressed) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > button, .tabs > a {
  display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 10px 14px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none; border-radius: 0;
  color: var(--texto-2); font: 600 14px/1.3 var(--fuente); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tabs > button:hover, .tabs > a:hover { color: var(--marino); text-decoration: none; }
.tabs > [aria-selected="true"], .tabs > [aria-current="page"], .tabs > [aria-pressed="true"] { color: var(--accion); border-bottom-color: var(--accion); }
.tabs > :focus-visible { outline-offset: -2px; }
.tabs.segmentos { display: inline-flex; max-width: 100%; gap: 2px; padding: 4px; border: 1px solid var(--borde); border-radius: 12px; background: var(--fondo); }
.tabs.segmentos > button, .tabs.segmentos > a { margin: 0; padding: 7px 12px; border: 0; border-radius: 8px; font-size: 13.5px; }
.tabs.segmentos > [aria-selected="true"], .tabs.segmentos > [aria-current="page"], .tabs.segmentos > [aria-pressed="true"] {
  background: var(--superficie); color: var(--marino); box-shadow: var(--sombra-1);
}
[role="tabpanel"] { padding-top: 18px; }
[role="tabpanel"]:focus-visible { outline-offset: 4px; }

/* ---------- 17. Calendario ---------- */
/* .cal-dia: .fin (sábado/domingo) · .festivo · .hoy · .fuera (otro mes) · [aria-pressed="true"] (seleccionado)
   Dentro: <span class="cal-num">15</span><span class="cal-puntos"><i class="punto-ruta roja"></i></span> */
.cal-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-mes { font-size: 15px; font-weight: 700; color: var(--marino); text-transform: capitalize; }
.cal-cab .icono-btn { width: 34px; height: 34px; }
.cal-rejilla { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-sem { padding: 4px 0 6px; text-align: center; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: var(--texto-2); }
.cal-dia {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; min-height: 50px;
  padding: 5px 2px; border: 1px solid transparent; border-radius: 10px; background: none;
  color: var(--marino); font: 600 13.5px/1 var(--fuente); font-variant-numeric: tabular-nums;
}
button.cal-dia { cursor: pointer; transition: background-color .15s, border-color .15s; }
button.cal-dia:hover { background: var(--fondo); border-color: var(--borde); }
.cal-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.cal-dia.fin { background: #F7F9FC; color: var(--texto-2); font-weight: 500; }
.cal-dia.festivo { background: #FDF5F5; color: var(--peligro-texto); }
.cal-dia.festivo::after { content: "Festivo"; font-size: 9.5px; font-weight: 600; letter-spacing: .01em; }
.cal-dia.fuera { visibility: hidden; }
.cal-dia.hoy .cal-num { background: var(--marca-600); color: #fff; }
.cal-dia[aria-pressed="true"] { border-color: var(--accion); background: var(--accion-50); }
.cal-puntos { display: flex; justify-content: center; align-items: center; gap: 3px; min-height: 9px; }
.cal-puntos .punto-ruta { width: 7px; height: 7px; }
.cal-puntos .punto-ruta.amarilla { width: 8px; }
.cal-puntos .punto-ruta.roja { width: 6px; height: 6px; }
.cal-leyenda { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 12.5px; color: var(--texto-2); }
.cal-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.cal-leyenda .muestra { width: 14px; height: 14px; border-radius: 4px; background: #F7F9FC; box-shadow: inset 0 0 0 1px var(--borde); }
.cal-leyenda .muestra.festivo { background: #FDF5F5; box-shadow: inset 0 0 0 1px #F3C9C9; }
.cal-leyenda .muestra.hoy { border-radius: 50%; background: var(--marca-600); box-shadow: none; }
/* Variante grande: celdas altas con el radicado de cada vencimiento */
.calendario.grande .cal-rejilla { gap: 6px; }
.calendario.grande .cal-dia { align-items: stretch; min-height: 104px; padding: 6px; border-color: var(--borde); background: var(--superficie); text-align: left; }
.calendario.grande .cal-dia.fin { background: #F7F9FC; border-color: var(--linea-tabla); }
.calendario.grande .cal-dia.festivo { background: #FDF5F5; border-color: #F8DADA; }
.calendario.grande .cal-dia.festivo::after { position: absolute; top: 10px; right: 8px; }
.calendario.grande .cal-dia.hoy { border-color: var(--marca); box-shadow: inset 0 0 0 1px var(--marca); }
.cal-eventos { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.cal-evento {
  display: flex; align-items: center; gap: 5px; min-width: 0; padding: 2px 6px; border-radius: 6px;
  background: var(--neutro-50); color: var(--marino); font: 500 11px/1.5 var(--mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-evento.verde { background: var(--ok-50); color: var(--ok-texto); }
.cal-evento.amarilla { background: var(--alerta-50); color: var(--alerta-texto); }
.cal-evento.roja { background: var(--peligro-50); color: var(--peligro-texto); }
.cal-evento .punto-ruta { width: 7px; height: 7px; }

/* ---------- 18. Dona y barras ---------- */
/* <div class="dona" style="--valor:98" role="img" aria-label="98 % a tiempo"><b>98%</b><small>a tiempo</small></div> */
.dona {
  --valor: 0; --color: var(--ok); --tam: 136px; --grosor: 13px;
  position: relative; flex: none; width: var(--tam); height: var(--tam);
  display: grid; place-content: center; justify-items: center; text-align: center;
}
.dona::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--color) calc(var(--valor) * 1%), #E7EDF5 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--grosor)), #000 calc(100% - var(--grosor) + 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--grosor)), #000 calc(100% - var(--grosor) + 1px));
}
.dona b { position: relative; font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--marino); font-variant-numeric: tabular-nums; }
.dona small { position: relative; display: block; max-width: calc(var(--tam) - 2 * var(--grosor) - 16px); margin-top: 4px; font-size: 11.5px; font-weight: 500; line-height: 1.3; color: var(--texto-2); }
.dona.alerta { --color: var(--alerta); }
.dona.peligro { --color: var(--peligro); }
.dona.info { --color: var(--accion); }
.dona.marca { --color: var(--marca); }
.dona.chica { --tam: 92px; --grosor: 10px; }
.dona.chica b { font-size: 20px; }
.dona-caja { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; }

/* Barras horizontales: <ul class="barras"><li class="verde"><span class="barra-etiqueta">…</span><span class="barra-pista"><span class="barra-valor" style="--valor:62"></span></span><span class="barra-num">62</span></li></ul> */
.barras { list-style: none; padding: 0; display: grid; gap: 12px; }
.barras > li { display: grid; grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13.5px; }
.barra-etiqueta { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-pista { height: 10px; border-radius: var(--r-pildora); background: #EBF0F7; overflow: hidden; }
.barra-valor { display: block; height: 100%; width: calc(var(--valor, 0) * 1%); min-width: 4px; border-radius: var(--r-pildora); background: var(--accion); transition: width .6s var(--ease); }
.barra-num { min-width: 3ch; text-align: right; font-weight: 700; color: var(--marino); font-variant-numeric: tabular-nums; }
.barras > li.verde .barra-valor { background: var(--ok); }
.barras > li.amarilla .barra-valor { background: var(--alerta); }
.barras > li.roja .barra-valor { background: var(--peligro); }
.barras > li.marca .barra-valor { background: var(--marca); }
/* Barra apilada (proporciones): <div class="apilada"><span class="verde" style="--valor:68"></span>…</div> */
.apilada { display: flex; gap: 3px; height: 12px; border-radius: var(--r-pildora); overflow: hidden; background: #EBF0F7; }
.apilada > span { flex: 0 0 calc(var(--valor, 0) * 1%); background: var(--accion); }
.apilada > .verde { background: var(--ok); }
.apilada > .amarilla { background: var(--alerta); }
.apilada > .roja { background: var(--peligro); }
.apilada > .marca { background: var(--marca); }

/* ---------- 19. Días hábiles (una casilla por día) ---------- */
/* .dia = día por usar · .usado = transcurrido · .alerta = transcurrido con ≤3 restantes · .mal = vencido
   .exceso = día hábil después del vencimiento · .hoy · .prorroga = prórroga posible (punteada) */
.dias { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.dia { width: 10px; height: 18px; border-radius: 3px; background: #E3E9F1; flex: none; }
.dia.usado { background: var(--marca); }
.dia.alerta { background: var(--alerta); }
.dia.mal { background: var(--peligro); }
.dia.prorroga { background: transparent; box-shadow: inset 0 0 0 1.5px #9AA8BB; }
.dia.exceso { background: repeating-linear-gradient(135deg, var(--peligro) 0 2px, #F4A9A9 2px 4px); }   /* días hábiles después del vencimiento */
.dia.hoy { outline: 2px solid var(--marino); outline-offset: 1px; }
.dias.chico { gap: 2px; }
.dias.chico .dia { width: 7px; height: 14px; border-radius: 2px; }

/* ---------- 20. Estados de página: vacío, error, carga ---------- */
.estado-vacio, .estado-error {
  display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 440px; margin: 0 auto;
  padding: 40px 20px; text-align: center;
}
.estado-vacio h3, .estado-error h3 { font-size: 16px; }
.estado-vacio p, .estado-error p { font-size: 14px; color: var(--texto-2); }
.estado-vacio .acciones, .estado-error .acciones { justify-content: center; margin-top: 6px; }
.estado-vacio.compacto, .estado-error.compacto { padding: 22px 12px; }
.estado-icono {
  display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 4px; border-radius: 50%;
  background: var(--accion-50); color: var(--accion); box-shadow: 0 0 0 8px rgba(234, 241, 255, .5);
}
.estado-icono svg.lucide, .estado-icono i[data-lucide] { width: 24px; height: 24px; }
.estado-vacio.marca .estado-icono { background: var(--marca-50); color: var(--marca-600); box-shadow: 0 0 0 8px rgba(230, 246, 244, .55); }
.estado-error .estado-icono { background: var(--peligro-50); color: var(--peligro); box-shadow: 0 0 0 8px rgba(253, 236, 236, .55); }
.estado-error.alerta .estado-icono { background: var(--alerta-50); color: var(--alerta); box-shadow: 0 0 0 8px rgba(254, 243, 226, .55); }

/* Esqueleto de carga: .esqueleto.texto · .titulo · .circulo · .bloque (ancho con style="width:60%") */
.esqueleto {
  display: block; height: 14px; border-radius: 8px;
  background: linear-gradient(90deg, #EBF0F6 0%, #F6F9FC 40%, #EBF0F6 80%) 0 0 / 300% 100%;
  animation: brillo 1.4s ease-in-out infinite;
}
.esqueleto.texto { height: 12px; margin: 8px 0; }
.esqueleto.titulo { height: 20px; width: 45%; }
.esqueleto.circulo { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.esqueleto.bloque { height: 120px; border-radius: var(--r-tarjeta); }

/* ---------- Animaciones ---------- */
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes brillo { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes rebote { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes sacudir { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 21. Responsive ---------- */
@media (max-width: 1180px) {
  .rejilla.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rejilla.c12 > :is(.s4, .s5, .s7, .s8, .s9) { grid-column: span 12; }
  .rejilla.c12 > .s3 { grid-column: span 6; }
}
@media (max-width: 960px) {
  /* La barra lateral pasa a menú superior con navegación desplazable */
  .app { display: block; }
  .lateral {
    position: sticky; top: 0; z-index: 30; height: auto; overflow: visible;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px 0;
    border-right: 0; border-bottom: 1px solid var(--borde); box-shadow: var(--sombra-1);
  }
  .lateral > .marca { padding: 0; }
  .lateral > .marca img { width: 32px; height: 32px; }
  .lateral > .marca b { font-size: 17px; }
  .lateral .nav {
    order: 5; flex-direction: row; gap: 6px; width: calc(100% + 32px); margin: 0 -16px;
    padding: 4px 16px 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  }
  .lateral .nav::-webkit-scrollbar { display: none; }
  .lateral .nav a { flex: none; padding: 7px 12px; border: 1px solid var(--borde); border-radius: var(--r-pildora); font-size: 13.5px; scroll-snap-align: start; }
  .lateral .nav a[aria-current="page"] { border-color: var(--accion-100); }
  .lateral .nav-titulo, .lateral-pie { display: none; }
  .topbar { position: static; min-height: 0; padding: 10px 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--superficie); }
  .contenido { padding: 22px 16px 56px; }
  .rejilla.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rejilla.c12 > .s6 { grid-column: span 12; }
  .cajon-cab, .cajon-cuerpo, .cajon-pie { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .encabezado { margin-bottom: 18px; }
  .encabezado p { font-size: 14px; }
  .rejilla { gap: 14px; }
  .rejilla.c2, .rejilla.c3 { grid-template-columns: minmax(0, 1fr); }
  .rejilla.c12 > .s3 { grid-column: span 12; }
  .tarjeta { padding: 16px; }
  .tarjeta.sin-relleno > .tarjeta-cab { padding: 16px 16px 0; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi-icono { width: 34px; height: 34px; }
  .kpi-icono svg.lucide, .kpi-icono i[data-lucide] { width: 17px; height: 17px; }
  .kpi-etiqueta { font-size: 12.5px; }
  .kpi-cifra { font-size: 26px; }
  .topbar { gap: 10px; }
  .topbar-acciones { gap: 4px; }
  .topbar .demo-badge { font-size: 0; gap: 0; padding: 6px; }
  .cuenta { padding: 3px; border-color: transparent; }
  .chat-hilo > .chips { margin-left: 0; }
  .cuenta > span:not(.avatar), .cuenta > svg, .cuenta > i[data-lucide] { display: none; }
  .topbar-titulo small { display: none; }
  .msg { max-width: 100%; }
  .msg.ancho .msg-avatar, .msg:has(> .msg-tarjeta) .msg-avatar { display: none; }
  .chat-hilo { padding: 16px 12px; }
  .msg-tarjeta { padding: 14px; }
  .pasos > li { font-size: 12px; }
  .pares { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pares dd { margin-bottom: 8px; }
  .barras > li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .barras > li .barra-pista { grid-column: 1 / -1; grid-row: 2; }
  .toasts { left: 16px; right: 16px; bottom: 16px; width: auto; }
  .modal-cab { padding: 18px 16px 0 18px; }
  .modal-cuerpo { padding: 16px 18px; }
  .modal-pie { padding: 12px 18px 18px; }
  .modal-pie .btn { flex: 1 1 auto; }
  .cal-dia { min-height: 44px; font-size: 13px; }
  .cal-dia.festivo::after { content: "Fest."; }
  .calendario.grande .cal-dia.festivo::after { position: static; }
  .calendario.grande .cal-dia { min-height: 64px; }
  .calendario.grande .cal-evento { font-size: 0; padding: 4px; justify-content: center; }
  .calendario.grande .cal-evento .punto-ruta { width: 7px; }
  /* Tabla apilable: cada fila se vuelve tarjeta (td con data-etiqueta) */
  .tabla.apilable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabla.apilable, .tabla.apilable tbody, .tabla.apilable tr, .tabla.apilable td { display: block; width: 100%; }
  .tabla.apilable tr { padding: 10px 14px; border-bottom: 1px solid var(--borde); }
  .tabla.apilable tbody tr:last-child { border-bottom: 0; }
  .tabla.apilable td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .tabla.apilable td::before { content: attr(data-etiqueta); flex: none; font-size: 12.5px; font-weight: 600; color: var(--texto-2); text-align: left; }
  .tabla.apilable td.vacia { display: block; text-align: center; }
  .tabla.apilable td.vacia::before { content: none; }
  .tabla.apilable tr[aria-selected="true"] { background: var(--accion-50); box-shadow: inset 3px 0 0 var(--accion); }
  .tabla.apilable tr[aria-selected="true"] td { background: none; box-shadow: none; }
}
@media (max-width: 400px) {
  .rejilla.c4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi { grid-template-columns: minmax(0, 1fr); }
  .kpi > .kpi-icono { margin-bottom: -2px; }
  .otp { gap: 6px; }
  .otp input { height: 50px; font-size: 20px; }
}

/* Impresión: solo el contenido */
@media print {
  .lateral, .topbar, .toasts, .velo, .chat-barra { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .tarjeta, .kpi, .tabla-caja { box-shadow: none; }
}

/* ---------- 22. Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .esqueleto { animation: none; background: #EDF2F7; }
  .puntos i { animation: none; opacity: .7; }
}
