/* ===========================================================
   AAE BR-319 · plataforma de dados territoriais
   identidade visual: folder oficial INPA · fev/2026
   =========================================================== */

:root {
  /* paleta oficial */
  --g0: #054229;
  --g1: #0F3D1F;
  --g2: #08632D;
  --g3: #1A573E;
  --g4: #48836A;
  --g5: #DCFCE7;

  --orange:        #CD5D1C;
  --orange-light:  #FAEEDC;
  --orange-medium: #D79F77;

  --white:  #FFFFFF;
  --bg:     #F9FAFB;
  --bg2:    #F3F6F0;
  --border: #E5E7EB;
  --border-strong: #C7D0C0;

  --t1: #111827;
  --t2: #374151;
  --t3: #6B7280;
  --t4: #9CA3AF;

  --shadow-sm: 0 1px 2px rgba(5,66,41,.04), 0 1px 3px rgba(5,66,41,.05);
  --shadow-md: 0 2px 8px rgba(5,66,41,.06), 0 1px 3px rgba(5,66,41,.05);
  --shadow-lg: 0 8px 24px rgba(5,66,41,.08), 0 4px 8px rgba(5,66,41,.05);

  --max: 1440px;
  --radius: 6px;
  --radius-sm: 4px;

  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  /* mapa tokens */
  --map-bg: #F3F6F0;
  --biome-fill: #E8EFE0;
  --biome-water: #C9DDE8;
  --grid: #C7D0C0;
  --axis: #6B6B6B;
  --road: #054229;
  --road-line: #CD5D1C;
  --river: #5b8db8;
  --river-label: #2c5478;
  --ti-stroke: #CD5D1C;
  --uc-stroke: #08632D;
  --muni-fill: #054229;
  --muni-fill-text: #ffffff;
  --muni-halo: #CD5D1C;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--t2);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--g2); color: #fff; }
h1,h2,h3,h4 { font-family: var(--font-display); color: var(--t1); margin: 0; line-height: 1.15; letter-spacing: -0.015em; }

.app { max-width: var(--max); margin: 0 auto; background: var(--white); }

/* faixa decorativa AAE */
.aae-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--g0) 0%, var(--g2) 35%, var(--g4) 55%, var(--orange) 80%, var(--orange-medium) 100%);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(180deg, var(--g0) 0%, var(--g1) 100%);
  color: #fff;
  padding: 28px 48px 56px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content:''; position:absolute; inset:0;
  background: radial-gradient(ellipse at 80% 30%, rgba(72,131,106,0.25), transparent 50%),
              radial-gradient(ellipse at 10% 90%, rgba(205,93,28,0.12), transparent 60%);
  pointer-events: none;
}
.hero-top {
  display:flex; justify-content:space-between; align-items:center; gap:24px;
  position: relative; z-index: 1;
  padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,0.12);
}
.hero-brand { display:flex; align-items:center; gap:14px; }
.hero-brand img { height: 48px; filter: brightness(0) invert(1); }
.hero-brand .b-divider { width: 1px; height: 38px; background: rgba(255,255,255,0.25); }
.hero-brand .b-text { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; line-height:1.2; }
.hero-brand .b-text .sub { display:block; font-weight: 400; font-size: 11px; opacity: 0.8; letter-spacing: 0.05em; text-transform: uppercase; margin-top: 2px; }

.hero-actions { display:flex; gap:8px; }
.hero-btn {
  font: inherit; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em;
  padding: 7px 14px; border: 1px solid rgba(255,255,255,0.3); background: transparent;
  color:#fff; cursor: pointer; border-radius: var(--radius-sm); text-transform: uppercase;
}
.hero-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }

