/* ============================================================
   LIV OS — wireframe navegável · design system evoluído
   Base LIV (grafite-esverdeado, hue 155) com sage como acento
   funcional, elevação por luminosidade e densidade de dados.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* superfícies — profundidade por luminosidade, mesmo hue da marca */
  --bg:        oklch(0.15 0.010 155);
  --surface-1: oklch(0.19 0.010 155);
  --surface-2: oklch(0.225 0.011 155);
  --surface-3: oklch(0.265 0.012 155);
  --line:      oklch(0.30 0.012 155);
  --line-strong: oklch(0.37 0.014 155);

  /* tinta */
  --ink:   oklch(0.955 0.006 155);
  --muted: oklch(0.73 0.010 155);
  --faint: oklch(0.56 0.010 155);

  /* marca — acentos raros por decisão */
  --sage:      oklch(0.81 0.055 155);
  --sage-deep: oklch(0.67 0.085 155);
  --sage-ink:  oklch(0.17 0.020 155);
  --sand:      oklch(0.88 0.032 85);
  --gold:      oklch(0.83 0.105 90);

  /* semânticos */
  --danger: oklch(0.66 0.140 25);
  --info:   oklch(0.73 0.100 240);
  --teal:   oklch(0.78 0.090 185);
  --violet: oklch(0.73 0.110 300);
  --orange: oklch(0.75 0.120 55);

  /* tipografia */
  --font-ui: "Satoshi", system-ui, -apple-system, sans-serif;
  --font-data: "Fragment Mono", ui-monospace, monospace;
  --text-xs: 0.6875rem;   /* labels mono, eyebrows */
  --text-sm: 0.8125rem;   /* secundário */
  --text-base: 0.875rem;  /* corpo de UI */
  --text-md: 1.0625rem;   /* títulos de card */
  --text-lg: 1.375rem;    /* títulos de seção */
  --text-xl: 1.875rem;    /* números KPI */
  --text-2xl: 2.625rem;   /* número herói */

  /* espaço — escala 4pt */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;

  /* movimento */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms; --dur-base: 240ms; --dur-slow: 480ms;

  --radius: 14px;
  --radius-sm: 9px;
  --edge-light: inset 0 1px 0 oklch(1 0 0 / 0.045);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 450;
  line-height: 1.55; /* +0.05 — texto claro sobre escuro respira mais */
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: oklch(0.67 0.085 155 / 0.45); }

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.main { min-width: 0; }
.content {
  max-width: 1180px;
  padding: var(--sp-8) var(--sp-8) var(--sp-12);
}

/* ---------- Sidebar ---------- */
.sidebar {
  border-right: 1px solid var(--line);
  background: oklch(0.165 0.010 155);
  padding: var(--sp-4) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* seletor de organização — semente do multi-tenant */
.org-switch {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-1);
  box-shadow: var(--edge-light);
}
.org-mark {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--sage-deep);
  color: var(--sage-ink);
  display: grid; place-items: center;
  font-weight: 900;
  font-size: var(--text-base);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.org-name { font-weight: 700; font-size: var(--text-sm); line-height: 1.3; }
.org-plan {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--faint);
  white-space: nowrap;
}
.org-switch .chev { margin-left: auto; color: var(--faint); flex-shrink: 0; }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--faint);
  padding: 0 var(--sp-3) var(--sp-2);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: var(--surface-1); color: var(--ink); }
.nav-item.active {
  background: oklch(0.67 0.085 155 / 0.14);
  color: var(--sage);
  font-weight: 700;
}
.nav-item.soon { opacity: 0.45; cursor: default; }
.nav-item.soon::after {
  content: "protótipo";
  margin-left: auto;
  font-family: var(--font-data);
  font-size: 0.5625rem;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 1px 6px;
}
.sidebar-foot {
  margin-top: auto;
  padding: var(--sp-3);
  font-size: var(--text-xs);
  font-family: var(--font-data);
  color: var(--faint);
  line-height: 1.7;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-8);
  border-bottom: 1px solid var(--line);
}
.search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 0 1 320px;
  padding: 8px var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--faint);
  font-size: var(--text-sm);
}
.search svg { width: 15px; height: 15px; }
.search .kbd { margin-left: auto; }
.kbd {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--faint);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }
.month-pill {
  display: flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-data);
  font-size: var(--text-sm);
  padding: 7px var(--sp-3);
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--muted);
}
.icon-btn {
  position: relative;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--muted);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 6px; height: 6px; border-radius: 99px;
  background: var(--gold);
}
.user-chip {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 5px var(--sp-3) 5px 5px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface-1);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ---------- Avatares ---------- */
.avatar {
  width: 30px; height: 30px;
  border-radius: 99px;
  display: grid; place-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--surface-3);
  color: var(--muted);
  flex-shrink: 0;
}
.avatar.lg { width: 40px; height: 40px; font-size: var(--text-sm); }
.avatar.sage { background: oklch(0.67 0.085 155 / 0.28); color: var(--sage); }
.avatar.gold { background: oklch(0.83 0.105 90 / 0.22); color: var(--gold); }
.avatar.sand { background: oklch(0.88 0.032 85 / 0.16); color: var(--sand); }
.avatar.teal { background: oklch(0.78 0.09 185 / 0.18); color: var(--teal); }
.avatar.violet { background: oklch(0.73 0.11 300 / 0.18); color: var(--violet); }

