:root {
  /* Identidade TerraYield (extraída do Brief, ID Sources e Bot InputsXCrossings da TerraYield Co) */
  --ty-forest: #132A13;      /* verde-floresta: fundo de capa, títulos */
  --ty-forest-2: #1F3D2B;    /* verde de cartões sobre o fundo escuro */
  --ty-forest-3: #2C4F37;
  --ty-gold: #C9A227;        /* dourado: filetes, destaques, agulha do logo */
  --ty-gold-soft: #EFE7CC;
  --ty-sage: #5C8374;        /* sálvia: rótulos grandes e detalhes (não usar em texto pequeno) */
  --ty-cream: #F4F2EC;       /* creme: cartões e faixas de tabela */
  --ty-sand: #E3E0D6;        /* bordas */

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: var(--ty-cream);
  --surface-3: #E9E6DC;
  --border: var(--ty-sand);
  --border-strong: #C4C0B2;
  --text: #1A1A1A;
  --text-2: #3F4A44;
  --text-3: #5E6A63;
  --primary: var(--ty-forest);
  --primary-hover: #0D1F0D;
  --primary-soft: #E7EEE8;
  --on-primary: #ffffff;
  --focus: #2563eb;

  /* Status no tom da matriz de risco da TerraYield (Baixo = verde, Médio = dourado, Alto = vermelho) */
  --st-fail: #A3302C;
  --st-fail-bg: #FBECEA;
  --st-warn: #7A5C0A;
  --st-warn-bg: #FBF4DD;
  --st-ok: #3B6B46;
  --st-ok-bg: #EDF3EE;
  --st-muted: #5C6660;
  --st-muted-bg: #F1F2EF;
  --st-down: #4A5450;
  --st-down-bg: #E8EAE6;

  --radius: 6px;
  --shadow-1: 0 1px 2px rgba(19, 42, 19, 0.06);
  --shadow-2: 0 4px 12px rgba(19, 42, 19, 0.10);
  --font: "Lato", "Carlito", "Calibri", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Caladea", "Georgia", "Cambria", serif;
  --topbar-h: 56px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; }
h1 { font-family: var(--font-display); color: var(--ty-forest); }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 40px; padding: 0 10px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 550; font-size: 14px; }
.field .help { color: var(--text-3); font-size: 13px; }
.input {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); width: 100%;
}
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(15, 61, 46, 0.18); }
.field-error { color: var(--st-fail); font-size: 13px; min-height: 0; }
.field-error:empty { display: none; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } * { transition: none !important; } }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
