/* ============================================================
   COPOM 9ª RPM — Design System (Impeccable-graded)
   Paleta OKLCH · tipografia Rawline / Rawline Black · ritmo 4pt
   ============================================================ */

/* Rawline — fonte oficial PMMG (fontes embarcadas localmente, uso offline garantido)
   Lazy-load estratégico: 3 pesos críticos (400/700/900) com unicode-range básico latin;
   pesos auxiliares (500/600/itálicos) carregados sob demanda.
*/
@font-face { font-family: 'Rawline'; font-weight: 400; font-style: normal;  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB, U+02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
  src: url('assets/fonts/rawline-400.ttf')  format('truetype'); }
@font-face { font-family: 'Rawline'; font-weight: 700; font-style: normal;  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB, U+02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
  src: url('assets/fonts/rawline-700.ttf')  format('truetype'); }
@font-face { font-family: 'Rawline Black'; font-weight: 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB, U+02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
  src: url('assets/fonts/rawline-900.ttf')  format('truetype'); }
/* Auxiliares — só carregam quando o navegador detecta uso */
@font-face { font-family: 'Rawline'; font-weight: 400; font-style: italic;  font-display: swap; src: url('assets/fonts/rawline-400i.ttf') format('truetype'); }
@font-face { font-family: 'Rawline'; font-weight: 500; font-style: normal;  font-display: swap; src: url('assets/fonts/rawline-500.ttf')  format('truetype'); }
@font-face { font-family: 'Rawline'; font-weight: 600; font-style: normal;  font-display: swap; src: url('assets/fonts/rawline-600.ttf')  format('truetype'); }
@font-face { font-family: 'Rawline'; font-weight: 700; font-style: italic;  font-display: swap; src: url('assets/fonts/rawline-700i.ttf') format('truetype'); }
@font-face { font-family: 'Rawline Black'; font-weight: 900; font-style: italic; font-display: swap; src: url('assets/fonts/rawline-900i.ttf') format('truetype'); }

:root {
  /* Surface (60% weight) — warm paper, subtly tinted toward brand gold */
  --surface:    oklch(99% 0.006 80);
  --surface-2:  oklch(97% 0.012 80);
  --surface-3:  oklch(94% 0.018 80);

  /* Ink (30% weight) — deep slate, slightly cool to read against warm paper */
  --ink:        oklch(26% 0.018 250);
  --ink-soft:   oklch(40% 0.014 250);
  --ink-muted:  oklch(54% 0.012 250);
  --ink-faint:  oklch(72% 0.010 250);

  /* Line */
  --line:       oklch(89% 0.014 80);
  --line-strong:oklch(82% 0.020 80);

  /* PMMG dourado (10% accent — used sparingly, never on every card) */
  --gold:       oklch(60% 0.092 78);
  --gold-deep:  oklch(48% 0.088 78);
  --gold-soft:  oklch(93% 0.038 78);
  --gold-ink:   oklch(42% 0.072 78);

  /* Operational marks */
  --signal:    oklch(56% 0.165 28);    /* vermillion — for "POP/urgência" only */
  --slate:     oklch(34% 0.020 250);  /* deep uniform */

  /* Spacing scale — semantic 4pt */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 20px;
  --space-xl: 32px;
  --space-2xl:48px;
  --space-3xl:72px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;

  /* Type — Rawline para texto; Rawline Black para títulos/ênfase (padrão PMMG) */
  --font-body:    'Rawline', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Rawline Black', 'Rawline', 'Segoe UI', system-ui, sans-serif;

  /* Modular type scale (fixed rem, dashboard-app) — ratio ~1.25 */
  --text-2xs: 0.6875rem;   /* 11px labels */
  --text-xs:  0.8125rem;   /* 13px captions */
  --text-sm:  0.9375rem;   /* 15px body small */
  --text-md:  1rem;        /* 16px body */
  --text-lg:  1.25rem;     /* 20px */
  --text-xl:  1.5rem;      /* 24px h2 */
  --text-2xl: 2rem;        /* 32px h1 */
  --text-3xl: 2.5rem;      /* 40px display */

  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ------- Reset ------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  font-feature-settings: "ss01", "kern";
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: var(--r-sm); }

