:root {
  --ds-green: #51e02e;
  --llyc-coral: #f54963;
  --ds-teal: #1d333a;
  --rosa: #fde8ec;
  --bg: #10181c;
  --panel: #162228;
  --panel-2: #132025;
  --line: #2a3d44;
  --text: #ffffff;
  --muted: #9bb0b6;
  --green: #51e02e;
  --coral: #f54963;
  --teal: #1d333a;
  --yellow: #f54963;
  --blue: #51e02e;
  --orange: #f54963;
  --keys: #0d1619;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Open Sans", system-ui, sans-serif;
}

body {
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(245, 73, 99, 0.10), transparent 50%),
    radial-gradient(700px 380px at 0% 100%, rgba(81, 224, 46, 0.07), transparent 46%),
    var(--bg);
}

body.hosted .drop { display: none; }

.app {
  display: block;
  min-height: 100vh;
}

.viz-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  color: var(--ds-green);
}

.brand-mark strong {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-mark span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.brand-mark em {
  font-style: normal;
  color: var(--llyc-coral);
}

.eyebrow,
.panel-kicker {
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-kicker {
  color: var(--ds-green);
  margin-bottom: 4px;
}

label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

input, textarea {
  width: 100%;
  margin-top: 4px;
  background: #080c11;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 9px;
  font: 13px/1.4 "Open Sans", system-ui, sans-serif;
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  background: var(--llyc-coral);
  color: white;
  font: 600 13px "Montserrat", system-ui, sans-serif;
  cursor: pointer;
}

.btn.alt { background: var(--ds-green); color: var(--ds-teal); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  margin-top: 0;
}

.btn:disabled { opacity: 0.55; }

.drop {
  min-height: 96px;
  border: 1px dashed #3a4a5c;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  padding: 12px;
}

.drop input { display: none; }
.drop strong { color: var(--text); font-size: 13px; }
.drop.drag { border-color: var(--green); background: rgba(81, 224, 46, 0.06); }
.file-name { margin-top: 8px; font-size: 12px; color: var(--green); }

.viz { padding: 0 28px 32px; min-width: 0; max-width: 1680px; margin: 0 auto; overflow-x: clip; }

.viz-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.viz-head h1,
.bi-head h1 {
  font-family: "Montserrat", sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--llyc-coral);
}

.stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.stamp {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 140px;
}

.stamp b {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
}

.stamp span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  min-height: 118px;
}

.card .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.card .value {
  font-family: "Montserrat", sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.card .sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.card.dadosfera { box-shadow: inset 3px 0 0 var(--llyc-coral); }
.card.databricks { box-shadow: inset 3px 0 0 var(--ds-green); }
.card.manual { box-shadow: inset 3px 0 0 #ffffff; }
.card.dadosfera .value,
.card .value.coral { color: var(--llyc-coral); }
.card.databricks .value,
.card .value.gold { color: var(--ds-green); }

.charts, .bottom {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 12px;
  margin-bottom: 12px;
}

.charts-single { grid-template-columns: 1fr; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px 18px;
  min-height: 220px;
}

.panel h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.bars { display: grid; gap: 11px; min-height: 90px; }

.bar-row {
  display: grid;
  grid-template-columns: 190px 1fr 72px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #c5d0dc;
}

.bar-row i {
  display: block;
  height: 18px;
  background: #18222c;
  overflow: hidden;
}

.bar-row b {
  display: block;
  height: 100%;
  background: var(--ds-green);
  width: 0;
  transition: width 0.7s ease;
}

.bar-row b.coral { background: var(--llyc-coral); }
.bar-row b.teal { background: #3d5a64; }
.bar-row b.white { background: #e8eef0; }

.bar-row em {
  font-style: normal;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
}

.bars.uf .bar-row { grid-template-columns: 36px 1fr 58px; }

.donut-body {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 6px;
  min-height: 196px;
}

.donut-wrap {
  position: relative;
  width: 188px;
  height: 188px;
  flex: 0 0 188px;
  margin: 0;
}

.donut-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pie-tip {
  position: fixed;
  z-index: 40;
  min-width: 188px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #12181f;
  border: 1px solid #2a3644;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.pie-tip div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
}

.pie-tip span {
  color: #8b9bb0;
  letter-spacing: 0.04em;
  font-size: 10px;
}

.pie-tip b {
  color: #f4f7fb;
  font-weight: 600;
}

.donut-center strong {
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.donut-center span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legend {
  list-style: none;
  margin: 0;
  display: grid;
  gap: 12px;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
}

.legend li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  margin: 5px 0 0;
  flex: 0 0 8px;
}

.donut-source {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.gaps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.gap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 14px;
  min-height: 104px;
  box-shadow: inset 3px 0 0 var(--llyc-coral);
}

.gap strong {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--llyc-coral);
}

.gap span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.kpi strong {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  min-height: 2.7em;
}

.kpi.accent strong { color: var(--llyc-coral); }

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.date-box {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 18px 12px;
  text-align: center;
}

.date-box b {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  margin-bottom: 6px;
}

.date-box span { color: var(--muted); font-size: 12px; }

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #15202b;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 20;
}

@media (max-width: 1180px) {
  .charts, .bottom, .sources { grid-template-columns: 1fr; }
  .viz-head { flex-direction: column; align-items: stretch; }
  .stamps { justify-content: flex-start; }
}

@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .viz { padding: 0 12px 28px; }
  .kpis, .gaps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viz-title { align-items: center; }
  .viz-head h1 { font-size: 22px; line-height: 1.15; }
  .card { min-height: 0; padding: 14px; }
  .card .value { font-size: clamp(24px, 8vw, 28px); overflow-wrap: anywhere; }
  .kpi { min-height: 96px; padding: 14px; }
  .kpi strong { font-size: 22px; overflow-wrap: anywhere; }
  .kpi span { min-height: 0; }
  .stamps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .stamp { min-width: 0; flex: none; }
  .stamp b, .stamp span { overflow-wrap: anywhere; }
  .bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
  }
  .bar-row span { grid-column: 1; grid-row: 1; }
  .bar-row em { grid-column: 2; grid-row: 1; }
  .bar-row i { grid-column: 1 / -1; grid-row: 2; }
  .bar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bars.uf .bar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .date-grid { grid-template-columns: 1fr; }
  .date-box b { font-size: 18px; }
  .donut-body { flex-direction: column; align-items: center; min-height: 0; }
  .donut-wrap { width: 160px; height: 160px; flex-basis: 160px; max-width: 100%; }
  .legend { width: 100%; }
  .pie-tip { max-width: calc(100vw - 24px); }
  .panel { min-height: 0; padding: 14px; }
  .toast { left: 12px; right: 12px; transform: none; text-align: center; }
}

