/* =========================================================
   BASE — reset, cuerpo, tipografía base, utilidades
   Carga DESPUÉS de style.css y de tokens.css; antes que el
   resto de css/. Es la capa "autoritativa" del reset: al
   final del rediseño el reset equivalente sale de style.css.
========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);

  font-family: var(--font-body);
  font-size: 14px;

  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

img {
  max-width: 100%;
}

/* Foco visible coherente para navegación con teclado
   (los inputs mantienen además su box-shadow de :focus). */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Utilidad — siempre debe ganar. */
.hidden {
  display: none !important;
}

/* Scrollbars finas y azuladas por defecto. Las zonas con
   scrollbar propio (tabla, preview, desglose) lo re-afinan
   en su sección. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: var(--r-pill);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--border-brand);
}
