/* ══════════════════════════════════════════════════════════════
   ormava — la pantalla del producto
   Paleta única: índigo, la del sitio (Ormava website/assets/css/ormava.css), decidida el 13/09/2026.
   La v2 (Figma «Ormava app design», 16/09) toma la forma de un tablero: lateral colapsable, barra de arriba con
   buscador y menú de perfil, tarjetas sin borde de radio 20. Cada color es una variable de la colección
   «ormava» del Figma con el mismo nombre que su custom property acá.
   Contraste sobre el fondo oscuro: tinta 14.9:1 · acento 4.7:1 · secundario 4.6:1.
   ══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  --orm-bg: #14171C; --orm-ink: #E7EAEF; --orm-mark: #E7EAEF; --orm-acc: #3D7BFF;
  --orm-surface: #1D212A; --orm-line: #353A45; --orm-muted: #7C818C;
  /* Sobre las superficies el gris de la marca da 4,1:1; ahí se usa uno apenas más claro, que da 4,7:1. */
  --orm-muted-tarjeta: #868B96;
  --orm-font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --orm-tracking: -0.012em;
  /* El botón principal es el del sitio: claro sobre el fondo, no azul. */
  --app-boton: #E7EAEF; --app-boton-tinta: #14171C;

  /* Semántica de la pantalla (Figma 98:3559). El azul es la marca y lo que se toca: nunca va en una franja ni
     en un estado. Verde: resuelto, salió bien, en línea. Azul claro: en conversación, informativo. Ámbar:
     promesa, vence hoy. Violeta: lo que tiene una persona. Coral: sólo lo urgente. */
  --app-bueno: #3DDC97;
  --app-malo: #FF7D7D;
  --app-alerta: #FFC857;
  --app-persona: #A98BFF;
  --app-info: #5AA9FF;

  /* Derivados. El marco es lo que rodea al panel de contenido; sup2 es la superficie de un escalón más arriba
     (ítem activo, círculos de los botones). */
  --app-marco: color-mix(in srgb, var(--orm-surface) 40%, var(--orm-bg));
  --app-sup2: color-mix(in srgb, var(--orm-ink) 7%, var(--orm-surface));
  --app-tinta-suave: color-mix(in srgb, var(--orm-ink) 82%, var(--orm-bg));
  --app-tinta-70: color-mix(in srgb, var(--orm-ink) 70%, var(--orm-bg));
  --app-sobre-acento: #E7EAEF;
  --app-sombra: 0 18px 40px -24px rgba(0, 0, 0, .55);
  --app-sombra-menu: 0 18px 40px -24px rgba(0, 0, 0, .55), 0 6px 16px rgba(0, 0, 0, .3);
  --app-radio: 12px;
  --radio-grande: 20px;
  --radio-panel: 16px;
  --radio-nav: 10px;

  /* Interacción al estilo Notion: el hover es un velo del color de la tinta, no un color nuevo. Entra casi al
     instante y sale suave; apretar achica un 3%. Nada dura más de 160 ms. */
  --velo-hover: color-mix(in srgb, var(--orm-ink) 6%, transparent);
  --velo-sel: color-mix(in srgb, var(--orm-ink) 8%, transparent);
  --velo-press: color-mix(in srgb, var(--orm-ink) 11%, transparent);
  --radio-control: 7px;
  --t-entra: 40ms;
  --t-sale: 150ms;
  --t-press: 160ms;
  --ease-out: cubic-bezier(.23, 1, .32, 1);

  --ancho-lateral: 264px;
}

/* Tema claro. No hay paleta clara en el Figma («no existe paleta clara», notas de la v2): esta sale de la oscura
   invirtiendo fondo y tinta, y oscureciendo los cinco colores de estado hasta que den 4,5:1 como texto sobre el
   blanco y sobre la superficie. El blanco del texto de las franjas también da 4,5:1 sobre esos mismos colores. */
:root[data-theme="light"] {
  color-scheme: light;
  --orm-bg: #FFFFFF; --orm-ink: #14171C; --orm-mark: #14171C; --orm-acc: #2F6BEA;
  --orm-surface: #F3F4F7; --orm-line: #DCE0E6; --orm-muted: #626874;
  --orm-muted-tarjeta: #5D636E;
  --app-boton: #14171C; --app-boton-tinta: #FFFFFF;
  --app-bueno: #0B8050;
  --app-malo: #D23F3F;
  --app-alerta: #9A6200;
  --app-persona: #6E4FD8;
  --app-info: #1F6FD1;
  --app-marco: #E9ECF1;
  --app-sobre-acento: #FFFFFF;
  --app-sombra: 0 18px 40px -24px rgba(20, 23, 28, .28);
  --app-sombra-menu: 0 18px 40px -24px rgba(20, 23, 28, .3), 0 6px 16px rgba(20, 23, 28, .1);
}
:root[data-nav="colapsado"] { --ancho-lateral: 80px; }

.tarjeta, .item, .conteo, .nodo, .rama, .zona-subida, .caja-respuesta, .nota-simulada, .hoja, .resumen-845, .menu,
.kpi-v2, .tarjeta-estado, .espera-fila { --orm-muted: var(--orm-muted-tarjeta); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--app-marco); color: var(--orm-ink); font-family: var(--orm-font);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace; font-size: .86em; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--orm-muted); }
.acento { color: var(--orm-acc); }
.malo { color: var(--app-malo); }
.alerta { color: var(--app-alerta); }
.oculto { display: none !important; }
.solo-lector {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
hr { border: 0; border-top: 1px solid var(--orm-line); margin: 18px 0; }
.saltar {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--radio-control);
  background: var(--app-boton); color: var(--app-boton-tinta); font-weight: 700; text-decoration: none;
}
.saltar:focus { top: 12px; outline: 2px solid var(--orm-acc); outline-offset: 2px; }

/* ── Estructura ──────────────────────────────────────────────── */
/* El lateral vive sobre el marco; el contenido es un panel redondeado del color del fondo, con 8 px de aire
   arriba, abajo y a la derecha (Figma 28:255). */
.app { display: grid; grid-template-columns: var(--ancho-lateral) minmax(0, 1fr); min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow-y: auto; overflow-x: hidden;
  padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin;
}
.lateral-arriba { display: flex; align-items: center; }
.boton-panel {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radio-nav); border: 0;
  background: transparent; color: var(--orm-ink); cursor: pointer; padding: 0; flex: none;
  transition: background-color var(--t-sale) ease;
}
.boton-panel svg { width: 20px; height: 20px; }
.marca-lateral { display: flex; align-items: center; min-height: 52px; padding: 8px 0 8px 8px; text-decoration: none; border-radius: var(--radio-nav); }
.marca-lateral .orm-lockup-inline { font-size: 26px; }
.marca-app {
  display: none; width: 36px; height: 36px; border-radius: 10px; background: var(--app-boton);
  place-items: center; flex: none;
}
.marca-app svg { width: 14px; height: 21px; }
.marca { display: block; padding: 2px 10px; text-decoration: none; }
.orm-lockup-inline {
  display: inline-flex; align-items: baseline; font-family: var(--orm-font); font-weight: 800;
  font-size: 34px; line-height: 1; letter-spacing: var(--orm-tracking); color: var(--orm-ink);
}
.orm-lockup-inline > svg { height: .9493em; width: .6302em; margin: 0 .003em 0 -.010em; position: relative; top: .015em; flex: none; }

/* El selector de empresa: la inicial en un cuadrado, el nombre y ⇅. */
.espacio-de-trabajo {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 6px; border-radius: var(--radio-nav);
  color: var(--orm-ink); font-size: 15px; font-weight: 500; line-height: 1.3; min-width: 0; list-style: none;
  cursor: default; transition: background-color var(--t-sale) ease;
}
summary.espacio-de-trabajo { cursor: pointer; }
.espacio-de-trabajo::-webkit-details-marker { display: none; }
.espacio-de-trabajo > .etiqueta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.espacio-de-trabajo > svg { width: 18px; height: 18px; color: var(--orm-muted); flex: none; }
.inicial {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: var(--app-sup2); color: var(--orm-ink); font-weight: 700; font-size: 13px; line-height: 1;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .grupo { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--orm-muted); font-weight: 600; margin: 16px 10px 4px; white-space: nowrap; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px;
  border-radius: var(--radio-nav); text-decoration: none; color: var(--orm-ink); font-weight: 500; font-size: 15px;
  line-height: 1.3; -webkit-tap-highlight-color: transparent; transition: background-color var(--t-sale) ease;
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a .etiqueta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a.activo { background: var(--app-sup2); }
/* Contador de pendientes (Nav v2/Contador): ámbar para la cola. */
.contador {
  display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 3px; border-radius: var(--radio-control);
  background: var(--app-alerta); color: var(--orm-bg); font-size: 13px; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums; flex: none;
}
.contador.persona { background: var(--app-persona); }
/* Punto de estado con anillo (Nav v2/Punto). */
.punto-estado {
  width: 8px; height: 8px; border-radius: 50%; background: var(--app-bueno); flex: none; margin: 0 8px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-bueno) 22%, transparent);
}
.punto-estado.malo { background: var(--app-malo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-malo) 22%, transparent); }
.lateral .espaciador { flex: 1 1 auto; min-height: 12px; }
.lateral .divisor { height: 1px; background: var(--orm-line); flex: none; }
.nav-secundario { padding-top: 12px; }
.punto-lateral { display: none; }
.lateral-pie { margin-top: auto; padding: 0 10px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--orm-muted); }