@media (max-width: 480px) {
  .kpis, .sources, .gaps { grid-template-columns: 1fr; }
  .stamps { grid-template-columns: 1fr; }
  .card .value { font-size: 26px; }
  .bi-kpis { grid-template-columns: 1fr 1fr; }
  .novos-toolbar { flex-direction: column; align-items: stretch; }
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin: 0 -28px 22px;
  padding: 14px 28px;
  background: rgba(16, 24, 28, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  justify-self: start;
  min-width: 0;
}

.brand .brand-icon { width: 34px; height: 34px; flex-basis: 34px; }

.brand-text { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }

.brand-text strong {
  font-family: "Montserrat", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text em {
  font-style: normal;
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--llyc-coral);
  padding-left: 10px;
  border-left: 1px solid var(--line);
  letter-spacing: 0.01em;
}

.brand-text em b { color: var(--ds-green); font-weight: 800; }

.bar-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.source-chips { display: flex; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px 6px 9px;
  font: 600 12px "Montserrat", system-ui, sans-serif;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.chip:hover { border-color: var(--ds-green); color: var(--text); }

.chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4b5d63;
  flex: 0 0 7px;
}

.chip i.on { background: var(--ds-green); box-shadow: 0 0 0 3px rgba(81, 224, 46, 0.18); }

.chip-refresh { font-size: 13px; line-height: 1; opacity: 0.7; }

.chip:disabled { opacity: 1; cursor: progress; }
.chip:disabled .chip-refresh { animation: chip-spin 0.9s linear infinite; }

@keyframes chip-spin { to { transform: rotate(360deg); } }

.stamp.loading b { color: var(--muted); font-weight: 600; }

@media (max-width: 1280px) {
  .app-bar { grid-template-columns: 1fr auto; }
  .app-bar .tab-bar { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
}

@media (max-width: 860px) {
  .app-bar { margin: 0 -12px 16px; padding: 10px 12px; gap: 10px; }
  .brand-text strong { font-size: 15px; }
  .brand-text em { font-size: 13px; padding-left: 8px; }
  .chip { padding: 5px 9px 5px 8px; font-size: 11px; }
  .app-bar .tab-bar { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .app-bar .tab { white-space: nowrap; }
}

@media (max-width: 560px) {
  .app-bar { grid-template-columns: 1fr; }
  .bar-right { justify-self: stretch; justify-content: space-between; }
}

.tab-bar { display: flex; gap: 8px; }

.tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font: 600 13px "Montserrat", system-ui, sans-serif;
  cursor: pointer;
}

.tab.on {
  background: var(--ds-green);
  border-color: var(--ds-green);
  color: var(--ds-teal);
}

.bi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.bi-head h1 {
  font-family: "Montserrat", sans-serif;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: var(--llyc-coral);
}

.bi-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
}

.bi-kpis div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.bi-kpis b {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  color: var(--llyc-coral);
}

.bi-kpis span, .bi-updated, .map-hint, #novos-count { color: var(--muted); font-size: 12px; }

.bi-grid .bar-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
}
.bi-grid .bar-row span { grid-column: 1; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-grid .bar-row em { grid-column: 2; grid-row: 1; }
.bi-grid .bar-row i { grid-column: 1 / -1; grid-row: 2; }
.bi-top { grid-template-columns: 0.9fr 1.1fr; }
.bi-mid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bi-map-row, .bi-month-row { grid-template-columns: 1fr; }

.month-chart {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 280px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.month-year {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-width: 0;
  border-left: 1px dashed rgba(215, 230, 220, 0.18);
  padding: 0 8px;
}

.month-year:first-child { border-left: none; padding-left: 0; }

.month-year strong {
  display: block;
  text-align: center;
  margin-top: 8px;
  font: 500 12px "Open Sans", system-ui, sans-serif;
  color: var(--muted);
}

.month-year-bars {
  display: flex;
  align-items: stretch;
  gap: 5px;
  flex: 1;
  min-height: 0;
  padding-top: 14px;
}

.month-col {
  flex: 1 0 28px;
  min-width: 28px;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
}

.month-track {
  display: flex;
  align-items: flex-end;
  width: 78%;
  flex: 1;
  min-height: 110px;
  overflow: visible;
}

.month-track i {
  position: relative;
  display: block;
  width: 100%;
  min-height: 3px;
  background: var(--green);
  border-radius: 3px 3px 0 0;
}

.month-col em {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin: 0;
  padding-bottom: 2px;
  font: 600 10px "Open Sans", system-ui, sans-serif;
  font-style: normal;
  color: #d7e6dc;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.month-col.on .month-track i,
.month-col.on i { background: var(--llyc-coral); }
.month-col:hover .month-track i { background: #7aee5a; }

.month-name {
  font-size: 11px;
  color: var(--muted);
  writing-mode: horizontal-tb;
  transform: none;
  text-transform: none;
}

.month-col.on .month-name,
.month-col.on span { color: var(--llyc-coral); font-weight: 600; }

#mes-escolhido {
  font: 600 13px "Montserrat", system-ui, sans-serif;
  color: var(--llyc-coral);
  text-transform: lowercase;
}

.map-toolbar, .novos-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.map-toolbar h2, .novos-toolbar h2 { margin: 0; margin-right: auto; }

.map-toolbar select {
  width: auto;
  margin: 0;
}

.map-toolbar .btn, .novos-toolbar .btn { width: auto; }

#lista-busca {
  width: min(340px, 100%);
  margin: 0;
  flex: 1 1 220px;
}

#map-br {
  height: min(68vh, 640px);
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a1210;
}
.map-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.modo-toggle { display: flex; gap: 6px; flex-wrap: wrap; }

#lista-local { margin: 0 0 10px; }

.leaflet-interactive { cursor: pointer; }

.heat-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.heat-legend i {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #1d333a, #51e02e, #f54963);
}

.novos-panel { margin-bottom: 24px; }

.cnes-search-panel { margin-bottom: 16px; padding: 16px 18px; min-height: 0; }
.cnes-search-panel .map-hint { margin-top: 12px; }
.cnes-search-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cnes-search-bar input[type="search"] {
  width: 100%;
  margin: 0;
  min-height: 48px;
  font-size: 16px;
  padding: 12px 16px;
}
.cnes-search-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}
.cnes-search-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}
.cnes-search-bar select {
  width: auto;
  min-width: 168px;
  min-height: 42px;
  margin: 0;
  background: #080c11;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
.cnes-search-bar .btn {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 11px 18px;
  font-size: 14px;
}
.cnes-search-bar .btn.ghost { margin-top: 0; }
.cnes-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}
.cnes-check input { width: auto; margin: 0; }
.cnes-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}
.cnes-field select { min-width: 220px; }
.cnes-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  align-items: start;
}
.cnes-list-panel, .cnes-detail-panel { min-height: 0; min-width: 0; }
.cnes-list-panel h2 {
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.cnes-detail-head { margin-bottom: 14px; min-width: 0; }
.cnes-detail-head h2 {
  margin: 0 0 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--llyc-coral);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cnes-docs { display: flex; flex-direction: column; gap: 8px; max-height: min(72vh, 760px); overflow: auto; }
#cnes-count, #cnes-detail-local { font-size: 13px; margin: 0; }
.cnes-doc {
  border: 1px solid var(--line);
  background: #0c1218;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
  min-width: 0;
}
.cnes-doc.on { border-color: var(--ds-green); background: rgba(81, 224, 46, 0.08); }
.cnes-doc strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cnes-doc span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.cnes-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.cnes-kpis div {
  background: #0c1218;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 78px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cnes-kpis b {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--green);
}
.cnes-kpis span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.cnes-block { margin-top: 18px; }
.cnes-block[hidden] { display: none; }
.cnes-block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cnes-block-head h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 700;
}
.cnes-block-head .map-hint { margin: 0; text-align: right; }

