/* STRONG LMB 360 V18.2.97 — Typography & Financial Numbers Visual Precision
   Objetivo: mejorar legibilidad de letras, números financieros, tablas y KPIs sin tocar lógica funcional. */
:root{
  --strong-font-base: 14px;
  --strong-font-small: 12.5px;
  --strong-font-table: 13.5px;
  --strong-font-number: 14px;
  --strong-font-kpi: clamp(1.45rem, 2.1vw, 2.15rem);
  --strong-line-readable: 1.35;
  --strong-cell-min: 104px;
}

html{font-size:var(--strong-font-base);} 
body,.app-shell,.module-page,.screen,.content,.panel,.card,.modal,.drawer,.view-container{
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Escala mínima de lectura para evitar etiquetas microscópicas heredadas */
body :where(label,.label,.form-label,.field-label,.hint,.help-text,.meta,.small,.badge,.pill,.chip,.caption,small){
  font-size:max(var(--strong-font-small), .78rem) !important;
  line-height:var(--strong-line-readable) !important;
}

/* Títulos consistentes y sin contaminación visual encima */
body :where(h1,.h1,.page-title,.module-title,.screen-title){
  font-size:clamp(1.35rem, 2vw, 2rem) !important;
  line-height:1.18 !important;
  letter-spacing:-.015em;
  margin-block:0 .75rem;
}
body :where(h2,.h2,.section-title,.panel-title,.card-title){
  font-size:clamp(1.08rem, 1.45vw, 1.45rem) !important;
  line-height:1.22 !important;
}
body :where(h3,.h3,.subsection-title){
  font-size:clamp(1rem, 1.2vw, 1.22rem) !important;
  line-height:1.25 !important;
}

/* Tablas financieras: lectura clara, números alineados y sin cortes */
table,.table,.data-table,.financial-table,.ratio-table,.statement-table{
  font-size:var(--strong-font-table) !important;
  line-height:1.32 !important;
  font-variant-numeric:tabular-nums lining-nums;
  border-collapse:separate;
  border-spacing:0;
}
table th, table td,
.table th,.table td,
.data-table th,.data-table td,
.financial-table th,.financial-table td,
.ratio-table th,.ratio-table td,
.statement-table th,.statement-table td{
  font-size:var(--strong-font-table) !important;
  line-height:1.32 !important;
  vertical-align:middle !important;
  min-height:34px;
  padding:.55rem .7rem !important;
  overflow-wrap:anywhere;
  word-break:normal;
}
table th,
.table th,.data-table th,.financial-table th,.ratio-table th,.statement-table th{
  font-weight:700 !important;
  white-space:normal !important;
}

/* Celdas numéricas: protegen millones, porcentajes, decimales y moneda */
:where(td,th,div,span,input,output)[data-type="number"],
:where(td,th,div,span,input,output)[data-field*="amount"],
:where(td,th,div,span,input,output)[data-field*="balance"],
:where(td,th,div,span,input,output)[data-field*="rate"],
:where(td,th,div,span,input,output)[data-field*="ratio"],
:where(td,th,div,span,input,output)[data-field*="percent"],
:where(.number,.numeric,.money,.currency,.amount,.balance,.rate,.ratio,.percent,.percentage,.kpi-value,.metric-value,.indicator-value,.financial-value,.value-number){
  font-variant-numeric:tabular-nums lining-nums !important;
  font-feature-settings:"tnum" 1, "lnum" 1;
  letter-spacing:-.01em;
  overflow-wrap:normal !important;
  word-break:keep-all !important;
  text-align:right;
}
:where(td,th).strong-numeric-cell,
td:has(.money),td:has(.currency),td:has(.amount),td:has(.percent),td:has(.ratio){
  min-width:var(--strong-cell-min);
  white-space:nowrap;
}

/* KPIs y tarjetas ejecutivas: números grandes pero flexibles */
:where(.kpi-card,.metric-card,.stat-card,.summary-card,.dashboard-card) :where(.kpi-value,.metric-value,.stat-value,.summary-value,.amount,.financial-value,.value-number){
  font-size:var(--strong-font-kpi) !important;
  line-height:1.08 !important;
  font-weight:800 !important;
  max-width:100%;
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
:where(.kpi-card,.metric-card,.stat-card,.summary-card,.dashboard-card){
  min-width:0;
  overflow:hidden;
}
:where(.kpi-card,.metric-card,.stat-card,.summary-card,.dashboard-card) :where(.kpi-label,.metric-label,.stat-label,.summary-label){
  font-size:max(12.5px,.8rem) !important;
  line-height:1.28 !important;
}

/* Formularios: campos legibles y números no recortados */
input,select,textarea,button,.btn,.button{
  font-size:max(14px,.88rem) !important;
  line-height:1.28 !important;
}
input[type="number"],input.input-number,.currency-input,.percent-input{
  font-variant-numeric:tabular-nums lining-nums;
  text-align:right;
  min-width:9ch;
}

/* Menú: evitar textos apretados o superpuestos */
nav,.menu,.sidebar,.app-menu,.navigation,.module-menu{
  font-size:max(13.5px,.86rem) !important;
}
nav a,.menu a,.sidebar a,.app-menu a,.navigation a,.module-menu a,
nav button,.menu button,.sidebar button,.app-menu button,.navigation button,.module-menu button{
  line-height:1.25 !important;
  min-height:34px;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Limpieza visual: evitar residuos pequeños vacíos o flotantes de versiones previas */
body [data-strong-garbage="true"],
body .debug,
body .debug-panel,
body .dev-only,
body .test-badge,
body .orphan-overlay,
body .ghost-layer,
body .empty-overlay:empty,
body .floating-garbage:empty{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

/* Responsive financiero */
@media (max-width: 900px){
  :root{--strong-font-base:13.5px;--strong-font-table:13px;--strong-cell-min:92px;}
  table th,table td,.table th,.table td,.data-table th,.data-table td{padding:.5rem .55rem !important;}
  :where(.kpi-card,.metric-card,.stat-card,.summary-card,.dashboard-card) :where(.kpi-value,.metric-value,.stat-value,.summary-value){font-size:clamp(1.25rem,5vw,1.8rem) !important;}
}
@media (max-width: 560px){
  :root{--strong-font-base:13px;--strong-font-table:12.75px;--strong-cell-min:82px;}
  .table-responsive,.responsive-table,.data-table-wrap,.financial-table-wrap{overflow-x:auto !important;-webkit-overflow-scrolling:touch;}
  table,.table,.data-table,.financial-table,.ratio-table,.statement-table{min-width:680px;}
}