.hero-body { position: relative; z-index: 1; padding-top: 36px; max-width: 1100px; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--orange-medium); margin-bottom: 14px; font-weight: 500; }
.hero h1 { font-size: clamp(34px, 4.8vw, 58px); font-weight: 800; color: #fff; max-width: 950px; text-wrap: balance; margin-bottom: 14px; }
.hero h1 em { font-style: normal; color: var(--orange); }
.hero .lede { font-size: 17px; color: rgba(255,255,255,0.85); max-width: 780px; font-weight: 300; text-wrap: pretty; }

.hero-meta {
  display:flex; gap:32px; flex-wrap:wrap; margin-top: 28px;
  padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 12px; font-family: var(--font-mono); color: rgba(255,255,255,0.7);
}
.hero-meta span b { color: #fff; font-weight: 500; margin-right: 6px; }

/* ===== ETAPAS — faixa laranja ===== */
.etapas-band {
  display:flex; align-items:stretch;
  background: var(--orange);
  color: #fff;
}
.etapas-label {
  padding: 18px 28px; font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.18em; text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,0.25);
  display:flex; align-items:center; gap: 10px; flex-shrink:0;
}
.etapas-list { display:flex; flex: 1; }
.etapa {
  flex: 1; padding: 14px 22px; display:flex; align-items:center; gap: 14px;
  border-right: 1px solid rgba(255,255,255,0.2); position: relative;
}
.etapa:last-child { border-right: none; }
.etapa-num {
  width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.18);
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; flex-shrink:0;
}
.etapa-text { line-height: 1.2; }
.etapa-text .et-name { font-family: var(--font-display); font-weight: 600; font-size: 13px; }
.etapa-text .et-desc { font-size: 11px; opacity: 0.85; margin-top: 2px; font-weight: 300; }
.etapa.active { background: var(--g0); }
.etapa.active .etapa-num { background: var(--orange); color: #fff; }
.etapa.active::after {
  content:''; position:absolute; bottom: -1px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px; background: var(--g0); margin-bottom: -6px;
}
.etapa-arrow { color: rgba(255,255,255,0.4); font-size: 16px; flex-shrink:0; }

/* ===== INDICADORES ===== */
.indicadores {
  display:grid; grid-template-columns: repeat(6, 1fr);
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.ind {
  padding: 26px 22px; border-right: 1px solid var(--border);
}
.ind:last-child { border-right: none; }
.ind-num {
  font-family: var(--font-display); font-size: 34px; font-weight: 700;
  color: var(--g0); line-height: 1; letter-spacing: -0.02em;
}
.ind-num .unit { font-size: 14px; font-weight: 500; color: var(--t3); margin-left: 6px; letter-spacing: 0; }
.ind-lbl { font-size: 13px; font-weight: 600; color: var(--t1); margin-top: 8px; }
.ind-sub { font-size: 11px; color: var(--t3); margin-top: 3px; font-family: var(--font-mono); letter-spacing: 0.02em; }

/* ===== SECTION HEADS ===== */
.section-head {
  padding: 48px 48px 28px;
}
.section-head .panel-tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  padding: 4px 10px; background: var(--orange); color: #fff;
  letter-spacing: 0.1em; margin-bottom: 14px;
}
.section-head h2 { font-size: 30px; font-weight: 700; color: var(--g0); margin: 0 0 8px; }
.section-head .section-lede { font-size: 15px; color: var(--t2); max-width: 760px; margin: 0; text-wrap: pretty; }

/* ===== MAP SECTION ===== */
.map-section {
  display:grid; grid-template-columns: 280px 1fr 320px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--white); min-height: 740px;
}
.panel {
  padding: 24px 22px; background: var(--bg2);
  border-right: 1px solid var(--border);
}
.panel:last-child { border-right: none; border-left: 1px solid var(--border); background: var(--white); }
.panel-head {
  display:flex; align-items:center; gap:10px; margin-bottom: 18px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
  position: relative;
}
.panel-tag {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  padding: 3px 8px; background: var(--g0); color: #fff;
  letter-spacing: 0.08em;
}
.panel-head h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--g0); }
.close-btn { position:absolute; right:0; top:-3px; background:none; border:none; font-size:22px; color: var(--t4); cursor: pointer; line-height:1; padding:4px 6px; border-radius:var(--radius-sm); }
.close-btn:hover { color: var(--g0); background: var(--g5); }