/* Colapsado: un riel de íconos de 44. Las etiquetas quedan para el lector de pantalla y como tooltip. */
[data-nav="colapsado"] .lateral { padding: 12px 18px 16px; align-items: center; }
[data-nav="colapsado"] .lateral-arriba { justify-content: center; }
[data-nav="colapsado"] .marca-lateral { padding: 0; min-height: 0; }
[data-nav="colapsado"] .marca-lateral .orm-lockup-inline { display: none; }
[data-nav="colapsado"] .marca-app { display: grid; }
[data-nav="colapsado"] .lateral .selector-empresa, [data-nav="colapsado"] .lateral > .espacio-de-trabajo { width: 40px; }
[data-nav="colapsado"] .lateral .espacio-de-trabajo { width: 40px; padding: 0; justify-content: center; background: var(--app-sup2); }
[data-nav="colapsado"] .lateral .espacio-de-trabajo > .etiqueta, [data-nav="colapsado"] .lateral .espacio-de-trabajo > svg { display: none; }
[data-nav="colapsado"] .lateral .espacio-de-trabajo .inicial { background: transparent; }
[data-nav="colapsado"] .lateral .nav { align-items: center; }
[data-nav="colapsado"] .lateral .nav .grupo { width: 24px; height: 1px; margin: 10px 0; background: var(--orm-line); font-size: 0; overflow: hidden; }
[data-nav="colapsado"] .lateral .nav a { width: 44px; height: 44px; padding: 0; justify-content: center; }
[data-nav="colapsado"] .lateral .nav a .etiqueta {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
[data-nav="colapsado"] .lateral .nav a .contador {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 2px; border-radius: 99px;
  font-size: 10px; box-shadow: 0 0 0 2px var(--app-marco);
}
[data-nav="colapsado"] .lateral .nav a .punto-estado { position: absolute; top: 5px; right: 5px; margin: 0; }
[data-nav="colapsado"] .lateral .divisor { width: 24px; align-self: center; }
[data-nav="colapsado"] .punto-lateral { display: block; margin: 8px 0 0; }
/* El tooltip del riel: el nombre de la sección, a la derecha, con el mouse o con el foco del teclado. */
[data-nav="colapsado"] .lateral .nav a[data-nombre]::after {
  content: attr(data-nombre); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  padding: 5px 9px; border-radius: var(--radio-control); background: var(--app-boton); color: var(--app-boton-tinta);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; z-index: 40;
  transition: opacity var(--t-sale) ease;
}
[data-nav="colapsado"] .lateral .nav a[data-nombre]:hover::after, [data-nav="colapsado"] .lateral .nav a[data-nombre]:focus-visible::after { opacity: 1; }
[data-nav="colapsado"] .lateral { overflow: visible; }

.contenido {
  display: flex; flex-direction: column; gap: 20px; min-width: 0; margin: 8px 8px 8px 0;
  min-height: calc(100vh - 16px); min-height: calc(100svh - 16px);
  padding: 12px 28px 32px; background: var(--orm-bg); border-radius: var(--radio-panel);
}
.contenido:focus { outline: none; }
/* El menú de la empresa no puede salirse del lateral abierto (que recorta a lo ancho); en el riel sí sale. */
.selector-empresa .menu { width: 100%; min-width: 0; }
[data-nav="colapsado"] .selector-empresa .menu { width: 264px; }

/* ── Barra de arriba ─────────────────────────────────────────── */
.barra-superior { display: flex; align-items: center; gap: 16px; min-height: 44px; }
.buscador {
  position: relative; display: flex; align-items: center; gap: 10px; width: 340px; max-width: 100%; height: 44px;
  padding: 0 8px 0 14px; border-radius: var(--app-radio); background: var(--orm-surface); color: var(--orm-muted);
  transition: box-shadow var(--t-sale) ease;
}
.buscador > svg { width: 18px; height: 18px; flex: none; }
.buscador input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--orm-ink); font: inherit;
  font-size: 14px; outline: none;
}
.buscador input::placeholder { color: var(--orm-muted); opacity: 1; }
.buscador input::-webkit-search-cancel-button { filter: grayscale(1); }
.buscador:focus-within { box-shadow: 0 0 0 2px var(--orm-acc); }
.buscador kbd, .atajo-tecla {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radio-control);
  background: var(--app-sup2); color: var(--orm-muted-tarjeta); font: 600 11px/1 var(--orm-font);
}
.buscador:focus-within kbd { display: none; }
.barra-acciones { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.boton-circulo {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--orm-line); background: var(--orm-surface); color: var(--app-tinta-70); cursor: pointer;
  list-style: none; transition: background-color var(--t-sale) ease, color var(--t-sale) ease;
}
.boton-circulo::-webkit-details-marker { display: none; }
.boton-circulo svg { width: 20px; height: 20px; }
.aviso-punto {
  position: absolute; top: 1px; right: 1.5px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--app-malo); border: 2px solid var(--orm-bg);
}
/* El botón píldora: claro sobre el fondo, con el círculo del ícono adentro (Botón píldora, Figma 38:244). */
.boton-pildora {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px 0 4px; border-radius: 99px;
  border: 0; background: var(--app-boton); color: var(--app-boton-tinta); font: inherit; font-size: 14.5px;
  font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-sale) ease, transform var(--t-press) var(--ease-out);
}
.boton-pildora .circulo {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: color-mix(in srgb, var(--orm-acc) 18%, var(--app-boton));
}
.boton-pildora .circulo svg { width: 18px; height: 18px; }
.boton-pildora:active { transform: scale(.97); }
.avatar {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--orm-acc);
  color: var(--app-sobre-acento); font-weight: 700; font-size: 15px; line-height: 1; letter-spacing: .01em; cursor: pointer;
  list-style: none; flex: none; border: 2px solid transparent; transition: border-color var(--t-sale) ease;
}
.avatar::-webkit-details-marker { display: none; }
.avatar.chico { width: 40px; height: 40px; font-size: 14px; cursor: default; }
details[open] > .avatar { border-color: var(--app-boton); }

/* ── Desplegables y menús ────────────────────────────────────── */
/* Son <details>: se abren sin JavaScript y con el teclado. El script sólo cierra al tocar afuera o con Escape. */
.desplegable { position: relative; }
.desplegable > summary { list-style: none; }
.desplegable > summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute; z-index: 50; top: calc(100% + 8px); right: 0; width: 304px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: var(--radio-panel);
  background: var(--orm-surface); border: 1px solid var(--orm-line); box-shadow: var(--app-sombra-menu);
  color: var(--orm-ink);
}
.desplegable[open] > .menu { animation: menu-aparece 140ms var(--ease-out); }
@keyframes menu-aparece { from { opacity: 0; transform: translateY(-4px); } }
.menu.a-la-izquierda { left: 0; right: auto; }
.menu-cabecera { display: flex; align-items: center; gap: 12px; padding: 8px 8px 10px; min-width: 0; }
.menu-cabecera .datos { display: flex; flex-direction: column; min-width: 0; }
.menu-cabecera strong { font-size: 14px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-cabecera span { font-size: 12.5px; color: var(--orm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-divisor { height: 13px; padding: 6px 0; flex: none; }
.menu-divisor::before { content: ''; display: block; height: 1px; background: var(--orm-line); }
.menu-titulo { padding: 8px 12px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--orm-muted); }
.menu form { margin: 0; display: contents; }
.menu-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: var(--app-radio); background: transparent; color: var(--app-tinta-suave); font: inherit;
  font-size: 15px; font-weight: 500; line-height: 1.3; text-align: left; text-decoration: none; cursor: pointer;
  list-style: none; -webkit-tap-highlight-color: transparent; transition: background-color var(--t-sale) ease, color var(--t-sale) ease;
}
.menu-item::-webkit-details-marker { display: none; }
.menu-item > svg { width: 20px; height: 20px; flex: none; }
.menu-item > .etiqueta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .menu-valor { font-size: 12.5px; font-weight: 400; color: var(--orm-muted); }
.menu-item > .chevron { width: 16px; height: 16px; color: var(--orm-muted); transition: transform var(--t-press) var(--ease-out); }
.menu-item[aria-current="page"], .menu-item[aria-current="true"], .menu-item[aria-pressed="true"] { background: var(--app-sup2); color: var(--orm-ink); }
.menu-item[aria-current="page"]::before {
  content: ''; position: absolute; left: -8px; top: 50%; width: 3px; height: 20px; border-radius: 2px;
  transform: translateY(-50%); background: var(--app-boton);
}
.menu-item .inicial { width: 24px; height: 24px; font-size: 12px; border-radius: 7px; }
.menu-item > .check { width: 18px; height: 18px; color: var(--app-bueno); }
.submenu[open] > summary .chevron { transform: rotate(90deg); }
.submenu-opciones { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px 32px; }
.submenu-opciones .menu-item { min-height: 36px; font-size: 14px; }
.menu-vacio { padding: 12px; font-size: 13.5px; color: var(--orm-muted); }
.menu-avisos { width: 360px; }
.aviso-item { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--app-radio); font-size: 13.5px; }
.aviso-item strong { display: flex; gap: 8px; align-items: center; }
.aviso-item strong::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--app-alerta); flex: none; }
.aviso-item.grave strong::before { background: var(--app-malo); }
.aviso-item span { color: var(--orm-muted); font-size: 12.5px; padding-left: 15px; }
.aviso-item form { display: block; padding: 6px 0 0 15px; }

/* ── Encabezados de página ───────────────────────────────────── */
.cinta {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 8px 14px; border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--app-alerta) 55%, var(--orm-line));
  color: color-mix(in srgb, var(--app-alerta) 80%, var(--orm-ink));
  background: color-mix(in srgb, var(--app-alerta) 6%, transparent);
}
.cinta strong { letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.encabezado { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.encabezado h1 { margin: 0; font-weight: 700; font-size: 32px; letter-spacing: -0.025em; line-height: 1.05; }
.encabezado .bajada { margin: 8px 0 0; color: var(--orm-muted); max-width: 74ch; font-size: 15px; }
.reloj-demo {
  text-align: right; font-size: 12.5px; color: var(--orm-muted); border-radius: var(--app-radio); padding: 8px 12px;
  background: var(--orm-surface);
}
.reloj-demo strong { display: block; color: var(--orm-ink); font-size: 15px; }
h2 { font-size: 13px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; margin: 0 0 12px; color: var(--app-tinta-suave); }
h2 .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
h3 { font-size: 16px; margin: 0 0 6px; letter-spacing: -0.01em; }
.seccion { margin-top: 34px; }
.seccion > .titulo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.seccion > .titulo h2 { margin: 0; }

/* ── Tarjetas y grillas ──────────────────────────────────────── */
.grilla { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.tarjeta {
  background: var(--orm-surface); border: 1px solid transparent; border-radius: var(--radio-grande);
  padding: 20px 22px; min-width: 0;
}
.tarjeta.plana { background: transparent; border-color: var(--orm-line); }
.tarjeta.resaltada { border-color: color-mix(in srgb, var(--orm-acc) 55%, var(--orm-line)); }
.tarjeta > h2:first-child { margin-bottom: 14px; }
.tarjeta .pie { margin-top: 14px; font-size: 12.5px; color: var(--orm-muted); }
.kpi .etiqueta { font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--orm-muted); font-weight: 700; }
.kpi .valor { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .valor small { font-size: .45em; letter-spacing: 0; font-weight: 700; color: var(--orm-muted); }
.kpi .nota { color: var(--orm-muted); font-size: 13px; }
.kpi .delta { display: inline-flex; gap: 4px; align-items: center; font-weight: 800; font-size: 13px; color: var(--app-bueno); }

.heroe { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.heroe .principal { padding: 24px 26px 18px; }
.heroe .cifra { font-size: 56px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.heroe .comparacion { display: flex; gap: 26px; flex-wrap: wrap; margin: 14px 0 6px; }
.heroe .comparacion div { font-size: 13px; color: var(--orm-muted); }
.heroe .comparacion strong { display: block; font-size: 20px; color: var(--orm-ink); letter-spacing: -0.02em; }
.heroe .lateral-kpis { display: grid; gap: 16px; }
.leyenda { display: flex; gap: 16px; font-size: 12.5px; color: var(--orm-muted); flex-wrap: wrap; }
.leyenda i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

/* ── Gráficos ─────────────────────────────────────────────────── */
.grafico svg { width: 100%; height: auto; display: block; overflow: visible; }
.grafico .guia { stroke: var(--orm-line); stroke-dasharray: 2 5; }
.grafico .eje { fill: var(--orm-muted); font-size: 11px; font-family: var(--orm-font); }
.grafico .serie-sistema { stroke: var(--orm-acc); stroke-width: 2.6; fill: none; stroke-linejoin: round; }
.grafico .area-sistema { fill: color-mix(in srgb, var(--orm-acc) 14%, transparent); }
.grafico .serie-control { stroke: var(--orm-muted); stroke-width: 2; fill: none; stroke-dasharray: 5 5; }
.grafico .final { font-size: 12px; font-weight: 800; font-family: var(--orm-font); }

.barras { display: flex; flex-direction: column; gap: 11px; }
.barras .fila { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; font-size: 13.5px; }
.barras .fila .n { font-weight: 800; font-variant-numeric: tabular-nums; }
.barra { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--orm-ink) 8%, transparent); overflow: hidden; }
.barra > span { display: block; height: 100%; border-radius: 99px; background: var(--orm-acc); }
.barra.malo > span { background: var(--app-malo); }
.barra.persona > span { background: var(--app-persona); }
.barra.alerta > span { background: var(--app-alerta); }
.barra.gris > span { background: var(--orm-muted); }

.embudo { display: flex; flex-direction: column; gap: 8px; }
.embudo .paso { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; font-size: 13.5px; }
.embudo .cinta-e { grid-column: 1 / -1; height: 28px; border-radius: 8px; background: color-mix(in srgb, var(--orm-acc) 20%, transparent); position: relative; overflow: hidden; }
.embudo .cinta-e span { position: absolute; inset: 0 auto 0 0; background: var(--orm-acc); border-radius: 8px; }
.embudo .paso strong { font-variant-numeric: tabular-nums; }

.columnas { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 6px; }
.columnas .col { flex: 1; display: flex; flex-direction: column-reverse; gap: 1px; min-width: 3px; height: 100%; position: relative; }
.columnas .col span { display: block; border-radius: 2px 2px 0 0; }
.columnas .col .bot { background: var(--orm-acc); }
.columnas .col .entra { background: color-mix(in srgb, var(--orm-ink) 55%, var(--orm-bg)); }
.columnas .col .fin-de-semana { position: absolute; inset: 0; background: color-mix(in srgb, var(--orm-ink) 4%, transparent); border-radius: 3px; }
.columnas .col.recortada::before { content: '≈'; position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--orm-muted); }
.columnas .col:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--orm-ink); color: var(--orm-bg); font-size: 11.5px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 3;
}
.eje-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--orm-muted); margin-top: 6px; }

