/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select {
  font-family: inherit;
  font-size: max(16px, 1rem); /* evita zoom automático no iOS */
  color: inherit;
  background: none;
  border: none;
  outline: none;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-light); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* Seleção */
::selection { background: var(--color-green-dim); color: var(--color-green); }

/* Tipografia utilitários */
.text-xs    { font-size: var(--text-xs); }
.text-sm    { font-size: var(--text-sm); }
.text-base  { font-size: var(--text-base); }
.text-md    { font-size: var(--text-md); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }
.text-2xl   { font-size: var(--text-2xl); }
.text-3xl   { font-size: var(--text-3xl); }
.text-soft  { color: var(--color-text-soft); }
.text-muted { color: var(--color-text-muted); }
.text-green { color: var(--color-green); }
.text-red   { color: var(--color-red); }
.text-blue  { color: var(--color-blue); }
.text-yellow{ color: var(--color-yellow); }
.text-mono  { font-family: var(--font-mono); }
.text-display { font-family: var(--font-display); }
.font-bold  { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout utilitários */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end  { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }

/* Espaçamento */
.p-0  { padding: 0; }
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.px-3 { padding-inline: var(--space-3); }
.px-4 { padding-inline: var(--space-4); }
.py-2 { padding-block: var(--space-2); }
.py-3 { padding-block: var(--space-3); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.ml-auto { margin-left: auto; }

/* Bordas */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded    { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.border     { border: 1px solid var(--color-border); }
.border-light { border: 1px solid var(--color-border-light); }

/* Visibilidade */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto  { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* Posicionamento */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { inset: 0; }
.w-full   { width: 100%; }
.h-full   { height: 100%; }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-0  { opacity: 0; }

/* Number formatting: valores monetários */
.value-positive { color: var(--color-income); font-weight: 600; }
.value-negative { color: var(--color-expense); font-weight: 600; }
.value-neutral  { color: var(--color-text); }
.value-pending  { color: var(--color-orange); }

canvas { background: transparent !important; }