.table-wrap.cnes-matrix-wrap {
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cnes-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.cnes-matrix th, .cnes-matrix td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cnes-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--ds-teal);
  color: #fff;
  font: 700 12px "Montserrat", sans-serif;
  letter-spacing: 0.02em;
  vertical-align: bottom;
}
.cnes-matrix thead th small {
  display: block;
  font-weight: 500;
  font-size: 10px;
  color: #b9cdd2;
  margin-top: 2px;
}
.cnes-matrix thead th.atual { box-shadow: inset 0 -3px 0 var(--ds-green); }
.cnes-matrix th.est {
  text-align: left;
  white-space: normal;
  min-width: 260px;
  max-width: 420px;
}
.cnes-matrix thead th.est { position: sticky; left: 0; z-index: 2; }
.cnes-matrix tbody th.est {
  position: sticky;
  left: 0;
  background: var(--panel);
  font-weight: 400;
  border-left: 3px solid transparent;
}
.cnes-matrix tbody tr.principal th.est { border-left-color: var(--ds-green); }
.cnes-matrix tbody th.est strong {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}
.cnes-matrix tbody th.est span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}
.cnes-matrix tbody th.est em {
  display: inline-block;
  margin-top: 6px;
  font-style: normal;
  font: 700 10px "Montserrat", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-teal);
  background: var(--ds-green);
  border-radius: 99px;
  padding: 2px 8px;
}
.cnes-matrix tbody td { background: rgba(81, 224, 46, var(--heat, 0)); }
.cnes-matrix tbody td b { font-weight: 700; color: var(--text); }
.cnes-matrix tbody td.vazio { color: #4b5d63; background: transparent; }
.cnes-matrix td.media, .cnes-matrix th.media {
  border-left: 1px solid var(--line);
  color: var(--muted);
}
.cnes-matrix tbody td.media { background: transparent; }
.cnes-matrix tfoot th, .cnes-matrix tfoot td {
  background: #0c1218;
  font-weight: 700;
  border-bottom: 0;
}
.cnes-matrix tfoot th { text-align: left; position: sticky; left: 0; font-family: "Montserrat", sans-serif; }

.cnes-table-wrap { max-height: min(62vh, 680px); overflow: auto; }
.cnes-table tr.novo-mes td { border-top: 1px solid #3a4f57; }
.cnes-table td.mes { color: var(--ds-green); font-weight: 600; text-transform: capitalize; }
.cnes-table td.est strong { display: block; font-weight: 600; }
.cnes-table td.est span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.cnes-table th.hrs { text-align: right; }
.cnes-table {
  min-width: 100%;
  width: 100%;
  table-layout: auto;
  font-size: 13px;
}
.cnes-table th, .cnes-table td {
  vertical-align: top;
  padding: 9px 10px;
}
.cnes-table td.hrs { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cnes-table td.uf, .cnes-table td.mes { white-space: nowrap; }
.cnes-table td.est, .cnes-table td.cbo {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.cnes-table tr.cnes-total td {
  font-weight: 700;
  background: #102016;
  border-bottom: none;
}
.cnes-table td.cbo em {
  font-style: normal;
  color: var(--muted);
  margin-right: 4px;
}
@media (max-width: 1180px) {
  .cnes-layout { grid-template-columns: minmax(0, 1fr); }
  .cnes-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cnes-search-actions { margin-left: 0; width: 100%; }
  .cnes-search-actions .btn { flex: 1; }
  .cnes-block-head .map-hint { text-align: left; }
}
.novos-monitor .map-hint { margin: 0; }
.table-wrap { overflow: auto; max-height: 520px; }

.novos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.novos-table th {
  position: sticky;
  top: 0;
  background: var(--ds-teal);
  color: #fff;
  text-align: left;
  padding: 8px;
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.novos-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
}

.novos-table tbody tr:nth-child(odd) td { background: rgba(253, 232, 236, 0.04); }
.novos-table tr:hover td { background: rgba(81, 224, 46, 0.08); }

.brand-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.novos-table.cnes-table th,
.novos-table.cnes-table td {
  vertical-align: top;
  padding: 9px 10px;
  overflow: visible;
  text-overflow: unset;
  white-space: inherit;
}

@media (max-width: 1180px) {
  .bi-top, .bi-mid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .bi-top, .bi-mid { grid-template-columns: 1fr; }
  #map-br { height: 320px; }
}

body.screen-visao { overflow: auto; }
body.screen-visao .viz {
  min-height: 100vh;
  height: auto;
  max-height: none;
  padding: 0 28px 28px;
  display: flex;
  flex-direction: column;
}
body.screen-visao .app-bar { margin-bottom: 16px; }
body.screen-visao .pbi-kpis { margin-left: 0; gap: 22px; }
body.screen-visao .source-chips { display: none; }
body.screen-visao .brand-foot { display: none; }
body.screen-visao .toast { display: none; }
.pbi-kpis { display: none; }
body.screen-visao .pbi-kpis {
  display: flex;
  gap: 32px;
  margin-left: auto;
}
.pbi-kpis b {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ds-green);
  line-height: 1;
}
.pbi-kpis span { color: var(--muted); font-size: 11px; }

#view-visao {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
#view-visao[hidden] { display: none !important; }

.pbi-row { display: grid; gap: 16px; align-items: stretch; }
.pbi-row-1 { grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr) minmax(240px, 1fr); }
.pbi-row-2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pbi-card {
  min-height: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pbi-card h2 {
  font-size: 16px;
  margin-bottom: 16px;
  flex: 0 0 auto;
}
.pbi-card .bars {
  flex: 1;
  display: grid;
  gap: 8px;
  min-height: 0;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a5158 transparent;
}
.pbi-card .bars#pbi-esp-ds,
.pbi-card .bars#pbi-esp-cfm {
  max-height: 280px;
}
.pbi-card .bar-row {
  grid-template-columns: minmax(0, 1.3fr) minmax(48px, 1fr) auto;
  gap: 12px;
  font-size: 12px;
  cursor: default;
}
.pbi-card .bars[id="pbi-regiao"] .bar-row,
.pbi-card .bars[id="pbi-ufs"] .bar-row { cursor: pointer; }
.pbi-card .bar-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--muted);
}
.pbi-card .bars.uf .bar-row { grid-template-columns: 28px minmax(48px, 1fr) auto; }
.pbi-card .bar-row i {
  height: 10px;
  border-radius: 99px;
  background: #1a2a2f;
}
.pbi-card .bar-row b { border-radius: 99px; }
.pbi-card .bar-row em {
  width: 64px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
}
.pbi-card .bar-row.dim { opacity: 0.28; }
.pbi-card .bar-row.on span,
.pbi-card .bar-row.on em { color: var(--text); font-weight: 700; }
.pbi-card .bar-row b.coral { background: var(--llyc-coral); }

