/* @ngaido/ikaro-ui 0.10.0: design-system/tokens.css + componentes.css */
/* Ikaro: tokens de diseño compartidos por todas las apps.
 *
 * Fuente única. Documento base: README.md de esta carpeta. Cada app lo recibe tal cual (paquete
 * @ngaido/ikaro-ui o copia verificada) y solo elige su acento con el atributo data-product.
 *
 * Nombres semánticos (--bg, --surface, --text, --brand...) y no de paleta (--gray-200):
 * así el modo oscuro y el acento de cada producto salen de cambiar variables, sin duplicar clases.
 * Son los mismos nombres que ya usan Radar (web/src/styles.css) y Ekko (web/src/styles.css).
 *
 * El contraste de los pares texto/fondo lo controla tests/test_ikaro_sitio.py (WCAG AA).
 */

:root {
  /* ---- Marca matriz ---- */
  --ik-ink: #0f1b2d;        /* azul tinta: texto fuerte, logo */
  --ik-sol: #e8611f;        /* naranja sol: el acento de Ikaro */
  --ik-sol-strong: #b8460f; /* sol para texto y botones (pasa AA sobre blanco) */
  --ik-sol-soft: #fdebdf;

  /* ---- Neutros ---- */
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #efebe3;
  --text: #17202b;
  --muted: #59616c;
  --line: #e2ddd3;

  /* ---- Estados ---- */
  --ok: #2b7a4b;
  --ok-soft: #e3f2e8;
  --warn: #8a5a00;
  --warn-soft: #fbf0d9;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  /* Papel: lo que se previsualiza como va a salir impreso (un PDF, un logo sobre blanco). No cambia en modo oscuro. */
  --paper: #ffffff;
  --on-paper: #0f1b2d;

  /* ---- Acento del producto (cada app pisa solo esto) ---- */
  --brand: var(--ik-sol-strong);
  --brand-strong: #933609;
  --brand-soft: var(--ik-sol-soft);
  --on-brand: #ffffff;

  /* ---- Tipografía ---- */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: clamp(1.9rem, 1.2rem + 2.6vw, 2.75rem);
  --text-4xl: clamp(2.3rem, 1.3rem + 4.2vw, 4rem);

  /* ---- Espacio (base 4 px) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* ---- Forma ---- */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06);
  --shadow: 0 8px 28px rgba(15, 27, 45, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 27, 45, 0.14);

  /* ---- Interacción ---- */
  --focus: var(--ik-sol);       /* anillo de foco: el sol de Ikaro en todas las apps */
  --target: 44px;               /* alto mínimo de lo que se toca (se usa con guantes, en el taller) */
  --target-sm: 34px;
  --duration: 150ms;
  --z-sticky: 20;
  --z-dropdown: 1000;           /* el mismo nivel que ya usa el Cotizador (ActionMenu, MultiSelectFilter) */
  --z-modal: 1100;
  --z-toast: 1200;

  /* ---- Estructura de las apps ---- */
  --topbar-h: 56px;
  --side-w: 232px;              /* el ancho que ya tiene el panel de Ekko */
  --content-max: 1200px;

  color-scheme: light;
}

/* ---- Acentos por producto ----
 * Ekko conserva su verde petróleo y Radar su índigo: el cliente que ya los conoce no ve un cambio brusco.
 * La Suite (ERP) y cobros toman colores nuevos; cobros no tiene marca propia todavía. */
