/* ==========================================================================
   Sistema Halvo-UMOH · base (M1 de «Migración del portal al sistema Halvo-UMOH»)

   Se carga DESPUÉS de umoh.css y ANTES del CSS del Admin. No renombra clases:
   remapea las variables de umoh.css a los tokens del kit (tokens.css, piel de G1)
   y reestiliza los componentes por sus clases de hoy, así que todos los paneles
   heredan. Para volver atrás alcanza con sacar el <link> de index.php.

   Piel de G1: Outfit en toda la interfaz, el rojo de marca como único acento
   (nunca dibuja un dato), «malo» en #B3261E / #FF948A y fondo con el degradado
   de marca. Hover y foco, instantáneos. Sin motion: eso es M2.

   Índice
     1. Tokens del kit (claro y oscuro)
     2. Variables de umoh.css remapeadas
     3. Base, tipografía y foco
     4. Tarjetas, KPI y gráficos
     5. Pestañas, segmentado, botones y chips
     6. Tablas
     7. Cajón y modal
     8. Barra lateral
     9. Hover y foco instantáneos
    10. Piso de 14 px (generado)

   Los valores salen de .claude/grafo-sistema-halvo/kit/tokens.css. Si se cambia un
   valor del kit, se cambia acá.
   ========================================================================== */

/* ── 1. TOKENS DEL KIT ───────────────────────────────────────── */
:root {
  --font-kit: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Escala de texto (N-12): siete valores y el rol de cada uno; no hay otros. */
  --fs-sm: 13px;                              /* rótulo de contexto (N-14) */
  --fs-md: 14px;                              /* dato y texto base */
  --fs-xl: 17px;                              /* título de tarjeta, variación, migaja */
  --fs-3xl: 22px;                             /* cifra secundaria, título de cajón */
  --fs-4xl: 26px;                             /* cifra de la ventana, total de fase */
  --fs-cifra: clamp(20px, 100cqw / 5.4, 28px);/* cifra de la tarjeta de cifra */
  --fs-h1: clamp(26px, 2.2vw, 32px);          /* título de la vista y cifra de lectura */
  --fs-input: 16px;                           /* campo de formulario con puntero grueso (iOS no hace zoom) */
  /* Íconos (N-19): 20, 16 dentro de un chip o una fila compacta, 24 en el estado vacío */
  --ico: 20px; --ico-sm: 16px; --ico-lg: 24px;

  --r-xs: 6px;
  --halo: 0 0 0 5px var(--glass-strong);       /* halo del foco (N-20): separa el anillo del fondo de marca */
  --r-pill: 999px;
  --side: 256px;
  --side-rail: 84px;
  --top-h: 64px;
  --inset: 16px;
  --gap: 16px;
  --max: 1480px;
  --pad: 20px;
  --pad-lg: 24px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-theme: cubic-bezier(.65, 0, .35, 1);
  --dur-stroke: 350ms;
  --dur-theme: 450ms;
}

:root,
:root[data-theme="light"] {
  --bg: #E8EBF0;
  --bg-hondo: var(--bg);
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .80);
  --glass-2: rgba(255, 255, 255, .50);
  --glass-3: rgba(255, 255, 255, .78);
  --card-3: var(--glass-3);
  --well: rgba(17, 24, 39, .06);
  --rim: rgba(255, 255, 255, .70);
  --rim-2: rgba(255, 255, 255, .28);
  --blur: blur(28px) saturate(1.6);
  --blur-strong: blur(36px) saturate(1.6);
  --shadow:
    inset 0 1px 0 var(--rim), inset 0 0 0 1px var(--rim-2),
    0 1px 1px rgba(22, 31, 44, .05), 0 18px 40px -22px rgba(22, 31, 44, .40);
  --shadow-lg: 0 2px 6px rgba(22, 31, 44, .08), 0 36px 80px -28px rgba(22, 31, 44, .50);
  --scrim: rgba(14, 20, 30, .38);

  --ink: #111827;
  --ink-2: #33444F;
  --muted: #3F4E5C;
  --line: rgba(17, 24, 39, .09);
  --line-2: rgba(17, 24, 39, .16);

  --accent: #E6003A;
  --accent-fill: #E6003A;
  --accent-hi: #E8083F;
  --accent-lo: #D1002F;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(230, 0, 58, .09);
  --accent-text: #A8002C;
  --glow: rgba(230, 0, 58, .45);

  --good: #165A36; --warn: #7A3A09; --bad: #B3261E; --info: #145F8A;
  --good-soft: rgba(29, 115, 68, .12);
  --warn-soft: rgba(154, 74, 14, .12);
  --bad-soft: rgba(179, 38, 30, .11);
  --info-soft: rgba(20, 95, 138, .11);
  --good-chip: #D9F0E0; --bad-chip: #FBE0DD; --warn-chip: #FBEBDD; --info-chip: #DCEBF5;
  --hover: rgba(255, 255, 255, .94);
  --switch-off: #7C8C9C;
  --trend-up: var(--good);
  --trend-down: var(--bad);

  --tip-bg: #161F2C; --tip-ink: #F0F5F5;
  --toast-bg: rgba(22, 31, 44, .88); --toast-ink: #F1F5F9;
}