.pbi-donut-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex: 1;
  min-height: 176px;
}
.pbi-donut-wrap {
  position: relative;
  width: 176px;
  height: 176px;
  flex: 0 0 176px;
}
.pbi-donut-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}
.pbi-donut-wrap .donut-center strong { font-size: 20px; }
.pbi-legend {
  list-style: none;
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}
.pbi-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}
.pbi-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 99px;
  flex: 0 0 10px;
}
.pbi-legend b { color: var(--text); font-weight: 600; }

.pbi-month {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #3a5158 transparent;
}
.pbi-month::-webkit-scrollbar { height: 8px; }
.pbi-month::-webkit-scrollbar-thumb {
  background: #3a5158;
  border-radius: 99px;
}
.pbi-evo-inner {
  display: flex;
  min-width: 720px;
  gap: 16px;
}
.pbi-evo-year {
  flex: 1 1 0;
  min-width: 0;
  border-right: 1px dashed var(--line);
  padding-right: 16px;
}
.pbi-evo-year:last-child {
  border-right: none;
  padding-right: 0;
}
.pbi-evo-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 224px;
}
.pbi-evo-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: default;
}
.pbi-evo-val {
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.pbi-evo-col i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--ds-green);
}
.pbi-evo-name {
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
}
.pbi-evo-ano {
  margin-top: 8px;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  color: var(--muted);
}