.filter-block { margin-bottom: 22px; }
.filter-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--t3); margin-bottom: 10px;
}
.layer-row {
  display:flex; align-items:center; gap:10px; padding: 7px 0; cursor: pointer;
  font-size: 13px; color: var(--t2);
}
.layer-row:hover { color: var(--g0); }
.layer-row input[type="checkbox"] { accent-color: var(--g2); width: 14px; height: 14px; cursor: pointer; }
.layer-swatch { width:14px; height:14px; flex-shrink:0; border-radius: 2px; }
.sw-br319 { background: var(--g0); height: 3px; margin: 6px 0; }
.sw-munis { background: var(--g0); border-radius:50%; }
.sw-rios  { background: var(--river); height: 3px; margin: 6px 0; }
.sw-tis   { background: repeating-linear-gradient(45deg, var(--ti-stroke) 0 2px, transparent 2px 4px); border:1px solid var(--ti-stroke); }
.sw-ucs   { background: repeating-linear-gradient(-45deg, var(--uc-stroke) 0 2px, transparent 2px 4px); border:1px solid var(--uc-stroke); }
.sw-desmat{ background: radial-gradient(circle, #dc2626, transparent 70%); }

.region-pill {
  display:inline-flex; align-items:center; gap:6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  padding: 3px 8px; border-radius: 99px;
  background: var(--g5); color: var(--g0);
  letter-spacing: 0.05em;
}
.region-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.year-slider input[type="range"] { width: 100%; accent-color: var(--g2); }
.year-ticks { display:flex; justify-content: space-between; margin-top: 8px; gap: 4px; }
.year-tick {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  padding: 4px 9px; background: transparent; border: 1px solid var(--border-strong);
  cursor: pointer; color: var(--t3); border-radius: var(--radius-sm); flex: 1;
}
.year-tick.active { background: var(--g0); color: #fff; border-color: var(--g0); }
.year-tick:hover:not(.active) { background: var(--white); color: var(--g0); border-color: var(--g0); }

.select {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 13px;
  border: 1px solid var(--border-strong); background: #fff;
  border-radius: var(--radius-sm); font-family: var(--font-body); color: var(--t1);
  cursor: pointer;
}
.select:focus { outline: 2px solid var(--g2); outline-offset: 1px; }

/* ===== Map stage ===== */
.map-stage { display:flex; flex-direction: column; }
.map-toolbar {
  display:flex; justify-content:space-between; align-items:center;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  background: var(--white);
}
.map-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--g0); }
.map-meta { font-family: var(--font-mono); font-size: 11px; color: var(--t3); letter-spacing: 0.02em; }
.map-canvas { flex: 1; min-height: 660px; background: var(--map-bg); position: relative; }

/* ===== Detail panel ===== */
.panel-detail.empty .empty-msg {
  color: var(--t3); font-size: 13px; padding: 22px 18px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  text-align:center; background: var(--bg2); line-height: 1.6;
}
.panel-detail.empty .empty-msg b { color: var(--g0); display:block; margin-bottom: 4px; font-family: var(--font-display); }
.muni-title { display:flex; align-items:flex-start; gap:12px; margin-bottom: 18px; }
.muni-uf {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  padding: 4px 8px; background: var(--g0); color: #fff;
  flex-shrink:0; margin-top: 4px; letter-spacing: 0.08em; border-radius: var(--radius-sm);
}
.muni-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--g0); line-height: 1.1; }
.muni-coords { font-family: var(--font-mono); font-size: 11px; color: var(--t3); margin-top: 4px; }
.muni-region { display:inline-block; margin-top: 6px; }

.kpi-grid {
  display:grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border); margin-bottom: 22px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.kpi { background: var(--white); padding: 14px 14px; }
.kpi-num { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--g0); line-height: 1; }
.kpi-lbl { font-size: 10px; color: var(--t3); margin-top: 5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }

.subhead {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--g0);
  margin: 22px 0 12px; padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  display:flex; justify-content:space-between; align-items:baseline;
}
.subhead .src { color: var(--t4); font-size: 9px; letter-spacing: 0.05em; font-weight: 400; text-transform: none; }