:root[data-theme="dark"] {
  --bg: #2A3441;
  --bg-hondo: #19222E;
  --glass: rgba(18, 24, 34, .62);
  --glass-strong: rgba(18, 24, 34, .80);
  --glass-2: rgba(255, 255, 255, .06);
  --glass-3: rgba(255, 255, 255, .12);
  --well: rgba(0, 0, 0, .20);
  --rim: rgba(255, 255, 255, .16);
  --rim-2: rgba(255, 255, 255, .05);
  --blur: blur(30px) saturate(1.5);
  --blur-strong: blur(36px) saturate(1.5);
  --shadow:
    inset 0 1px 0 var(--rim), inset 0 0 0 1px var(--rim-2),
    0 1px 1px rgba(0, 0, 0, .20), 0 20px 46px -22px rgba(0, 0, 0, .75);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, .35), 0 40px 90px -28px rgba(0, 0, 0, .90);
  --scrim: rgba(4, 8, 14, .55);

  --ink: #F1F5F9;
  --ink-2: #D0D9E4;
  --muted: #A6B3C5;
  --line: rgba(241, 245, 249, .09);
  --line-2: rgba(241, 245, 249, .17);

  --accent: #FF3D5E;
  --accent-fill: #E0113F;
  --accent-hi: #E41A47;
  --accent-lo: #C70033;
  --accent-soft: rgba(255, 61, 94, .14);
  --accent-text: #FFB3C4;
  --glow: rgba(255, 61, 94, .45);

  --good: #77D6A0; --warn: #FFB27E; --bad: #FF948A; --info: #8FD0F2;
  --good-soft: rgba(119, 214, 160, .14);
  --warn-soft: rgba(255, 178, 126, .14);
  --bad-soft: rgba(255, 148, 138, .14);
  --info-soft: rgba(143, 208, 242, .14);
  --good-chip: #16382A; --bad-chip: #47232A; --warn-chip: #3F2A1B; --info-chip: #1B3445;
  --hover: rgba(255, 255, 255, .20);
  --switch-off: #566579;

  --tip-bg: #F0F5F5; --tip-ink: #161F2C;
}

/* El fondo de la página es un color sólido: --bg (19/11/2026). Las series de charts.js (--s1 a --s8 del
   kit son las mismas que CHART_PALETTE) no se tocan: ya son los valores del kit.
   --bg-hondo es el tono que tenía --bg en oscuro (#19222E) para lo que NO es página (hover de fila, campo,
   pozo, chip): sigue oscuro aunque la página se aclare. En claro vale lo mismo que --bg. */

/* ── 2. VARIABLES DE UMOH.CSS REMAPEADAS ─────────────────────── */
/* Las mismas custom properties de umoh.css, con el valor del kit. Van en :root y
   en :root[data-theme] para ganarle a los bloques [data-theme="dark"] de umoh.css
   (los valores del kit se resuelven según el tema: var(--ink), var(--muted)...). */
:root,
:root[data-theme] {
  /* tipografía: Outfit en toda la interfaz (G1) */
  --font: var(--font-kit);
  --font-display: var(--font-kit);

  /* forma: 12 / 16 / 22 / 28 */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* superficies */
  --bg-page: var(--bg-hondo);
  --bg-card: var(--glass-strong);
  --bg-card-header: transparent;
  --border-subtle: var(--line-2);
  --shadow-sm: var(--shadow);
  --shadow-md: var(--shadow);

  /* texto */
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-muted: var(--muted);

  /* estados: «malo» deja de ser casi el rojo de marca (G1) */
  --delta-up: var(--good);
  --delta-down: var(--bad);
  --live: var(--good);
  --callout-bg: var(--accent-soft);

  /* rojo de marca: único acento, nunca en datos */
  --umoh-accent: var(--accent);
  --umoh-accent-mid: var(--accent-hi);
  --umoh-accent-soft: var(--accent-text);

  /* vidrio compartido de umoh.css (l. 10635) con la receta del kit */
  --glass-bg: var(--glass);
  --glass-bg-hi: var(--glass-3);
  --glass-border: var(--rim-2);
  --glass-edge: var(--rim);
  --glass-filter: var(--blur);
  --glass-shadow: var(--shadow);
  --glass-shadow-hi: var(--shadow-lg);

  /* layout: barra de 256 px y contenido hasta 1480 */
  --sb-width: 256px;
  --sb-width-collapsed: 84px;
  --content-max: var(--max);

  /* Research y Reportes */
  --research-acento-texto: var(--accent-text);
  --research-verde: var(--good);
  --research-ambar: var(--warn);
  --research-rojo: var(--bad);              /* tono «malo» de los datos: nunca el rojo de marca */
  --research-kpi-bg: var(--glass-3);
  --research-kpi-linea: var(--line);
  --research-kpi-sombra: var(--shadow);
  --research-linea-suave: var(--line);
  --research-borrador-bg: var(--warn-soft);
  --research-chip-bg: var(--accent-soft);
  --entrada-tono-verde-bg: var(--good-chip);
  --entrada-tono-ambar-bg: var(--warn-chip);
  --entrada-tono-rojo-bg: var(--bad-chip);
  --entrada-tono-gris-bg: var(--well);
}

