/* =========================================================
   Sálvia — tokens de design
   Neutros quentes, verde-salva profundo, serifa nos números grandes.
   Contraste do texto: AA (4,5:1) no mínimo, nos dois temas.
   ========================================================= */
:root{
  /* Superfícies */
  --bg: #F2F1EC;
  --surface: #FFFFFF;
  --surface-2: #F7F6F2;
  --surface-3: #ECEBE5;
  --line: #E6E4DD;
  --line-2: #D6D4CB;
  /* Texto */
  --ink: #1C1E1B;
  --ink-2: #4F524C;
  --ink-3: #6A6E66;
  /* Marca */
  --sage: #6E8B76;
  --sage-dark: #46604F;
  --sage-deep: #2C3B31;
  --sage-soft: #E4EBE4;
  --sage-tint: #C5D3C8;
  /* Semântica */
  --income: #2F6B40;   --income-soft: #E0EDE2;
  --expense: #A24F30;  --expense-soft: #F6E4DC;
  --savings: #46627C;  --savings-soft: #E1E8EF;
  --withdraw: #80622D; --withdraw-soft: #F1E9D9;
  --warn: #8F6213;     --warn-soft: #F7EDD8;
  /* Herói */
  --hero-a: #34473A; --hero-b: #1F2B23; --on-hero: #EEF3EE; --on-hero-2: rgba(238,243,238,.74);

  /* Tipografia */
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 18px;
  --fs-num: clamp(40px, 5vw, 64px);
  --fs-title: clamp(32px, 3.4vw, 44px);

  /* Espaços (escala de 4) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;

  /* Raios */
  --r-2xl: 28px; --r-xl: 22px; --r-lg: 18px; --r-md: 14px; --r-sm: 10px; --r-pill: 999px;

  /* Sombras */
  --shadow: 0 1px 1px rgba(28,30,27,.03), 0 2px 6px -2px rgba(28,30,27,.05), 0 12px 28px -18px rgba(28,30,27,.16);
  --shadow-lg: 0 2px 4px rgba(28,30,27,.04), 0 24px 60px -20px rgba(28,30,27,.28);
  --ring: 0 0 0 3px color-mix(in srgb, var(--sage) 30%, transparent);

  /* Movimento */
  --ease: cubic-bezier(.2,.8,.2,1);
  --t-fast: .15s; --t: .25s; --t-slow: .4s;

  --tabbar-h: 68px;
}
[data-theme="dark"]{
  --bg: #0F110F;
  --surface: #171A17;
  --surface-2: #1D201D;
  --surface-3: #252925;
  --line: #262A26;
  --line-2: #363B36;
  --ink: #ECEDE8;
  --ink-2: #B2B6AE;
  --ink-3: #8F948B;
  --sage: #86A58E;
  --sage-dark: #A3C1AB;
  --sage-deep: #C9DCCD;
  --sage-soft: #1F2A22;
  --sage-tint: #3A4D3F;
  --income: #84C293;   --income-soft: #1B2A1F;
  --expense: #EB977A;  --expense-soft: #2E1E17;
  --savings: #97B3D3;  --savings-soft: #1B232D;
  --withdraw: #D8B677; --withdraw-soft: #2A2416;
  --warn: #E6BA66;     --warn-soft: #2B2414;
  --hero-a: #24332A; --hero-b: #121914;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 28px -18px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}

*{ box-sizing: border-box; }
[hidden]{ display: none !important; }
html{ -webkit-text-size-adjust: 100%; }
html, body{ min-height: 100%; }
body{
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.45;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
body.locked{ overflow: hidden; }
button, input, select, textarea{ font-family: inherit; color: inherit; font-size: inherit; }
button{ -webkit-tap-highlight-color: transparent; }
h1, h2, h3{ margin: 0; }
.cents{ font-size: .58em; font-weight: 500; opacity: .6; margin-left: 1px; letter-spacing: 0; }
svg.i{ width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.logo-stroke{ stroke: var(--bg); }
::selection{ background: var(--sage-tint); }
:focus-visible{ outline: 2px solid var(--sage); outline-offset: 2px; }
.pos{ color: var(--income); } .neg, .negative{ color: var(--expense); }
.ok{ color: var(--income); font-weight: 600; }
.todo{ color: var(--warn); font-weight: 600; }
.strong{ font-weight: 700; }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