.bars { display:flex; flex-direction:column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 1fr 56px 36px; align-items:center; gap: 10px; font-size: 12px; }
.bar-lbl { color: var(--t1); font-weight: 500; }
.bar-track { background: var(--bg2); height: 6px; border-radius: 99px; overflow: hidden; }
.bar-fill { background: var(--g2); height: 100%; border-radius: 99px; }
.bar-num { font-family: var(--font-mono); text-align:right; color: var(--t2); font-size: 11px; font-variant-numeric: tabular-nums; }

.prod-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.prod-table td { padding: 6px 0; border-bottom: 1px dotted var(--border); }
.prod-table td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--g0); font-weight: 500; }
.prod-table td.un { text-align: left; padding-left: 6px; color: var(--t4); width: 28px; font-family: var(--font-mono); font-size: 10px; }

.orgs-list { display:flex; flex-direction:column; gap: 0; max-height: 280px; overflow:auto; }
.org-row { display:flex; align-items:center; gap:10px; font-size: 12px; padding: 6px 0; border-bottom: 1px dotted var(--border); }
.org-tag {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  width: 18px; height: 18px; display:inline-flex; align-items:center; justify-content:center;
  flex-shrink:0; border-radius: var(--radius-sm); color: #fff;
}
.tag-cooperativa { background: var(--g2); }
.tag-associação { background: var(--g4); }
.tag-sindicato { background: var(--orange); }
.tag-outro { background: var(--t4); }
.org-nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--t2); }
.org-more { font-family: var(--font-mono); font-size: 10px; color: var(--t3); padding: 8px 0 0; font-style: italic; }

/* ===== GRAPH ===== */
.graph-section { padding: 0 48px 56px; background: var(--white); border-bottom: 1px solid var(--border); }
.graph-stage {
  height: 720px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius); position: relative; overflow: hidden;
}

/* ===== TABLE ===== */
.table-section { padding: 0 48px 56px; background: var(--bg2); border-bottom: 1px solid var(--border); }
.prod-full { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.prod-head {
  display:flex; justify-content:space-between; align-items:center;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  background: var(--white);
}
.prod-head h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--g0); }
.prod-actions { display:flex; gap:14px; align-items:center; font-size: 11px; color: var(--t3); font-family: var(--font-mono); }
.btn-export {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  padding: 7px 14px; border: 1px solid var(--g0); background: transparent;
  color: var(--g0); cursor: pointer; border-radius: var(--radius-sm);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.btn-export:hover { background: var(--g0); color: #fff; }

.table-wrap { overflow-x: auto; }
.big-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.big-table thead th {
  text-align: left; padding: 12px 16px; background: var(--g0); color: #fff;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; user-select: none;
  white-space: nowrap;
}
.big-table thead th.num { text-align: right; }
.big-table thead th:hover { background: var(--g1); }
.big-table .sort-arrow { color: var(--orange-medium); font-size: 9px; margin-left: 4px; }
.big-table tbody td { padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--t2); }
.big-table tbody tr:hover { background: var(--bg2); }
.big-table tbody tr:hover td { color: var(--t1); }
.big-table td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--g0); }
.big-table .muni-cell { font-weight: 600; color: var(--t1); }
.uf-pill {
  display:inline-block; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  padding: 2px 7px; background: var(--bg2); color: var(--g0); border-radius: var(--radius-sm);
  letter-spacing: 0.08em; margin-right: 6px;
}
.region-tag {
  display:inline-block; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  padding: 2px 7px; border-radius: 99px; color: var(--g0); background: var(--g5);
  letter-spacing: 0.05em;
}