/* ------- Utility ------- */
.muted   { color: var(--ink-muted); }
.eyebrow {
  font-family: var(--font-body); font-weight: 600;
  font-size: var(--text-2xs); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold-ink);
}
.serif    { font-family: var(--font-display); }
.hidden   { display: none !important; }
.stack    { display: flex; flex-direction: column; }
.cluster  { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; }
.cluster-lg { display: flex; flex-wrap: wrap; gap: var(--space-lg); }

/* ------- Entry (logo PMMG) — refined, no sound ------- */
#entry {
  position: fixed; inset: 0; display: grid; place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, oklch(20% 0.02 250), oklch(28% 0.020 250) 65%, oklch(34% 0.020 78) 100%);
}
#entry::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 48%, oklch(60% 0.08 78 / 0.18), transparent 42%);
  animation: entryGlow 5.6s ease-in-out infinite;
}
@keyframes entryGlow {
  0%, 100% { opacity: .55; transform: scale(0.96); }
  50%      { opacity: .9;  transform: scale(1.04); }
}
.entry-mark {
  position: relative; z-index: 2;
  background: transparent; border: 0; cursor: pointer;
  padding: var(--space-lg);
  display: grid; place-items: center; gap: var(--space-lg);
}
.entry-mark .emblem { width: min(280px, 52vw); aspect-ratio: 1; position: relative; }
/* Halo ring behind the emblem — subtle gold glow that highlights the brand mark */
.entry-mark .emblem::before {
  content: ""; position: absolute; inset: -10%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, oklch(60% 0.092 78 / 0.22) 0%, oklch(60% 0.092 78 / 0.05) 42%, transparent 66%);
  z-index: 0; pointer-events: none;
  animation: haloPulse 4.4s ease-in-out infinite;
}
@keyframes haloPulse {
  0%, 100% { transform: scale(0.94); opacity: 0.7; }
  50%      { transform: scale(1.04); opacity: 1; }
}
/* Outer rotating shimmer ring — adds focus without noise */
.entry-mark .emblem::after {
  content: "";
  position: absolute; inset: -3%; border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0deg, oklch(78% 0.06 78 / 0) 60deg,
    oklch(78% 0.06 78 / .35) 90deg, oklch(78% 0.06 78 / 0) 120deg,
    transparent 200deg, oklch(78% 0.06 78 / 0) 300deg,
    oklch(78% 0.06 78 / .25) 330deg, transparent 360deg);
  z-index: 0; pointer-events: none; filter: blur(3px);
  animation: ringSpin 12s linear infinite;
  mask: radial-gradient(circle, transparent 44%, #000 45%, #000 49%, transparent 50%);
  -webkit-mask: radial-gradient(circle, transparent 44%, #000 45%, #000 49%, transparent 50%);
}
@keyframes ringSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.entry-mark .emblem img {
  width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 1;
  filter: drop-shadow(0 24px 32px oklch(15% 0.02 250 / .55)) drop-shadow(0 0 16px oklch(60% 0.092 78 / .35));
  animation: emblemBreathe 4.8s var(--ease) infinite;
}
@keyframes emblemBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.018); }
}
.entry-mark .legend { text-align: center; color: oklch(96% 0.008 80); }
.entry-mark .legend h1 {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: .02em;
}
.entry-mark .legend p {
  margin: var(--space-xs) 0 0; font-family: var(--font-body);
  font-size: var(--text-xs); letter-spacing: .22em; text-transform: uppercase;
  color: oklch(78% 0.04 78);
}
.entry-mark .legend .cta {
  margin-top: var(--space-lg);
  display: inline-block; padding: var(--space-sm) var(--space-lg);
  border: 1px solid oklch(60% 0.06 78 / .55);
  border-radius: 999px; font-size: var(--text-xs);
  letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  color: oklch(92% 0.02 80);
  background: oklch(40% 0.02 250 / .25);
  backdrop-filter: blur(4px);
  animation: ctaPulse 3.2s ease-in-out infinite;
}
@keyframes ctaPulse { 0%,100% { opacity: .78; } 50% { opacity: 1; } }