/* ---------- Cabeçalho de página ---------- */
.page-head { margin-bottom: var(--sp-8); }
.eyebrow {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--sage);
  margin-bottom: var(--sp-2);
}
.page-title {
  font-size: var(--text-lg);
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.page-sub { color: var(--muted); font-size: var(--text-sm); margin-top: var(--sp-2); max-width: 62ch; }

/* ---------- Cards e superfícies ---------- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--edge-light);
}
.card.raised { background: var(--surface-2); }
.card-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6) 0;
}
.card-title { font-size: var(--text-md); font-weight: 700; letter-spacing: -0.01em; }
.card-aside { margin-left: auto; font-family: var(--font-data); font-size: var(--text-xs); color: var(--faint); }
.card-body { padding: var(--sp-4) var(--sp-6) var(--sp-6); }

/* ---------- KPIs ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.kpi {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--edge-light);
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}
.kpi.hero { background: var(--surface-2); justify-content: space-between; }
.kpi-label {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--faint);
}
.kpi-value {
  font-size: var(--text-xl);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi.hero .kpi-value { font-size: var(--text-2xl); }
.kpi-value .unit { font-size: 0.55em; font-weight: 700; color: var(--muted); margin-right: 2px; }
.kpi-foot { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-sm); color: var(--muted); }

.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-data);
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.delta.up { background: oklch(0.67 0.085 155 / 0.16); color: var(--sage); }
.delta.down { background: oklch(0.66 0.14 25 / 0.14); color: var(--danger); }
.delta.flat { background: var(--surface-3); color: var(--muted); }

/* ---------- Sparklines ---------- */
.spark { width: 100%; height: 44px; }
.spark svg { width: 100%; height: 100%; overflow: visible; }
.spark polyline { fill: none; stroke: var(--sage); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .area { fill: oklch(0.67 0.085 155 / 0.12); stroke: none; }
.spark .last { fill: var(--sage); }
.spark.sand polyline { stroke: var(--sand); }
.spark.sand .area { fill: oklch(0.88 0.032 85 / 0.08); }
.spark.sand .last { fill: var(--sand); }
.spark.sm { height: 28px; }

/* ---------- Progresso de meta ---------- */
.meta-progress { display: flex; flex-direction: column; gap: var(--sp-2); }
.meta-progress .row {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: var(--text-sm); color: var(--muted);
}
.meta-progress .row strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.bar {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}
.bar > i {
  display: block; height: 100%;
  border-radius: 99px;
  background: var(--sage-deep);
}
.bar > i.gold { background: var(--gold); }
.bar > i.sand { background: var(--sand); }
.bar > i.teal { background: var(--teal); }
.bar.thin { height: 5px; }

/* ---------- Funil ---------- */
.funnel { display: flex; flex-direction: column; gap: var(--sp-3); }
.funnel-row {
  display: grid;
  grid-template-columns: 92px 1fr 64px;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
}
.funnel-row .fr-label { color: var(--muted); }
.funnel-row .fr-value {
  font-family: var(--font-data);
  text-align: right;
  color: var(--ink);
}
.funnel-row .bar { height: 18px; border-radius: 6px; }
.funnel-row .bar > i { border-radius: 6px; background: oklch(0.67 0.085 155 / 0.75); }
.funnel-row:last-child .bar > i { background: var(--gold); }

/* ---------- Ranking ---------- */
.rank-list { display: flex; flex-direction: column; }
.rank-row {
  display: grid;
  grid-template-columns: 24px 40px 1fr 130px 92px;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
  border-radius: var(--radius-sm);
  transition: background var(--dur-fast) var(--ease-out);
}
.rank-row:hover { background: var(--surface-2); }
.rank-row + .rank-row { border-top: 1px solid oklch(0.30 0.012 155 / 0.5); }
.rank-pos {
  font-family: var(--font-data);
  font-size: var(--text-sm);
  color: var(--faint);
  text-align: center;
}
.rank-pos.first { color: var(--gold); }
.rank-name { font-weight: 700; font-size: var(--text-sm); line-height: 1.3; }
.rank-role { font-size: var(--text-xs); color: var(--faint); font-family: var(--font-data); }
.rank-value {
  font-family: var(--font-data);
  font-size: var(--text-sm);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rank-meta { font-size: var(--text-xs); color: var(--faint); text-align: right; }

/* ---------- Tabelas ---------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: var(--sp-3);
  border-bottom: 1px solid oklch(0.30 0.012 155 / 0.4);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num {
  font-family: var(--font-data);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table .strong { font-weight: 700; color: var(--ink); }
.table-scroll { overflow-x: auto; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 99px; background: currentColor; }
.badge.sage { background: oklch(0.67 0.085 155 / 0.15); color: var(--sage); }
.badge.gold { background: oklch(0.83 0.105 90 / 0.14); color: var(--gold); }
.badge.sand { background: oklch(0.88 0.032 85 / 0.10); color: var(--sand); }
.badge.danger { background: oklch(0.66 0.14 25 / 0.13); color: var(--danger); }
.badge.info { background: oklch(0.73 0.10 240 / 0.13); color: var(--info); }
.badge.teal { background: oklch(0.78 0.09 185 / 0.13); color: var(--teal); }
.badge.violet { background: oklch(0.73 0.11 300 / 0.13); color: var(--violet); }
.badge.orange { background: oklch(0.75 0.12 55 / 0.13); color: var(--orange); }
.badge.neutral { background: var(--surface-3); color: var(--muted); }
.badge.hollow { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }

/* código localizador */
.code {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--sand);
  background: oklch(0.88 0.032 85 / 0.07);
  border: 1px solid oklch(0.88 0.032 85 / 0.14);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: 9px var(--sp-4);
  border-radius: var(--radius-sm);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--sage-deep); color: var(--sage-ink); }
.btn.primary:hover { background: oklch(0.72 0.085 155); }
.btn.ghost { border: 1px solid var(--line-strong); color: var(--muted); }
.btn.ghost:hover { border-color: var(--sage); color: var(--sage); }
.btn.subtle { background: var(--surface-2); color: var(--muted); }
.btn.subtle:hover { color: var(--ink); background: var(--surface-3); }
.btn.sm { padding: 6px var(--sp-3); font-size: var(--text-xs); }

/* ---------- Formulários (wizard) ---------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field > label { font-weight: 700; font-size: var(--text-sm); }
.field .hint { font-size: var(--text-xs); color: var(--faint); line-height: 1.5; }
.input {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px var(--sp-3);
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.input:focus { outline: none; border-color: var(--sage); }
.input.mono { font-family: var(--font-data); }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.input-suffix { position: relative; }
.input-suffix .suffix {
  position: absolute; right: var(--sp-3); top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--faint);
  pointer-events: none;
}

/* ---------- Wizard ---------- */
.wizard { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--sp-8); }
.steps { display: flex; flex-direction: column; gap: var(--sp-1); }
.step {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--faint);
  font-size: var(--text-sm);
  font-weight: 500;
}
.step .step-dot {
  width: 24px; height: 24px;
  border-radius: 99px;
  display: grid; place-items: center;
  font-family: var(--font-data);
  font-size: var(--text-xs);
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.step.done { color: var(--muted); }
.step.done .step-dot { background: oklch(0.67 0.085 155 / 0.2); border-color: transparent; color: var(--sage); }
.step.active { background: oklch(0.67 0.085 155 / 0.12); color: var(--sage); font-weight: 700; }
.step.active .step-dot { background: var(--sage-deep); border-color: transparent; color: var(--sage-ink); }

/* ---------- Kanban (pipeline) ---------- */
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(232px, 1fr);
  gap: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-3);
}
.kcol { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.kcol-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2) 0;
}
.kcol-title { font-weight: 700; font-size: var(--text-sm); }
.kcol-count {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--faint);
  background: var(--surface-2);
  border-radius: 99px;
  padding: 1px 8px;
}
.kcol-sum { margin-left: auto; font-family: var(--font-data); font-size: var(--text-xs); color: var(--faint); }
.kcard {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--edge-light);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.kcard:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.kcard.selected { border-color: var(--sage); background: var(--surface-2); }
.kcard-name { font-weight: 700; font-size: var(--text-sm); }
.kcard-row { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-xs); color: var(--faint); }
.kcard-value { font-family: var(--font-data); font-size: var(--text-sm); color: var(--ink); }

