/* =============================================================================
   mvp-financeiro | global.css
   Tokens de design: cor, tipografia, espaçamento, sombra, raio.
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* --- Cor: base neutra --- */
  --color-bg: #F6F8F7;
  --color-surface: #FFFFFF;
  --color-surface-muted: #F1F4F2;
  --color-border: #E6EBE8;
  --color-text: #10241C;
  --color-text-secondary: #5B6B63;
  --color-text-muted: #8B9A92;

  /* --- Cor: marca / semântica ---
     Verde = positivo/receita/saúde. Vermelho = negativo/despesa/alerta.
     Âmbar = atenção. Índigo = ações secundárias/transferência. */
  --color-brand: #0F9D58;
  --color-brand-dark: #0B7A45;
  --color-brand-soft: #E4F5EB;
  --color-positive: #16A34A;
  --color-positive-soft: #E7F7ED;
  --color-negative: #E0483C;
  --color-negative-soft: #FDECEA;
  --color-warning: #D9932A;
  --color-warning-soft: #FCF2E1;
  --color-accent: #5B5BD6;
  --color-accent-soft: #ECECFB;

  /* --- Tipografia --- */
  --font-display: 'Manrope', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* --- Espaçamento --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* --- Raio e sombra --- */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 36, 28, 0.04);
  --shadow-md: 0 8px 24px -8px rgba(16, 36, 28, 0.10), 0 2px 6px -2px rgba(16, 36, 28, 0.05);
  --shadow-lg: 0 20px 48px -16px rgba(16, 36, 28, 0.18);

  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 180ms;
  --duration-base: 220ms;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}

input, select, textarea {
  font-family: var(--font-body);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.text-positive { color: var(--color-positive); }
.text-negative { color: var(--color-negative); }
.text-warning  { color: var(--color-warning); }
.text-muted    { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

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

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.skeleton-loader {
  background: linear-gradient(90deg, var(--color-border, #e2e2e2) 25%, #f5f5f5 50%, var(--color-border, #e2e2e2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  color: transparent !important;
  border-radius: 4px;
  user-select: none;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast simples usado por app.js para feedback de erros/sucesso */
.toast-stack {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 1000;
}

.toast {
  background: var(--color-text);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  max-width: 320px;
  animation: toast-in var(--duration-base) var(--ease-standard);
}

.toast.error { background: var(--color-negative); }
.toast.success { background: var(--color-brand-dark); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
