/* ============================================================
   INTER TIGHT - TIPOGRAFIA UNIVERSAL DEL SISTEMA
   ------------------------------------------------------------
   Inter Tight manda por encima de todo el texto real del ERP:
   body, inputs, selects, checkboxes, placeholders, calendario,
   tablas, menus, botones, modales y widgets de terceros.

   Cargar SIEMPRE como ULTIMO stylesheet del <head> (gana por
   orden de cascada + !important).

   Excepciones intencionales (NO son tipografia de texto):
     - Fuentes de icono: Tabler Icons (.ti / <i>), FontAwesome
       (.fa*), flag-icons (.fi). Ganan por su propia especificidad
       de clase; ademas excluimos <i> del selector universal.
     - Campos monoespaciados (.mono): conservan su fuente para
       alinear codigos/numeros (mayor especificidad, no se tocan).
     - Logo de marca "nexa cloud" (SVG <text>): conserva Montserrat
       (re-afirmado al final de este archivo).
   ============================================================ */

/* Base Bootstrap: redefinir variables de fuente del template
   (afecta a todo lo que herede de --bs-font-sans-serif). */
:root,
.light-style,
.dark-style {
  --bs-font-sans-serif: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  --bs-body-font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

/* Selector universal de texto.
   `body *:not(i)` = baja especificidad (0,0,2): cualquier regla
   basada en clase (iconos .ti/.fa/.fi, campos .mono) la sobrescribe,
   por lo que se preservan automaticamente. */
html,
body,
body *:not(i) {
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

/* Controles de formulario: NO heredan font-family por defecto del
   navegador -> regla explicita. */
input,
select,
textarea,
button,
optgroup,
option,
.form-control,
.form-select,
.form-check-label {
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

/* Placeholders (todos los prefijos). */
::placeholder,
::-webkit-input-placeholder,
:-ms-input-placeholder,
::-ms-input-placeholder {
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

/* Widgets de terceros que se inyectan en <body> (refuerzo explicito;
   el selector universal ya los cubre, pero algunos definen su propia
   font-family). Flatpickr=calendario, Select2, Choices, SweetAlert2,
   DataTables, dropdowns/tooltips/popovers de Bootstrap. */
.flatpickr-calendar, .flatpickr-calendar *:not(i),
.select2-container, .select2-container *:not(i),
.swal2-container, .swal2-popup, .swal2-popup *:not(i),
.choices, .choices *:not(i),
.dataTables_wrapper, .dataTables_wrapper *:not(i),
.dropdown-menu, .dropdown-menu *:not(i),
.tooltip, .tooltip *:not(i),
.popover, .popover *:not(i),
.toast, .toast *:not(i) {
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

/* --- Re-afirmacion de las fuentes de icono ---
   El bloque de widgets de terceros de arriba usa `X *` (0,1,1) y le ganaba a
   `.ti` (0,1,0): el glifo PUA terminaba pintado con Inter Tight, o sea en
   blanco. Caso real: los botones Ver tabla / Aceptar / Reemplazar / Exportar
   archivos del RCE viven dentro de un `.dataTables_wrapper` y salian sin icono.
   Arriba se les agrego `:not(i)`; aca se cubren los iconos que NO son <i>
   (por ejemplo <span class="ti ti-x">), con doble clase para ganar siempre. */
.ti[class*="ti-"] {
  font-family: 'tabler-icons' !important;
}
.fa[class*="fa-"],
.fas[class*="fa-"],
.far[class*="fa-"],
.fa-solid[class*="fa-"],
.fa-regular[class*="fa-"] {
  font-family: 'Font Awesome 6 Free' !important;
}
.fab[class*="fa-"],
.fa-brands[class*="fa-"] {
  font-family: 'Font Awesome 6 Brands' !important;
}

/* --- Re-afirmacion del logo de marca: conserva Montserrat ---
   (ultima regla del archivo -> gana sobre el selector universal). */
svg text {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}