/* ---------- Timeline / jornada ---------- */
.journey { display: flex; flex-direction: column; gap: 0; }
.jstep { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--sp-3); }
.jstep .jrail { display: flex; flex-direction: column; align-items: center; }
.jstep .jdot {
  width: 12px; height: 12px;
  border-radius: 99px;
  border: 2px solid var(--line-strong);
  background: var(--bg);
  flex-shrink: 0;
  margin-top: 5px;
}
.jstep.done .jdot { background: var(--sage-deep); border-color: var(--sage-deep); }
.jstep.now .jdot { background: var(--gold); border-color: var(--gold); }
.jstep .jline { width: 2px; flex: 1; background: var(--line); margin: 4px 0; }
.jstep.done .jline { background: oklch(0.67 0.085 155 / 0.5); }
.jstep:last-child .jline { display: none; }
.jstep .jbody { padding-bottom: var(--sp-4); }
.jstep .jtitle { font-weight: 700; font-size: var(--text-sm); }
.jstep .jmeta { font-family: var(--font-data); font-size: var(--text-xs); color: var(--faint); margin-top: 2px; }

/* ---------- Régua de faixas (comissões) ---------- */
.ruler { display: flex; flex-direction: column; gap: var(--sp-2); }
.ruler-track {
  display: flex;
  height: 26px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.ruler-seg {
  display: grid;
  place-items: center;
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--muted);
  background: var(--surface-2);
}
.ruler-seg + .ruler-seg { border-left: 1px solid var(--line); }
.ruler-seg.hit { background: oklch(0.67 0.085 155 / 0.30); color: var(--sage); font-weight: 700; }
.ruler-seg.now { background: var(--sage-deep); color: var(--sage-ink); font-weight: 700; }
.ruler-legend {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--faint);
}