.pbi-map-row { display: grid; }
.pbi-map-card {
  padding: 0;
  min-height: 420px;
  overflow: hidden;
}
#map-pbi {
  height: 420px;
  border: 0;
  border-radius: 12px;
  background: #0a1210;
}
.pbi-updated {
  margin: 0;
  text-align: right;
  color: var(--llyc-coral);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .pbi-row-1 { grid-template-columns: 1fr 1fr; }
  .pbi-row-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .pbi-row-1, .pbi-row-2 { grid-template-columns: 1fr; }
  body.screen-visao .pbi-kpis { margin-left: 0; width: 100%; }
  .pbi-donut-body { flex-direction: column; }
  .pbi-card .bar-row {
    grid-template-columns: minmax(0, 1.3fr) minmax(48px, 1fr) auto;
  }
  .pbi-card .bar-row span,
  .pbi-card .bar-row i,
  .pbi-card .bar-row em {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 560px) {
  .cnes-matrix th.est { min-width: 160px; max-width: 190px; }
  .cnes-matrix th, .cnes-matrix td { padding: 9px 8px; }
}

/* ---------- Aba Qualidade ---------- */
.q-head { align-items: flex-end; }
.q-head-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.q-head-actions .btn { width: auto; padding: 9px 16px; }
.q-head-actions .map-hint { margin: 0; text-align: right; }

.q-section { min-height: 0; margin-bottom: 12px; }
.q-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.q-section-head h2 { margin-bottom: 0; }
.q-section-head .map-hint { margin: 0; max-width: 520px; text-align: right; }

.q-cov {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.q-cov-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: inset 3px 0 0 var(--tom, var(--ds-green));
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.q-cov-card.green { --tom: var(--ds-green); }
.q-cov-card.teal { --tom: #6f9aa6; }
.q-cov-card.coral { --tom: var(--llyc-coral); }
.q-cov-card .label { color: var(--muted); font-size: 12px; }
.q-cov-card .value {
  font-family: "Montserrat", sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--tom);
}
.q-bar { display: block; height: 6px; border-radius: 99px; background: #0c1218; overflow: hidden; }
.q-bar b { display: block; height: 100%; border-radius: 99px; background: var(--tom); }
.q-cov-card .sub { color: var(--muted); font-size: 12px; }
.q-cov-card .sub em { font-style: normal; color: var(--text); font-weight: 600; }

.q-link {
  align-self: flex-start;
  margin-top: 2px;
  border: 0;
  background: none;
  color: var(--ds-green);
  font: 600 12px "Open Sans", sans-serif;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.q-link:disabled { opacity: 0.6; cursor: progress; }

.q-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.q-grid > .panel { min-width: 0; min-height: 0; }

.q-status { display: grid; gap: 12px; }
.q-status-row { grid-template-columns: minmax(150px, 210px) 1fr minmax(96px, auto); }
.q-status-row span strong { display: block; color: var(--text); font-weight: 600; }
.q-status-row span small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }
.q-status-row em small { display: block; font-size: 10px; color: var(--muted); font-weight: 500; }

.q-metrics { display: grid; gap: 8px; }
.q-metric {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.q-metric b {
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ds-green);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.q-metric.alerta b { color: var(--llyc-coral); }
.q-metric strong { display: block; font-size: 13px; font-weight: 600; }
.q-metric span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.q-note { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.q-note code, .q-table code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  color: #c9d8dc;
}

.table-wrap.q-table-wrap { max-height: 420px; border-radius: 10px; }
.q-table { font-size: 12px; }
.q-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.q-table th.hrs, .q-table td.hrs { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-table tr.alerta td:first-child { color: var(--llyc-coral); font-weight: 600; }
.q-table td.q-variantes { color: var(--muted); line-height: 1.4; }

.q-tag {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 8px;
  font: 600 11px "Montserrat", sans-serif;
  color: var(--muted);
  white-space: nowrap;
}
.q-tag.green { color: var(--ds-teal); background: var(--ds-green); border-color: var(--ds-green); }
.q-tag.coral { color: #fff; background: var(--llyc-coral); border-color: var(--llyc-coral); }

.q-downloads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.q-download {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease;
}
.q-download:hover { border-color: var(--ds-green); }
.q-download.destaque { border-color: var(--ds-green); background: rgba(81, 224, 46, 0.07); }
.q-download strong { font-family: "Montserrat", sans-serif; font-size: 13px; }
.q-download span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.q-download em { margin-top: 4px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--ds-green); }
.q-download:disabled { cursor: progress; opacity: 0.7; }

/* Fonte do Comparativo sem atualização há mais de 2 dias. */
.stamp.atrasada { border-color: var(--llyc-coral); }
.stamp.atrasada b { color: var(--llyc-coral); }

@media (max-width: 1180px) {
  .q-cov { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .q-cov { grid-template-columns: minmax(0, 1fr); }
  .q-head-actions { margin-left: 0; width: 100%; justify-content: space-between; }
  .q-section-head .map-hint, .q-head-actions .map-hint { text-align: left; }
  .q-status-row { grid-template-columns: minmax(0, 1fr) auto; }
  .q-status-row i { grid-column: 1 / -1; grid-row: 2; }
  .q-metric { grid-template-columns: minmax(72px, auto) 1fr; gap: 10px; }
  .q-metric b { font-size: 18px; }
}

/* Qualidade: indicador em que 0 é o esperado, especialidade DS x RQE, telefones. */
.q-metric.ok b { color: var(--ds-green); }
.q-metric b small {
  display: block;
  font: 700 10px "Montserrat", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-green);
}
.q-esp-table td span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.q-esp-table tr.sub td:first-child { padding-left: 18px; }
.q-note-top { margin: 0 0 4px; }
.q-h2-gap { margin-top: 22px; }
#q-telefones .q-status-row small { white-space: normal; }

/* CNES: setor do estabelecimento pela natureza jurídica. */
.cnes-setor {
  display: inline-block;
  margin-top: 4px;
  font-style: normal;
  font: 700 10px "Montserrat", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
  border: 1px solid var(--line);
  color: var(--muted);
}
.cnes-setor.publico { color: var(--ds-teal); background: var(--ds-green); border-color: var(--ds-green); }
.cnes-setor.privado { color: #fff; background: rgba(245, 73, 99, 0.18); border-color: var(--llyc-coral); }
.cnes-matrix tbody th.est .cnes-setor { margin-right: 6px; }
.cnes-table td.setor { white-space: nowrap; }
.cnes-kpis b small { font-size: 15px; color: var(--muted); font-weight: 600; }
#q-telefones .q-status-row { grid-template-columns: minmax(220px, 300px) 1fr minmax(72px, auto); }
@media (max-width: 560px) {
  #q-telefones .q-status-row { grid-template-columns: minmax(0, 1fr) auto; }
}
.q-futuro { display: block; margin-top: 3px; font-size: 11px; color: var(--llyc-coral); }
.q-link em { font-style: normal; }

/* Logo oficial na navegação (ícone verde, LLYC coral) + nome do produto. */
.brand .brand-logo { height: 38px; width: auto; display: block; }
/* Assinatura do produto: nome em gradiente coral, o "2" em verde com brilho
   e uma linha de apoio. Separada do logo por um fio vertical em degradê. */
.brand-produto {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding-left: 16px;
  white-space: nowrap;
  line-height: 1;
}
.brand-produto::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--ds-green), var(--llyc-coral));
  opacity: 0.85;
}
.bp-nome {
  font-family: "Montserrat", sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #f54963 0%, #ff7f93 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bp-nome b {
  display: inline-block;
  margin: 0 1px;
  font-weight: 900;
  color: var(--ds-green);
  -webkit-text-fill-color: var(--ds-green);
  text-shadow: 0 0 14px rgba(81, 224, 46, 0.55);
  transform: translateY(-1px) scale(1.08);
}
.bp-sub {
  font-family: "Montserrat", sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand:hover .bp-nome b { text-shadow: 0 0 18px rgba(81, 224, 46, 0.85); }
@media (max-width: 860px) {
  .brand .brand-logo { height: 30px; }
  .brand-produto { padding-left: 12px; }
  .bp-nome { font-size: 16px; }
  .bp-sub { display: none; }
}

/* ================= CNES: Explorer + Médico ================= */
.cnes-head { align-items: flex-end; }
.cnes-head h1 { margin-bottom: 4px; }
.cnes-head .map-hint { margin: 0; }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  margin-left: auto;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 16px;
  font: 600 13px "Montserrat", system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--ds-green); color: var(--ds-teal); }
.seg-sm .seg-btn { padding: 5px 12px; font-size: 12px; }

.cx-filtros {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cx-filtros label { margin: 0; }
.cx-filtros select {
  display: block;
  margin-top: 4px;
  min-width: 200px;
  background: #080c11;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font: 13px "Open Sans", sans-serif;
}
.cx-filtros .map-hint { margin: 0 0 8px auto; }
.cx-regioes { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-filtro {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font: 600 12px "Montserrat", sans-serif;
  cursor: pointer;
}
.chip-filtro:hover { color: var(--text); border-color: #3d5a64; }
.chip-filtro.on { color: var(--ds-teal); background: var(--ds-green); border-color: var(--ds-green); }

.cx-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.cx-kpis div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 0;
}
.cx-kpis b {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cx-kpis span {
  display: block;
  margin-top: 4px;
  font: 600 11px "Montserrat", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cx-kpis div.destaque { box-shadow: inset 3px 0 0 var(--ds-green); }
.cx-kpis div.destaque b { color: var(--ds-green); }

.cx-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.cx-grid > .panel { min-width: 0; min-height: 0; }
.cx-grid-mapa { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.cx-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.cx-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.cx-card-head h2 { margin-bottom: 0; }
.cx-card-head .seg { margin-left: 0; }

.cx-mapa-card { position: relative; }
.cx-mapa { width: 100%; max-width: 620px; margin: 6px auto 0; }
.cx-mapa svg { display: block; width: 100%; height: auto; }
.cx-uf {
  stroke: #0b1317;
  stroke-width: 1.4;
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.cx-uf:hover { filter: brightness(1.25); stroke: #e8eef0; stroke-width: 1.8; }
.cx-uf.apagado { opacity: 0.32; }
.cx-uf.sel { stroke: var(--llyc-coral); stroke-width: 3; }
.cx-uf-sigla {
  fill: #e8eef0;
  font: 700 13px "Montserrat", sans-serif;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(11, 19, 23, 0.75);
  stroke-width: 3px;
}
.cx-legenda {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.cx-legenda i {
  width: 120px;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #1d333a, #51e02e);
}
.cx-legenda em {
  font-style: normal;
  margin-left: auto;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 8px;
}
.cx-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: rgba(8, 12, 17, 0.95);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  display: grid;
  gap: 2px;
  min-width: 160px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.cx-tip[hidden] { display: none; }
.cx-tip strong { font-family: "Montserrat", sans-serif; font-size: 13px; }
.cx-tip span { color: var(--muted); }

.cx-rank { display: grid; gap: 6px; }
.cx-scroll { max-height: 430px; overflow: auto; padding-right: 4px; }
.cx-bar {
  display: grid;
  gap: 5px;
  text-align: left;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 7px 8px;
  font: inherit;
  cursor: pointer;
}
.cx-bar.fixo { cursor: default; }
.cx-bar:not(.fixo):hover, .cx-bar.on { background: rgba(81, 224, 46, 0.08); }
.cx-bar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.cx-bar-top strong {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cx-bar-top b {
  font: 700 12px "Montserrat", sans-serif;
  color: var(--ds-green);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cx-bar small { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cx-bar small .cnes-setor { margin-top: 0; }
.cx-bar > i { display: block; height: 5px; border-radius: 99px; background: #0c1218; overflow: hidden; }
.cx-bar > i > em { display: block; height: 100%; border-radius: 99px; background: var(--ds-green); }
#cx-rank .cx-bar > i > em { background: var(--llyc-coral); }
#cx-rank .cx-bar-top b { color: var(--llyc-coral); }

.cx-tabela { min-height: 0; }
.cx-esp { min-height: 0; }
.cx-evo { min-height: 0; }
.cx-evo .cx-card-head { flex-wrap: wrap; }
.cx-evo .pbi-evo-bars { height: 210px; gap: 12px; }
.cx-evo .pbi-evo-col i { max-width: 52px; }
.cx-evo .pbi-evo-val { font-size: 10.5px; }
.cx-evo-delta { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-evo-delta.sobe { color: var(--ds-green); }
.cx-evo-delta.desce { color: var(--llyc-coral); }
.table-wrap.cx-esp-wrap { max-height: 420px; overflow: auto; }
.cx-table th.hrs, .cx-table td.hrs { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cx-busca { display: flex; gap: 8px; flex: 1; max-width: 560px; }
.cx-busca input {
  flex: 1;
  margin: 0;
  background: #080c11;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
}
.cx-busca .btn { width: auto; padding: 9px 18px; }
.table-wrap.cx-table-wrap { max-height: none; border: 1px solid var(--line); border-radius: 12px; margin-top: 6px; }
.cx-table { font-size: 12.5px; }
.cx-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cx-table td small { color: var(--muted); }
.cx-table th.hrs, .cx-table td.hrs { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-table tr.cx-linha { cursor: pointer; }
.cx-table tr.cx-linha:hover td, .cx-table tr.cx-linha:focus td { background: rgba(81, 224, 46, 0.06); }
.cx-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cx-pager .btn { width: auto; padding: 7px 14px; }

/* Visão única do médico */
.cnes-detail-head .panel-kicker { color: var(--llyc-coral); }
.cnes-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cnes-tag {
  font-style: normal;
  font: 700 10px "Montserrat", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 9px;
  color: var(--muted);
}
.cnes-tag.ok { color: var(--ds-teal); background: var(--ds-green); border-color: var(--ds-green); }
.cnes-ficha {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 28px;
  margin: 6px 0 18px;
}
.cnes-ficha-bloco { min-width: 0; }
.cnes-ficha-bloco h3 {
  font: 700 11px "Montserrat", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ds-green);
  margin: 12px 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cnes-carregando {
  font: 500 10px "Open Sans", sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  animation: cnes-pisca 1.2s ease-in-out infinite;
}
@keyframes cnes-pisca { 50% { opacity: 0.35; } }
.cnes-ficha-erro { grid-column: 1 / -1; color: var(--llyc-coral); }
.cnes-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 0; }
.cnes-dl > div { padding: 8px 0; border-bottom: 1px solid rgba(42, 61, 68, 0.6); min-width: 0; }
.cnes-dl > div.largo { grid-column: 1 / -1; }
.cnes-dl dt { font-size: 11px; color: var(--muted); }
.cnes-dl dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }

.cnes-estabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cnes-estab {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel-2);
  min-width: 0;
}
.cnes-estab header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 4px; }
.cnes-estab h4 { font: 700 14px "Montserrat", sans-serif; margin: 0; }
.cnes-estab header p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.cnes-estab-tags { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.cnes-estab-tags .cnes-setor { margin-top: 0; }
.cnes-uf {
  font-style: normal;
  font: 700 10px "Montserrat", sans-serif;
  color: var(--llyc-coral);
  background: rgba(245, 73, 99, 0.12);
  border-radius: 99px;
  padding: 3px 8px;
}
.cnes-cbos { margin-top: 10px; }
.cnes-dl-titulo { font-size: 11px; color: var(--muted); margin: 0 0 4px; }
.cnes-cbo-linha {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid rgba(42, 61, 68, 0.6);
  font-size: 12.5px;
}
.cnes-cbo-linha small { color: var(--muted); margin-left: 4px; }
.cnes-cbo-linha b { font-family: "Montserrat", sans-serif; color: var(--ds-green); white-space: nowrap; }
.cnes-cbo-linha.total span { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
.cnes-cbo-linha.total b { color: var(--text); }

@media (max-width: 1280px) {
  .cx-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cx-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .cx-grid-mapa, .cx-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .cnes-ficha, .cnes-estabs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .cx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-filtros .map-hint { margin-left: 0; }
  .cnes-dl { grid-template-columns: minmax(0, 1fr); }
  .seg { margin-left: 0; }
  .cx-busca { max-width: none; }
}

/* Mapa de médicos novos: só os estados, sem mapa-base (ver ensureMap em bi.js). */
#map-br {
  background: radial-gradient(ellipse at 50% 40%, #14232a 0%, #0c1519 70%);
}
#map-br .leaflet-control-zoom {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: none;
}
#map-br .leaflet-control-zoom a {
  background: var(--panel-2);
  color: var(--text);
  border-bottom-color: var(--line);
}
#map-br .leaflet-control-zoom a:hover { background: var(--panel); color: var(--ds-green); }
.leaflet-tooltip.map-tip {
  background: rgba(8, 12, 17, 0.95);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font: 600 12px "Open Sans", sans-serif;
}
.leaflet-tooltip.map-tip::before { display: none; }
.heat-legend i { background: linear-gradient(90deg, #16262c, #51e02e); }
.heat-legend .bolha {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f54963;
  border: 1px solid rgba(255, 255, 255, 0.85);
  margin-left: 12px;
}
.q-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.q-grid-3 .q-status-row { grid-template-columns: minmax(130px, 1.2fr) 1fr minmax(80px, auto); }
@media (max-width: 1280px) { .q-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .q-grid-3 { grid-template-columns: minmax(0, 1fr); } }
.pbi-evo-col.consolidando i { background: repeating-linear-gradient(135deg, var(--ds-green) 0 4px, rgba(81, 224, 46, 0.35) 4px 8px); }
.pbi-evo-nota { font-size: 11px; color: var(--muted); margin: 6px 0 0; }
