/* ============================================================
   base.css — Reset suave, body, scrollbars, focus, selection
   ------------------------------------------------------------
   Convive con _legacy.css. Solo agrega lo que NO está cubierto
   por las reglas legacy. Las reglas legacy siguen aplicando
   hasta que la Capa 9 (cleanup) borre _legacy.css.
   ============================================================ */

/* Tabular numerals globales para métricas (sumar a .kpi-v, tablas, etc.)
   Aplico solo donde la lectura precisa de números importa, NO en body global
   para no afectar UI elements que prefieren proportional. */
.tabular-nums,
[class*="kpi"],
.cf table,
.kpi-hero .value,
.delta {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Focus visible — para accesibilidad de teclado.
   _legacy.css no tiene un focus ring sistemático. */
:focus-visible {
  outline: none;
  box-shadow: var(--sh-focus);
  border-radius: var(--r-sm);
}

/* Selección de texto */
::selection {
  background: color-mix(in srgb, var(--blue) 22%, transparent);
  color: var(--text-1);
}

/* Scrollbars discretos (estilo macOS / Apple) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong, #d2d2d7) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-strong, #d2d2d7);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--text-3, #86868b);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* Reduced motion: respeta preferencia del usuario */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Helper para ocultar visualmente pero mantener accesible al SR */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