[data-product="ekko"]  { --brand: #0f5e5a; --brand-strong: #0a4542; --brand-soft: #e3f0ee; }
[data-product="radar"] { --brand: #4338ca; --brand-strong: #3730a3; --brand-soft: #eeecff; }
[data-product="suite"] { --brand: #1d4ed8; --brand-strong: #1e3a8a; --brand-soft: #e6edff; }
[data-product="cobros"]{ --brand: #2b7a4b; --brand-strong: #1f5c38; --brand-soft: #e3f2e8; }

/* ---- Modo oscuro ----
 * Sigue al sistema salvo que la página fije data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ik-ink: #e9edf3;
    --ik-sol: #f07a3c;
    --ik-sol-strong: #f39463;
    --ik-sol-soft: #3a2216;
    --bg: #0e141c;
    --surface: #151d28;
    --surface-2: #1c2633;
    --text: #e8ecf1;
    --muted: #a0aab6;
    --line: #2a3442;
    --ok: #6cc08e; --ok-soft: #1c3326;
    --warn: #e0a656; --warn-soft: #3a2e17;
    --bad: #f08a80; --bad-soft: #3d1f1c;
    --brand: var(--ik-sol-strong);
    --brand-strong: #f8b58f;
    --brand-soft: var(--ik-sol-soft);
    --on-brand: #1a0e06;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) [data-product="ekko"]  { --brand: #4fb3a9; --brand-strong: #7fd0c7; --brand-soft: #1d3330; }
  :root:not([data-theme="light"]) [data-product="radar"] { --brand: #8c84ff; --brand-strong: #b4aeff; --brand-soft: #28264a; }
  :root:not([data-theme="light"]) [data-product="suite"] { --brand: #7aa2ff; --brand-strong: #a9c2ff; --brand-soft: #1b2a4d; }
  :root:not([data-theme="light"]) [data-product="cobros"]{ --brand: #6cc08e; --brand-strong: #9bd8b2; --brand-soft: #1c3326; }
}

:root[data-theme="dark"] {
  --ik-ink: #e9edf3;
  --ik-sol: #f07a3c;
  --ik-sol-strong: #f39463;
  --ik-sol-soft: #3a2216;
  --bg: #0e141c;
  --surface: #151d28;
  --surface-2: #1c2633;
  --text: #e8ecf1;
  --muted: #a0aab6;
  --line: #2a3442;
  --ok: #6cc08e; --ok-soft: #1c3326;
  --warn: #e0a656; --warn-soft: #3a2e17;
  --bad: #f08a80; --bad-soft: #3d1f1c;
  --brand: var(--ik-sol-strong);
  --brand-strong: #f8b58f;
  --brand-soft: var(--ik-sol-soft);
  --on-brand: #1a0e06;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
:root[data-theme="dark"] [data-product="ekko"]  { --brand: #4fb3a9; --brand-strong: #7fd0c7; --brand-soft: #1d3330; }
:root[data-theme="dark"] [data-product="radar"] { --brand: #8c84ff; --brand-strong: #b4aeff; --brand-soft: #28264a; }
:root[data-theme="dark"] [data-product="suite"] { --brand: #7aa2ff; --brand-strong: #a9c2ff; --brand-soft: #1b2a4d; }
:root[data-theme="dark"] [data-product="cobros"]{ --brand: #6cc08e; --brand-strong: #9bd8b2; --brand-soft: #1c3326; }

/* Ikaro UI: el CSS de los componentes del ecosistema. Requiere tokens.css antes.
 *
 * Regla: un patrón visual = una clase ik-*, igual en todas las apps. El paquete de React @ngaido/ikaro-ui
 * renderiza exactamente estas clases; las apps sin React (sitios estáticos, cobros) las usan directo.
 * Sin colores sueltos: todo sale de tokens.css (lo controla tests/test_design_system.py).
 * Documento: README.md de esta carpeta. Referencia visual: https://ikaro.com.ar/design-system/
 */

/* ------------------------------------------------------------------ base de las apps */
.ik-app { background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; }
.ik-app :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ik-num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ik-muted { color: var(--muted); }
/* Lo que se abre en un portal cuelga de <body>, fuera de .ik-app: lleva su propia tipografía y foco. */
.ik-menu, .ik-backdrop, .ik-toasts, .ik-tooltip { font-family: var(--font-sans); font-size: var(--text-sm); line-height: 1.5; color: var(--text); -webkit-font-smoothing: antialiased; }
.ik-menu :focus-visible, .ik-backdrop :focus-visible, .ik-toasts :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Prosa dentro de una app: títulos chicos, párrafos, listas, código. Con :where() la especificidad es cero,
 * así cualquier clase de componente manda sobre esto (pedido de cobros, 2026-11-22). */
:where(.ik-app) a { color: var(--brand); }
:where(.ik-app) h2 { margin: var(--space-5) 0 var(--space-2); font: 600 var(--text-lg)/1.3 var(--font-sans); }
:where(.ik-app) h3 { margin: var(--space-4) 0 var(--space-2); font: 600 var(--text-sm)/1.3 var(--font-sans); }
:where(.ik-app) p { margin: 0 0 var(--space-3); }
:where(.ik-app) p:where(:last-child) { margin-bottom: 0; }
:where(.ik-app) :where(ol, ul) { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
:where(.ik-app) li { margin-bottom: var(--space-1); }
:where(.ik-app) :where(code, pre) { font-family: var(--font-mono); font-size: var(--text-xs); }
:where(.ik-app) code { overflow-wrap: anywhere; }
:where(.ik-app) pre { margin: 0 0 var(--space-3); padding: var(--space-3); overflow-x: auto; white-space: pre; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
:where(.ik-app) fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ik-texto--ok { color: var(--ok); }
.ik-texto--warn { color: var(--warn); }
.ik-texto--bad { color: var(--bad); }
.ik-nota { font-size: var(--text-xs); color: var(--muted); }
.ik-num--neg { color: var(--bad); }
.ik-papel { color-scheme: light; background: var(--paper); color: var(--on-paper); }
.ik-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ estructura: shell, barra, lateral */
.ik-shell { display: grid; grid-template-columns: var(--side-w) 1fr; grid-template-rows: var(--topbar-h) 1fr; min-height: 100vh; }
.ik-topbar { grid-column: 1 / -1; position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: var(--space-3); height: var(--topbar-h); padding: 0 var(--space-4); background: var(--surface); border-bottom: 1px solid var(--line); }
.ik-lockup { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--text); white-space: nowrap; }
.ik-lockup__marca { font: 700 20px/1 var(--font-display); letter-spacing: -0.04em; color: var(--ik-ink); }
.ik-lockup__sep { width: 1px; height: 18px; background: var(--line); }
.ik-lockup__producto { font-weight: 600; font-size: var(--text-sm); color: var(--brand); }
.ik-topbar__fin { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.ik-topbar__buscar { flex: 1; max-width: 420px; margin-left: var(--space-4); }
.ik-nav-count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--brand); color: var(--on-brand); font-size: var(--text-xs); font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.ik-side { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); box-sizing: border-box; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: var(--space-4) var(--space-3); display: flex; flex-direction: column; gap: 2px; }
.ik-side a { display: flex; align-items: center; gap: var(--space-3); min-height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 500; font-size: var(--text-sm); }
.ik-side a:hover { background: var(--surface-2); color: var(--text); }
.ik-side a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.ik-side__grupo { margin: var(--space-4) var(--space-3) var(--space-1); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ik-main { min-width: 0; padding: var(--space-6) var(--space-5) var(--space-8); }
.ik-main__in { max-width: var(--content-max); margin: 0 auto; display: grid; gap: var(--space-5); }
.ik-dos-columnas { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.ik-en-linea { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ik-en-linea > .ik-input { flex: 1 1 160px; width: auto; }
/* Herramienta pública (diagnóstico, cotizador público, alta): barra simple con la firma y una columna de 760 px. */
.ik-publica { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.ik-publica .ik-topbar { position: static; }
.ik-publica__col { box-sizing: border-box; width: 100%; max-width: 760px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-7); display: grid; align-content: start; gap: var(--space-5); }
.ik-publica__col h1 { margin: 0; font: 600 var(--text-2xl)/1.2 var(--font-sans); letter-spacing: -0.02em; }
.ik-publica__pie { padding: var(--space-5) var(--space-4); text-align: center; font-size: var(--text-sm); color: var(--muted); }
.ik-tabbar { display: none; }
@media (max-width: 1023px) {
  .ik-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--topbar-h) 1fr auto; }
  .ik-topbar { min-width: 0; }
  .ik-topbar__fin { min-width: 0; }
  .ik-cuenta__texto { display: none; }
  .ik-side { display: none; }
  .ik-main { padding: var(--space-5) var(--space-4) calc(var(--space-8) + 64px); }
  .ik-tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset: auto 0 0 0; z-index: var(--z-sticky); height: 64px; background: var(--surface); border-top: 1px solid var(--line); }
  .ik-tabbar a { position: relative; display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: var(--text-xs); font-weight: 500; }
  .ik-tabbar a[aria-current="page"] { color: var(--brand); }
  .ik-tabbar__mas { display: grid; place-items: center; align-content: center; gap: 2px; border: 0; background: none; color: var(--muted); font: 500 var(--text-xs)/1.2 var(--font-sans); cursor: pointer; }
  .ik-tabbar__mas[aria-current="page"] { color: var(--brand); }
  /* "Más" sin React: <button popovertarget="mas-secciones"> + <div id="mas-secciones" popover class="ik-menu ik-tabbar__menu">. */
  .ik-tabbar__menu[popover] { inset: auto var(--space-3) calc(64px + var(--space-2)) auto; margin: 0; }
  .ik-tabbar .ik-nav-count { position: absolute; top: 6px; left: calc(50% + 12px); margin: 0; }
  .ik-topbar__buscar { display: none; }
  .ik-toasts { bottom: calc(64px + var(--space-3)); left: var(--space-4); }
  .ik-toast { max-width: none; }
}

/* ------------------------------------------------------------------ encabezado de página */
.ik-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-5); }
.ik-page-head h1 { margin: 0; font: 600 var(--text-2xl)/1.2 var(--font-sans); letter-spacing: -0.02em; color: var(--text); }
.ik-page-head p { margin: var(--space-1) 0 0; color: var(--muted); max-width: 70ch; }
.ik-page-head__acciones { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ------------------------------------------------------------------ botones */
.ik-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--target); padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 var(--text-sm)/1 var(--font-sans); text-decoration: none; cursor: pointer; transition: background var(--duration), border-color var(--duration); white-space: nowrap; }
.ik-btn:hover { border-color: var(--muted); }
.ik-btn--primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.ik-btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.ik-btn--danger { background: var(--surface); border-color: var(--bad); color: var(--bad); }
.ik-btn--danger:hover { background: var(--bad-soft); }
.ik-btn--quiet { border-color: transparent; background: transparent; }
.ik-btn--quiet:hover { background: var(--surface-2); }
.ik-btn--sm { min-height: var(--target-sm); padding: 0 var(--space-3); font-size: var(--text-xs); }
.ik-btn--icono { padding: 0; width: var(--target); }
.ik-btn:disabled, .ik-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------------ formularios */
.ik-field { display: grid; gap: var(--space-1); align-content: start; }
.ik-label { font-size: var(--text-sm); font-weight: 500; color: var(--text); }
.ik-help { font-size: var(--text-xs); color: var(--muted); }
.ik-field__error { font-size: var(--text-xs); color: var(--bad); }
.ik-field__req { color: var(--bad); }
.ik-input { box-sizing: border-box; width: 100%; min-height: var(--target); padding: 0 var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
textarea.ik-input { min-height: 96px; padding: var(--space-2) var(--space-3); resize: vertical; }
.ik-input::placeholder { color: var(--muted); opacity: .75; }
.ik-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ik-input[aria-invalid="true"] { border-color: var(--bad); }
.ik-input--sm { min-height: var(--target-sm); padding: 0 var(--space-2); }
.ik-input--mono { font-family: var(--font-mono); font-size: var(--text-xs); }
/* En la barra superior un campo (elegir cuenta, contribuyente) no se estira ni empuja la firma. */
.ik-topbar__fin .ik-input { width: auto; min-width: 0; max-width: 300px; }
.ik-check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); min-height: 32px; }
.ik-form { display: grid; gap: var(--space-4); }
.ik-form__fila { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ik-form__acciones { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }

/* ------------------------------------------------------------------ tarjetas, insignias, métricas */
.ik-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); }
.ik-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.ik-card__head h2 { margin: 0; font: 600 var(--text-md)/1.3 var(--font-sans); }
.ik-card__acciones { display: flex; gap: var(--space-2); }
.ik-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.ik-badge--brand { background: var(--brand-soft); color: var(--brand); }
.ik-badge--ok { background: var(--ok-soft); color: var(--ok); }
.ik-badge--warn { background: var(--warn-soft); color: var(--warn); }
.ik-badge--bad { background: var(--bad-soft); color: var(--bad); }
.ik-stats { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.ik-stat { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); display: grid; gap: var(--space-1); }
.ik-stat__label { font-size: var(--text-xs); color: var(--muted); }
.ik-stat__valor { font: 600 var(--text-2xl)/1.1 var(--font-sans); font-variant-numeric: tabular-nums; }
.ik-stat__hint { font-size: var(--text-xs); color: var(--muted); }
.ik-meter { position: relative; height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.ik-meter > i { display: block; height: 100%; width: var(--valor, 0%); border-radius: 8px; background: var(--brand); }
.ik-meter--ok > i { background: var(--ok); }
.ik-meter--warn > i { background: var(--warn); }
.ik-meter--bad > i { background: var(--bad); }
.ik-meter__marca { position: absolute; top: 0; bottom: 0; left: var(--en); width: 2px; background: var(--surface); }

/* ------------------------------------------------------------------ gráfico de barras (BarChart)
 * HTML y CSS, sin SVG ni JS: una plantilla del servidor solo escribe porcentajes (--valor en cada barra, --en en
 * cada marca de la grilla). El dato de cada barra es texto (lo leen los lectores de pantalla) y se ve al pasar el
 * mouse o al enfocarla con el teclado. --alto cambia la altura del área. */
.ik-barras { --alto: 200px; --eje: 96px; --cero: 0%; margin: 0; position: relative; padding: var(--space-4) 0 var(--space-6) var(--eje); font-family: var(--font-sans); }
.ik-barras__area { position: relative; height: var(--alto); }
.ik-barras__grilla { position: absolute; inset: 0; pointer-events: none; }
.ik-barras__grilla > span { position: absolute; left: 0; right: 0; bottom: var(--en, 0%); border-top: 1px solid var(--line); }
.ik-barras__grilla > span::before { content: attr(data-label); position: absolute; right: calc(100% + var(--space-2)); top: 0; transform: translateY(-50%); font-size: var(--text-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ik-barras__grilla > span:first-child, .ik-barras__grilla > .ik-barras__cero { border-top-color: var(--muted); }
.ik-barras--neg .ik-barras__grilla > span:first-child:not(.ik-barras__cero) { border-top-color: var(--line); }
.ik-barras__lista { position: absolute; inset: 0; display: flex; align-items: stretch; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.ik-barra { position: relative; flex: 1 1 0; min-width: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; outline: none; cursor: default; }
/* La barra nace en el cero (--cero, 0% sin negativos) y crece --valor hacia arriba; ik-barra--neg, hacia abajo. */
.ik-barra__col { position: absolute; left: 50%; bottom: var(--cero); transform: translateX(-50%); display: block; width: 100%; max-width: 48px; height: var(--valor, 0%); border-radius: 4px 4px 0 0; background: var(--brand); transition: background var(--duration); }
.ik-barra--neg .ik-barra__col { bottom: auto; top: calc(100% - var(--cero)); border-radius: 0 0 4px 4px; background: var(--bad); }
.ik-barra--neg:hover .ik-barra__col, .ik-barra--neg:focus-visible .ik-barra__col { background: var(--bad); opacity: .8; }
.ik-barra--actual .ik-barra__col { background: var(--brand-strong); }
.ik-barras--ok .ik-barra__col { background: var(--ok); }
.ik-barras--warn .ik-barra__col { background: var(--warn); }
.ik-barras--bad .ik-barra__col { background: var(--bad); }
.ik-barra:hover .ik-barra__col, .ik-barra:focus-visible .ik-barra__col { background: var(--brand-strong); }
.ik-barra:focus-visible { box-shadow: 0 0 0 3px var(--focus); }
.ik-barra__etiqueta { position: absolute; top: calc(100% + var(--space-1)); left: 0; right: 0; text-align: center; font-size: var(--text-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.ik-barra__dato { position: absolute; bottom: calc(var(--cero) + var(--valor, 0%) + var(--space-2)); left: 50%; transform: translateX(-50%); z-index: 1; width: max-content; max-width: 220px; padding: var(--space-2) var(--space-3); border-radius: 6px; background: var(--ik-ink); color: var(--bg); font-size: var(--text-xs); line-height: 1.4; box-shadow: var(--shadow); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity var(--duration); }
.ik-barra__dato strong { display: block; font-weight: 600; }
.ik-barra--neg .ik-barra__dato { bottom: calc(var(--cero) + var(--space-2)); }
.ik-barra:hover .ik-barra__dato, .ik-barra:focus-visible .ik-barra__dato { opacity: 1; visibility: visible; }
/* Las primeras y las últimas abren hacia adentro: si no, el dato se sale de la tarjeta. */
.ik-barra:nth-child(-n+2) .ik-barra__dato { left: 0; transform: none; }
.ik-barra:nth-last-child(-n+2):not(:nth-child(-n+2)) .ik-barra__dato { left: auto; right: 0; transform: none; }
/* En el celular, la etiqueta corta (data-corta="M") reemplaza a la larga: 12 meses en 390 px no entran ("agosep"). */
@media (max-width: 520px) {
  .ik-barras { --eje: 64px; } .ik-barras__lista { gap: 2px; }
  .ik-barra__etiqueta[data-corta] { font-size: 0; }
  .ik-barra__etiqueta[data-corta]::after { content: attr(data-corta); font-size: var(--text-xs); }
}

/* ------------------------------------------------------------------ pestañas */
.ik-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ik-tab { border: 0; background: none; padding: var(--space-3) var(--space-3); margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font: 500 var(--text-sm)/1 var(--font-sans); cursor: pointer; white-space: nowrap; }
.ik-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.ik-tab:disabled { opacity: .5; cursor: not-allowed; }
.ik-tab .ik-nav-count { margin-left: var(--space-2); }

/* ------------------------------------------------------------------ tabla (DataTable) */
.ik-table-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ik-table-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--line); }
.ik-table-bar .ik-input { max-width: 280px; min-height: var(--target-sm); }
.ik-table-bar__fin { margin-left: auto; display: flex; gap: var(--space-2); }
.ik-table-scroll { overflow-x: auto; }
.ik-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.ik-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-weight: 600; font-size: var(--text-xs); color: var(--muted); padding: 0 var(--space-3); height: 40px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ik-table td { padding: var(--space-2) var(--space-3); height: 44px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ik-table tbody tr:last-child td { border-bottom: 0; }
.ik-table tbody tr:hover td { background: var(--surface-2); }
.ik-table tr[aria-selected="true"] td { background: var(--brand-soft); }
/* Tono por fila (DataTable rowTone): atrasados, avisos, lo hecho, lo destacado. El borde izquierdo lo dice también sin color. */
.ik-table tr.ik-table__fila--bad > * { background: var(--bad-soft); }
.ik-table tr.ik-table__fila--warn > * { background: var(--warn-soft); }
.ik-table tr.ik-table__fila--ok > * { background: var(--ok-soft); }
.ik-table tr.ik-table__fila--brand > * { background: var(--brand-soft); }
.ik-table tr.ik-table__fila--bad > :first-child { box-shadow: inset 3px 0 0 var(--bad); }
.ik-table tr.ik-table__fila--warn > :first-child { box-shadow: inset 3px 0 0 var(--warn); }
.ik-table tr.ik-table__fila--ok > :first-child { box-shadow: inset 3px 0 0 var(--ok); }
.ik-table tr.ik-table__fila--brand > :first-child { box-shadow: inset 3px 0 0 var(--brand); }
/* Fila expandida (DataTable renderExpanded): el detalle debajo, o el formulario de edición en el lugar de la fila. */
.ik-table tr.ik-table__expandida > td { height: auto; padding: var(--space-4); background: var(--surface-2); }
.ik-table tbody tr.ik-table__expandida:hover td { background: var(--surface-2); }
/* Fila de totales (DataTable footer). */
.ik-table tfoot td, .ik-table tfoot th { padding: var(--space-2) var(--space-3); height: 44px; border-top: 2px solid var(--line); font-weight: 600; background: var(--surface); text-align: left; position: static; color: var(--text); font-size: inherit; }
.ik-table tfoot .ik-num { text-align: right; }
.ik-table--compacta td { height: 36px; padding-top: var(--space-1); padding-bottom: var(--space-1); }
.ik-table th.ik-num, .ik-table td.ik-num { text-align: right; }
/* Encabezado de fila (DataTable: columna con rowHeader): se ve como una celda, no como el encabezado fijo de arriba. */
.ik-table tbody th[scope="row"] { position: static; z-index: auto; background: none; height: 44px; padding: var(--space-2) var(--space-3); font-size: inherit; font-weight: 600; color: var(--text); text-align: left; white-space: normal; vertical-align: middle; }
.ik-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.ik-sort::after { content: "↕"; opacity: .35; }
th[aria-sort="ascending"] .ik-sort { color: var(--text); }
th[aria-sort="ascending"] .ik-sort::after { content: "▲"; opacity: 1; font-size: .8em; }
th[aria-sort="descending"] .ik-sort { color: var(--text); }
th[aria-sort="descending"] .ik-sort::after { content: "▼"; opacity: 1; font-size: .8em; }
.ik-table__vacia td { height: auto; padding: var(--space-7) var(--space-4); text-align: center; color: var(--muted); }
.ik-filter { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--target-sm); padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px dashed var(--line); background: var(--surface); color: var(--text); font: 500 var(--text-xs)/1 var(--font-sans); cursor: pointer; }
.ik-filter[aria-pressed="true"], .ik-filter--activo { border-style: solid; border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.ik-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3); border-top: 1px solid var(--line); font-size: var(--text-sm); color: var(--muted); }
.ik-pagination__nav { display: flex; align-items: center; gap: var(--space-1); }
.ik-pagination select { min-height: var(--target-sm); border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; padding: 0 var(--space-2); }
@media (max-width: 639px) {
  /* En el celular, cada fila es una tarjeta: el encabezado va como etiqueta dentro de la celda (data-label). */
  .ik-table--tarjetas thead { display: none; }
  .ik-table--tarjetas tr.ik-table__expandida > td { display: block; padding: var(--space-2) 0 0; }
  .ik-table--tarjetas tr.ik-table__expandida > td::before { content: none; }
  .ik-table--tarjetas tfoot tr { display: grid; gap: var(--space-1); padding: var(--space-3); }
  .ik-table--tarjetas tfoot td:empty { display: none; }
  .ik-table--tarjetas tr { display: grid; gap: var(--space-1); padding: var(--space-3); border-bottom: 1px solid var(--line); }
  .ik-table--tarjetas td, .ik-table--tarjetas tbody th[scope="row"] { height: auto; padding: 0; border: 0; display: flex; justify-content: space-between; gap: var(--space-3); }
  .ik-table--tarjetas td::before, .ik-table--tarjetas tbody th[scope="row"]::before { content: attr(data-label); color: var(--muted); font-size: var(--text-xs); font-weight: 400; }
}

/* ------------------------------------------------------------------ menús, modales, avisos */
.ik-menu { position: fixed; z-index: var(--z-dropdown); min-width: 180px; padding: var(--space-1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.ik-menu button, .ik-menu a, .ik-menu label { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 36px; padding: 0 var(--space-3); border: 0; border-radius: 6px; background: none; color: var(--text); font: 400 var(--text-sm)/1 var(--font-sans); text-align: left; text-decoration: none; cursor: pointer; }
.ik-menu button:hover, .ik-menu a:hover, .ik-menu label:hover { background: var(--surface-2); }
.ik-menu .ik-menu__peligro { color: var(--bad); }
.ik-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--space-4); }
.ik-backdrop, dialog.ik-modal::backdrop { background: rgba(10, 14, 20, 0.55); }
/* <dialog> nativo (ikaro-ui-html.js, apps sin React): se le sacan los estilos del navegador. */
dialog.ik-modal { margin: auto; color: var(--text); font-family: var(--font-sans); font-size: var(--text-sm); line-height: 1.5; }
dialog.ik-modal:not([open]) { display: none; }
.ik-modal { box-sizing: border-box; width: min(560px, 100%); max-height: calc(100vh - 2 * var(--space-4)); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: var(--space-5); display: grid; gap: var(--space-4); }
.ik-modal h2 { margin: 0; font: 600 var(--text-lg)/1.3 var(--font-sans); }
.ik-modal__texto { color: var(--muted); }
.ik-modal__acciones { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.ik-alert { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); font-size: var(--text-sm); background: var(--surface-2); color: var(--text); }
.ik-alert--ok { background: var(--ok-soft); color: var(--ok); }
.ik-alert--warn { background: var(--warn-soft); color: var(--warn); }
.ik-alert--bad { background: var(--bad-soft); color: var(--bad); }
.ik-alert__cuerpo { flex: 1; display: grid; gap: 2px; }
.ik-alert__titulo { font-weight: 600; }
.ik-toasts { position: fixed; z-index: var(--z-toast); right: var(--space-4); bottom: var(--space-4); display: grid; gap: var(--space-2); }
.ik-toast { display: flex; align-items: center; gap: var(--space-3); min-width: 260px; max-width: 380px; padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border-radius: var(--radius-sm); border-left: 4px solid var(--brand); background: var(--ik-ink); color: var(--bg); box-shadow: var(--shadow); font-size: var(--text-sm); }
.ik-toast--ok { border-left-color: var(--ok); }
.ik-toast--warn { border-left-color: var(--warn); }
.ik-toast--bad { border-left-color: var(--bad); }
.ik-toast__texto { flex: 1; }
.ik-toast__accion, .ik-toast__cerrar { border: 0; background: none; color: inherit; font: 600 var(--text-sm)/1 var(--font-sans); cursor: pointer; padding: var(--space-1) var(--space-2); border-radius: 6px; }
.ik-toast__accion { text-decoration: underline; }
.ik-toast__cerrar { font-size: 18px; opacity: .7; }
.ik-empty { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-8) var(--space-4); text-align: center; color: var(--muted); }
.ik-empty h3 { margin: 0; color: var(--text); font: 600 var(--text-md)/1.3 var(--font-sans); }
.ik-spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: ik-girar .8s linear infinite; }
.ik-skeleton { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: ik-brillo 1.2s ease-in-out infinite; min-height: 14px; }
@keyframes ik-girar { to { transform: rotate(360deg); } }
@keyframes ik-brillo { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ik-spinner, .ik-skeleton { animation-duration: 3s; } }

/* ------------------------------------------------------------------ íconos */
.ik-icon { flex-shrink: 0; vertical-align: middle; }

/* ------------------------------------------------------------------ chips */
.ik-chip { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 28px; padding: 0 var(--space-2) 0 var(--space-3); border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font: 500 var(--text-xs)/1 var(--font-sans); white-space: nowrap; }
.ik-chip--boton { padding: 0 var(--space-3); min-height: var(--target-sm); cursor: pointer; }
.ik-chip--boton[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.ik-chip--boton:disabled { opacity: .5; cursor: not-allowed; }
.ik-chip__quitar { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.ik-chip__quitar:hover { background: var(--line); color: var(--text); }

/* ------------------------------------------------------------------ combobox */
.ik-combo { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); box-sizing: border-box; width: 100%; min-height: var(--target); padding: var(--space-1) 64px var(--space-1) var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: text; }
.ik-combo:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ik-combo--off { opacity: .6; cursor: not-allowed; }
.ik-combo__input { flex: 1; min-width: 80px; min-height: 32px; border: 0; outline: none; background: none; color: inherit; font: inherit; padding: 0; }
.ik-combo__input:focus-visible, .ik-app .ik-combo__input:focus-visible { outline: none; }
.ik-combo__input::placeholder { color: var(--muted); opacity: .75; }
.ik-combo__flecha { position: absolute; right: var(--space-3); color: var(--muted); pointer-events: none; }
.ik-combo__limpiar { position: absolute; right: 34px; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.ik-combo__limpiar:hover { background: var(--surface-2); color: var(--text); }
.ik-combo__lista { list-style: none; margin: 0; max-height: 280px; overflow: auto; }
.ik-combo__op { display: flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-3); border-radius: 6px; font-size: var(--text-sm); cursor: pointer; }
.ik-combo__op > span:first-child { flex: 1; }
.ik-combo__op--activa { background: var(--surface-2); }
.ik-combo__op[aria-selected="true"] { color: var(--brand); font-weight: 600; }
.ik-combo__nota { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); color: var(--muted); }

/* ------------------------------------------------------------------ radios, segmentado, interruptor, contraseña */
.ik-radios { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-2); min-width: 0; }
.ik-radios--fila { grid-auto-flow: column; justify-content: start; gap: var(--space-4); }
.ik-radios--columna { grid-auto-flow: row; }
.ik-radios legend { padding: 0; margin-bottom: var(--space-2); }
.ik-radio { display: flex; align-items: flex-start; gap: var(--space-2); min-height: 32px; cursor: pointer; font-size: var(--text-sm); }
.ik-radio input { margin: 3px 0 0; accent-color: var(--brand); width: 18px; height: 18px; }
.ik-radio > span { display: grid; gap: 2px; }
.ik-radio__label { font-weight: 500; }
.ik-radios--grilla { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2); }
/* Radio con muestra de color (RadioGroup con swatch): el color lo pone el HTML en --muestra, como --valor en las barras. */
.ik-radio--muestra { align-items: center; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ik-radio--muestra:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.ik-radio--muestra input { margin: 0; }
.ik-radio__muestra { flex: none; width: 24px; height: 24px; border-radius: 6px; background: var(--muestra, var(--surface-2)); box-shadow: inset 0 0 0 1px var(--line); }
.ik-check input { accent-color: var(--brand); width: 18px; height: 18px; }
.ik-segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.ik-segmented button { display: inline-flex; align-items: center; gap: var(--space-1); min-height: calc(var(--target) - 8px); padding: 0 var(--space-3); border: 0; border-radius: 6px; background: none; color: var(--muted); font: 600 var(--text-sm)/1 var(--font-sans); cursor: pointer; }
.ik-segmented button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.ik-segmented button:disabled { opacity: .5; cursor: not-allowed; }
.ik-segmented--sm button { min-height: calc(var(--target-sm) - 8px); padding: 0 var(--space-2); font-size: var(--text-xs); }
.ik-switch { display: flex; align-items: flex-start; gap: var(--space-3); }
.ik-switch__pista { position: relative; flex-shrink: 0; width: 44px; height: 26px; margin-top: 1px; border: 0; border-radius: var(--radius-pill); background: var(--line); cursor: pointer; padding: 0; transition: background var(--duration); }
.ik-switch__pista[aria-checked="true"] { background: var(--brand); }
.ik-switch__pista:disabled { opacity: .5; cursor: not-allowed; }
.ik-switch__bola { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform var(--duration); }
.ik-switch__pista[aria-checked="true"] .ik-switch__bola { transform: translateX(18px); }
.ik-switch__texto { display: grid; gap: 2px; }
.ik-password { position: relative; display: grid; gap: var(--space-1); }
.ik-password .ik-input { padding-right: 48px; }
.ik-password__ver { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: var(--target); height: var(--target); border: 0; background: none; color: var(--muted); cursor: pointer; }
.ik-password__ver:hover { color: var(--text); }
.ik-password__ver[hidden] { display: none; } /* sin JS (apps sin React) el botón no se muestra: no haría nada */

/* ------------------------------------------------------------------ archivos */
.ik-filedrop-caja { display: grid; gap: var(--space-2); }
.ik-filedrop { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-4); border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); text-align: center; cursor: pointer; transition: border-color var(--duration), background var(--duration); }
.ik-filedrop strong { color: var(--text); font-weight: 600; font-size: var(--text-sm); }
.ik-filedrop:hover, .ik-filedrop--encima { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.ik-filedrop--off { opacity: .5; cursor: not-allowed; }
/* Sin React: el input va adentro de la zona y la cubre, así tocar, soltar y el teclado andan sin JS. */
.ik-filedrop { position: relative; }
.ik-filedrop > input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ik-filedrop:focus-within { border-color: var(--focus); }

/* ------------------------------------------------------------------ pasos numerados (Steps) */
.ik-pasos { counter-reset: ik-paso; list-style: none; padding: 0; margin: 0; }
.ik-paso { position: relative; padding: 0 0 var(--space-5) 40px; margin: 0; }
.ik-paso::before { counter-increment: ik-paso; content: counter(ik-paso); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: var(--text-xs); font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
.ik-paso::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 4px; width: 1px; background: var(--line); }
.ik-paso:last-child::after { display: none; }
.ik-paso--hecho::before { content: "✓"; background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.ik-paso--actual::before { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.ik-paso__titulo { margin: 2px 0 var(--space-2); font: 600 var(--text-md)/1.3 var(--font-sans); }
.ik-filedrop__rechazos { margin: 0; padding-left: var(--space-5); color: var(--bad); font-size: var(--text-xs); }
.ik-filedrop-boton { display: inline-grid; justify-items: start; gap: var(--space-1); vertical-align: middle; }
.ik-filedrop-boton .ik-filedrop__rechazos { margin: 0; }

/* ------------------------------------------------------------------ contenido: desplegable, tooltip, historial, planes */
.ik-disclosure { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ik-disclosure summary { display: flex; align-items: center; gap: var(--space-2); min-height: var(--target); padding: 0 var(--space-4); font-weight: 600; font-size: var(--text-sm); cursor: pointer; list-style: none; }
.ik-disclosure summary::-webkit-details-marker { display: none; }
.ik-disclosure summary::before { content: "›"; display: inline-block; width: 1em; color: var(--muted); transition: transform var(--duration); }
.ik-disclosure[open] summary::before { transform: rotate(90deg); }
.ik-disclosure__cuerpo { padding: 0 var(--space-4) var(--space-4); font-size: var(--text-sm); }
.ik-tooltip { position: fixed; z-index: var(--z-toast); max-width: 280px; padding: var(--space-2) var(--space-3); border-radius: 6px; background: var(--ik-ink); color: var(--bg); font-size: var(--text-xs); line-height: 1.4; box-shadow: var(--shadow); pointer-events: none; }
.ik-timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.ik-timeline__item { position: relative; display: grid; gap: 2px; padding: 0 0 var(--space-4) var(--space-5); font-size: var(--text-sm); }
.ik-timeline__item::before { content: ""; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px var(--surface); }
.ik-timeline__item::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.ik-timeline__item:last-child::after { display: none; }
.ik-timeline__item--ok::before { background: var(--ok); }
.ik-timeline__item--warn::before { background: var(--warn); }
.ik-timeline__item--bad::before { background: var(--bad); }
.ik-timeline__item--brand::before { background: var(--brand); }
.ik-timeline__cabeza { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); }
.ik-timeline__texto { color: var(--muted); }
.ik-planes { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: stretch; }
.ik-plan { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ik-plan--destacado { border: 2px solid var(--brand); }
.ik-plan__cabeza { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ik-plan__cabeza h3 { margin: 0; font: 600 var(--text-md)/1.3 var(--font-sans); }
.ik-plan__precio { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1); }
.ik-plan__monto { font: 700 var(--text-3xl)/1 var(--font-sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ik-plan p { margin: 0; font-size: var(--text-sm); }
.ik-plan__lista { flex: 1; list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: var(--space-2); font-size: var(--text-sm); }
.ik-plan__lista li { display: flex; gap: var(--space-2); }
.ik-plan__lista .ik-icon { color: var(--ok); margin-top: 2px; }

/* ------------------------------------------------------------------ cuenta, conexión, error, formularios, copiar */
.ik-cuenta { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-sm); padding: 2px var(--space-2) 2px 2px; border: 1px solid transparent; border-radius: var(--radius-pill); background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.ik-cuenta:hover { background: var(--surface-2); }
.ik-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font: 700 var(--text-xs)/1 var(--font-sans); }
.ik-cuenta__texto { display: grid; line-height: 1.2; }
.ik-cuenta__nombre { font-size: var(--text-sm); font-weight: 600; }
.ik-cuenta__org { font-size: var(--text-xs); color: var(--muted); }
.ik-menu__titulo { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); color: var(--muted); }
.ik-menu__grupo { padding: var(--space-2) var(--space-3) var(--space-1); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ik-menu__sep { border: 0; border-top: 1px solid var(--line); margin: var(--space-1) 0; }
.ik-conexion { position: sticky; top: var(--topbar-h); z-index: var(--z-sticky); display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.ik-conexion > span { flex: 1; }
.ik-error-box { display: grid; gap: var(--space-2); }
.ik-error-box p { margin: 0; }
.ik-form__pie { display: grid; gap: var(--space-3); }
.ik-copyfield { display: flex; gap: var(--space-2); }
.ik-copyfield__valor { font-family: var(--font-mono); font-size: var(--text-sm); }

/* ------------------------------------------------------------------ panel lateral (Drawer) */
.ik-backdrop--drawer { place-items: stretch end; padding: 0; }
.ik-drawer { display: flex; flex-direction: column; height: 100%; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.ik-drawer--left { justify-self: start; border-left: 0; border-right: 1px solid var(--line); }
.ik-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.ik-drawer__head h2 { margin: 0; font: 600 var(--text-lg)/1.3 var(--font-sans); }
.ik-drawer__cuerpo { flex: 1; overflow: auto; padding: var(--space-5); display: grid; align-content: start; gap: var(--space-4); }
.ik-drawer__acciones { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ pantalla de entrada (AuthLayout) */
.ik-auth { min-height: 100vh; display: grid; justify-items: center; align-content: center; gap: var(--space-5); padding: var(--space-6) var(--space-4); box-sizing: border-box; }
.ik-auth .ik-lockup__marca { font-size: 26px; }
.ik-auth__tarjeta { box-sizing: border-box; width: min(420px, 100%); display: grid; gap: var(--space-4); padding: var(--space-6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ik-auth__tarjeta h1 { margin: 0; font: 600 var(--text-xl)/1.25 var(--font-sans); }
.ik-auth__tarjeta > p { margin: calc(-1 * var(--space-2)) 0 0; font-size: var(--text-sm); }
.ik-auth__pie { display: grid; justify-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--muted); }

/* ------------------------------------------------------------------ sitio de marketing (ik-sitio)
 * La estructura de ikaro.com.ar hecha componente, para sitios de clientes (fabrica) y landings de producto.
 * HTML estático, sin JS: el menú del celular es un popover nativo (<button popovertarget="menu"> + <div id="menu"
 * popover class="ik-sitio__menu">). Va en <body class="ik-app ik-sitio">: la prosa de .ik-app aplica adentro.
 * Acento de un cliente: pisar --brand, --brand-strong, --brand-soft y --on-brand (claro y oscuro) en un CSS propio
 * del sitio, verificado AA por quien lo genera. Títulos con --font-display (también se puede pisar). */
.ik-sitio { min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font-sans); }
.ik-sitio__col { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--space-4); box-sizing: border-box; }
.ik-sitio__head { position: sticky; top: 0; z-index: var(--z-sticky); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.ik-sitio__barra { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 68px; }
.ik-sitio__marca { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; color: var(--text); text-decoration: none; font: 700 var(--text-lg)/1.1 var(--font-display); letter-spacing: -0.02em; }
.ik-sitio__marca img, .ik-sitio__marca svg { display: block; max-height: 40px; width: auto; }
.ik-sitio__nav { display: none; align-items: center; gap: var(--space-5); margin: 0; padding: 0; list-style: none; }
.ik-sitio__nav a { color: var(--text); text-decoration: none; font-size: var(--text-sm); font-weight: 500; }
.ik-sitio__nav a:hover, .ik-sitio__nav a[aria-current] { color: var(--brand); }
.ik-sitio__accion { display: none; }
.ik-sitio__menu-btn { display: grid; place-items: center; flex: none; width: var(--target); height: var(--target); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
.ik-sitio__menu[popover] { box-sizing: border-box; inset: 68px 0 auto 0; width: auto; max-width: none; margin: 0; padding: var(--space-3) var(--space-4) var(--space-5); border: 0; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--text); box-shadow: var(--shadow); font-family: var(--font-sans); }
.ik-sitio__menu a:not(.ik-btn) { display: block; padding: var(--space-3) 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 500; }
.ik-sitio__menu .ik-btn { box-sizing: border-box; width: 100%; margin-top: var(--space-4); }
@media (min-width: 960px) {
  .ik-sitio__nav { display: flex; }
  .ik-sitio__accion { display: inline-flex; }
  .ik-sitio__menu-btn, .ik-sitio__menu[popover] { display: none; }
}
.ik-hero { padding: var(--space-8) 0 var(--space-7); }
@media (min-width: 720px) { .ik-hero { padding: var(--space-9) 0 var(--space-8); } }
.ik-hero h1 { max-width: 20ch; margin: 0 0 var(--space-5); font: 700 var(--text-4xl)/1.05 var(--font-display); letter-spacing: -0.03em; }
.ik-hero__bajada { max-width: 56ch; margin: 0; color: var(--muted); font-size: var(--text-lg); line-height: 1.5; }
.ik-hero__acciones { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.ik-seccion { padding: var(--space-8) 0; }
@media (min-width: 720px) { .ik-seccion { padding: var(--space-9) 0; } }
.ik-seccion--alt { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ik-seccion__head { max-width: 680px; margin-bottom: var(--space-7); }
.ik-seccion__head h2 { margin: 0 0 var(--space-3); font: 700 var(--text-3xl)/1.1 var(--font-display); letter-spacing: -0.02em; }
.ik-seccion__head p { margin: 0; color: var(--muted); font-size: var(--text-lg); }
.ik-grilla { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .ik-grilla--2, .ik-grilla--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .ik-grilla--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ik-sitio__pie { padding: var(--space-7) 0 var(--space-6); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-sm); }
.ik-sitio__pie a { color: var(--text); }
/* Botón flotante (WhatsApp u otra acción de contacto): abajo a la derecha, por encima del contenido, nunca debajo
 * de la barra del celular del navegador. 56 px, más que --target. Lleva aria-label con la acción. */
.ik-wa-flotante { position: fixed; right: max(var(--space-4), env(safe-area-inset-right)); bottom: max(var(--space-4), env(safe-area-inset-bottom)); z-index: var(--z-sticky); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: var(--bg); box-shadow: var(--shadow-lg); text-decoration: none; transition: transform var(--duration); }
.ik-wa-flotante:hover { transform: scale(1.06); }
.ik-wa-flotante:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.ik-wa-flotante svg { width: 28px; height: 28px; }
@media (prefers-reduced-motion: reduce) { .ik-wa-flotante { transition: none; } .ik-wa-flotante:hover { transform: none; } }

/* ------------------------------------------------------------------ mapa de calor (Heatmap)
 * Una grilla de intensidades (mensajes por día y hora en Ekko). Es una <table> de verdad para los lectores de
 * pantalla (filas con <th scope="row">, cada celda con aria-label "Lun 14 h: 12 mensajes"), pero no ordena ni
 * pagina: no es DataTable. --k (0 a 1) en cada celda mezcla el acento con --surface-2. Scroll horizontal en el
 * celular dentro de ik-heatmap. */
.ik-heatmap { max-width: 100%; overflow-x: auto; }
.ik-heatmap table { border-collapse: separate; border-spacing: 2px; font-size: var(--text-xs); color: var(--muted); }
.ik-heatmap th { font-weight: 500; padding: 0 var(--space-1) 0 0; text-align: left; white-space: nowrap; }
.ik-heatmap thead th { min-width: 14px; padding: 0; text-align: center; font-variant-numeric: tabular-nums; }
.ik-heatmap td { width: 22px; height: 18px; border-radius: 3px; background: color-mix(in srgb, var(--brand) calc(var(--k, 0) * 100%), var(--surface-2)); }
@media (max-width: 520px) { .ik-heatmap td { width: 10px; height: 14px; } .ik-heatmap thead th { min-width: 10px; } }