/* Barra lateral: sus propios tokens, con el valor del kit */
html[data-theme] .dashboard-sidebar {
  --sb3-hover: var(--glass-2);
  --sb3-line: var(--line);
  --sb3-active: var(--accent-soft);
  --sb3-accent: var(--accent);
  --text-secondary: var(--ink-2);
  --text-muted: var(--muted);
}

/* Las secciones reforzaban el texto con grises propios (umoh.css, «vidrio en todas
   las secciones»). Esos grises ya son los del kit: se igualan para que haya un solo
   juego de valores. Selectores con un id de más para ganar a los de umoh.css. */
html[data-theme] .dashboard-section:not(#_):not(#__),
html[data-theme] #section-reports {
  --text-secondary: var(--ink-2);
  --text-muted: var(--muted);
  --delta-up: var(--good);
  --delta-down: var(--bad);
  --rep-line: var(--line);
}

/* ── 3. BASE, TIPOGRAFÍA Y FOCO ──────────────────────────────── */
body {
  font-family: var(--font);
  font-feature-settings: "tnum" 1;
}
button, input, select, textarea { font-family: inherit; }

/* Íconos (N-19): una sola familia, Material Symbols Rounded, peso 400 y relleno 0. Es la única clase de ícono del portal: la
   familia Outlined se dio de baja (el menú, el Admin y Reportes pasaron a esta). */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded'; font-weight: 400; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none;
  white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Roles de texto (N-40): la interlínea de cada uno; el tamaño, el peso y el color viven en la regla de cada pieza */
html[data-theme] :is(.kpi-label, .adm-figure__label) { line-height: 1.3; }
html[data-theme] :is(.kpi-delta, .adm-figure__delta) { line-height: 1.2; }
html[data-theme] :is(.chart-title, .pv-card__title, .ah-card__title) { line-height: 1.25; }
html[data-theme] :is(.hub-kpi-sub, .adm-figure__sub) { line-height: 1.35; }
html[data-theme] .pv-enlace { border-radius: var(--r-pill); }
html[data-theme] :is(.kpi-value, .adm-figure__value) { font-size: var(--fs-cifra); }
html[data-theme] .dashboard-sidebar :is(.sb-module-trigger.is-open .sb-dt-icon, .sb-nav-item--home.active .sb-nav-icon) { color: var(--accent-text); }
html[data-theme] .dashboard-sidebar .sb-dt-icon { --sb3-accent: var(--accent-text); }   /* el ícono del módulo activo es texto: lleva el color de texto del acento (N-10) */
html[data-theme] .chart-filter-select { box-sizing: border-box; height: 40px; }   /* select: 40 de alto (N-53) */
/* Chips (N-54): 24 de alto los de contexto y de estado, 32 los de opción y de filtro */
html[data-theme] :is(.adm-pill, .adm-chip--sm, .adm-pill--sm) { box-sizing: border-box; display: inline-flex; align-items: center; height: 24px; padding-block: 0; }
html[data-theme] :is(.adm-pill--lg, .adm-chip:not(.adm-chip--sm), .hub-var-pill) { box-sizing: border-box; display: inline-flex; align-items: center; height: 32px; padding-block: 0; }

/* Cifra de lectura de una curva (N-12): el tamaño del título de la vista, peso 600 */
html[data-theme] .hub-readout-value { font-size: var(--fs-h1); font-weight: 600; }

/* Pesos (N-13): 400, 500 y 600; nunca 700 ni más. El negrita del navegador y los pesos pesados de umoh.css bajan a 600. */
html[data-theme] :is(strong, b, th, .td-name, .fin-proy-tag, .fin-proy-desglose-value, .fin-proy-desglose-label, .fin-proy-desglose-meta, .hub-phase-badge) { font-weight: 600; }

/* Cifras: tabulares, sin saltos de ancho */
.kpi-value, .chart-title, [class*="-value"] { font-variant-numeric: tabular-nums; }

/* Foco: anillo de acento con halo de vidrio por detrás. El rojo desnudo sobre el
   fondo de marca da 2,61:1 y no pasa; sobre el halo sí. */
:focus-visible,
html[data-theme] .sb-nav-item:focus-visible,
html[data-theme] .kpi-card[data-kpi]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: var(--halo);
}

/* ── 4. TARJETAS, KPI Y GRÁFICOS ─────────────────────────────── */
/* Tarjeta de vidrio: blur, filo, sombra de 4 capas y radio 22. Se aplica a las
   tarjetas de todas las secciones (incluido el Inicio y Financiero). */
