/* Estilos globais e tipografia */
html { scroll-padding-top: calc(var(--header-h) + var(--sp-4)); }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "tnum" 0;
}

h1, h2, h3, h4 { line-height: var(--lh-tight); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); font-weight: 600; }
p  { max-width: 68ch; }

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }

/* Valores monetários: algarismos tabulares para alinhar colunas */
.money, .num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; white-space: nowrap; }
.money-income  { color: var(--income); }
.money-expense { color: var(--expense); }

.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--fs-sm); }

/* Foco visível e consistente para navegação por teclado */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 1000;
  background: var(--surface); color: var(--text); padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); font-weight: 600;
}
.skip-link:focus { top: var(--sp-4); }

.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

::selection { background: var(--info-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