/* ------- App shell ------- */
#app { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
  padding: var(--space-xl) var(--space-lg);
  display: flex; flex-direction: column; gap: var(--space-lg);
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.brand {
  display: flex; align-items: center; gap: var(--space-md);
  padding-bottom: var(--space-lg); border-bottom: 1px solid var(--line);
}
.brand img { width: 56px; flex-shrink: 0; }
.brand h1 {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: var(--text-lg); color: var(--ink); line-height: 1.15;
}
.brand small {
  display: block; font-family: var(--font-body); font-weight: 600;
  font-size: var(--text-2xs); letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-ink); margin-top: 2px;
}
.nav { display: flex; flex-direction: column; gap: var(--space-xs); }
.nav a, .nav button {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%; text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: transparent; border: 0;
  border-radius: var(--r-sm);
  font-family: var(--font-body); font-weight: 500;
  font-size: var(--text-sm); color: var(--ink-soft);
  cursor: pointer; transition: background .15s, color .15s;
}
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav .nav-num {
  font-family: var(--font-display); font-weight: 500; font-style: italic;
  font-size: var(--text-xs); color: var(--gold-ink); width: 22px;
}
.nav .active {
  background: var(--slate); color: var(--surface);
}
.nav .active .nav-num { color: oklch(78% 0.06 78); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-md); padding: var(--space-lg) var(--space-2xl);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.topbar .title-block .eyebrow { margin-bottom: 4px; }
.topbar h1 {
  margin: 0; font-family: var(--font-display); font-weight: 500;
  font-size: var(--text-2xl); line-height: 1.1; color: var(--ink);
  letter-spacing: -.01em;
}
.topbar p { margin: 6px 0 0; color: var(--ink-muted); font-size: var(--text-xs); max-width: 52ch; }

.content { padding: var(--space-xl) var(--space-2xl) var(--space-3xl); }
.page { display: none; }
.page.active { display: block; }
.page > * + * { margin-top: var(--space-xl); }

/* ------- Hero / intro band ------- */
.hero-band {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-xl) var(--space-2xl);
  display: grid; grid-template-columns: 1.4fr .8fr; gap: var(--space-2xl);
  align-items: end;
}
.hero-band h2 {
  margin: 0; font-family: var(--font-display); font-weight: 500;
  font-size: var(--text-2xl); color: var(--ink); letter-spacing: -.01em;
}
.hero-band p { margin: var(--space-sm) 0 0; color: var(--ink-muted); max-width: 60ch; }
.hero-band .stamp {
  text-align: right; font-family: var(--font-display); font-style: italic;
  color: var(--gold-ink); font-size: var(--text-lg); line-height: 1.3;
}
.hero-band .stamp b { display: block; font-style: normal; font-weight: 700; font-size: var(--text-2xl); color: var(--ink); }

/* ------- KPIs (without generic "metric hero" template) ------- */
.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.kpi {
  background: var(--surface);
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  display: flex; flex-direction: column; gap: var(--space-xs);
}
.kpi .kpi-label {
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-2xs);
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted);
}
.kpi .kpi-value {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--text-2xl); color: var(--ink); line-height: 1;
}
.kpi .kpi-note { color: var(--ink-muted); font-size: var(--text-2xs); }

/* ------- Grids ------- */
.grid-2 {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--space-xl);
  align-items: start;
}
.grid-cards {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg);
}

/* ------- Panel (flat, not always carded) ------- */
.panel { padding: 0; }
.panel > h2 {
  margin: 0 0 var(--space-md); font-family: var(--font-display); font-weight: 600;
  font-size: var(--text-xl); color: var(--ink); letter-spacing: -.005em;
}
.panel > .panel-intro { margin: 0 0 var(--space-lg); color: var(--ink-muted); max-width: 60ch; }

/* ------- Bars (distribution) ------- */
.bars { display: flex; flex-direction: column; gap: var(--space-md); }
.bar-row .bar-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--text-xs); color: var(--ink-soft); margin-bottom: 4px;
}
.bar-row .bar-meta b { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.bar-track { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; background: var(--slate); border-radius: 99px;
  transform-origin: left; animation: fillGrow .7s var(--ease) both; }
@keyframes fillGrow { from { transform: scaleX(0); } }

/* ------- Chips ------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface);
  padding: 6px 12px; border-radius: 999px;
  font-size: var(--text-2xs); font-weight: 600;
  letter-spacing: .04em; color: var(--ink-soft); cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-faint); }
.chip.active { background: var(--slate); color: var(--surface); border-color: var(--slate); }

/* ------- Search row ------- */
.search-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.search-row input, .search-row select {
  padding: var(--space-sm) var(--space-md);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); min-width: 200px;
}
.search-row input { flex: 1; min-width: 240px; }
.search-row input:focus, .search-row select:focus {
  border-color: var(--gold); background: var(--surface);
}