html[data-theme] .dashboard-section:not(#_):not(#__) :is(.kpi-card, .chart-card, .web-highlight-card, .inicio-quick-card) {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
html[data-theme] .dashboard-section:not(#_):not(#__) .kpi-card { padding: var(--pad); }
html[data-theme] .dashboard-section:not(#_):not(#__) :is(.kpi-card, .chart-card)::before { background: none; }
html[data-theme] .dashboard-section:not(#_):not(#__) .chart-card-header {
  background: transparent;
  border-bottom-color: var(--line);
}
/* Hover de tarjeta: vidrio más cerrado, sin borde rojo ni sombra nueva */
html[data-theme] .dashboard-section:not(#_):not(#__) :is(.kpi-card, .web-highlight-card, .inicio-quick-card):hover {
  background: var(--glass-3);
  border-color: transparent;
  box-shadow: var(--shadow);
}
/* Tarjeta vacía o sin dato (N/D): texto apagado */
html[data-theme] .dashboard-section:not(#_):not(#__) .kpi-card--nd .kpi-value { color: var(--muted); }

/* Cifra */
html[data-theme] .dashboard-section:not(#_):not(#__) .kpi-value {
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: -.01em;
}
html[data-theme] .dashboard-section:not(#_):not(#__) .kpi-label { color: var(--muted); font-weight: 500; }
html[data-theme] .dashboard-section:not(#_):not(#__) .kpi-card--accent .kpi-value { color: var(--ink); }

/* Título de sección: Outfit 600 con la escala del kit */
html[data-theme] .section-title { font-family: var(--font); font-weight: 600; letter-spacing: -.015em; }
html[data-theme] .inicio-saludo,
html[data-theme] .section-title--hero { font-family: var(--font); font-weight: 600; }
html[data-theme] .chart-title { font-family: var(--font); font-weight: 600; }

/* Barra de anclas: vidrio */
html[data-theme] .dashboard-section:not(#_):not(#__) .section-anchors {
  background: var(--glass);
  border: 0;
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
/* Reportes: los controles de la cabecera no son una superficie propia y el segmentado mide lo del sistema (N-03, N-51) */
html[data-theme] #section-reports .reports-header-controls { padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-theme] #section-reports #reports-view-toggle { height: 40px; padding: 4px; }
html[data-theme] #section-reports #reports-view-toggle .hub-lens-btn { height: 32px; padding: 0 12px; }
html[data-theme] #section-reports #reports-firma { font-size: var(--fs-md); }

/* Contenedor de la tarjeta de fase y de Reportes */
html[data-theme] #section-reports .chart-card { border-radius: var(--r-lg); }

/* Gráficos: la leyenda y los ejes de Chart.js se dibujan en JS (M2 los afina);
   el tooltip propio del portal toma el invertido del kit. */
html[data-theme] .chart-tooltip { background: var(--tip-bg); color: var(--tip-ink); box-shadow: var(--shadow-lg); border-radius: var(--r-sm); }

/* ── 5. PESTAÑAS, SEGMENTADO, BOTONES Y CHIPS ────────────────── */
/* Segmentado y pestañas (.hub-lens, anclas): pista con pozo, opción elegida en vidrio.
   La selección es de interfaz: el rojo no la pinta (el kit usa vidrio + tinta). */
html[data-theme] .hub-lens {
  padding: 4px;
  gap: 2px;
  background: var(--well);
  border: 0;
  border-radius: var(--r-pill);
}
html[data-theme] .hub-lens .hub-lens-btn {
  height: 32px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: none;
  border: 0;
  color: var(--ink-2);
  font-family: var(--font);
  font-weight: 500;
}
html[data-theme] .hub-lens .hub-lens-btn:hover { background: var(--glass-2); color: var(--ink); }
html[data-theme] .hub-lens .hub-lens-btn.active {
  background: var(--glass-3);
  box-shadow: inset 0 0 0 1px var(--rim);
  color: var(--ink);
  font-weight: 600;
}
html[data-theme] .section-anchor-link { border-radius: var(--r-pill); color: var(--ink-2); font-weight: 500; }
html[data-theme] .section-anchor-link:hover {
  background: var(--glass-2);
  border-color: transparent;
  color: var(--ink);
}

/* Período del sidebar (segmentado vertical): elegido = acento suave del kit */
html[data-theme] .sb-period-btn { border-radius: var(--r-sm); }
html[data-theme] .sb-period-btn:hover { background: var(--glass-2); color: var(--ink); }
html[data-theme] .sb-period-btn.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--rim-2);
  color: var(--accent-text);
  font-weight: 600;
}

/* Botones: primario con degradado de acento, secundario en vidrio */
html[data-theme] .date-apply-btn {
  border: 0;
  border-radius: var(--r-pill);
  color: var(--accent-ink);
  font-weight: 600;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent-lo));
  box-shadow: none;
}
html[data-theme] .date-apply-btn:hover {
  background: linear-gradient(160deg, var(--accent-hi), var(--accent-lo));
  filter: brightness(1.07);
  opacity: 1;
}
html[data-theme] .reports-download-btn {
  border: 0;
  border-radius: var(--r-pill);
  color: var(--ink);
  font-weight: 600;
  background: var(--glass-3);
  box-shadow: inset 0 0 0 1px var(--rim);
}
html[data-theme] .reports-download-btn:hover:not(:disabled) {
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transform: none;
}
html[data-theme] .reports-download-btn:disabled { color: var(--muted); background: var(--well); box-shadow: none; opacity: 1; }

/* Chips: etiqueta de metodología y de IA, rótulo de contexto en el rojo suave del kit */
html[data-theme] .dashboard-section:not(#_):not(#__) :is(.chart-badge, .web-ia-badge) {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: var(--r-pill);
}
html[data-theme] .dashboard-section:not(#_):not(#__) .research-chip:not(.research-chip--neutro) {
  background: var(--accent-soft);
  color: var(--accent-text);
}
/* Cápsulas de fase: tintes del kit (info / warn / good) con texto de su color */
html[data-theme] .dashboard-section:not(#_):not(#__) .hub-phase-badge--awareness { background: var(--info-chip); color: var(--info); }
html[data-theme] .dashboard-section:not(#_):not(#__) .hub-phase-badge--interest  { background: var(--warn-chip); color: var(--warn); }
html[data-theme] .dashboard-section:not(#_):not(#__) .hub-phase-badge--sales     { background: var(--good-chip); color: var(--good); }

/* Selector de período: panel de vidrio */
html[data-theme] .date-picker-popover {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 0;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}

/* ── 6. TABLAS ───────────────────────────────────────────────── */
html[data-theme] .dashboard-section:not(#_):not(#__) table:not(.adm-table) thead th {
  color: var(--muted);
  font-weight: 600;
  border-bottom-color: var(--line);
}
html[data-theme] .dashboard-section:not(#_):not(#__) table:not(.adm-table) tbody tr { border-bottom-color: var(--line); }
html[data-theme] .dashboard-section:not(#_):not(#__) table:not(.adm-table) tbody tr:hover { background: var(--glass-2); }
html[data-theme] .dashboard-section:not(#_):not(#__) table:not(.adm-table) td { color: var(--ink); font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .terms-table tbody tr:hover { background: var(--glass-2); }

/* ── 7. CAJÓN Y MODAL ────────────────────────────────────────── */
html[data-theme] .kpi-modal-overlay { background: var(--scrim); -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-theme] .kpi-modal {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--pad-lg);
}
html[data-theme] .kpi-modal-title { font-family: var(--font); font-weight: 600; }
html[data-theme] .kpi-modal-close { border-radius: var(--r-pill); }

/* ── 8. BARRA LATERAL ────────────────────────────────────────── */
/* 256 px desde --sb-width (sección 2). El rail de 84 px no entra en esta base:
   hoy plegar oculta la barra (width 0) y el cambio de modelo toca JS y DOM (M3b). */
html[data-theme] .dashboard-sidebar { font-family: var(--font); }
html[data-theme] .dashboard-sidebar .sb-nav-item,
html[data-theme] .dashboard-sidebar .sb-module-trigger,
html[data-theme] .dashboard-sidebar .sb-user-trigger { border-radius: var(--r-sm); }
html[data-theme] .dashboard-sidebar .sb-nav-item:hover,
html[data-theme] .dashboard-sidebar .sb-module-trigger:hover,
html[data-theme] .dashboard-sidebar .sb-user-trigger:hover { background: var(--glass-2); color: var(--ink); }
/* Destino activo: píldora de acento suave con filo, sin la barra de marca */
html[data-theme] .dashboard-sidebar .sb-nav-item.active,
html[data-theme] .dashboard-sidebar .sb-nav-item--home.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--rim-2);
  color: var(--accent-text);
  font-weight: 600;
}
html[data-theme] .dashboard-sidebar .sb-nav-item.active .sb-nav-icon { color: var(--accent-text); }
html[data-theme] .dashboard-sidebar .sb-nav-item--home::before { display: none; }
/* Enlace directo (N-06): un módulo con una sola sección. Es una fila de la lista de módulos: lleva la tinta del título de módulo
   (texto --ink, ícono --muted) y el peso de «Inicio»; el activo y el hover son los de cualquier ítem (reglas de arriba). */
html[data-theme] .dashboard-sidebar .sb-nav-item--directo { color: var(--ink); font-weight: 600; }
html[data-theme] .dashboard-sidebar .sb-nav-item--directo .sb-nav-icon { color: var(--muted); }

/* Flotantes del sidebar (drawer móvil, hover-open): vidrio cerrado del kit */
@media (max-width: 767px) {
  html[data-theme] .dashboard-sidebar {
    background: var(--glass-strong);
    -webkit-backdrop-filter: var(--blur-strong);
    backdrop-filter: var(--blur-strong);
  }
}

/* ── 9. HOVER Y FOCO INSTANTÁNEOS ────────────────────────────── */
/* Regla del kit: el color de hover y el foco no se animan. Se anula la transición
   en los controles y en las tarjetas de datos. La subida de la tarjeta (translateY)
   es movimiento y queda para M2: se conserva la que ya tenía, solo en transform. */
html[data-theme] :is(button, a, input, select, textarea, summary, [role="button"], [role="tab"],
  .sb-nav-item, .sb-module-trigger, .sb-user-trigger, .sb-period-btn, .hub-lens-btn, .section-anchor-link,
  .period-btn, .nav-tab, .date-apply-btn,
  .reports-download-btn, .terms-table tbody tr) {
  transition: none !important;
}
html[data-theme] .dashboard-section:not(#_):not(#__) :is(.kpi-card, .chart-card, .web-highlight-card, .inicio-quick-card) {
  transition: transform 180ms cubic-bezier(.33, 1, .68, 1);
}

/* ── 10. PISO DE 14 PX (generado) ────────────────────────────── */
/* Ningún dato por debajo de 14 px; los rótulos de contexto, 13 px. Lo escribe
   herramientas/piso14.js a partir de umoh.css. */

/* >>> PISO14 (generado por herramientas/piso14.js a partir de umoh.css; no editar a mano) */
/* 229 reglas: 135 de dato a 14 px y 94 rotulos a 13 px. Mismo selector que la regla original, para conservar su especificidad. */
.brand-client { font-size: var(--fs-md); }
.cs-btn-id { font-size: var(--fs-md); }
.cs-opt-name { font-size: var(--fs-md); }
.cs-opt-id { font-size: var(--fs-md); }
.period-btn { font-size: var(--fs-md); }
.date-picker-label { font-size: var(--fs-sm); }
.date-picker-input { font-size: var(--fs-md); }
.date-historic-btn { font-size: var(--fs-md); }
.historic-label { font-size: var(--fs-sm); }
.historic-btn { font-size: var(--fs-md); }
.user-menu-trigger { font-size: var(--fs-md); }
.user-avatar { font-size: var(--fs-md); }
.user-menu-role { font-size: var(--fs-md); }
.user-menu-item { font-size: var(--fs-md); }
.nav-tab { font-size: var(--fs-md); }
.section-subtitle { font-size: var(--fs-md); }
.kpi-label { font-size: var(--fs-md); }
.kpi-kicker { font-size: var(--fs-sm); }
.kpi-delta { font-size: var(--fs-xl); }
.chart-badge { font-size: var(--fs-sm); }
.chart-note { font-size: var(--fs-sm); }
.chart-filter-select { font-size: var(--fs-md); }
.chart-narrative { font-size: var(--fs-md); }
.tools-orb-title { font-size: var(--fs-sm); }
.orb-tool-label { font-size: var(--fs-sm); }
.terms-table { font-size: var(--fs-md); }
.terms-table thead th { font-size: var(--fs-sm); }
.geo-table thead th { font-size: var(--fs-sm); }
.geo-table tbody td { font-size: var(--fs-md); }
.geo-legend-label { font-size: var(--fs-sm); }
.map-error { font-size: var(--fs-md); }
.kpi-card[data-kpi]::after { font-size: var(--fs-md); }
.kpi-modal-formula { font-size: var(--fs-md); }
.kpi-modal-example-label { font-size: var(--fs-sm); }
.kpi-modal-example p { font-size: var(--fs-md); }
.sellers-table thead th { font-size: var(--fs-sm); }
.sellers-table .td-rank { font-size: var(--fs-md); }
.sellers-table .seller-delta { font-size: var(--fs-md); }
.sellers-table tfoot .td-total-label { font-size: var(--fs-sm); }
.footer-brand { font-size: var(--fs-sm); }
.footer-sep { font-size: var(--fs-sm); }
.footer-text { font-size: var(--fs-sm); }
.footer-badge { font-size: var(--fs-sm); }
.journey-canal-label { font-size: var(--fs-md); }
.journey-tooltip-label { font-size: var(--fs-sm); }
.journey-tooltip-phase { font-size: var(--fs-sm); }
.journey-tooltip-bd-row { font-size: var(--fs-sm); }
.journey-modal-phase-badge { font-size: var(--fs-sm); }
.journey-modal-breakdown-title { font-size: var(--fs-sm); }
.journey-modal-bd-row { font-size: var(--fs-md); }
.journey-modal-bd-pct { font-size: var(--fs-md); }
.journey-modal-section-label { font-size: var(--fs-sm); }
.journey-modal-section-text { font-size: var(--fs-md); }
.journey-modal-action-label { font-size: var(--fs-sm); }
.journey-modal-action-text { font-size: var(--fs-md); }
.journey-modal-example-label { font-size: var(--fs-sm); }
.journey-modal-example-text { font-size: var(--fs-md); }
.pending-table tfoot .sales-totals-label { font-size: var(--fs-sm); }
.pending-table thead th { font-size: var(--fs-sm); }
.origin-badge { font-size: var(--fs-sm); }
.sales-complete-badge { font-size: var(--fs-sm); }
.sales-missing-tag { font-size: var(--fs-sm); }
.sales-uncounted-badge { font-size: var(--fs-sm); }
.pending-table .pending-segment { font-size: var(--fs-md); }
.sales-segment { font-size: var(--fs-md); }
.lead-modal-subtitle { font-size: var(--fs-md); }
.lead-modal-section-label { font-size: var(--fs-sm); }
.lead-modal-label { font-size: var(--fs-sm); }
.lead-modal-action-btn { font-size: var(--fs-md); }
.lead-modal-history-item { font-size: var(--fs-md); }
.lead-modal-history-date { font-size: var(--fs-md); }
.lead-modal-history-empty { font-size: var(--fs-md); }
.lead-modal-pending-text { font-size: var(--fs-md); }
.lead-modal-pending-text code { font-size: var(--fs-md); }
.lead-modal-activity-date { font-size: var(--fs-sm); }
.lead-modal-activity-text { font-size: var(--fs-md); }
.lead-modal-empty { font-size: var(--fs-md); }
.sb-section-label { font-size: var(--fs-sm); }
.sb-nav-group-label { font-size: var(--fs-sm); }
.sb-nav-item { font-size: var(--fs-md); }
.sb-nav-item .sb-tooltip { font-size: var(--fs-sm); }
.sb-period-label { font-size: var(--fs-sm); }
.sb-period-range-prefix { font-size: var(--fs-sm); }
.sb-period-range { font-size: var(--fs-md); }
.sb-period-range-compare { font-size: var(--fs-md); }
.web-ov-group-title { font-size: var(--fs-sm); }
.web-ov-group-empty { font-size: var(--fs-md); }
.sb-period-group-label { font-size: var(--fs-sm); }
.sb-period-btn { font-size: var(--fs-md); }
.sb-period-compact-label { font-size: var(--fs-sm); }
.sb-user-name { font-size: var(--fs-md); }
.sb-user-role { font-size: var(--fs-md); }
.inicio-ai-recommendation p { font-size: var(--fs-md); }
.web-highlight-label { font-size: var(--fs-sm); }
.web-highlight-meta { font-size: var(--fs-md); }
.web-highlight-link { font-size: var(--fs-md); }
.hub-lens-btn { font-size: var(--fs-md); }
.hub-phase-badge { font-size: var(--fs-sm); }
.hub-phase-note { font-size: var(--fs-sm); }
.hub-var-pill { font-size: var(--fs-md); }
.hub-readout-label { font-size: var(--fs-md); }
.hub-readout-delta { font-size: var(--fs-md); }
.inicio-quick-card--compact .inicio-quick-desc { font-size: var(--fs-md); }
.sb-dropdown-trigger { font-size: var(--fs-md); }
.sb-dt-name { font-size: var(--fs-md); }
.sb-dt-meta { font-size: var(--fs-md); }
.sb-module-trigger .sb-dt-name { font-size: var(--fs-md); }
.section-scope-chip { font-size: var(--fs-sm); }
.sb-user-avatar-initial { font-size: var(--fs-md); }
.sb-theme-row { font-size: var(--fs-md); }
.chart-badge .chart-badge-info { font-size: var(--fs-sm); }
.section-anchor-link { font-size: var(--fs-md); }
.web-label-info { font-size: var(--fs-sm); }
.web-ia-badge { font-size: var(--fs-sm); }
.empty-state-cta { font-size: var(--fs-md); }
.ses-hint { font-size: var(--fs-sm); }
.ses-kicker { font-size: var(--fs-sm); }
.client-switcher-trigger { font-size: var(--fs-md); }
.cs-panel-title { font-size: var(--fs-md); }
.cs-item { font-size: var(--fs-md); }
.cs-item-sector { font-size: var(--fs-md); }
.reports-control-label { font-size: var(--fs-sm); }
.reports-download-btn { font-size: var(--fs-md); }
.reports-verdict-table { font-size: var(--fs-md); }
.reports-verdict-table th { font-size: var(--fs-sm); }
.reports-verdict-var { font-size: var(--fs-md); }
.reports-kpi-sub { font-size: var(--fs-sm); }
.reports-lectura { font-size: var(--fs-md); }
.reports-journey-table { font-size: var(--fs-md); }
.reports-journey-table th { font-size: var(--fs-sm); }
.reports-journey-pct { font-size: var(--fs-md); }
.reports-bullet { font-size: var(--fs-md); }
.reports-ventas-table { font-size: var(--fs-md); }
.reports-ventas-table th { font-size: var(--fs-sm); }
.reports-roas-badge { font-size: var(--fs-sm); }
.reports-narrative-body { font-size: var(--fs-md); }
.auction-hidden-note { font-size: var(--fs-sm); }
.auction-metrics-table { font-size: var(--fs-md); }
.auction-metrics-table thead th { font-size: var(--fs-sm); }
.chart-badge--neutral .material-symbols-rounded { font-size: var(--fs-sm); }
.fin-proy-tag { font-size: var(--fs-md); }
.fin-proy-chip { font-size: var(--fs-md); }
.fin-proy-desglose { font-size: var(--fs-md); }
.fin-proy-desglose-meta { font-size: var(--fs-md); }
.fin-proy-detail-btn { font-size: var(--fs-md); }
.fin-proy-disabled { font-size: var(--fs-md); }
.umitoh-signature { font-size: var(--fs-md); }
.umitoh-suggests { font-size: var(--fs-sm); }
.reports-tab-badge { font-size: var(--fs-sm); }
.research-chip { font-size: var(--fs-sm); }
.research-avisos { font-size: var(--fs-md); }
.research-card-bajada { font-size: var(--fs-md); }
.research-nota { font-size: var(--fs-md); }
.research-leyenda li { font-size: var(--fs-md); }
.research-leyenda li small { font-size: var(--fs-md); }
.research-kpi-label { font-size: var(--fs-sm); }
.research-kpi-detalle { font-size: var(--fs-md); }
.research-hallazgo-accion > span { font-size: var(--fs-sm); }
.research-leyenda-series { font-size: var(--fs-md); }
.research-sbar-label small { font-size: var(--fs-sm); }
.research-seg em { font-size: var(--fs-md); }
.research-hb { font-size: var(--fs-md); }
.research-tabla { font-size: var(--fs-md); }
.research-tabla thead th { font-size: var(--fs-sm); }
.research-nchico { font-size: var(--fs-md); }
.research-details summary small { font-size: var(--fs-md); }
.research-hito-top { font-size: var(--fs-sm); }
.research-fuentes { font-size: var(--fs-md); }
.reports-canal-plataforma { font-size: var(--fs-md); }
.entrada-ficha dt { font-size: var(--fs-sm); }
.entrada-cita-fecha { font-size: var(--fs-md); }
.entrada-cita-etiqueta { font-size: var(--fs-sm); }
.research-celda-tono { font-size: var(--fs-md); }
#section-reports .reports-control-label { font-size: var(--fs-sm); }
[data-theme] #section-reports .reports-control .chart-filter-select { font-size: var(--fs-md); }
#section-reports .reports-download-btn { font-size: var(--fs-md); }
[data-theme] .live-badge { font-size: var(--fs-sm); }
.dashboard-section .web-highlight-label { font-size: var(--fs-sm); }
.dashboard-section .web-highlight-meta { font-size: var(--fs-md); }
.eco-grupo-rotulo { font-size: var(--fs-sm); }
@media (max-width: 767px) {
  .period-btn { font-size: var(--fs-md); }
  .nav-tab { font-size: var(--fs-md); }
}
@media (max-width: 480px) {
  .period-btn { font-size: var(--fs-md); }
  .nav-tab { font-size: var(--fs-md); }
  .kpi-label { font-size: var(--fs-md); }
  .terms-table, .geo-table, .pending-table, .sellers-table, .segments-table, table.bofu-segment-table { font-size: var(--fs-md); }
  .footer-text { font-size: var(--fs-sm); }
}
@media (max-width: 360px) {
  .chart-title { font-size: var(--fs-xl); }
  .nav-tab { font-size: var(--fs-md); }
}
@media (max-width: 640px) {
  .sellers-table thead th, .sellers-table td { font-size: var(--fs-md); }
  .pending-table thead th, .pending-table td { font-size: var(--fs-md); }
}
@media (max-width: 390px) {
  .ses-message { font-size: var(--fs-md); }
}
/* <<< PISO14 */

/* ── 11. MOTION (M2) ─────────────────────────────────────────── */
/* Lo mueve assets/js/motion.js (GSAP) y, en los gráficos, el bloque _chartMotion de charts.js.
   Esto es solo lo que el CSS tiene que dejar libre o esconder. */

/* Carga sin destello: un script del <head> pone .pre-carga en <html> en el primer cuadro; motion.js
   la saca cuando cada pieza quedó en su estado inicial (o un temporizador, si el motion no llega). */
html.pre-carga .dashboard-sidebar,
html.pre-carga .dashboard-main,
html.pre-carga .sb-hamburger { opacity: 0; }

/* La entrada de sección la hace motion.js: se saca el fundido de 0,2 s que traía umoh.css. */
html[data-theme] .dashboard-section.active { animation: none; }

/* Tema por View Transition: el círculo lo anima motion.js sobre la imagen nueva; las dos imágenes
   se apilan sin fundido propio del navegador. */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* Movimiento reducido: sin subida de tarjeta ni desplazamientos; solo opacidad. */
@media (prefers-reduced-motion: reduce) {
  html[data-theme] .dashboard-section:not(#_):not(#__) :is(.kpi-card, .chart-card, .web-highlight-card, .inicio-quick-card),
  html[data-theme] .dashboard-section:not(#_):not(#__) :is(.kpi-card, .chart-card, .web-highlight-card, .inicio-quick-card):hover {
    transition: none;
    transform: none;
  }
  html.pre-carga .dashboard-sidebar,
  html.pre-carga .dashboard-main,
  html.pre-carga .sb-hamburger { opacity: 1; }
}
