/* ============================================================================
   STRONG LMB 360 — v18.3.15
   Coherencia tipográfica (un solo sistema de fuentes en toda la app)
   ----------------------------------------------------------------------------
   Problema: distintas pantallas usaban familias de fuente distintas porque
   convivían dos sistemas en paralelo (Fraunces/DM Sans vs Inter/monospace),
   referenciados por muchas variables diferentes. Resultado: "letras diferentes"
   según la pantalla.

   Solución: se unifican TODAS las variables de fuente a un único sistema
   coherente y se fija la base del contenido. Carga al final para prevalecer.

   Sistema unificado:
     · Títulos / display  → serif (Fraunces si está disponible; si no, Georgia).
     · Cuerpo / interfaz  → sans del sistema (DM Sans si está disponible).
     · Números / finanzas → mismo sans, con cifras tabulares para alinear.
   No se añaden dependencias externas: las pilas degradan a fuentes del sistema.
   ============================================================================ */

:root{
  /* Pilas canónicas */
  --strong-display-stack: 'Fraunces','Hoefler Text',Georgia,'Times New Roman',serif;
  --strong-body-stack: 'DM Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,Roboto,Helvetica,Arial,sans-serif;
  --strong-num-stack: 'DM Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,Roboto,Helvetica,Arial,sans-serif;

  /* Todas las variables existentes apuntan ahora al MISMO sistema */
  --font-display: var(--strong-display-stack);
  --s312-display: var(--strong-display-stack);

  --font-body: var(--strong-body-stack);
  --s312-body: var(--strong-body-stack);
  --strong-font-main: var(--strong-body-stack);
  --strong-v18306-font-main: var(--strong-body-stack);
  --v18304-font-ui: var(--strong-body-stack);

  /* Números: mismo sans con cifras tabulares (en vez de monospace) para coherencia */
  --font-mono: var(--strong-num-stack);
  --v18304-font-num: var(--strong-num-stack);
  --strong-font-finance: var(--strong-num-stack);
  --strong-v18306-font-finance: var(--strong-num-stack);
}

/* Base del contenido (no toca la pantalla de login, que tiene su identidad) */
body:not(.login-active){
  font-family: var(--strong-body-stack);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Títulos en serif de forma consistente en todos los módulos */
body:not(.login-active) h1,
body:not(.login-active) h2,
body:not(.login-active) h3,
body:not(.login-active) .module-title,
body:not(.login-active) .card-title,
body:not(.login-active) .section-title,
body:not(.login-active) .kpi-title{
  font-family: var(--strong-display-stack);
}

/* Texto general, controles y tablas en el sans unificado */
body:not(.login-active) p,
body:not(.login-active) span,
body:not(.login-active) div,
body:not(.login-active) li,
body:not(.login-active) td,
body:not(.login-active) th,
body:not(.login-active) label,
body:not(.login-active) input,
body:not(.login-active) select,
body:not(.login-active) textarea,
body:not(.login-active) button{
  font-family: var(--strong-body-stack);
}

/* Cifras y celdas numéricas: sans unificado + tabular para alinear columnas */
body:not(.login-active) .num,
body:not(.login-active) .numeric,
body:not(.login-active) .mono,
body:not(.login-active) .kpi-value,
body:not(.login-active) .metric-value,
body:not(.login-active) .strong-numeric-cell,
body:not(.login-active) .strong-fit-number-v18311{
  font-family: var(--strong-num-stack);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1,"lnum" 1;
}

/* ============================================================================
   ALINEACIÓN — Opción B (orden lógico de lectura)
   · Por defecto TODO a la izquierda (texto, fechas, estados, acciones, y sus
     encabezados) para que columna y encabezado siempre coincidan.
   · Números/montos y el encabezado de su columna → DERECHA.
   ============================================================================ */

/* Predeterminado: izquierda en toda celda y encabezado (orden de lectura). */
body:not(.login-active) table td,
body:not(.login-active) table th{
  text-align: left !important;
}

/* Excepción: columnas numéricas (datos y su encabezado) a la derecha. La clase
   'numeric' se propaga al encabezado para que coincida con su columna. */
body:not(.login-active) table td.numeric,
body:not(.login-active) table th.numeric,
body:not(.login-active) table td.num,
body:not(.login-active) table th.num,
body:not(.login-active) table td.money,
body:not(.login-active) table td.percent,
body:not(.login-active) table td.ratio{
  text-align: right !important;
}