/* ------- Buttons ------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-family: var(--font-body); font-weight: 600;
  font-size: var(--text-sm); cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--slate); color: var(--surface); }
.btn-primary:hover { background: oklch(28% 0.022 250); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-faint); }
.btn-gold { background: var(--gold); color: oklch(99% 0.005 80); }
.btn-gold:hover { background: var(--gold-deep); }
.btn-back { background: transparent; color: var(--ink-soft); font-weight: 500; padding: var(--space-xs) 0; }
.btn-back::before { content: "←  "; color: var(--gold-ink); }

/* ------- Results ------- */
.results { display: flex; flex-direction: column; gap: var(--space-md); margin-top: var(--space-lg); }
.result {
  padding: var(--space-lg); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  display: grid; grid-template-rows: auto 1fr; gap: var(--space-md);
}
.result-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md); }
.result h3 {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: var(--text-lg); color: var(--ink); letter-spacing: -.005em;
}
.result .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--space-xs); }
.badge {
  padding: 3px 9px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); font-size: var(--text-2xs);
  font-weight: 600; color: var(--ink-soft); background: var(--surface);
  font-family: var(--font-body); letter-spacing: .04em;
}
.badge.accent { border-color: var(--gold); color: var(--gold-ink); background: var(--gold-soft); }
.result-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: var(--space-md); align-items: start; }
.result-grid .box { padding: var(--space-md); background: var(--surface-2); border-radius: var(--r-sm); line-height: 1.55; }
.result-grid .box b { color: var(--ink); }
.copy {
  padding: 6px 12px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: var(--text-2xs); font-weight: 600; letter-spacing: .04em;
  color: var(--gold-ink); cursor: pointer; text-transform: uppercase;
}
.copy:hover { background: var(--gold-soft); border-color: var(--gold); }

/* ------- Sheet table ------- */
.sheet-toolbar { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.sheet-toolbar input, .sheet-toolbar select {
  padding: var(--space-sm) var(--space-md); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
}
.sheet-toolbar input { flex: 1; min-width: 240px; }
.sheet-wrap {
  overflow: auto; max-height: 62vh; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--surface); margin-top: var(--space-md);
}
.sheet-table { border-collapse: collapse; width: 100%; min-width: 1100px; }
.sheet-table th, .sheet-table td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.sheet-table th {
  position: sticky; top: 0; background: var(--slate); color: var(--surface);
  z-index: 2; font-family: var(--font-body); font-weight: 600;
  font-size: var(--text-2xs); letter-spacing: .1em; text-transform: uppercase;
}
.sheet-table tr:nth-child(even) { background: var(--surface-2); }
.sheet-table td { font-size: var(--text-xs); }
.sheet-table td:nth-child(6) { min-width: 420px; }

/* ------- Orientações ------- */
.orient-card {
  padding: var(--space-lg); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.orient-card h3 {
  margin: 0 0 var(--space-sm); font-family: var(--font-display); font-weight: 600;
  font-size: var(--text-md); color: var(--ink);
}
.orient-card p { margin: 0; color: var(--ink-muted); font-size: var(--text-sm); }

/* ------- BPM menu ------- */
.bpm-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg);
  margin-top: var(--space-xl);
}
.bpm-card {
  position: relative; padding: 0; min-height: 220px;
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface); cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s, background .2s;
  display: flex; flex-direction: row; overflow: hidden;
  color: var(--ink);
}
.card-body {
  flex: 7; padding: var(--space-2xl) var(--space-xl);
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-md);
  min-height: inherit;
}
.card-img {
  flex: 3; min-width: 0; overflow: hidden;
  background-size: cover; background-position: center; position: relative;
}
.card-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, var(--surface), transparent);
  pointer-events: none;
}
.bpm-card:hover { transform: translateY(-2px); border-color: var(--gold); background: var(--surface); }
.bpm-card .unit-num {
  font-family: var(--font-display); font-weight: 600; font-style: italic;
  font-size: var(--text-3xl); color: var(--ink); letter-spacing: -.02em;
}
.bpm-card .unit-label {
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-2xs);
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink);
  margin-bottom: var(--space-sm);
}
.bpm-card .unit-meta { font-size: var(--text-xs); color: var(--ink-muted); }
.bpm-card .unit-arrow {
  align-self: flex-end; font-family: var(--font-display); font-size: var(--text-xl);
  color: var(--gold-ink); transition: transform .2s;
}
.bpm-card:hover .unit-arrow { transform: translateX(4px); }

