:root {
  --ink: #0c1824;
  --ink-2: #142638;
  --paper: #f2f4f5;
  --white: #fbfcfc;
  --muted: #6b7781;
  --line: #d5dce0;
  --blue: #0b61d8;
  --blue-soft: #dbeaff;
  --good: #1c8b64;
  --warning: #a56a12;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 22px; display: flex; flex-direction: column; color: #dce6ee; background: var(--ink); }
.brand { display: flex; align-items: baseline; gap: 9px; color: inherit; text-decoration: none; }
.brand b { color: #fff; font-size: 25px; letter-spacing: -.07em; }
.brand span { color: #8ca0af; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
nav { margin-top: 68px; display: grid; gap: 4px; }
nav a { padding: 11px 9px; display: flex; gap: 12px; color: #a9bac6; border-left: 2px solid transparent; font-size: 12px; text-decoration: none; transition: color .18s ease, border-color .18s ease, transform .18s ease; }
nav a span { width: 18px; color: #607686; font-size: 9px; }
nav a:hover, nav a.active { color: #fff; border-left-color: #4d9bff; transform: translateX(2px); }
nav a.disabled { opacity: .42; pointer-events: none; }
.scope { margin-top: auto; padding-top: 20px; border-top: 1px solid #243746; display: grid; gap: 6px; }
.scope small { color: #698091; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.scope b { color: #fff; font-size: 11px; }
.scope span { color: #8fa1ad; font-size: 9px; }
main { min-width: 0; }
.topbar { height: 64px; padding: 0 42px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(242,244,245,.92); backdrop-filter: blur(12px); }
.menu { display: none; border: 0; background: none; font-size: 22px; }
.system-state { display: flex; align-items: center; gap: 9px; color: #475661; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.system-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px #eadcc7; }
.system-state.ready i { background: var(--good); box-shadow: 0 0 0 4px #d7ece4; }
.last-read { color: var(--muted); font-size: 9px; }
.workspace { padding: 44px clamp(24px, 4vw, 68px) 80px; }
.workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.workspace-head p, .section-head p, .decision-strip > div > p { margin: 0 0 8px; color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.045em; }
h1 { font-size: clamp(38px, 5vw, 70px); font-weight: 610; }
h2 { font-size: clamp(25px, 3vw, 40px); font-weight: 560; }
.phase { padding-left: 18px; border-left: 2px solid var(--blue); display: grid; gap: 6px; }
.phase span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.phase b { font-size: 12px; }
.metric-ledger { margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.metric-ledger > div { min-width: 0; padding: 22px 20px 20px 0; border-right: 1px solid var(--line); }
.metric-ledger > div:not(:first-child) { padding-left: 20px; }
.metric-ledger > div:last-child { border-right: 0; }
.metric-ledger span { display: block; color: var(--muted); font-size: 8px; letter-spacing: .09em; text-transform: uppercase; }
.metric-ledger strong { display: block; margin: 12px 0 5px; font-size: 35px; line-height: 1; font-weight: 560; font-variant-numeric: tabular-nums; }
.metric-ledger strong.text-metric { color: var(--warning); font-size: 19px; }
.metric-ledger small { color: var(--muted); font-size: 9px; }
.decision-strip { margin: 72px 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); gap: 60px; align-items: end; }
.decision-strip > p { margin: 0; color: #4e5d68; font: 16px/1.65 Georgia, serif; }
.coverage-board, .sources-section { margin-top: 70px; }
.section-head { padding-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--ink); }
.section-head > span, .status-tag { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.status-tag { padding: 7px 9px; color: #80550f; background: #f2e6cf; }
.coverage-grid { display: grid; grid-template-columns: 1.4fr 1fr; border-bottom: 1px solid var(--line); }
.brazil-field { min-height: 340px; padding: 42px; display: grid; align-content: center; justify-items: center; border-right: 1px solid var(--line); background: var(--white); text-align: center; }
.map-mark { width: 126px; height: 126px; display: grid; place-items: center; color: #97a9b5; border: 1px solid #aebcc5; border-radius: 52% 48% 57% 43% / 41% 51% 49% 59%; font-size: 37px; font-weight: 600; letter-spacing: -.08em; transform: rotate(-7deg); }
.brazil-field p { max-width: 330px; margin: 26px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.coverage-grid dl { margin: 0; padding: 25px 0 25px 34px; }
.coverage-grid dl div { padding: 20px 0; border-bottom: 1px solid var(--line); }
.coverage-grid dl div:last-child { border-bottom: 0; }
dt { color: var(--muted); font-size: 8px; letter-spacing: .09em; text-transform: uppercase; }
dd { margin: 8px 0 0; font-size: 13px; }
.source-table { border-bottom: 1px solid var(--ink); }
.source-row { min-height: 68px; display: grid; grid-template-columns: 1.5fr 1fr 1fr .6fr; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); font-size: 11px; }
.source-row > span:first-child { font-weight: 600; }
.source-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.source-header { min-height: 40px; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.source-row:last-child { border-bottom: 0; }
.source-status { justify-self: start; padding: 5px 7px; color: #52626e; background: #e2e7ea; font-size: 8px; text-transform: uppercase; }
.source-status.documented { color: #245845; background: #dceddf; }
.source-status.blocked { color: #793f1e; background: #f1dfd3; }
.validation-table { border-bottom: 1px solid var(--ink); }
.validation-row { min-height: 68px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; gap: 22px; border-bottom: 1px solid var(--line); font-size: 11px; }
.validation-row:last-child { border-bottom: 0; }
.validation-row span { display: grid; gap: 6px; }
.validation-row small { color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.blocked-text { color: #96501f; font-weight: 600; }
.empty-state { margin: 0; padding: 28px 0; color: var(--muted); font-size: 11px; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: 340px; padding: 12px 15px; color: #fff; background: var(--ink); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; font-size: 11px; }
.toast.show { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  .workspace-head, .metric-ledger, .decision-strip { animation: reveal .5s both; }
  .metric-ledger { animation-delay: .08s; }
  .decision-strip { animation-delay: .14s; }
  @keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 920px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 20; width: 230px; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .menu { display: block; }
  .topbar { padding: 0 22px; }
  .system-state { margin-right: auto; margin-left: 14px; }
  .metric-ledger { grid-template-columns: 1fr 1fr; }
  .metric-ledger > div:nth-child(2) { border-right: 0; }
  .metric-ledger > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .workspace { padding: 30px 22px 60px; }
  .workspace-head { display: grid; align-items: start; }
  .phase { margin-top: 8px; }
  .metric-ledger { grid-template-columns: 1fr; }
  .metric-ledger > div, .metric-ledger > div:not(:first-child) { padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-ledger > div:last-child { border-bottom: 0; }
  .decision-strip { margin: 50px 0; grid-template-columns: 1fr; gap: 20px; }
  .coverage-grid { grid-template-columns: 1fr; }
  .brazil-field { min-height: 280px; padding: 32px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .coverage-grid dl { padding: 16px 0; }
  .source-header { display: none; }
  .source-row { padding: 18px 0; grid-template-columns: 1fr 1fr; gap: 12px; }
  .source-row > span:first-child { grid-column: 1 / -1; }
  .source-row > span:nth-child(3)::before { content: "Empresa: "; color: var(--muted); }
  .validation-row { padding: 18px 0; grid-template-columns: 1fr 1fr; }
  .validation-row span:first-child { grid-column: 1 / -1; }
  .last-read { display: none; }
}
