/* JOT-2903. Extensão do núcleo C/D às superfícies de gestão.
   Regras locais: nenhum token global nem estilo de outra tela é redefinido. */
.indicadores-page,
.mapa-page,
.pesos-page {
  --indicadores-serie-a: #4b627a;
  --indicadores-serie-b: #74684a;
  --indicadores-serie-c: #615d79;
  --indicadores-serie-d: #795f52;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--pv-s-6);
  min-width: 0;
  padding-bottom: max(var(--pv-s-8), env(safe-area-inset-bottom));
}
:is(.indicadores-page, .mapa-page, .pesos-page) .page-header {
  margin: 0;
}
:is(.indicadores-page, .mapa-page, .pesos-page) .sub {
  max-width: 70ch;
  line-height: 1.5;
}
:is(.indicadores-page, .mapa-page, .pesos-page) :is(.panel, .card, .kpi-card) {
  min-width: 0;
  background: var(--pv-bg-1);
  border: 0;
  border-radius: var(--pv-r-lg);
  box-shadow: none;
  padding: var(--pv-s-5);
}
:is(.indicadores-page, .mapa-page, .pesos-page) :is(h2, h3, h4) {
  line-height: 1.35;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
:is(.indicadores-page, .mapa-page, .pesos-page) h2 {
  font-size: var(--t-lg);
}
:is(.indicadores-page, .mapa-page, .pesos-page) :is(p, .muted, .text-xs) {
  line-height: 1.55;
}
:is(.indicadores-page, .mapa-page, .pesos-page) .text-xs {
  font-size: var(--t-sm);
}
:is(.indicadores-page, .mapa-page, .pesos-page) :is(button, .btn, .chip, select, input, summary) {
  min-height: 44px;
}
:is(.indicadores-page, .mapa-page, .pesos-page) :is(button, .btn, .chip) {
  white-space: normal;
}
:is(.indicadores-page, .mapa-page, .pesos-page) :is(input, select) {
  max-width: 100%;
  font-size: 16px;
}
:is(.indicadores-page, .mapa-page, .pesos-page) :focus-visible,
.mapa-sheet :focus-visible {
  outline: 2px solid var(--pv-gold);
  outline-offset: 3px;
}
.indicadores-page :is(.stack, .grid-2, .kpi-grid, .indicadores-site) {
  min-width: 0;
}
.indicadores-page > .stack {
  gap: var(--pv-s-8);
}
.indicadores-section {
  min-width: 0;
  gap: var(--pv-s-4);
}
.indicadores-page .indicadores-section-title {
  font-size: var(--t-xl);
  margin: var(--pv-s-2) 0 0;
  color: var(--pv-fg-0);
}
.indicadores-periodo,
.indicadores-filtros,
.pesos-filtros,
.mapa-page .mapa-controles {
  display: grid;
  gap: var(--pv-s-3);
}
.indicadores-label,
:is(.indicadores-filtros, .pesos-filtros, .pesos-edicao, .mapa-page) label {
  display: grid;
  gap: var(--pv-s-2);
  color: var(--pv-fg-2);
  font-size: var(--t-sm);
  font-weight: 500;
}
.indicadores-page .chip-row {
  flex-wrap: wrap;
}
.indicadores-page .indicadores-filtros .chip-row {
  align-items: end;
}
.indicadores-page .kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.indicadores-page .kpi-card {
  min-height: 112px;
  gap: var(--pv-s-3);
  justify-content: space-between;
}
.indicadores-page .kpi-label {
  font-size: var(--t-sm);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  line-height: 1.4;
}
.indicadores-page .kpi-value {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.3;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.indicadores-page .grid-2 {
  min-width: 0;
}
.indicadores-page .bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--pv-s-2);
  padding: var(--pv-s-3) 0;
}
.indicadores-page .bar-label {
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.indicadores-page .bar-track {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  height: 6px;
  background: var(--pv-bg-3);
}
.indicadores-page .bar-fill {
  background: var(--indicadores-serie-a);
}
.indicadores-page .bar-fill.serie-b {
  background: var(--indicadores-serie-b);
}
.indicadores-page .bar-fill.serie-c {
  background: var(--indicadores-serie-c);
}
.indicadores-page .bar-fill.serie-d {
  background: var(--indicadores-serie-d);
}
.indicadores-page .bar-value {
  font-variant-numeric: tabular-nums;
}
.indicadores-page .chart-line {
  stroke: var(--indicadores-serie-a);
  stroke-width: 3;
}
.indicadores-page .chart-dot {
  fill: var(--indicadores-serie-a);
}
.indicadores-page .chart-area {
  fill: var(--pv-bg-3);
}
.indicadores-chart-legend {
  display: flex;
  align-items: center;
  gap: var(--pv-s-2);
  color: var(--pv-fg-2);
  font-size: var(--t-sm);
}
.indicadores-chart-legend::before {
  content: "";
  width: 24px;
  height: 3px;
  background: var(--indicadores-serie-a);
  flex: none;
}
.indicadores-table {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-radius: var(--pv-r-sm);
  scrollbar-color: var(--pv-fg-2) var(--pv-bg-2);
}
.indicadores-page .table {
  min-width: 480px;
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
}
.indicadores-page .table :is(td, th) {
  padding: var(--pv-s-3);
  vertical-align: top;
  line-height: 1.5;
}
.indicadores-page .table th {
  white-space: normal;
}
.indicadores-page .table caption {
  padding: var(--pv-s-4) 0;
  text-align: left;
  font-weight: 600;
}
.indicadores-page .row-between {
  flex-wrap: wrap;
  gap: var(--pv-s-2);
}
.indicadores-page .empty {
  min-height: 120px;
  padding: var(--pv-s-6) var(--pv-s-3);
}
.indicadores-state {
  padding: var(--pv-s-5);
  border-radius: var(--pv-r-md);
  background: var(--pv-bg-1);
  color: var(--pv-fg-2);
}
.indicadores-site {
  display: grid;
  gap: var(--pv-s-4);
}
.indicadores-site .table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}
.indicadores-site .table :is(td, th) {
  overflow-wrap: anywhere;
}
.indicadores-site .card-tight {
  display: grid;
  gap: var(--pv-s-3);
}
.indicadores-page summary {
  padding-block: var(--pv-s-3);
  cursor: pointer;
}
.pesos-feedback:empty {
  display: none;
}
.pesos-feedback:not(:empty) {
  margin: 0;
  padding: var(--pv-s-4);
  border-radius: var(--pv-r-md);
  background: var(--pv-selected);
  color: var(--pv-fg-0);
}
.pesos-page .table {
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
}
.pesos-edicao form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--pv-s-2);
}
.pesos-edicao label {
  flex: 1 1 120px;
}
.pesos-page :is(.table td, .table th) {
  padding: var(--pv-s-3);
}
.mapa-page .mapa-controles {
  padding: var(--pv-s-5);
  background: var(--pv-bg-1);
  border-radius: var(--pv-r-lg);
}
.mapa-page .mapa-legenda {
  display: grid;
  gap: var(--pv-s-2);
}
.mapa-page .legenda-chip {
  white-space: normal;
  color: var(--pv-fg-1);
  line-height: 1.4;
}
.mapa-page .legenda-cor {
  width: 12px;
  height: 12px;
}
.mapa-page .mapa-svg {
  min-height: 280px;
  max-height: 55vh;
}
.mapa-page .mapa-bolha {
  fill: var(--pv-bg-1);
  stroke: var(--pv-fg-0);
  stroke-width: 1.5;
}
.mapa-page .mapa-municipio:focus-visible {
  stroke: var(--pv-fg-0);
  stroke-width: 4;
  filter: brightness(1.2);
}
:is(.mapa-page, .mapa-sheet) .linha-cliente-mapa {
  min-height: 44px;
  flex-wrap: wrap;
  padding-block: var(--pv-s-3);
}
:is(.mapa-page, .mapa-sheet) .linha-cliente-nome {
  white-space: normal;
  overflow-wrap: anywhere;
}
.mapa-sheet .sheet {
  display: flex;
  flex-direction: column;
  gap: var(--pv-s-4);
  overflow-y: auto;
  max-height: 85dvh;
  padding-bottom: max(var(--pv-s-6), env(safe-area-inset-bottom));
}
.mapa-sheet .btn {
  min-height: 44px;
  justify-self: end;
}
@media (max-width: 767px) {
  .pesos-page .pesos-tabela,
  .pesos-page .pesos-tabela :is(tbody, tr, td) {
    display: block;
    width: 100%;
  }
  .pesos-page .pesos-tabela thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .pesos-page .pesos-tabela tr {
    padding-block: var(--pv-s-3);
    border-bottom: 1px solid var(--pv-line);
  }
  .pesos-page .pesos-tabela td {
    border: 0;
    padding: var(--pv-s-2) 0;
  }
  .pesos-page .pesos-tabela td::before {
    content: attr(data-label);
    display: block;
    color: var(--pv-fg-2);
    font-size: var(--t-sm);
    margin-bottom: var(--pv-s-1);
  }
  .pesos-edicao form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pesos-edicao form label {
    grid-column: 1 / -1;
  }
  .pesos-page .pesos-table {
    min-width: 0;
  }
}
@media (min-width: 768px) {
  .indicadores-page .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .pesos-filtros {
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
  }
  .mapa-page .mapa-controles {
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    align-items: start;
  }
  .mapa-page .mapa-municipio-select {
    max-width: 360px;
  }
  .pesos-page .table {
    table-layout: fixed;
    width: 100%;
  }
  .pesos-page .table td {
    overflow-wrap: anywhere;
    vertical-align: top;
  }
  .pesos-page .table th:first-child {
    width: 24%;
  }
  .pesos-page .table th:last-child {
    width: 42%;
  }
}
