/* STRONG LMB 360 V18.3.04 — Global Typography & Numeric Layout Authority
   Objetivo: organizar profesionalmente letras y números en todas las páginas sin alterar la lógica funcional. */
:root{
  --v18304-font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --v18304-font-num: "Roboto Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --v18304-text: #172033;
  --v18304-muted: #5d6b82;
  --v18304-border: rgba(45, 62, 91, .14);
  --v18304-soft: rgba(248, 250, 252, .92);
  --v18304-card-radius: 18px;
  --v18304-cell-y: .66rem;
  --v18304-cell-x: .82rem;
  --v18304-min-num: 9.5ch;
  --v18304-title-letter: -.018em;
}
html{font-size:14.5px !important;}
body{
  font-family:var(--v18304-font-ui) !important;
  text-rendering:geometricPrecision;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-variant-numeric:lining-nums;
}
body:not(.dark-mode):not([data-theme="dark"]) :where(.main,#content-area,.module-page,.screen,.page,.panel,.card,.dashboard-card,.kpi-card,.metric-card,.stat-card,.modal,.drawer){
  color:var(--v18304-text);
}
/* Jerarquía de lectura: evita títulos apretados, textos encima de títulos y encabezados desordenados */
:where(#content-area,.main,.modal,.drawer,.panel,.card,.module-page,.screen) :where(h1,h2,h3,h4,.page-title,.module-title,.screen-title,.section-title,.panel-title,.card-title){
  max-width:100%;
  overflow-wrap:break-word;
  word-break:normal;
  text-wrap:balance;
  letter-spacing:var(--v18304-title-letter) !important;
  margin-top:0 !important;
}
:where(#page-title,.page-title,.module-title,.screen-title,h1){
  font-size:clamp(1.42rem,1.7vw,2.05rem) !important;
  line-height:1.14 !important;
  font-weight:800 !important;
}
:where(.section-title,.panel-title,h2){
  font-size:clamp(1.12rem,1.25vw,1.48rem) !important;
  line-height:1.2 !important;
  font-weight:760 !important;
}
:where(.card-title,h3,h4){
  font-size:clamp(1rem,1.05vw,1.22rem) !important;
  line-height:1.24 !important;
  font-weight:720 !important;
}
:where(p,li,.description,.help-text,.hint,.meta,.caption,small,.subtitle,.card-subtitle,.panel-subtitle){
  line-height:1.44 !important;
  overflow-wrap:break-word;
}
:where(label,.label,.form-label,.field-label,.badge,.pill,.chip,.tag,small,.caption,.meta){
  font-size:max(12.4px,.79rem) !important;
  line-height:1.3 !important;
}
/* Rejilla limpia para páginas y tarjetas */
:where(#content-area,.module-page,.screen,.page,.view-container,.dashboard-grid,.cards-grid,.metrics-grid,.kpi-grid){
  min-width:0 !important;
}
:where(.card,.panel,.dashboard-card,.kpi-card,.metric-card,.stat-card,.summary-card,.strong-card){
  min-width:0 !important;
  overflow:hidden !important;
  border-radius:var(--v18304-card-radius);
}
:where(.card,.panel,.dashboard-card,.kpi-card,.metric-card,.stat-card,.summary-card) > *{
  min-width:0;
}
/* Números: alineación, anchura, lectura y no recorte */
:where(.strong-numeric-cell,.number,.numeric,.money,.currency,.amount,.balance,.rate,.ratio,.percent,.percentage,.kpi-value,.metric-value,.stat-value,.summary-value,.financial-value,.value-number,[data-type="number"],[data-value-type="number"],[data-field*="amount"],[data-field*="balance"],[data-field*="rate"],[data-field*="ratio"],[data-field*="percent"],[data-field*="total"],[data-field*="monto"],[data-field*="saldo"]){
  font-family:var(--v18304-font-num) !important;
  font-variant-numeric:tabular-nums lining-nums !important;
  font-feature-settings:"tnum" 1, "lnum" 1, "zero" 0 !important;
  letter-spacing:-.022em !important;
  white-space:nowrap !important;
  overflow-wrap:normal !important;
  word-break:keep-all !important;
  text-align:right !important;
}
:where(.kpi-value,.metric-value,.stat-value,.summary-value,.financial-value,.value-number){
  display:block !important;
  width:100%;
  max-width:100%;
  font-size:clamp(1.32rem,2vw,2.12rem) !important;
  line-height:1.04 !important;
  font-weight:850 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
:where(.kpi-label,.metric-label,.stat-label,.summary-label,.label-title){
  display:block;
  max-width:100%;
  line-height:1.27 !important;
  white-space:normal !important;
}
/* Tablas: columnas legibles y números ordenados */
:where(.strong-table-responsive,.table-responsive,.responsive-table,.data-table-wrap,.financial-table-wrap){
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:visible !important;
  -webkit-overflow-scrolling:touch;
}
:where(table,.table,.data-table,.financial-table,.ratio-table,.statement-table){
  width:100%;
  max-width:100%;
  border-collapse:separate !important;
  border-spacing:0 !important;
  table-layout:auto !important;
  font-size:13.5px !important;
  line-height:1.32 !important;
  font-variant-numeric:tabular-nums lining-nums !important;
}
:where(table,.table,.data-table,.financial-table,.ratio-table,.statement-table) :where(th,td){
  padding:var(--v18304-cell-y) var(--v18304-cell-x) !important;
  line-height:1.32 !important;
  vertical-align:middle !important;
  min-height:38px !important;
  max-width:36ch;
  overflow-wrap:anywhere;
  word-break:normal;
  border-bottom:1px solid var(--v18304-border);
}
:where(table,.table,.data-table,.financial-table,.ratio-table,.statement-table) :where(th){
  font-weight:780 !important;
  text-align:left;
  white-space:normal !important;
  color:inherit;
}
:where(table,.table,.data-table,.financial-table,.ratio-table,.statement-table) :where(td.strong-numeric-cell,th.strong-numeric-cell,td.numeric,td.amount,td.money,td.currency,td.percent,td.ratio){
  min-width:var(--v18304-min-num) !important;
  max-width:none !important;
}
:where(table,.table,.data-table,.financial-table,.ratio-table,.statement-table) :where(tbody tr:hover){
  background:rgba(15, 23, 42, .035);
}
/* Formularios y filtros: letras visibles, campos no comprimidos */
:where(input,select,textarea,button,.btn,.button,.action-btn){
  font-family:var(--v18304-font-ui) !important;
  font-size:max(14px,.88rem) !important;
  line-height:1.28 !important;
  min-height:36px;
}
:where(input[type="number"],input.input-number,.currency-input,.percent-input,.rate-input,.amount-input){
  font-family:var(--v18304-font-num) !important;
  font-variant-numeric:tabular-nums lining-nums !important;
  text-align:right !important;
  min-width:10ch !important;
}
:where(.form-grid,.filters,.filter-grid,.controls,.toolbar,.topbar-actions,.button-row,.actions){
  min-width:0;
  gap:.75rem !important;
}
:where(.form-grid,.filters,.filter-grid){
  align-items:end;
}
/* Menús: evita texto montado o cortado agresivamente */
:where(.sidebar,.nav,.menu,.module-menu,.app-menu,.navigation){
  font-size:max(13.25px,.84rem) !important;
}
:where(.sidebar,.nav,.menu,.module-menu,.app-menu,.navigation) :where(a,button,.nav-item,.menu-item){
  line-height:1.22 !important;
  min-height:36px !important;
  white-space:normal !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
/* Modales y reportes */
:where(.modal,.report,.print-area,.report-body){
  font-size:14px !important;
  line-height:1.42 !important;
}
:where(.modal-body,.report-body){
  overflow-wrap:break-word;
}
/* Limpieza visual de residuos vacíos o de prueba */
body :where(.debug:empty,.debug-panel:empty,.test-badge:empty,.ghost-layer:empty,.orphan-overlay:empty,.floating-garbage:empty,.empty-overlay:empty,[data-debug="true"]:empty,[data-test="true"]:empty,[data-strong-garbage="true"]){
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}
/* Modo oscuro: mantiene contraste sin cambiar funcionalidad */
body.dark-mode :where(table,.table,.data-table,.financial-table,.ratio-table,.statement-table) :where(th,td),
body[data-theme="dark"] :where(table,.table,.data-table,.financial-table,.ratio-table,.statement-table) :where(th,td){
  border-bottom-color:rgba(255,255,255,.12);
}
body.dark-mode :where(table,.table,.data-table,.financial-table,.ratio-table,.statement-table) :where(tbody tr:hover),
body[data-theme="dark"] :where(table,.table,.data-table,.financial-table,.ratio-table,.statement-table) :where(tbody tr:hover){
  background:rgba(255,255,255,.045);
}
@media (max-width:1100px){
  html{font-size:14px !important;}
  :where(.kpi-value,.metric-value,.stat-value,.summary-value,.financial-value,.value-number){font-size:clamp(1.2rem,2.9vw,1.78rem) !important;}
}
@media (max-width:760px){
  html{font-size:13.5px !important;}
  :where(table,.table,.data-table,.financial-table,.ratio-table,.statement-table){min-width:720px;}
  :where(#page-title,.page-title,.module-title,.screen-title,h1){font-size:1.38rem !important;}
  :where(.topbar,.toolbar,.filters,.filter-grid,.button-row,.actions){flex-wrap:wrap !important;}
}