.horas { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 96px; }
.horas span { display: block; border-radius: 3px 3px 0 0; background: var(--orm-acc); min-height: 2px; }
.horas span.fuera { background: color-mix(in srgb, var(--app-persona) 80%, transparent); }
.horas-eje { display: grid; grid-template-columns: repeat(24, 1fr); font-size: 10px; color: var(--orm-muted); margin-top: 4px; }

/* ── Pastillas de estado ─────────────────────────────────────── */
.pastilla {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12px;
  font-weight: 700; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); white-space: nowrap; line-height: 1.4;
  background: color-mix(in srgb, currentColor 9%, transparent);
}
.pastilla::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pastilla.sin-punto::before { display: none; }
.e-nuevo, .e-no_contactable, .e-excluido, .e-fuera_de_scope { color: var(--orm-muted); }
.e-contactado { color: var(--app-tinta-70); }
.e-en_conversacion { color: var(--app-info); }
.e-promesa { color: var(--app-alerta); }
.e-comprobante { color: var(--app-persona); }
.e-escalado, .e-derivado { color: var(--app-persona); }
/* Atención: `interesado` y `ticket` son las dos salidas de una conversación, y se leen distinto de un vistazo. */
.e-interesado { color: var(--app-bueno); }
.e-ticket { color: var(--app-alerta); }
.e-resuelto { color: var(--app-bueno); }
.p-malo { color: var(--app-malo); }
.p-ok { color: var(--app-bueno); }
.p-alerta { color: var(--app-alerta); }
.p-persona { color: var(--app-persona); }
.p-gris { color: var(--orm-muted); }