/* ===== CONSORCIO ===== */
.consorcio-section { padding: 56px 48px; background: var(--white); border-bottom: 1px solid var(--border); }
.consorcio-grid { display:grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: start; }
.consorcio-block { margin-bottom: 36px; }
.consorcio-block:last-child { margin-bottom: 0; }
.consorcio-head { font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--orange); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.consorcio-row { display:flex; flex-wrap:wrap; align-items:center; gap: 36px; }
.consorcio-row img { height: 60px; max-width: 180px; object-fit: contain; }
.consorcio-row.responsavel img { height: 88px; max-width: 220px; }
.apoio-list { display:flex; flex-wrap:wrap; gap: 8px; align-items:center; }
.apoio-pill {
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  padding: 8px 14px; background: var(--bg2); color: var(--g0);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.apoio-pill img { height: 28px; vertical-align: middle; }

/* ===== FOOTER ===== */
.foot {
  background: var(--g0); color: rgba(255,255,255,0.85);
  padding: 56px 48px 32px;
}
.foot-grid { display:grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
.foot-h {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--orange-medium);
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.foot p { margin: 0 0 10px; line-height: 1.6; font-size: 13px; }
.foot-list { list-style: none; padding: 0; margin: 0; font-size: 12px; line-height: 1.75; color: rgba(255,255,255,0.7); }
.foot-list li { padding-left: 12px; position: relative; }
.foot-list li::before { content:'→'; position:absolute; left:0; color: var(--orange); font-weight: 700; }
.foot a { color: var(--orange-light); text-decoration: none; border-bottom: 1px dotted var(--orange-medium); }
.foot a:hover { color: #fff; border-bottom-color: #fff; }
.foot-sub { font-size: 11px; opacity: 0.55; margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.1); font-family: var(--font-mono); }
.foot b { color: #fff; font-weight: 600; }

.foot-conecte { background: var(--orange); padding: 10px 16px; display:inline-block; border-radius: var(--radius-sm); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 14px; border: none !important; }
.foot-conecte:hover { background: #b34a0e; color: #fff; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: var(--g0); color: #fff;
  padding: 12px 22px; font-size: 13px; font-family: var(--font-mono);
  opacity: 0; transition: all 0.3s; pointer-events: none; z-index: 100;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--orange);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* === Breakpoints granulares === */

/* Desktop intermediário: 3 colunas mais apertadas no mapa */
@media (max-width: 1280px) {
  .map-section { grid-template-columns: 240px 1fr 280px; }
  .panel { padding: 20px 16px; }
}

/* Tablet largo: 1 coluna no mapa, painéis empilhados */
@media (max-width: 1100px) {
  .map-section { grid-template-columns: 1fr; min-height: auto; }
  .panel:first-child { border-right: none; border-bottom: 1px solid var(--border); }
  .panel:last-child { border-left: none; border-top: 1px solid var(--border); }
  .map-canvas, .map-stage { min-height: 540px; }
  .map-stage { order: 0; }
  .panel-filters { order: 1; }
  .panel-detail { order: 2; }
  .indicadores { grid-template-columns: repeat(3,1fr); }
  .indicadores .ind:nth-child(3n) { border-right: none; }
  .indicadores .ind:nth-child(n+4) { border-top: 1px solid var(--border); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .consorcio-grid { grid-template-columns: 1fr; }
  .etapas-band { flex-direction: column; }
  .etapas-list { flex-direction: column; }
  .hero { padding: 24px 24px 40px; }
  .section-head, .graph-section, .table-section, .consorcio-section, .foot { padding-left: 24px; padding-right: 24px; }
  .graph-stage { height: 580px; }
}

/* Tablet médio: dashboard 1 coluna, mapa menor */
@media (max-width: 900px) {
  .section-head { padding: 32px 20px 20px; }
  .section-head h2 { font-size: 24px; }
  .section-head .section-lede { font-size: 14px; }
  .graph-section, .table-section, .consorcio-section, .foot {
    padding-left: 16px; padding-right: 16px;
  }
  .graph-stage { height: 540px; margin: 0; }
  .panel { padding: 16px 14px; }
  .map-canvas, .map-stage { min-height: 460px; }
  .basemap-toggle { flex-wrap: wrap; }
}

/* Mobile: tudo empilhado, fontes menores */
@media (max-width: 640px) {
  .hero { padding: 18px 14px 28px; }
  .hero h1 { font-size: 22px; }
  .hero .lede { font-size: 14px; }
  .hero-meta { gap: 14px; font-size: 11px; }
  .hero-actions .hero-btn { font-size: 10px; padding: 5px 10px; }

  .indicadores { grid-template-columns: repeat(2, 1fr); }
  .indicadores .ind {
    border-right: 1px solid var(--border) !important;
    padding: 16px 14px;
  }
  .indicadores .ind:nth-child(2n) { border-right: none !important; }
  .indicadores .ind:nth-child(n+3) { border-top: 1px solid var(--border) !important; }
  .ind-num { font-size: 24px; }
  .ind-lbl { font-size: 12px; }

  .section-head { padding: 24px 14px 16px; }
  .section-head h2 { font-size: 20px; }

  .dash-grid { padding: 0 12px 24px; gap: 14px; }
  .dash-card { padding: 14px 14px; }

  .graph-section, .table-section, .consorcio-section, .foot {
    padding-left: 12px; padding-right: 12px;
  }
  .graph-stage { height: 460px; border-radius: var(--radius-sm); }

  .map-toolbar { flex-direction: column; gap: 8px; align-items: stretch; padding: 8px 12px; }
  .map-canvas, .map-stage { min-height: 380px; }

  .foot-grid { grid-template-columns: 1fr; }
}


/* =====================================================
   LEAFLET MAP STYLES
   ===================================================== */
.leaflet-stage {
  background: #0b1410;
  font-family: var(--font-display);
}
.leaflet-stage .leaflet-control-zoom a,
.leaflet-stage .leaflet-control-attribution {
  font-family: var(--font-display) !important;
}
.leaflet-stage .leaflet-control-attribution {
  background: rgba(11,20,16,0.78) !important;
  color: rgba(255,255,255,0.55) !important;
  font-size: 10px !important;
  padding: 4px 8px !important;
  border: none !important;
  border-radius: 0 !important;
}
.leaflet-stage .leaflet-control-attribution a {
  color: rgba(255,255,255,0.75) !important;
}
.leaflet-stage .leaflet-control-zoom {
  border: 1px solid rgba(255,255,255,0.18) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}
.leaflet-stage .leaflet-control-zoom a {
  background: rgba(11,20,16,0.92) !important;
  color: #fff !important;
  border-bottom: 1px solid rgba(255,255,255,0.12) !important;
  font-weight: 600 !important;
}
.leaflet-stage .leaflet-control-zoom a:hover {
  background: var(--orange) !important;
  color: #fff !important;
}
.leaflet-stage .leaflet-control-scale-line {
  background: rgba(11,20,16,0.78) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.4) !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  text-shadow: none !important;
}

.aae-tip {
  background: rgba(8,18,14,0.96) !important;
  color: #fff !important;
  border: 1px solid rgba(205,93,28,0.5) !important;
  border-left: 3px solid var(--orange) !important;
  border-radius: 3px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
  font-family: var(--font-display) !important;
  padding: 10px 14px !important;
  font-size: 12px !important;
}
.aae-tip::before { display: none !important; }
.aae-tip-mini {
  padding: 4px 10px !important;
  font-size: 11px !important;
  border-left-width: 2px !important;
}

.basemap-toggle { display: flex; gap: 0; }
.bm-btn {
  background: transparent; color: var(--t2);
  border: 1px solid var(--border);
  padding: 6px 14px; font-family: var(--font-mono); font-size: 10.5px;
  font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; transition: all 0.15s;
}
.bm-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.bm-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.bm-btn:not(:first-child):not(:last-child) { border-left: none; }
.bm-btn:hover { background: var(--bg2); color: var(--t1); }
.bm-btn.on { background: var(--g0); color: #fff; border-color: var(--g0); }

.map-legend {
  position: absolute; bottom: 18px; right: 18px;
  background: rgba(8,18,14,0.94);
  color: #fff;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-left: 3px solid var(--orange);
  border-radius: 3px;
  z-index: 500;
  font-family: var(--font-display);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 220px;
}
.map-legend .legend-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7); margin-bottom: 8px; font-weight: 600;
  font-family: var(--font-mono);
}
.legend-bar {
  display: flex; height: 10px; border-radius: 2px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
}
.legend-bar span { flex: 1; }
.legend-scale {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px;
  color: rgba(255,255,255,0.75); margin-top: 4px;
}

.map-credit {
  position: absolute; bottom: 4px; left: 70px;
  font-family: var(--font-mono); font-size: 9.5px;
  color: rgba(255,255,255,0.65);
  background: rgba(11,20,16,0.6);
  padding: 3px 8px;
  z-index: 500;
  border-radius: 2px;
  letter-spacing: 0.04em;
}

/* =====================================================
   GRAFO (force-graph canvas)
   ===================================================== */
.graph-shell {
  position: relative;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, #0a1f15 0%, #050d09 100%);
  border-radius: var(--radius);
  overflow: hidden;
}
.graph-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.graph-canvas canvas { display: block; }

.graph-controls {
  position: absolute; top: 16px; left: 16px;
  display: flex; gap: 8px;
  z-index: 5;
}
.graph-tabs {
  display: flex;
  background: rgba(8,18,14,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  padding: 3px;
  backdrop-filter: blur(8px);
}
.g-tab {
  background: transparent; color: rgba(255,255,255,0.72);
  border: none; padding: 6px 14px;
  font-family: var(--font-mono); font-size: 10.5px;
  font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; border-radius: 99px;
  transition: all 0.15s;
}
.g-tab:hover { background: rgba(255,255,255,0.06); color: #fff; }
.g-tab.on { background: var(--orange); color: #fff; }
.graph-tabs + .g-tab {
  background: rgba(8,18,14,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
}

.graph-legend {
  position: absolute; top: 16px; right: 16px;
  background: rgba(8,18,14,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 12px 14px;
  z-index: 5;
  font-family: var(--font-display);
  font-size: 12px;
  color: #fff;
  backdrop-filter: blur(8px);
  min-width: 200px;
}
.gl-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.gl-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
}
.gl-tip {
  font-family: var(--font-mono); font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
  letter-spacing: 0.04em;
}

.graph-hover {
  position: absolute; bottom: 18px; left: 18px;
  background: rgba(8,18,14,0.95);
  border: 1px solid rgba(255,255,255,0.18);
  border-left: 3px solid var(--orange);
  border-radius: 3px;
  padding: 12px 16px;
  z-index: 5;
  font-family: var(--font-display);
  color: #fff;
  min-width: 220px;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  pointer-events: none;
}
.gh-tag {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--orange); text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 600; margin-bottom: 4px;
}
.gh-name {
  font-family: var(--font-display); font-size: 16px;
  font-weight: 700; color: #fff;
  margin-bottom: 4px;
}
.gh-meta {
  font-size: 11.5px;
  color: rgba(255,255,255,0.7);
}

.graph-section { padding-bottom: 60px; }
.graph-stage {
  margin: 0 80px;
  height: 720px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

@media (max-width: 1100px) {
  .graph-stage { margin: 0 24px; height: 540px; }
}

/* Map toolbar improvements */
.map-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.map-title {
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  color: var(--g0); letter-spacing: 0.02em;
}

/* Labels permanentes dos municípios no mapa */
.aae-muni-label {
  pointer-events: none;
  background: transparent !important;
  border: none !important;
  margin: 0 !important;
}
.muni-label-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.02em;
  padding: 0 3px;
  line-height: 1.1;
}
.muni-label-dark {
  color: #fff;
  text-shadow:
    0 0 3px #000, 0 0 5px #000,
    0 0 7px rgba(0,0,0,0.7), 1px 1px 0 rgba(0,0,0,0.6);
}
.muni-label-light {
  color: #054229;
  text-shadow:
    0 0 3px #fff, 0 0 5px #fff,
    0 0 7px rgba(255,255,255,0.95);
}

/* ===== DASHBOARD ===== */
.dash-section {
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 0 48px 48px;
}

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; padding: 0 20px 32px; }
}

.dash-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.dash-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.2;
}

.dash-card-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--t4);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.dash-empty {
  font-size: 13px;
  color: var(--t4);
  font-style: italic;
  padding: 40px 0;
  text-align: center;
}

.cadeia-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.cadeia-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg2);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--t3);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  line-height: 1;
}

.cadeia-toggle:hover { border-color: var(--g4); color: var(--t1); }

.cadeia-toggle.on {
  background: var(--white);
  border-color: var(--g2);
  color: var(--t1);
  font-weight: 600;
}

.ct-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.12s;
}