/* ------- BPM inner page ------- */
.pel-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg); margin-top: var(--space-xl);
}
.pel-card {
  padding: var(--space-lg); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.pel-card .pel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-md); padding-bottom: var(--space-md); border-bottom: 1px solid var(--line);
}
.pel-card .pel-num {
  font-family: var(--font-display); font-weight: 600; font-style: italic;
  font-size: var(--text-xl); color: var(--ink);
}
.pel-card .pel-count {
  font-size: var(--text-2xs); font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-muted);
}
.pel-card .bairro-list {
  margin: var(--space-md) 0 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 6px;
}
.pel-card .bairro-list li {
  font-size: var(--text-xs); padding: 6px 10px;
  background: var(--surface-2); border-radius: var(--r-sm);
  cursor: pointer; transition: background .12s, color .12s;
}
.pel-card .bairro-list li:hover { background: var(--gold-soft); color: var(--gold-ink); }

.contact-list { margin-top: var(--space-lg); }
.contact-list dt {
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-2xs);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted);
  margin-top: var(--space-md);
}
.contact-list dd { margin: 4px 0 0; font-size: var(--text-sm); color: var(--ink); font-family: var(--font-body); }
.contact-list dd.tel { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); }

/* ------- Map panel ------- */
.map-panel {
  margin-top: var(--space-xl);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
}
.map-toolbar {
  display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center;
  padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.map-toolbar label { font-size: var(--text-2xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.map-toolbar input[type=text] {
  flex: 1; min-width: 220px; padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
}
.map-switch { display: inline-flex; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.map-switch button {
  padding: var(--space-xs) var(--space-md); background: var(--surface); border: 0;
  font-size: var(--text-2xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); cursor: pointer; transition: background .12s, color .12s;
}
.map-switch button.active { background: var(--slate); color: var(--surface); }
.map-hint { font-size: var(--text-2xs); color: var(--ink-muted); }
.map-frame {
  position: relative; height: 460px; width: 100%; background: var(--surface-3);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-overlay-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; padding: var(--space-xl); color: var(--ink-muted); font-size: var(--text-sm);
}
.match-line {
  padding: var(--space-sm) var(--space-lg); border-top: 1px solid var(--line);
  background: var(--surface-2); font-size: var(--text-xs); color: var(--ink-soft);
}
.match-line b { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.match-line .pill {
  display: inline-block; padding: 1px 8px; border-radius: 99px;
  background: var(--gold-soft); color: var(--gold-ink);
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: .04em; margin-left: 8px;
  text-transform: uppercase;
}

/* ------- Footer ------- */
.site-footer {
  margin-top: auto; padding: var(--space-lg) var(--space-2xl);
  border-top: 1px solid var(--line); background: var(--surface);
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-lg);
  font-size: var(--text-2xs); letter-spacing: .08em; color: var(--ink-muted);
}
.site-footer .sig {
  font-family: var(--font-display); font-style: italic; font-size: var(--text-xs);
  color: var(--gold-ink); letter-spacing: 0;
}
/* Autores do projeto — coautores em linha menor, sem destaque */
.site-footer .sig-authors {
  text-align: right;
}
.site-footer .sig-authors .lead {
  display: block;
  font-family: var(--font-display); font-style: italic; font-size: var(--text-xs);
  color: var(--gold-ink); letter-spacing: 0;
}
.site-footer .sig-authors .coauthor {
  display: block; margin-top: 2px;
  font-family: var(--font-body); font-size: var(--text-2xs);
  color: var(--ink-muted); letter-spacing: .04em; font-weight: 500;
  font-style: normal;
}

/* ------- Toast ------- */
.toast {
  position: fixed; right: var(--space-xl); bottom: var(--space-xl);
  background: var(--slate); color: var(--surface);
  padding: var(--space-sm) var(--space-lg); border-radius: var(--r-sm);
  font-size: var(--text-xs); letter-spacing: .04em; opacity: 0;
  transform: translateY(8px); transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ------- Ocorrência form ------- */
.ocorrencia-form {
  max-width: 720px;
  padding: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.ocorrencia-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.ocorrencia-form label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin-bottom: var(--space-sm);
}
.ocorrencia-form input,
.ocorrencia-form select,
.ocorrencia-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
}
.ocorrencia-form input:focus,
.ocorrencia-form select:focus,
.ocorrencia-form textarea:focus {
  border-color: var(--gold);
  outline: none;
}
.ocorrencia-form textarea {
  resize: vertical;
  min-height: 72px;
}
.ocorrencia-form .form-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}
@media (max-width: 600px) {
  .ocorrencia-form .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ------- Reduce motion ------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Transições — marcantes, elegantes, sem poluir
   ============================================================ */

/* Page transition (fade + slight slide-up) when switching sections */
.page { animation: pageEnter .42s var(--ease) both; }
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Staggered reveal — children rise and fade in sequence */
.page.active > * { animation: staggerChild .5s var(--ease) both; }
.page.active > *:nth-child(1) { animation-delay: .04s; }
.page.active > *:nth-child(2) { animation-delay: .10s; }
.page.active > *:nth-child(3) { animation-delay: .16s; }
.page.active > *:nth-child(4) { animation-delay: .22s; }
.page.active > *:nth-child(5) { animation-delay: .28s; }
.page.active > *:nth-child(6) { animation-delay: .34s; }
@keyframes staggerChild {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero band — slight parallax-ish shimmer on load */
.hero-band { animation: heroIn .7s var(--ease) both; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(20px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* KPI grid — fade in together with crisp rise */
.kpis { animation: kpiIn .55s var(--ease) .12s both; }
@keyframes kpiIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Cards & panels — smooth hover lift on interactive surfaces */
.bpm-card, .pel-card, .orient-card, .result {
  transition: transform .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease), box-shadow .22s var(--ease);
}
.bpm-card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px oklch(20% 0.020 250 / .08); }
.orient-card:hover { border-color: var(--gold); }
.pel-card .bairro-list li { transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease); }
.pel-card .bairro-list li:hover { transform: translateX(3px); }

/* Buttons — subtle press + lift feedback */
.btn {
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease), transform .12s var(--ease);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active, .btn-gold:active, .btn-ghost:active { transform: translateY(0) scale(.98); }

/* Nav items — underline indicator on active */
.nav a, .nav button { position: relative; transition: background .15s, color .15s, padding .2s var(--ease); }
.nav a::before, .nav button::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 3px; height: 60%; background: var(--gold); border-radius: 0 2px 2px 0;
  transition: transform .22s var(--ease);
}
.nav a:hover::before, .nav button:hover::before { transform: translateY(-50%) scaleY(.6); }
.nav .active::before { transform: translateY(-50%) scaleY(1); }

/* Results — staggered list reveal */
.result { animation: resultIn .38s var(--ease) both; }
.results .result:nth-child(1) { animation-delay: .02s; }
.results .result:nth-child(2) { animation-delay: .06s; }
.results .result:nth-child(3) { animation-delay: .10s; }
.results .result:nth-child(4) { animation-delay: .14s; }
.results .result:nth-child(5) { animation-delay: .18s; }
.results .result:nth-child(n+6) { animation-delay: .22s; }
@keyframes resultIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bars — fill-grow already animates; add subtle glow */
.bar-fill { box-shadow: 0 0 0 0 oklch(60% 0.092 78 / 0); }
.bar-row:hover .bar-fill { background: var(--gold-deep); }

/* Toast — refined drop */
.toast { transition: opacity .22s var(--ease), transform .22s var(--ease); }

/* Map frame fade on update */
.map-frame iframe { animation: frameIn .35s var(--ease) both; }
@keyframes frameIn { from { opacity: 0; } to { opacity: 1; } }

/* Smooth scroll for in-page anchor jumps */
html { scroll-behavior: smooth; }

/* Subtle entry→app handoff: app fades in once entry dismissed */
#app:not(.hidden) { animation: appIn .55s var(--ease) .04s both; }
@keyframes appIn {
  from { opacity: 0; transform: translateY(8px) scale(.995); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* Entry smoothly fades out, then unmounts */
#entry:not(.hidden) { transition: opacity .35s var(--ease); }
#entry.dismissing { opacity: 0; pointer-events: none; }

/* ------- Responsive ------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .result-grid, .grid-cards, .hero-band { grid-template-columns: 1fr; }
  .hero-band { grid-template-columns: 1fr; gap: var(--space-lg); }
  .hero-band .stamp { text-align: left; }
}
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: var(--space-lg); }
  .topbar { padding: var(--space-lg); flex-direction: column; align-items: flex-start; }
  .content { padding: var(--space-lg); }
  .bpm-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: var(--text-xl); }
  .site-footer { flex-direction: column; align-items: flex-start; padding: var(--space-lg); }
}