/* ---------- Grids utilitários ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--sp-4); }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }

/* ---------- Notas e divisores ---------- */
.divider { height: 1px; background: var(--line); border: 0; margin: var(--sp-4) 0; }
.foot-note {
  margin-top: var(--sp-12);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--faint);
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.note {
  border: 1px solid oklch(0.88 0.032 85 / 0.18);
  background: oklch(0.88 0.032 85 / 0.05);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--sand);
  line-height: 1.6;
}

/* ---------- Reveal (entrada staggered) ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  animation: rise var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---------- Capa (index) ---------- */
.cover {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--sp-16) var(--sp-8) var(--sp-12);
}
.cover-brand {
  font-family: var(--font-data);
  font-size: var(--text-sm);
  color: var(--sage);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--sp-8);
}
.cover h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.02;
  max-width: 18ch;
}
.cover h1 em { font-style: normal; color: var(--sage); }
.cover-lead {
  margin-top: var(--sp-6);
  font-size: var(--text-md);
  color: var(--muted);
  max-width: 58ch;
  line-height: 1.7;
}
.cover-lead + .cover-lead { margin-top: var(--sp-4); }
.screen-grid {
  margin-top: var(--sp-12);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.screen-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--edge-light);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.screen-card:hover { border-color: var(--sage); transform: translateY(-2px); }
.screen-num { font-family: var(--font-data); font-size: var(--text-xs); color: var(--faint); }
.screen-card h2 { font-size: var(--text-md); font-weight: 700; letter-spacing: -0.01em; }
.screen-card p { font-size: var(--text-sm); color: var(--muted); line-height: 1.6; }
.screen-card .go {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--sage); font-weight: 700; font-size: var(--text-sm);
}
.screen-card .go svg { width: 14px; height: 14px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi.hero { grid-column: 1 / -1; }
  .grid-main-side { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .wizard { grid-template-columns: 1fr; }
  .steps { flex-direction: row; overflow-x: auto; }
  .step { flex-shrink: 0; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
  }
  .org-switch { flex-shrink: 0; }
  .nav-group { flex-direction: row; flex-shrink: 0; }
  .nav-label, .sidebar-foot { display: none; }
  .nav-item { white-space: nowrap; }
  .content { padding: var(--sp-6) var(--sp-4) var(--sp-12); }
  .topbar { padding: var(--sp-3) var(--sp-4); }
  .search { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .input-row { grid-template-columns: 1fr; }
}