/* ── Tablas ───────────────────────────────────────────────────── */
.tabla-caja { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--orm-muted);
  font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--orm-line); white-space: nowrap;
}
.tabla td { padding: 10px; border-bottom: 1px solid color-mix(in srgb, var(--orm-line) 55%, transparent); vertical-align: top; }
.tabla tbody tr:hover td { background: color-mix(in srgb, var(--orm-ink) 3%, transparent); }
.tabla .num { text-align: right; white-space: nowrap; }
.tabla a { text-decoration: none; }
.tabla a:hover { text-decoration: underline; }
.fila-link { cursor: pointer; }
.recorte { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Botones y formularios ───────────────────────────────────── */
.boton {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px;
  padding: 0 14px; border-radius: var(--radio-control); border: 1px solid var(--orm-line); background: transparent;
  color: var(--orm-ink); font: inherit; font-weight: 600; font-size: 13.5px; line-height: 1.2; cursor: pointer;
  text-decoration: none; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color var(--t-sale) ease, border-color var(--t-sale) ease, color var(--t-sale) ease,
    transform var(--t-press) var(--ease-out);
}
.boton svg { width: 16px; height: 16px; flex: none; transition: transform var(--t-press) var(--ease-out); }
.boton:active { transform: scale(.97); background-color: var(--velo-press); }
.boton.primario { background: var(--app-boton); color: var(--app-boton-tinta); border-color: transparent; }
.boton.primario:active { background: color-mix(in srgb, var(--app-boton) 84%, var(--app-boton-tinta)); }
.boton.chico { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.boton.grande { min-height: 44px; padding: 0 18px; font-size: 14.5px; }
.boton.fantasma { border-color: transparent; color: var(--app-tinta-suave); }
.boton[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.botonera { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.campo, select.campo, textarea.campo {
  background: var(--orm-bg); border: 1px solid var(--orm-line); color: var(--orm-ink); border-radius: 10px;
  padding: 9px 12px; font: inherit; font-size: 14px; width: 100%;
}
.campo:focus { outline: 2px solid color-mix(in srgb, var(--orm-acc) 60%, transparent); outline-offset: 1px; border-color: transparent; }
textarea.campo { min-height: 120px; resize: vertical; line-height: 1.45; }
label.etiqueta { display: block; font-size: 12px; font-weight: 700; color: var(--orm-muted); margin: 0 0 5px; letter-spacing: .02em; }
.formulario { display: grid; gap: 14px; }
.formulario .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.formulario .tres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.check input { accent-color: var(--orm-acc); width: 16px; height: 16px; }

/* ── Avisos ───────────────────────────────────────────────────── */
.aviso { border: 1px solid var(--orm-line); border-left: 3px solid var(--orm-acc); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; background: color-mix(in srgb, var(--orm-acc) 5%, transparent); }
.aviso.malo { border-left-color: var(--app-malo); background: color-mix(in srgb, var(--app-malo) 7%, transparent); color: var(--orm-ink); }
.aviso.alerta { border-left-color: var(--app-alerta); background: color-mix(in srgb, var(--app-alerta) 7%, transparent); color: var(--orm-ink); }
.aviso strong { display: block; margin-bottom: 2px; }
.lista-limpia { list-style: none; margin: 0; padding: 0; }
.lista-puntos { margin: 0; padding-left: 18px; }
.lista-puntos li { margin: 4px 0; }

/* ── Cola de la mañana ───────────────────────────────────────── */
.resumen-845 { display: grid; grid-template-columns: auto repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; overflow: hidden; }
.resumen-845 > div { padding: 18px 20px; border-left: 1px solid var(--orm-line); }
.resumen-845 > div:first-child { border-left: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 210px; background: color-mix(in srgb, var(--orm-acc) 8%, transparent); }
.resumen-845 .cifra { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.bloque { margin-top: 26px; }
.bloque-cabecera { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bloque-cabecera .numero { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: var(--orm-surface); border: 1px solid var(--orm-line); font-size: 14px; }
.bloque-cabecera h2 { margin: 0; }
.bloque-cabecera .cuantos { margin-left: auto; font-size: 13px; color: var(--orm-muted); }
.item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; padding: 16px 20px; border: 1px solid transparent;
  border-radius: var(--radio-panel); background: var(--orm-surface); margin-bottom: 8px; align-items: center;
}
.item .quien { font-weight: 600; font-size: 16px; line-height: 1.25; }
.item .quien a { text-decoration: none; }
.item .quien a:hover { text-decoration: underline; }
.item .datos { color: var(--orm-muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.item .cita { margin-top: 8px; font-size: 13.5px; padding: 8px 12px; border-radius: var(--app-radio); background: var(--app-sup2); max-width: 70ch; }
.item .acciones { display: flex; gap: 8px; align-items: center; }
.item.prioridad-0 { box-shadow: inset 3px 0 0 var(--app-malo); }
/* El que se abrió desde el buscador (#ticket-12, #interesado-7): un anillo del acento, y aire arriba al saltar. */
.item[id] { scroll-margin-top: 24px; }
.item:target { box-shadow: inset 0 0 0 2px var(--orm-acc); }
.item.prioridad-1 { box-shadow: inset 3px 0 0 var(--app-alerta); }
.item .monto { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.vacio { padding: 18px; border: 1px dashed var(--orm-line); border-radius: 14px; color: var(--orm-muted); font-size: 13.5px; text-align: center; }
.salud { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.medidor { width: 140px; height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--orm-ink) 10%, transparent); overflow: hidden; }
.medidor span { display: block; height: 100%; background: var(--orm-acc); }

/* ── WhatsApp (colores de WhatsApp a propósito: así lo ve el deudor) ── */
.wa { --wa-fondo: #EFEAE2; --wa-entra: #FFFFFF; --wa-sale: #D9FDD3; --wa-tinta: #111B21; --wa-gris: #667781; --wa-link: #027EB5;
  background: var(--wa-fondo); color: var(--wa-tinta); font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14.2px;
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 18px 18px;
}
.wa-hilo { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 16px; }
.wa-dia { align-self: center; background: #FFFFFF; color: #54656F; font-size: 12px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); margin: 10px 0 6px; text-transform: capitalize; }
.wa-msj { max-width: 82%; padding: 6px 9px 8px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); white-space: pre-wrap; line-height: 1.38; word-wrap: break-word; position: relative; }
.wa-msj.entra { align-self: flex-start; background: var(--wa-entra); border-top-left-radius: 2px; }
.wa-msj.sale { align-self: flex-end; background: var(--wa-sale); border-top-right-radius: 2px; }
.wa-msj.primero { margin-top: 6px; }
.wa-hora { float: right; margin: 8px 0 -5px 12px; font-size: 11px; color: var(--wa-gris); white-space: nowrap; }
.wa-hora .tilde { color: #53BDEB; margin-left: 2px; }
.wa-autor { display: block; font-size: 12.5px; font-weight: 600; color: #6B4FD8; margin-bottom: 2px; }
.wa-botones { align-self: flex-start; width: min(82%, 300px); display: flex; flex-direction: column; gap: 2px; margin: 1px 0 4px; }
.wa-boton { background: #FFFFFF; color: var(--wa-link); text-align: center; padding: 9px 10px; border-radius: 8px; font: inherit; font-weight: 500; border: 0; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
button.wa-boton { cursor: pointer; }
button.wa-boton:hover { background: #F5F6F6; }
.wa-boton[disabled] { color: #8696A0; cursor: default; }
.wa-frenado { align-self: center; max-width: 90%; background: #FFF1EE; color: #8F2716; border: 1px dashed #E3A091; font-size: 12.5px; padding: 7px 11px; border-radius: 9px; margin: 6px 0; line-height: 1.35; }
.wa-frenado b { display: block; margin-bottom: 2px; }
.wa-frenado .texto-frenado { display: block; margin-top: 4px; color: #6B4A44; font-style: italic; white-space: pre-wrap; }
.wa-nota { align-self: center; max-width: 90%; background: #FFF7D6; color: #5E4B0B; font-size: 12.5px; padding: 6px 11px; border-radius: 8px; margin: 6px 0; text-align: center; box-shadow: 0 1px .5px rgba(11,20,26,.1); }
.wa-adjunto { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.wa-adjunto::before { content: ''; width: 34px; height: 40px; border-radius: 4px; background: linear-gradient(135deg, #cfd8dc, #eceff1); border: 1px solid #b0bec5; }

.telefono {
  width: 384px; height: 780px; border-radius: 48px; background: #0B0F0E; padding: 12px; flex: none;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.6), inset 0 0 0 2px #2A302F, 0 0 0 1px #000;
  position: relative;
}
.telefono::before { content: ''; position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; border-radius: 20px; background: #000; z-index: 2; }
.pantalla { width: 100%; height: 100%; border-radius: 38px; overflow: hidden; display: flex; flex-direction: column; }
.wa-cabecera { background: #008069; color: #FFFFFF; padding: 44px 14px 10px; display: flex; align-items: center; gap: 10px; flex: none; }
.wa-cabecera .flecha { font-size: 20px; opacity: .9; }
.wa-avatar { width: 38px; height: 38px; border-radius: 50%; background: #DFE5E7; color: #14171C; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; }
.wa-cabecera .nombre { font-weight: 600; font-size: 16px; line-height: 1.1; display: flex; align-items: center; gap: 5px; }
.wa-cabecera .nombre svg { width: 15px; height: 15px; }
.wa-cabecera .sub { font-size: 12.5px; opacity: .85; }
.wa-cuerpo { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.wa-pie { background: #F0F2F5; padding: 8px 8px 14px; display: flex; gap: 6px; align-items: center; flex: none; }
.wa-entrada { flex: 1; border-radius: 22px; border: 0; padding: 11px 15px; font: inherit; font-size: 14.5px; background: #FFFFFF; color: #111B21; outline: none; }
.wa-circulo { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.wa-circulo.enviar { background: #00A884; color: #FFFFFF; }
.wa-circulo.clip { background: transparent; color: #54656F; width: 36px; }
.wa-circulo svg { width: 22px; height: 22px; }
.escribiendo { align-self: flex-start; background: #FFFFFF; border-radius: 8px; padding: 10px 12px; box-shadow: 0 1px .5px rgba(11,20,26,.13); display: none; gap: 4px; }
.escribiendo.si { display: inline-flex; }
.escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: #8696A0; animation: salto 1s infinite; }
.escribiendo i:nth-child(2) { animation-delay: .15s; } .escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes salto { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ── Simulador ────────────────────────────────────────────────── */
.simulador { display: grid; grid-template-columns: 384px minmax(0, 1fr); gap: 28px; align-items: start; }
.simulador .panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.estados { display: flex; flex-wrap: wrap; gap: 6px; }
.estados .pastilla { opacity: .38; }
.estados .pastilla.actual { opacity: 1; box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 40%, transparent); }
.pasos { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.paso-sim { border: 1px solid var(--orm-line); border-radius: 12px; padding: 12px 14px; background: var(--orm-bg); animation: aparece .25s ease-out; }
.paso-sim .titulo { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; font-size: 13.5px; }
.paso-sim .titulo span { color: var(--orm-muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.paso-sim ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.paso-sim li { font-size: 13px; display: grid; grid-template-columns: 20px 1fr; gap: 6px; }
.paso-sim li .ic { font-weight: 800; text-align: center; }
.paso-sim li small { display: block; color: var(--orm-muted); font-size: 12px; }
.paso-sim .t-regla_ok .ic, .paso-sim .t-promesa .ic { color: var(--app-bueno); }
.paso-sim .t-regla_no .ic { color: var(--app-malo); }
.paso-sim .t-escalada .ic { color: var(--app-persona); }
.paso-sim .t-intencion .ic, .paso-sim .t-fecha .ic { color: var(--app-info); }
.paso-sim .t-transicion .ic { color: var(--app-alerta); }
.paso-sim .t-aviso .ic, .paso-sim .t-evento .ic { color: var(--orm-muted); }
@keyframes aparece { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.desglose { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13.5px; }
.desglose .total { font-weight: 800; border-top: 1px solid var(--orm-line); padding-top: 6px; margin-top: 2px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  position: relative; border: 1px solid var(--orm-line); background: transparent;
  color: color-mix(in srgb, var(--orm-ink) 82%, var(--orm-bg)); border-radius: 99px; padding: 6px 12px; font: inherit;
  font-size: 12.5px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color var(--t-sale) ease, border-color var(--t-sale) ease, color var(--t-sale) ease,
    transform var(--t-press) var(--ease-out);
}
.chip:active { transform: scale(.97); }
.chip.activo { background: var(--orm-acc); color: var(--orm-bg); border-color: transparent; }
.semaforo { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.semaforo span { display: inline-flex; gap: 6px; align-items: center; }
.semaforo i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ── Cómo funciona ────────────────────────────────────────────── */
.mapa { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 34px; padding: 6px 0; }
.mapa svg.flechas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.mapa svg.flechas path { fill: none; stroke: color-mix(in srgb, var(--orm-ink) 28%, var(--orm-bg)); stroke-width: 1.6; }
.mapa svg.flechas path.activa { stroke: var(--orm-acc); stroke-width: 2.4; }
.nodo {
  position: relative; z-index: 1; background: var(--orm-surface); border: 1px solid var(--orm-line); border-radius: 14px;
  padding: 14px 16px 15px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; text-align: left; font: inherit; color: inherit;
}
.nodo:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--orm-acc) 50%, var(--orm-line)); }
.nodo.activo { border-color: var(--orm-acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orm-acc) 22%, transparent); }
.nodo .n { font-size: 11px; font-weight: 800; color: var(--orm-acc); letter-spacing: .1em; text-transform: uppercase; }
.nodo h3 { margin: 5px 0 4px; font-size: 16px; }
.nodo p { margin: 0; color: var(--orm-muted); font-size: 12.8px; line-height: 1.4; }
.nodo.persona .n { color: var(--app-persona); }
.nodo.guardia .n { color: var(--app-malo); }
.detalle-nodo { position: sticky; top: 20px; }
.detalle-nodo h3 { font-size: 22px; letter-spacing: -0.02em; }
.detalle-nodo dl { margin: 14px 0 0; display: grid; gap: 12px; }
.detalle-nodo dt { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--orm-muted); font-weight: 800; }
.detalle-nodo dd { margin: 3px 0 0; font-size: 14px; }
.carril { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 22px; }
.carril .quien { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: var(--orm-muted); padding-top: 14px; text-align: right; }
.carril .quien.bot { color: var(--orm-acc); } .carril .quien.deudor { color: var(--app-info); } .carril .quien.sistema { color: var(--app-alerta); } .carril .quien.persona { color: var(--app-persona); }
.carril .cuerpo { border-left: 2px solid var(--orm-line); padding: 10px 0 18px 22px; position: relative; }
.carril .cuerpo::before { content: ''; position: absolute; left: -7px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--orm-bg); border: 2px solid var(--orm-acc); }
.carril .cuerpo .explica { color: var(--orm-muted); font-size: 13px; margin-top: 8px; max-width: 72ch; }
.carril .cuerpo .explica code { color: var(--orm-ink); }
.ramas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 6px; }
.rama { border: 1px solid var(--orm-line); border-radius: 14px; padding: 14px; background: var(--orm-surface); }
.rama > .etiqueta-rama { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--app-info) 16%, transparent); color: var(--app-info); margin-bottom: 8px; }
.rama .explica { color: var(--orm-muted); font-size: 12.8px; margin: 8px 0 0; }
.mini-wa { border-radius: 12px; overflow: hidden; }
.mini-wa .wa-hilo { padding: 10px; }
.mini-wa .wa-msj { max-width: 100%; font-size: 13.2px; }
.mini-wa .wa-botones { width: 100%; }
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--orm-line); margin-bottom: 18px; flex-wrap: wrap; }
.pestanas button { background: none; border: 0; color: var(--orm-muted); font: inherit; font-weight: 700; font-size: 14px; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pestanas button.activa { color: var(--orm-ink); border-bottom-color: var(--orm-acc); }
.escalera { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.escalon .dia { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.escalon .dia small { font-size: 12px; color: var(--orm-muted); font-weight: 700; letter-spacing: 0; }
.maquina { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.maquina .estado-caja { border: 1px solid var(--orm-line); border-radius: 12px; padding: 10px 12px; background: var(--orm-bg); }
.maquina .estado-caja code { font-size: 11.5px; color: var(--orm-muted); }
.maquina .estado-caja p { margin: 4px 0 0; font-size: 12.5px; color: var(--orm-muted); }

/* ── Subida ───────────────────────────────────────────────────── */
.zona-subida {
  border: 2px dashed var(--orm-line); border-radius: 18px; padding: 34px; text-align: center; background: var(--orm-surface);
  transition: border-color .15s, background .15s; cursor: pointer;
}
.zona-subida.encima, .zona-subida:hover { border-color: var(--orm-acc); background: color-mix(in srgb, var(--orm-acc) 6%, var(--orm-surface)); }
.zona-subida svg { width: 38px; height: 38px; color: var(--orm-acc); }
.zona-subida h3 { font-size: 18px; margin: 10px 0 4px; }
.conteos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.conteo { border: 1px solid var(--orm-line); border-radius: 14px; padding: 14px 16px; background: var(--orm-surface); }
.conteo .valor { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.conteo .etiqueta { font-size: 12.5px; color: var(--orm-muted); font-weight: 600; }
.conteo.ok { border-color: color-mix(in srgb, var(--app-bueno) 55%, var(--orm-line)); }
.conteo.ok .valor { color: var(--app-bueno); }
.conteo.alerta .valor { color: var(--app-alerta); }
.conteo.malo .valor { color: var(--app-malo); }
.mapeo { display: grid; grid-template-columns: auto auto 1fr; gap: 8px 12px; align-items: center; font-size: 14px; }
.mapeo .canon { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--orm-acc); font-weight: 700; }
.mapeo .flecha { color: var(--orm-muted); }
.mapeo .suyo { background: var(--orm-bg); border: 1px solid var(--orm-line); border-radius: 8px; padding: 3px 10px; justify-self: start; }
.crudo { font-size: 12px; border-collapse: collapse; }
.crudo td, .crudo th { border: 1px solid color-mix(in srgb, var(--orm-line) 70%, transparent); padding: 4px 8px; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.crudo th { background: var(--orm-bg); color: var(--orm-muted); font-weight: 700; }
.crudo tr.fila-encabezado td { font-weight: 800; background: color-mix(in srgb, var(--orm-acc) 10%, transparent); }
.crudo tr.cuarentena td { background: color-mix(in srgb, var(--app-malo) 12%, transparent); }
.crudo tr.duplicada td { background: color-mix(in srgb, var(--app-alerta) 12%, transparent); }
.crudo tr.descartada td { color: var(--orm-muted); text-decoration: line-through; }
.crudo tr.no_contactable td { background: color-mix(in srgb, var(--app-persona) 12%, transparent); }
.crudo td.nfila { color: var(--orm-muted); text-align: right; }
.mora-barra { display: flex; height: 14px; border-radius: 99px; overflow: hidden; margin: 10px 0 8px; }
.mora-barra span { display: block; height: 100%; }
.texto-plano { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--orm-bg); border: 1px solid var(--orm-line); border-radius: 12px; padding: 16px; max-height: 480px; overflow: auto; }

/* ── Conversación ─────────────────────────────────────────────── */
.conversacion { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.hilo-caja { border-radius: var(--app-radio); overflow: hidden; border: 1px solid var(--orm-line); }
.linea-tiempo { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--orm-line); }
.linea-tiempo li { position: relative; padding: 0 0 14px 6px; font-size: 13.5px; }
.linea-tiempo li::before { content: ''; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--orm-bg); border: 2px solid var(--orm-acc); }
.linea-tiempo .cuando { font-size: 12px; color: var(--orm-muted); }
.filtros { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filtros a { text-decoration: none; }

/* ── Registro ─────────────────────────────────────────────────── */
.cadena { display: flex; flex-direction: column; gap: 0; }
.eslabon { display: grid; grid-template-columns: 70px minmax(0, 1fr) 190px; gap: 14px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--orm-line) 55%, transparent); font-size: 13px; align-items: start; }
.eslabon .sec { font-weight: 800; font-variant-numeric: tabular-nums; }
.eslabon .hash { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--orm-muted); line-height: 1.5; word-break: break-all; }
.eslabon .hash b { color: var(--orm-acc); font-weight: 600; }

/* ── Responsivo ───────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .heroe, .g-2-1, .g-1-2, .conversacion { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conteos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mapa { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .escalera, .maquina { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .simulador { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .simulador .panel { width: 100%; }
  .resumen-845 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resumen-845 > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  body { background: var(--orm-bg); }
  .app { display: block; }
  .lateral, .barra-superior { display: none; }
  .barra-movil { display: flex; }
  .pestanas-movil { display: grid; }
  .contenido { display: block; margin: 0; min-height: 0; border-radius: 0; padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
  .contenido > * + * { margin-top: 14px; }
  .g2, .g3, .g4, .ramas, .formulario .dos, .formulario .tres { grid-template-columns: minmax(0, 1fr); }
  .conteos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .telefono { width: 100%; max-width: 384px; }
  .carril { grid-template-columns: minmax(0, 1fr); }
  .carril .quien { text-align: left; }
}

/* ── Ingreso y app instalada ─────────────────────────────────── */
/* El ingreso no está en el Figma: toma el mismo lenguaje. El marco de fondo y la caja como el panel de contenido. */
body.ingreso { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.ingreso-caja {
  width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; padding: 32px 32px 28px;
  background: var(--orm-bg); border-radius: var(--radio-grande); box-shadow: var(--app-sombra);
}
.ingreso-caja .marca { padding: 0; margin-bottom: 14px; }
.ingreso-caja .marca .orm-lockup-inline { font-size: 30px; }
.ingreso-caja h1 { margin: 0; font-weight: 700; font-size: 30px; letter-spacing: -0.025em; line-height: 1.05; }
@media (max-width: 520px) {
  body.ingreso { padding: 0; place-items: stretch; background: var(--orm-bg); }
  .ingreso-caja { max-width: none; box-shadow: none; border-radius: 0; padding: 28px 20px; justify-content: center; }
}
.ingreso-caja > p { margin: 0; }
.ingreso-caja > .boton { justify-self: start; align-self: flex-start; }
.ingreso-form { display: grid; gap: 12px; margin-top: 4px; }
.ingreso-form label, .form-en-vivo label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--orm-muted); }
.ingreso-form .boton { justify-content: center; padding: 11px 16px; font-size: 14.5px; }
.ingreso-pie { font-size: 12.5px; margin: 4px 0 0; }
.sesion { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--orm-line); border-radius: 10px; }
.sesion span { display: flex; flex-direction: column; font-size: 12px; min-width: 0; }
.sesion strong { color: var(--orm-ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instalar { display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.instalar svg { width: 16px; height: 16px; flex: none; }
@media (display-mode: standalone) { .instalar { display: none !important; } }

/* ── En vivo y la caja de respuesta ──────────────────────────── */
.caja-respuesta { display: grid; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--orm-line); background: var(--orm-surface); color: var(--orm-ink); }
.caja-respuesta textarea { min-height: 76px; resize: vertical; font-family: inherit; font-size: 14px; }
.caja-respuesta textarea[disabled] { opacity: .6; cursor: not-allowed; }
.caja-respuesta-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; flex-wrap: wrap; }
.caja-respuesta-pie > span { flex: 1 1 260px; }
.nota-simulada { font-size: 12.5px; padding: 11px 14px; margin: 0; border-top: 1px solid var(--orm-line); background: var(--orm-surface); }
.tilde.leido { color: #53BDEB; }
.chequeo { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.chequeo li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 13.5px; align-items: start; }
.chequeo .marca-ok { color: var(--app-bueno); font-weight: 800; text-align: center; }
.chequeo .marca-no { color: var(--app-alerta); font-weight: 800; text-align: center; }
.copiable { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; background: var(--app-sup2); padding: 2px 7px; border-radius: 6px; word-break: break-all; user-select: all; }
.interruptor-estado { font-weight: 800; font-size: 20px; letter-spacing: -0.01em; }
.interruptor-estado.apagado { color: var(--app-malo); }

/* ── Interacción (al estilo Notion) ──────────────────────────── */
/* El hover sólo con puntero de verdad: en el celular no queda pegado. Entra en 40 ms y sale en 150. */
a.tarjeta, .kpi-inicio {
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-sale) ease, border-color var(--t-sale) ease, transform var(--t-press) var(--ease-out);
}
a.tarjeta:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) {
  .nav a:hover, .boton:not(.primario):hover, .chip:not(.activo):hover, .hoy-lista a:hover, .esperando-lista a:hover {
    background-color: var(--velo-hover); color: var(--orm-ink); transition-duration: var(--t-entra), var(--t-entra), var(--t-entra), var(--t-press);
  }
  .nav a.activo:hover { background-color: color-mix(in srgb, var(--app-sup2), var(--orm-ink) 4%); }
  .boton-panel:hover, summary.espacio-de-trabajo:hover, .menu-item:hover, .boton-circulo:hover { background-color: var(--velo-hover); color: var(--orm-ink); transition-duration: var(--t-entra); }
  .boton-circulo:hover { background-color: color-mix(in srgb, var(--orm-surface), var(--orm-ink) 5%); }
  .boton-pildora:hover { background-color: color-mix(in srgb, var(--app-boton) 90%, var(--app-boton-tinta)); transition-duration: var(--t-entra), var(--t-press); }
  .menu-item[aria-current]:hover { background-color: var(--app-sup2); }
  .boton.primario:hover { background-color: color-mix(in srgb, var(--app-boton) 90%, var(--app-boton-tinta)); }
  .boton:hover svg, .hoy-lista a:hover svg { transform: translateX(2px); }
  .chip:not(.activo):hover { border-color: color-mix(in srgb, var(--orm-line), var(--orm-ink) 22%); }
  a.tarjeta:hover {
    background-color: color-mix(in srgb, var(--orm-surface), var(--orm-ink) 4%);
    border-color: color-mix(in srgb, var(--orm-line), var(--orm-ink) 16%); transition-duration: var(--t-entra), var(--t-entra), var(--t-press);
  }
  .ver-todo:hover { color: var(--orm-ink); }
}
:is(.boton, .chip, a.tarjeta, .pestanas-movil a, .pestanas-movil button, .hoy-lista a, .esperando-lista a,
     .boton-panel, .boton-circulo, .boton-pildora, .avatar, summary.espacio-de-trabajo, .marca-lateral, .kpi-v2,
     .tarjeta-estado, .boton-ir, .selector-periodo, .boton-ol, .casilla, .fila-mas > summary, a.tarjeta-v2,
     .fila-v2 .nombre, .saltar):focus-visible {
  outline: 2px solid var(--orm-acc); outline-offset: 2px;
}
.nav a:focus-visible, .menu-item:focus-visible { outline: 2px solid var(--orm-acc); outline-offset: -2px; }
@media (pointer: coarse) {
  .nav a { min-height: 44px; }
  .boton::after, .chip::after {
    content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
  }
}

/* ── Navegación del celular ──────────────────────────────────── */
.barra-movil, .pestanas-movil { display: none; }
.barra-movil {
  position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--orm-bg) 86%, transparent); backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid color-mix(in srgb, var(--orm-line) 60%, transparent);
}
.barra-movil .marca { padding: 0; }
.barra-movil .orm-lockup-inline { font-size: 24px; }
.barra-movil-cliente { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--orm-muted); }
.barra-movil-cliente b, .chip-demo {
  font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--app-alerta);
  border: 1px solid color-mix(in srgb, var(--app-alerta) 45%, transparent); border-radius: 99px; padding: 1px 7px;
}
.pestanas-movil {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--orm-surface) 90%, transparent); backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%); border-top: 1px solid var(--orm-line);
}
.pestanas-movil a, .pestanas-movil button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 50px; min-width: 0;
  padding: 0; border: 0; background: none; border-radius: 10px; font: inherit; font-size: 10.5px; font-weight: 600;
  color: var(--orm-muted); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: color var(--t-sale) ease, background-color var(--t-sale) ease, transform var(--t-press) var(--ease-out);
}
.pestanas-movil svg { width: 22px; height: 22px; flex: none; }
.pestanas-movil span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pestanas-movil .activo { color: var(--orm-ink); }
.pestanas-movil .activo svg { color: var(--orm-acc); }
.pestanas-movil a:active, .pestanas-movil button:active { transform: scale(.94); background: var(--velo-press); }

/* «Más»: una hoja que sube desde abajo. */
.hoja {
  width: min(100%, 520px); max-width: 100%; max-height: 82svh; margin: auto auto 0; padding: 0; overflow-y: auto;
  border: 1px solid var(--orm-line); border-bottom: 0; border-radius: 16px 16px 0 0; background: var(--orm-surface); color: var(--orm-ink);
}
.hoja::backdrop { background: rgb(0 0 0 / .5); }
.hoja[open] { animation: hoja-sube 220ms var(--ease-out); }
.hoja[open]::backdrop { animation: aparecer 220ms ease; }
@keyframes hoja-sube { from { transform: translateY(28px); opacity: 0; } }
@keyframes aparecer { from { opacity: 0; } }
.hoja-cuerpo { display: flex; flex-direction: column; gap: 12px; padding: 6px 12px calc(16px + env(safe-area-inset-bottom)); }
.hoja-asa { width: 38px; height: 4px; border-radius: 99px; background: var(--orm-line); margin: 4px auto 2px; }
.hoja .nav a { min-height: 44px; }
.hoja .nav .grupo:first-child { margin-top: 4px; }
.hoja .instalar { align-self: flex-start; }

/* ── Inicio: una sola pantalla, sin scroll ───────────────────── */
/* Si el alto no alcanza, primero se va el gráfico, después la línea de anoche y la curvita. Nunca se corta: si
   alguien agranda la letra, la pantalla scrollea en vez de esconder. */
.inicio { display: flex; flex-direction: column; gap: 14px; }
.inicio > * { animation: subir 280ms var(--ease-out) both; }
.inicio > :nth-child(2) { animation-delay: 40ms; } .inicio > :nth-child(3) { animation-delay: 80ms; }
.inicio > :nth-child(4) { animation-delay: 120ms; } .inicio > :nth-child(5) { animation-delay: 160ms; }
@keyframes subir { from { opacity: 0; transform: translateY(6px); } }
.inicio-cabecera { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 24px; flex-wrap: wrap; }
.inicio-fecha { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--orm-muted); }
.inicio-cabecera h1 { margin: 0; font-size: clamp(24px, 1.1rem + 1.1vw, 32px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; }
.estado-sistema { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--orm-muted); }
.estado-sistema .punto {
  width: 7px; height: 7px; border-radius: 50%; background: var(--app-bueno);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-bueno) 22%, transparent);
}
.estado-sistema .punto.malo { background: var(--app-malo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-malo) 22%, transparent); }
.estado-sistema .sep { opacity: .5; }
.aviso-enlace { display: block; text-decoration: none; }

.inicio-accion { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; }
.hoy-titulo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hoy-titulo h2 { margin: 0; }
.hoy-titulo > span, .ver-todo { font-size: 12.5px; color: var(--orm-muted); text-decoration: none; white-space: nowrap; transition: color var(--t-sale) ease; }
.tarjeta.hoy { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.hoy-lista, .esperando-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.hoy-lista a {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) 16px; align-items: center; gap: 10px; min-height: 38px;
  padding: 0 8px; margin: 0 -8px; border-radius: var(--radio-control); color: var(--orm-ink); text-decoration: none; font-size: 14px;
  -webkit-tap-highlight-color: transparent; transition: background-color var(--t-sale) ease;
}
.hoy-lista a:active, .esperando-lista a:active { background: var(--velo-press); }
.hoy-lista svg { width: 16px; height: 16px; color: var(--orm-muted); transition: transform var(--t-press) var(--ease-out); }
.hoy-n { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-align: right; color: var(--orm-muted); }
.hoy-n.alerta { color: var(--app-alerta); } .hoy-n.persona { color: var(--app-persona); }
.hoy-noche { margin: 0; font-size: 12.5px; color: var(--orm-muted); }
.tarjeta.hoy .boton.primario { align-self: flex-start; margin-top: 2px; }

.tarjeta.esperando { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; min-width: 0; }
.esperando-lista a {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px;
  border-radius: var(--radio-control); color: var(--orm-ink); text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-sale) ease;
}
.esperando-lista .avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: color-mix(in srgb, var(--app-persona) 16%, var(--orm-surface)); color: var(--app-persona);
}
.esperando-lista .quien { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; line-height: 1.3; }
.esperando-lista .quien > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esperando-lista .quien span { font-size: 12px; color: var(--orm-muted); }
.esperando-lista .espera { font-size: 12px; color: var(--orm-muted); white-space: nowrap; }
.esperando-lista .espera.malo { color: var(--app-malo); }
.esperando-lista .vacio { padding: 16px; }

.inicio-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-inicio { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 14px; color: var(--orm-ink); text-decoration: none; overflow: hidden; min-width: 0; }
.kpi-inicio .etiqueta { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--orm-muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-inicio .valor { font-size: clamp(26px, 1rem + 1.5vw, 38px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-inicio .nota { font-size: 12.5px; color: var(--orm-muted); line-height: 1.35; }
.kpi-inicio .bueno { color: var(--app-bueno); font-weight: 800; }
.kpi-inicio .chispa { width: 100%; height: 26px; margin-top: auto; padding-top: 6px; overflow: visible; }
.chispa-linea { fill: none; stroke: var(--orm-acc); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chispa-area { fill: color-mix(in srgb, var(--orm-acc) 14%, transparent); }

.inicio-grafico { flex: 1 1 0; min-height: 150px; display: flex; flex-direction: column; gap: 8px; padding: 14px 20px 12px; }
/* El gráfico se estira para llenar la tarjeta: la curva es un SVG sin proporción fija (el trazo no se deforma) y
   las etiquetas son HTML ubicado en porcentaje, así el texto nunca se estira. */
.grafico-fluido { flex: 1 1 0; min-height: 0; padding: 6px 46px 22px 36px; }
.grafico-fluido .lienzo { position: relative; width: 100%; height: 100%; }
.grafico-fluido svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grafico-fluido svg * { vector-effect: non-scaling-stroke; }
.grafico-fluido .eje-y, .grafico-fluido .eje-x { position: absolute; font-size: 11px; color: var(--orm-muted); white-space: nowrap; }
.grafico-fluido .eje-y { right: calc(100% + 8px); transform: translateY(-50%); }
.grafico-fluido .eje-x { top: calc(100% + 6px); transform: translateX(-50%); }
.punto-final {
  position: absolute; left: 100%; display: flex; align-items: center; gap: 6px; transform: translate(-4.5px, -50%);
  font-size: 12px; font-weight: 800; color: var(--orm-acc); font-variant-numeric: tabular-nums;
}
.punto-final i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.punto-final.control { color: var(--orm-muted); }
.punto-final.abajo { transform: translate(-4.5px, 35%); }

@media (max-height: 720px) and (min-width: 821px) { .inicio-grafico { display: none; } }
@media (max-width: 1100px) and (min-width: 821px) {
  .inicio-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-inicio .chispa { display: none; }
}
/* Van acá y no más arriba: tienen que ganarle a «.barra-movil, .pestanas-movil { display: none }». */
@media (max-width: 820px) {
  .barra-movil { display: flex; }
  .pestanas-movil { display: grid; }
  .pantalla-inicio .contenido { padding: 12px 16px calc(74px + env(safe-area-inset-bottom)); }
  .pantalla-inicio .cinta { display: none; }
  .inicio { gap: 8px; min-height: 0; }
  .inicio-cabecera { align-items: flex-start; gap: 6px; }
  .inicio-cabecera h1 { font-size: 23px; }
  .inicio-fecha, .estado-sistema .extra { display: none; }
  .inicio-accion { grid-template-columns: minmax(0, 1fr); }
  .tarjeta.esperando, .inicio-grafico { display: none; }
  .tarjeta.hoy { padding: 12px 14px; gap: 6px; }
  .hoy-lista a { min-height: 36px; }
  .tarjeta.hoy .boton.primario { align-self: stretch; }
  .inicio-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-inicio { padding: 10px 12px; gap: 3px; }
  .kpi-inicio .etiqueta { white-space: normal; letter-spacing: .05em; font-size: 10.5px; line-height: 1.3; }
  .kpi-inicio .valor { font-size: 24px; }
  .kpi-inicio .nota { font-size: 11.5px; }
  .kpi-inicio .chispa { height: 18px; }
}
@media (max-width: 820px) and (max-height: 720px) {
  .hoy-noche, .kpi-inicio .chispa { display: none; }
  .hoy-lista a { min-height: 32px; }
}
@media (max-width: 820px) and (max-height: 660px) {
  .pantalla-inicio .contenido { padding-top: 8px; }
  .inicio { gap: 6px; }
  .hoy-lista a { min-height: 30px; }
}

/* Las demás pantallas en el celular: la cinta de la demo y los títulos, más chicos. */
@media (max-width: 820px) {
  .cinta { font-size: 12px; line-height: 1.35; padding: 7px 10px; gap: 8px; }
  .encabezado { margin-bottom: 16px; }
  .encabezado h1 { font-size: 26px; }
  .encabezado .bajada { font-size: 14px; }
  .reloj-demo { display: none; }
  .heroe .cifra { font-size: clamp(32px, 10vw, 56px); }
  .heroe .principal { padding: 18px 16px 14px; }
  .mapa { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .escalera, .maquina { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* «Cómo funciona» ubica cada paso en una grilla de cuatro columnas desde JavaScript. Cuando entran menos, los pasos
   se acomodan solos, en orden, y las flechas (dibujadas para las cuatro columnas) se esconden. */
@media (max-width: 1180px) {
  .mapa > .nodo { grid-column: auto !important; grid-row: auto !important; }
  .mapa svg.flechas { display: none; }
}
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) and (min-width: 821px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .g5 { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  .boton, .chip, a.tarjeta, .kpi-inicio, .pestanas-movil a, .pestanas-movil button { transition-property: background-color, border-color, color; }
  .boton:active, .chip:active, a.tarjeta:active, .pestanas-movil a:active, .pestanas-movil button:active { transform: none; }
  .inicio > *, .hoja[open], .hoja[open]::backdrop, .desplegable[open] > .menu, .tablero-v2 > * { animation: none; }
  .boton-pildora:active, .kpi-v2:active, .tarjeta-estado:active { transform: none; }
  .menu-item > .chevron { transition: none; }
}

.campo.chico, select.campo.chico { padding: 6px 8px; font-size: 13px; }

/* La cinta de alertas: lo que está roto ahora, arriba de todo y en todas las pantallas. Usa el rojo de la
   semántica, que en el resto del producto significa «esto salió mal», no el acento de la marca. */
.alertas { display: flex; flex-direction: column; gap: 8px; }
.alerta-cinta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: var(--app-radio); font-size: 13.5px;
  border: 1px solid color-mix(in srgb, var(--app-alerta) 45%, transparent);
  background: color-mix(in srgb, var(--app-alerta) 10%, var(--orm-surface));
}
.alerta-cinta.grave {
  border-color: color-mix(in srgb, var(--app-malo) 55%, transparent);
  background: color-mix(in srgb, var(--app-malo) 12%, var(--orm-surface));
}
.alerta-cinta strong { display: block; }
.alerta-cinta span { color: var(--orm-muted); font-size: 12.5px; }

/* ── El comprobante que mandó el deudor ──────────────────────── */
.comprobante + .comprobante { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--orm-line); }
.comprobante-foto { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 10px; border: 1px solid var(--orm-line); background: var(--orm-bg); }

/* ── Doble factor ────────────────────────────────────────────── */
.sesion .sesion-cuenta { display: flex; flex-direction: column; font-size: 12px; min-width: 0; color: var(--orm-muted); text-decoration: none; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; transition: background-color 150ms ease; }
.sesion .sesion-cuenta:hover { background: var(--velo-hover, color-mix(in srgb, var(--orm-ink) 6%, transparent)); }
.ingreso-caja.ancha { max-width: 480px; }
.campo.codigo-unico { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 22px; letter-spacing: 0.3em; text-align: center; padding: 10px 12px; }
.pasos-alta { margin: 4px 0 0; padding: 0; list-style: none; counter-reset: paso; display: grid; gap: 18px; }
.pasos-alta > li { counter-increment: paso; display: grid; gap: 8px; padding-left: 34px; position: relative; }
.pasos-alta > li::before { content: counter(paso); position: absolute; left: 0; top: -1px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: color-mix(in srgb, var(--orm-acc) 18%, transparent); color: var(--orm-ink); }
.pasos-alta > li > .muted { font-size: 13.5px; }
.pasos-alta details { font-size: 13px; }
.pasos-alta summary, .ingreso-pie summary { cursor: pointer; }
.qr { background: #fff; border-radius: 12px; padding: 6px; justify-self: start; line-height: 0; }
.qr svg { width: 200px; height: 200px; }
.secreto { display: block; font-size: 14px; letter-spacing: 0.06em; padding: 10px 12px; border: 1px solid var(--orm-line); border-radius: 8px; word-break: break-all; user-select: all; }
.codigos-recuperacion { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; border: 1px solid var(--orm-line); border-radius: 12px; }
.codigos-recuperacion code { font-size: 15px; letter-spacing: 0.04em; user-select: all; }
.ingreso-caja > .boton.primario { align-self: stretch; justify-content: center; }

/* ══════════════════════════════════════════════════════════════
   v2 · Inicio, Conversaciones y búsqueda (Figma 28:255, 46:1053, 46:1194)
   ══════════════════════════════════════════════════════════════ */

.pagina { min-width: 0; }
/* Los tableros son una sola pantalla sin scroll a 1440×900. Si el alto no alcanza, scrollea: nunca se corta. */
.pantalla-tablero .contenido { padding-bottom: 16px; }
.pantalla-tablero .pagina { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.tablero-v2 { flex: 1 1 auto; display: flex; flex-direction: column; gap: 20px; min-height: 0; }
.tablero-v2 > * { animation: subir 280ms var(--ease-out) both; }
.tablero-v2 > :nth-child(2) { animation-delay: 40ms; } .tablero-v2 > :nth-child(3) { animation-delay: 80ms; }
@keyframes subir { from { opacity: 0; transform: translateY(6px); } }

.cabecera-v2 { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 13px 0; }
.cabecera-v2 h1 { margin: 0; font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; }
.cabecera-v2 .controles { display: flex; align-items: center; gap: 10px; }
.cabecera-v2 .chip-demo { vertical-align: middle; margin-left: 10px; position: relative; top: -6px; }
.estado-bot { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; line-height: 1.3; margin: 0; }
.estado-bot .punto-estado { margin: 0; }

/* Selector de período: pastilla de 36 con etiqueta y ▾. Abre la lista de períodos. */
.selector-periodo {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 16px; border-radius: 99px;
  background: var(--orm-surface); color: var(--orm-ink); font-size: 13px; font-weight: 600; line-height: 1.3; cursor: pointer;
  list-style: none; transition: background-color var(--t-sale) ease;
}
.selector-periodo svg { width: 18px; height: 18px; transition: transform var(--t-press) var(--ease-out); }
details[open] > .selector-periodo svg { transform: rotate(180deg); }
.menu.periodos { width: 220px; }

/* El círculo ↗ que lleva a otra pantalla. Oscuro en las tarjetas chicas, claro en las grandes. */
.boton-ir {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--app-sup2); color: var(--app-tinta-70); transition: background-color var(--t-sale) ease, color var(--t-sale) ease;
}
.boton-ir svg { width: 18px; height: 18px; }
.boton-ir.claro { background: var(--app-boton); color: var(--app-boton-tinta); }
.boton-ir.chico { width: 32px; height: 32px; }
.boton-ir.chico svg { width: 16px; height: 16px; }

/* ── Dirección ─────────────────────────────────────────────── */
.fila-principal { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 435px); gap: 16px; min-height: 380px; }
.tarjeta-v2 {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; padding: 20px;
  background: var(--orm-surface); border-radius: var(--radio-grande); color: var(--orm-ink); text-decoration: none;
  --orm-muted: var(--orm-muted-tarjeta);
}
.tarjeta-v2 .cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tarjeta-v2 .titulo-tarjeta { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--orm-ink); text-transform: none; }
.tarjeta-v2 .etiqueta-tarjeta { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.3; color: var(--app-tinta-suave); letter-spacing: 0; text-transform: none; }
.recuperado { padding: 20px 20px 20px 24px; }
.cifra-heroe { margin: 0; font-size: 60px; font-weight: 600; line-height: 1; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* El gráfico: la curva es un SVG sin proporción fija (el trazo no se deforma) y las etiquetas son HTML ubicado en
   porcentaje, así el texto nunca se estira. La curva deja 20 px de aire a cada lado de las guías. */
.grafico-v2 { flex: 1 1 auto; min-height: 140px; padding: 8px 20px 30px 76px; position: relative; }
.grafico-v2 .lienzo { position: relative; width: 100%; height: 100%; }
.grafico-v2 svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grafico-v2 svg * { vector-effect: non-scaling-stroke; }
.grafico-v2 .guia { position: absolute; left: -20px; right: -20px; height: 0; border-top: 1px dashed var(--orm-line); }
.grafico-v2 .guia.base { border-top-style: solid; }
.grafico-v2 .eje-y {
  position: absolute; right: calc(100% + 32px); transform: translateY(-50%); font-size: 12px; color: var(--orm-muted);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.grafico-v2 .eje-x { position: absolute; top: calc(100% + 10px); transform: translateX(-50%); font-size: 12px; color: var(--orm-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.grafico-v2 .linea { fill: none; stroke: var(--app-bueno); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.grafico-v2 .area { fill: url(#gradiente-recuperado); stroke: none; }
.grafico-v2 .gradiente-arriba { stop-color: var(--app-bueno); stop-opacity: .34; }
.grafico-v2 .gradiente-abajo { stop-color: var(--app-bueno); stop-opacity: 0; }
.grafico-v2 .punto-v2 { position: absolute; width: 28px; height: 28px; transform: translate(-50%, -50%); pointer-events: none; }
.grafico-v2 .punto-v2::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--app-bueno); opacity: .2; }
.grafico-v2 .punto-v2::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--app-bueno); border: 3px solid var(--orm-surface); box-sizing: border-box;
}
.grafico-vacio { flex: 1; display: grid; place-items: center; color: var(--orm-muted); font-size: 13.5px; text-align: center; }

/* Cartera por estado: una dona con un color por estado de especificacion-v1.md. */
.c-resuelto { --c: var(--app-bueno); }
.c-contactado { --c: var(--app-tinta-70); }
.c-en_conversacion { --c: var(--app-info); }
.c-promesa { --c: var(--app-alerta); }
.c-escalado, .c-comprobante { --c: var(--app-persona); }
.c-no_contactable, .c-excluido, .c-fuera_de_scope { --c: var(--orm-muted); }
.c-nuevo { --c: var(--orm-line); }
.cartera .cuerpo { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; min-height: 0; }
.dona { position: relative; width: 204px; height: 204px; flex: none; }
.dona svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.dona circle { fill: none; stroke-width: 43; stroke: var(--c, var(--orm-line)); }
.dona circle.dona-vacia { stroke: var(--orm-line); }
.dona-etiqueta {
  position: absolute; left: 50%; top: 50%; font-size: 13px; font-weight: 600; line-height: 1; color: var(--orm-bg);
  font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(-80.5px) rotate(calc(-1 * var(--a)));
}
:root[data-theme="light"] .dona-etiqueta { color: #FFFFFF; }
/* Sobre los segmentos grises oscuros (nuevo, no contactable) el número va en tinta. */
.dona-etiqueta.c-nuevo, .dona-etiqueta.c-no_contactable, .dona-etiqueta.c-excluido, .dona-etiqueta.c-fuera_de_scope { color: var(--orm-ink); }
.dona-centro { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 12.5px; color: var(--orm-muted); padding: 60px; }
.leyenda-v2 { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.leyenda-v2 li { display: flex; align-items: center; gap: 10px; min-height: 20px; font-size: 14px; line-height: 1.45; }
.leyenda-v2 li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--orm-line)); flex: none; }
.leyenda-v2 .nombre { flex: 1; min-width: 0; }
.leyenda-v2 .pct { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Con más de siete estados con cuotas, la leyenda se aprieta para que los indicadores sigan entrando en la pantalla. */
.leyenda-v2.densa { gap: 6px; }
.cartera .cuerpo:has(.leyenda-v2.densa) { gap: 20px; }

.fila-inferior { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; flex: none; }
.kpi-v2 {
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-width: 0; height: 158px;
  padding: 18px 18px 18px 20px; border-radius: var(--radio-grande); background: var(--orm-surface); color: var(--orm-ink);
  text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-sale) ease, transform var(--t-press) var(--ease-out);
}
.kpi-v2 .arriba { display: flex; align-items: flex-start; gap: 8px; }
.kpi-v2 .etiqueta-tarjeta { flex: 1; margin: 0; padding-top: 8px; font-size: 16px; font-weight: 500; line-height: 1.3; color: var(--app-tinta-suave); }
.kpi-v2 .valor-v2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpi-v2 .valor { font-size: 40px; font-weight: 600; line-height: 1.05; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-v2 .valor.cero { color: var(--orm-muted); }
.kpi-v2:active { transform: scale(.99); }
/* Chip delta: el color depende de lo que significa, no de la dirección, y siempre lleva flecha (WCAG 1.4.1). */
.chip-delta {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px 3px 6px; border-radius: 99px;
  background: var(--app-bueno); color: var(--orm-bg); font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
:root[data-theme="light"] .chip-delta { color: #FFFFFF; }
.chip-delta svg { width: 10px; height: 10px; }
.chip-delta.malo { background: var(--app-malo); }
.chip-delta.neutro { background: var(--app-sup2); color: var(--app-tinta-suave); }
.chip-delta.baja svg { transform: rotate(180deg); }

@media (hover: hover) and (pointer: fine) {
  .kpi-v2:hover, a.tarjeta-v2:hover, .tarjeta-estado:hover { background-color: color-mix(in srgb, var(--orm-surface), var(--orm-ink) 4%); transition-duration: var(--t-entra), var(--t-press); }
  .kpi-v2:hover .boton-ir, .fila-v2:hover .boton-ir, .boton-ir:hover { background: color-mix(in srgb, var(--app-sup2), var(--orm-ink) 8%); color: var(--orm-ink); }
  .boton-ir.claro:hover { background: color-mix(in srgb, var(--app-boton) 90%, var(--app-boton-tinta)); color: var(--app-boton-tinta); }
  .selector-periodo:hover, .boton-ol:hover { background-color: color-mix(in srgb, var(--orm-surface), var(--orm-ink) 5%); }
  .tabla-ol tbody tr:hover > td { background: var(--velo-hover); }
}

/* ── Administración ─────────────────────────────────────────── */
.cabecera-adm { padding: 0; min-height: 40px; }
.cabecera-adm h1 { font-size: 28px; line-height: 32px; letter-spacing: -0.025em; }
.fila-trabajo { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-height: 420px; }
.cifra-titulo { display: flex; align-items: baseline; gap: 10px; margin: 0; font-weight: 600; color: var(--orm-ink); min-width: 0; letter-spacing: 0; text-transform: none; }
.cifra-titulo .n { font-size: 40px; line-height: 1.05; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.cifra-titulo .texto { font-size: 18px; line-height: 1.3; }
.tarjeta-v2 .divisor-v2 { height: 1px; background: var(--orm-line); flex: none; }
.filas-v2 { list-style: none; margin: 0; padding: 0; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.fila-v2 {
  position: relative; display: flex; align-items: center; gap: 16px; flex: 1 1 0; min-height: 64px; max-height: 100px;
  border-bottom: 1px solid color-mix(in srgb, var(--orm-line) 60%, transparent);
}
.fila-v2:last-child { border-bottom: 0; }
.fila-v2.esperando { gap: 12px; }
.fila-v2 .texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.fila-v2 .l1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fila-v2 .nombre { font-size: 16px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: var(--orm-ink); }
.fila-v2 a.nombre::after { content: ''; position: absolute; inset: 0; }
.fila-v2 .motivo { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--app-persona); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-v2 .monto { font-size: 16px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fila-v2 .derecha { display: flex; align-items: center; gap: 12px; flex: none; }
.fila-v2 .boton-ir, .fila-v2 form, .fila-v2 .boton { position: relative; z-index: 1; }
.fila-v2 form { margin: 0; }
.avatar-deudor {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; font-size: 12px; font-weight: 700;
  background: color-mix(in srgb, var(--app-persona) 16%, var(--orm-surface)); color: var(--app-persona);
}
.boton.atendido { min-width: 92px; }
.pie-v2 { display: flex; }
.pie-v2 .boton { flex: 1; }
.vacio-v2 { flex: 1; display: grid; place-items: center; font-size: 14px; color: var(--orm-muted); text-align: center; padding: 24px; }
/* Pastilla de plazo: fondo al 9 % y borde al 35 % del color, con un ícono de 12. */
.pastilla.plazo { gap: 5px; height: 22px; padding: 0 10px 0 8px; font-size: 12px; font-weight: 600; line-height: 1.2; }
.pastilla.plazo::before { display: none; }
.pastilla.plazo svg { width: 12px; height: 12px; flex: none; }
.fila-baja { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; flex: none; }
.fila-baja .tarjeta-v2 { min-height: 124px; justify-content: center; gap: 12px; }
.fila-baja .cabecera { min-height: 32px; }
.fila-baja .etiqueta-tarjeta { color: var(--orm-ink); }
.cifra-sola { font-size: 40px; font-weight: 600; line-height: 1.05; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.estado-archivo { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 500; line-height: 1.25; min-height: 44px; }
.estado-archivo .circulo {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--app-bueno); color: var(--orm-bg);
}
:root[data-theme="light"] .estado-archivo .circulo { color: #FFFFFF; }
.estado-archivo .circulo svg { width: 18px; height: 18px; }
.estado-archivo .circulo.alerta { background: var(--app-alerta); }
.estado-archivo .circulo.gris { background: var(--app-sup2); color: var(--orm-muted); }

/* ── Conversaciones v2 ──────────────────────────────────────── */
.encabezado-v2 h1 { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; }
.tarjetas-estado { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0 28px; }
/* Tarjeta de estado (Figma 67:2083): franja de 36 con el color del grupo, cifra de 40. Es un filtro de la misma
   pantalla: sin ↗. Seleccionada = anillo interior de 2 px del color de la franja y ✓ en la franja. */
.tarjeta-estado {
  position: relative; display: flex; flex-direction: column; min-width: 0; height: 112px; overflow: hidden;
  border-radius: var(--radio-grande); background: var(--orm-surface); color: var(--orm-ink); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-sale) ease, transform var(--t-press) var(--ease-out);
}
.tarjeta-estado:active { transform: scale(.99); }
.tarjeta-estado .franja {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 36px; padding: 0 16px; flex: none;
  background: var(--c); color: var(--app-boton-tinta); font-size: 13px; font-weight: 700; line-height: 20px;
}
.tarjeta-estado .franja span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarjeta-estado .franja svg { width: 14px; height: 14px; flex: none; }
.tarjeta-estado .cuerpo { padding: 14px 16px 16px; }
.tarjeta-estado .n { font-size: 40px; font-weight: 600; line-height: 1.05; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.tarjeta-estado .n.cero { color: var(--orm-muted); }
.tarjeta-estado[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--c); }
.g-equipo { --c: var(--app-persona); }
.g-promesa { --c: var(--app-alerta); }
.g-bot { --c: var(--app-info); }
.g-resuelto { --c: var(--app-bueno); }

.herramientas { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.herramientas .fila { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; min-height: 32px; }
.herramientas .conteo-cuotas { font-size: 15px; font-weight: 700; line-height: 1.45; }
.herramientas .acciones { display: flex; align-items: center; gap: 8px; }
/* Botón píldora de superficie, en 36 (ordenar) y 32 (filtros). */
.boton-ol {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 4px; border-radius: 99px;
  border: 1px solid var(--orm-line); background: var(--orm-surface); color: var(--orm-ink); font: inherit; font-size: 13.5px;
  line-height: 1.3; cursor: pointer; list-style: none; white-space: nowrap; transition: background-color var(--t-sale) ease;
}
.boton-ol .circulo { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--app-sup2); flex: none; }
.boton-ol .circulo svg { width: 16px; height: 16px; }
.boton-ol .criterio { color: var(--orm-muted-tarjeta); font-weight: 400; }
.boton-ol b { font-weight: 700; }
.boton-ol > .chevron { width: 16px; height: 16px; color: var(--app-tinta-70); }
.boton-ol.chico { height: 32px; font-weight: 600; }
.boton-ol.chico .circulo { width: 24px; height: 24px; }
.boton-ol.chico .circulo svg { width: 14px; height: 14px; }
.insignia {
  display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--orm-acc); color: var(--app-sobre-acento); font-size: 11px; font-weight: 600; line-height: 1;
}
.menu.opciones { width: 264px; }
.menu-item .cuenta-opcion { font-size: 12.5px; color: var(--orm-muted); font-variant-numeric: tabular-nums; }
.paginacion { display: flex; align-items: center; gap: 8px; }
.paginacion .rango { font-size: 13px; line-height: 20px; color: var(--orm-muted); font-variant-numeric: tabular-nums; margin-right: 8px; }
.paginacion a, .paginacion span.paso {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--orm-line);
  background: var(--orm-surface); color: var(--app-tinta-70); text-decoration: none;
}
.paginacion svg { width: 16px; height: 16px; }
.paginacion span.paso[aria-disabled="true"] { opacity: .45; }
.paginacion a:focus-visible { outline: 2px solid var(--orm-acc); outline-offset: 2px; }
.paginacion-pie { display: flex; justify-content: flex-end; align-items: center; min-height: 48px; }

/* Tabla «Order list» (Figma 113:6756 y 114:7044): encabezado de 50 en superficie con radio 12 arriba, filas de 69
   sin separadores, hover con velo y radio 12. */
.tabla-ol-caja { overflow-x: auto; }
.tabla-ol { width: 100%; min-width: 1040px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 14px; }
.tabla-ol thead th {
  height: 50px; padding: 0 8px 0 0; background: var(--orm-surface); text-align: left; font-size: 12px; font-weight: 500;
  line-height: 1.3; letter-spacing: .02em; text-transform: uppercase; color: var(--app-tinta-suave); white-space: nowrap;
}
.tabla-ol thead th:first-child { border-radius: 12px 0 0 0; padding-left: 16px; }
.tabla-ol thead th:last-child { border-radius: 0 12px 0 0; }
.tabla-ol th.der, .tabla-ol td.der { text-align: right; padding-right: 16px; }
.tabla-ol tbody td { height: 69px; padding: 0 8px 0 0; vertical-align: middle; line-height: 1.45; font-weight: 500; transition: background-color var(--t-sale) ease; }
.tabla-ol tbody td:first-child { padding-left: 16px; border-radius: 12px 0 0 12px; }
.tabla-ol tbody td:last-child { border-radius: 0 12px 12px 0; }
.tabla-ol tbody tr[data-href] { cursor: pointer; }
.tabla-ol tbody tr:has(.casilla:checked) > td { background: var(--velo-sel); }
.tabla-ol .n-op { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabla-ol .deudor a { display: block; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabla-ol .deudor span { display: block; font-size: 12px; font-weight: 400; line-height: 1.3; color: var(--orm-muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabla-ol .cifra { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla-ol .ultimo { padding-left: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabla-ol .ultimo.frenado { color: var(--app-malo); }
.tabla-ol .ultimo.deudor-escribio { color: var(--app-info); }
.tabla-ol .ultimo.equipo { color: var(--app-persona); }
.casilla { width: 18px; height: 18px; margin: 0; accent-color: var(--orm-acc); cursor: pointer; vertical-align: middle; }
.estado-ol {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 96px; height: 26px; padding: 0 10px;
  border-radius: 6px; background: var(--app-sup2); color: var(--c, var(--app-tinta-suave)); font-size: 12px; font-weight: 500;
  line-height: 1.3; white-space: nowrap;
}
.estado-ol.c-contactado, .estado-ol.c-nuevo, .estado-ol.c-no_contactable, .estado-ol.c-excluido, .estado-ol.c-fuera_de_scope { --c: var(--app-tinta-suave); }
.estado-ol svg { width: 7px; height: 4px; flex: none; fill: currentColor; opacity: .8; }
.fila-mas { position: relative; display: flex; justify-content: center; }
.fila-mas > summary {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--orm-ink); cursor: pointer;
  list-style: none;
}
.fila-mas > summary::-webkit-details-marker { display: none; }
.fila-mas > summary svg { width: 18px; height: 18px; }
.fila-mas .menu { width: 250px; cursor: default; }
/* En las últimas filas el menú abre para arriba: la caja de la tabla recorta lo que se sale por abajo. */
.tabla-ol tbody tr:nth-last-child(-n+2):not(:first-child) .fila-mas .menu { top: auto; bottom: calc(100% + 4px); }
.vacio-tabla { padding: 36px 16px; text-align: center; color: var(--orm-muted); font-size: 14px; }

/* ── Búsqueda ─────────────────────────────────────────────── */
.resultados { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.resultado {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px 12px 20px; border-radius: var(--radio-panel);
  background: var(--orm-surface); color: var(--orm-ink); text-decoration: none; --orm-muted: var(--orm-muted-tarjeta);
  transition: background-color var(--t-sale) ease;
}
.resultado .texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.resultado strong { font-size: 16px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resultado .detalle { font-size: 13px; color: var(--orm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resultado .pastilla { min-width: 104px; justify-content: center; }
.resultado:focus-visible { outline: 2px solid var(--orm-acc); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .resultado:hover { background: color-mix(in srgb, var(--orm-surface), var(--orm-ink) 4%); transition-duration: var(--t-entra); }
  .resultado:hover .boton-ir { color: var(--orm-ink); }
}
.buscador.grande { width: 100%; max-width: 560px; margin: 0 0 20px; }
/* En la computadora ya está el de la barra de arriba; el de la página queda para el celular. */
@media (min-width: 821px) { .buscador.grande { display: none; } }

/* ── Atajos de teclado ─────────────────────────────────────── */
.dialogo {
  width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--orm-line); border-radius: var(--radio-grande);
  background: var(--orm-surface); color: var(--orm-ink); box-shadow: var(--app-sombra-menu); --orm-muted: var(--orm-muted-tarjeta);
}
.dialogo::backdrop { background: rgb(0 0 0 / .45); }
.dialogo[open] { animation: menu-aparece 160ms var(--ease-out); }
.dialogo-cuerpo { padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.dialogo h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; text-transform: none; color: var(--orm-ink); font-weight: 600; }
.atajos { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; font-size: 14px; align-items: center; }
.atajos dd { margin: 0; display: flex; gap: 4px; justify-content: flex-end; }
.atajos kbd {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: var(--radio-control);
  background: var(--app-sup2); color: var(--orm-ink); font: 600 12px/1 var(--orm-font);
}
.dialogo .botonera { justify-content: flex-end; }

/* En la hoja del celular, el buscador arriba de las secciones. */
.hoja .buscador { width: 100%; background: var(--app-sup2); }

@media (max-width: 1280px) and (min-width: 821px) {
  .fila-principal { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }
  .fila-inferior { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .kpi-v2 { padding: 16px; }
  .kpi-v2 .valor { font-size: 32px; }
  .kpi-v2 .etiqueta-tarjeta { font-size: 14.5px; }
  .cifra-heroe { font-size: 48px; }
}
@media (max-width: 1080px) and (min-width: 821px) {
  .fila-principal, .fila-trabajo { grid-template-columns: minmax(0, 1fr); }
  .fila-inferior { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tarjetas-estado { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buscador { width: 260px; }
}
@media (max-width: 820px) {
  .cabecera-v2 { padding: 0; }
  .cabecera-v2 h1, .encabezado-v2 h1 { font-size: 26px; }
  .fila-principal, .fila-trabajo, .fila-baja { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .fila-inferior, .tarjetas-estado { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .recuperado { min-height: 320px; }
  .cifra-heroe { font-size: 40px; }
  .kpi-v2 { height: auto; min-height: 112px; padding: 14px; }
  .kpi-v2 .valor, .tarjeta-estado .n, .cifra-titulo .n, .cifra-sola { font-size: 30px; }
  .kpi-v2 .etiqueta-tarjeta { font-size: 14px; padding-top: 4px; }
  .fila-v2 { max-height: none; padding: 10px 0; flex-wrap: wrap; gap: 8px 12px; }
  .herramientas .fila { align-items: flex-start; }
  .tablero-v2 { gap: 14px; }
}

/* Casillas de elegir varias cosas en un formulario (usuarios: agentes, equipos, vistas). */
fieldset.casillas { border: 1px solid var(--orm-line); border-radius: var(--app-radio); padding: 8px 12px 10px; margin: 0;
  display: flex; flex-wrap: wrap; gap: 6px 16px; }
fieldset.casillas legend { padding: 0 4px; font-size: 12.5px; }
.form-en-vivo label.casilla, label.casilla { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--orm-ink); white-space: nowrap; width: auto; min-width: max-content; }
label.casilla input { accent-color: var(--orm-acc); width: 15px; height: 15px; margin: 0; flex: none; }

/* «Pasárselo a…» (`_macros.pasar`): el select y su botón juntos, del alto de los otros botones de la fila. */
.pasar { display: flex; gap: 6px; align-items: center; margin: 0; min-width: 0; }
.pasar select.campo.chico { width: auto; max-width: 22ch; min-width: 0; min-height: 28px; padding-top: 3px; padding-bottom: 3px; }
/* Con el pase, las acciones de una fila no entran en un renglón: bajan a dos, alineadas a la derecha, en vez de dejarle
   al caso una columna angosta. */
.item .acciones:has(> .pasar) { flex-wrap: wrap; justify-content: flex-end; max-width: 400px; }
/* En el celular, la fila de un caso va en una columna: con el monto, «Ver», «Lo tomo», «Pasárselo a…» y «Resuelto» al
   costado, el nombre y los datos quedaban de dos palabras de ancho. Las acciones bajan y se acomodan en renglones. */
@media (max-width: 640px) {
  .item { grid-template-columns: minmax(0, 1fr); }
  .item .acciones, .item .acciones:has(> .pasar) { flex-wrap: wrap; justify-content: flex-start; max-width: none; }
  .item .acciones .pasar { flex: 1 1 100%; }
  .item .acciones .pasar select.campo.chico { flex: 1 1 auto; max-width: none; }
}
