/* Biblioteca de componentes PCO — reproduz a linguagem visual de Rafatella_PCO.html
 * (contrato aprovado pelo Diretor/CFO). Depende de pco/tokens.css e pco/fonts.css.
 * Nenhum número/fórmula do protótipo é reproduzido aqui — só layout/interação. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
/* Reduz a densidade visual do app inteiro para o equivalente a 90% de zoom do
 * navegador (pedido do Diretor, 01/09/2026; ajustado de 80% para 90% no
 * mesmo dia) — `zoom` (não `transform: scale`) porque escala layout/scroll/
 * posição sticky do mesmo jeito que o zoom nativo do navegador, sem borrar
 * texto nem exigir recalcular cada px espalhado pelos outros arquivos de
 * CSS. Valor em --app-zoom (pco/tokens.css) — shell.css compensa onde
 * depende de `vh`, que `zoom` não redimensiona. Só na tela: a impressão
 * (analytics.css, `@media print`) já define o próprio @page/tamanho de fonte
 * para papel. */
@media screen { html { zoom: var(--app-zoom); } }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- Cartões / KPIs / tags ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
}
.card-h {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-h h3 { font-size: 13px; font-weight: 700; letter-spacing: -.012em; color: var(--ink); }
.card-h .note { font-size: 12px; color: var(--muted); font-weight: 500; }
.card-b { padding: 14px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: 14px; margin-bottom: 18px; }
/* Faixa notebook (decisão CTO, 27/08/2026): entre o mobile (900px, nav
   off-canvas) e a tela cheia não havia nenhum corte — o piso de 212px por
   card, com o menu ainda expandido consumindo largura fixa, deixa pouco
   espaço sobrando nessa faixa. auto-fit já nunca estoura (sempre quebra
   linha em vez de forçar rolagem), mas reduzir o piso aqui evita cards
   espremidos até o limite antes da hora. */
@media (max-width: 1440px) { .kpis { grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 12px; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 13px 14px 12px; }
.kpi .lbl { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: -.005em; }
.kpi .val { font-size: 22px; font-weight: 800; letter-spacing: -.032em; margin-top: 10px; color: var(--ink); line-height: 1.1; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 9px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600;
  padding: 2.5px 8px; border-radius: 20px; letter-spacing: -.005em;
}
.tag.pos { background: var(--pos-sf); color: var(--pos); }
.tag.neg { background: var(--neg-sf); color: var(--neg); }
.tag.neu { background: var(--surface-3); color: var(--muted); }
.tag.brand { background: var(--brand-sf); color: var(--brand-dp); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.g-2-1 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.mb { margin-bottom: 16px; }
.mt { margin-top: 16px; }
table.t th.col-sep, table.t td.col-sep { border-left: 1px solid var(--line-2); }

/* ---------- Página ---------- */

.page { padding: 20px 22px 48px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 21px; font-weight: 800; letter-spacing: -.028em; color: var(--ink); line-height: 1.2; }
.page-head .desc { color: var(--muted); font-size: 13.5px; margin-top: 6px; max-width: 64ch; line-height: 1.55; }

/* ---------- Botões / campos ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px;
  border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; border: 1px solid transparent;
  transition: .15s; letter-spacing: -.005em; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(241, 103, 34, .3); }
.btn-primary:hover { background: var(--brand-dp); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--muted-2); background: var(--surface-2); }
.btn-danger { background: var(--neg); color: #fff; }
.btn-danger:hover { background: #A93232; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn:disabled { opacity: .38; cursor: not-allowed; }

.err { background: var(--neg-sf); border: 1px solid #F3CFCF; color: #A93232; padding: 10px 12px; border-radius: var(--r-sm); font-size: 12.5px; margin-bottom: 14px; }
.note-box { padding: 12px 14px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.65; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.note-box b { color: var(--ink); }
.note-box.ok { background: var(--pos-sf); border-color: #CDEBDD; color: #0E6B48; }
.note-box.info { background: var(--brand-sf); border-color: #F7D9C5; color: #8A4514; }
.note-box.info b { color: #6B3410; }

/* ---------- Barra de filtros (PCO: .filters / .sel / .search) ---------- */

.filters { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.sel {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-xs);
  padding: 7px 10px; font-size: 12.5px; font-weight: 500; color: var(--ink); transition: .15s;
}
.sel:hover { border-color: var(--muted-2); }
.search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search input {
  width: 100%; padding: 8px 11px 8px 32px; border: 1px solid var(--line-2);
  border-radius: var(--r-xs); font-size: 13px; background: var(--surface); transition: .15s;
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-sf); outline: none; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted-2); }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); font-size: 13px; transition: .15s;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-sf); outline: none; }

/* ---------- Tabela ---------- */

.tbl-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.t th, table.t td { padding: 7px 9px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.t th {
  font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2);
  position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line-2); letter-spacing: -.005em;
}
table.t th.l, table.t td.l { text-align: left; }
table.t th.ct, table.t td.ct { text-align: center; }
table.t td.l { white-space: normal; }
table.t tbody tr:last-child td { border-bottom: none; }
.stick { position: sticky; left: 0; z-index: 3; background: var(--surface); }
table.t th.stick { z-index: 4; background: var(--surface-2); }
table.t tbody tr:hover td, table.t tbody tr:hover td.stick { background: var(--surface-2); }
.cfg-person { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 150px; }
.cfg-person-avatar { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
.cfg-person-name { font-weight: 650; color: var(--ink); }
tr.sub td { font-weight: 700; color: var(--ink); background: var(--surface-3) !important; }
tr.sub td.stick { background: var(--surface-3) !important; }
tr.tot td { font-weight: 700; background: var(--nav) !important; color: #fff; border-color: var(--nav); }
tr.tot td.stick { background: var(--nav) !important; color: #fff; }
/* O totalizador preto encostava no rodapé do card com canto VIVO dentro de
   um card de canto arredondado (pedido do Diretor, 03/09/2026: "tem card
   canto arredondado e totalizador com fundo preto quadrado"). Arredonda só
   quando ele é mesmo a última linha da tabela -- um `tot` no meio (a linha
   Lucro Líquido da Análise, por exemplo) continua reto, que é o certo.
   `--r` é o mesmo raio do card, então as duas curvas coincidem. */
table.t tbody tr.tot:last-child td:first-child { border-bottom-left-radius: var(--r); }
table.t tbody tr.tot:last-child td:last-child { border-bottom-right-radius: var(--r); }
tr.lvl2 td.l { padding-left: 30px; color: var(--muted); }
tr.lvl3 td.l { padding-left: 50px; color: var(--muted); }
tr.lvl4 td.l { padding-left: 70px; color: var(--muted-2); font-size: 12.5px; }
tr.lvl5 td.l { padding-left: 88px; color: var(--muted-2); font-size: 12px; }
.n-neg { color: var(--neg); }
.n-pos { color: var(--pos); }
.n-zero { color: var(--muted-2); }
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: -.03em; }
.cc-pill { font-family: var(--mono); font-size: 10.5px; background: var(--surface-3); padding: 2px 6px; border-radius: 5px; color: var(--muted); margin-right: 7px; }
.empty { padding: 48px 22px; text-align: center; color: var(--muted); }
.empty h4 { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.empty p { font-size: 13px; max-width: 48ch; margin: 0 auto; line-height: 1.6; }

/* `tr.sub td` fixa a cor em --ink; sem estas três, a coluna de desvio de uma
   linha de subtotal perderia a cor de favorabilidade (regra do PCO). */
tr.sub td.n-pos { color: var(--pos); }
tr.sub td.n-neg { color: var(--neg); }
tr.sub td.n-zero { color: var(--muted-2); }

/* Variante densa das tabelas do Panorama (t-mini/t-lam do PCO). */
table.t.t-mini th, table.t.t-mini td { padding: 5px 8px; font-size: 11.5px; }
table.t.t-mini th { font-size: 9.5px; letter-spacing: .01em; }
table.t.t-mini tr.sub td, table.t.t-mini tr.tot td { font-weight: 700; }
table.t.t-mini tr.lvl2 td.l { padding-left: 18px; }
table.t td.l.nw { white-space: nowrap; }
/* Nome longo cede espaço e trunca em vez de espremer os valores. */
table.t td.l.tr1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 1px; }
.analytics-deviation-table { table-layout: fixed; }
.analytics-deviation-table th:first-child,
.analytics-deviation-table td:first-child { width: 46%; }
.analytics-deviation-table th:not(:first-child),
.analytics-deviation-table td:not(:first-child) { width: 13.5%; white-space: nowrap; }
.analytics-deviation-table td.deviation-package {
  white-space: normal; overflow: visible; text-overflow: clip; max-width: none;
  font-size: 10.5px; line-height: 1.25; word-break: normal; overflow-wrap: anywhere;
}

/* Botão de drill das linhas expansíveis (exp/rowbtn do PCO). */
.exp {
  display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px;
  margin-right: 8px; border: 1px solid var(--line-2); border-radius: 5px; font-size: 12px;
  line-height: 1; color: var(--muted); flex: 0 0 17px; transition: .14s; background: var(--surface);
}
.exp:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-sf); }
.rowbtn { display: flex; align-items: center; text-align: left; width: 100%; font: inherit; color: inherit; }

/* ---------- Gráficos (SVG com geometria vinda do Worker) ---------- */

.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--sans); font-size: 10.5px; fill: var(--muted); font-weight: 500; }
/* A cor da série é papel semântico, resolvido aqui — o Worker devolve só
   geometria e o papel (`budget` / `actual`), nunca hex. */
.chart-line { fill: none; }
.chart-line-budget, .chart-point-budget { stroke: var(--muted); }
.chart-point-budget { fill: var(--muted); }
.chart-line-actual, .chart-point-actual { stroke: var(--brand); }
.chart-point-actual { fill: var(--brand); }
/* Papéis da "Evolução no horizonte" (line_geometry). Sem eles o `path` herda
   o stroke padrão do SVG — que é `none` — e o gráfico desenhava apenas os
   pontos, todos preenchidos de preto pelo `fill` padrão. Era a causa do
   "gráfico desconfigurado e muito feio" relatado em 28/08/2026: não faltava
   layout, faltava cor de série. */
.chart-line-receitaOrcada, .chart-point-receitaOrcada { stroke: var(--nav); }
.chart-point-receitaOrcada { fill: var(--nav); }
.chart-line-resultadoOrcado, .chart-point-resultadoOrcado { stroke: var(--muted); }
.chart-point-resultadoOrcado { fill: var(--muted); }
.chart-line-resultadoRealizado, .chart-point-resultadoRealizado { stroke: var(--brand); }
.chart-point-resultadoRealizado { fill: var(--brand); stroke: var(--surface); stroke-width: 1.5px; }
.chart-value {
  font-size: 9px; font-weight: 700;
  paint-order: stroke fill; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round;
}
.chart-value-budget, .chart-value-resultadoOrcado { fill: var(--muted); }
.chart-value-actual, .chart-value-resultadoRealizado { fill: var(--brand); }
/* Fundinho atrás do rótulo percentual da Eficiência de gasto (pedido do
   Diretor, 03/09/2026: "laranja clarinho nos Realizado % e cinza claro nos
   Orçado"). <text> em SVG não aceita background, então o fundo é um halo:
   `paint-order` pinta o traço ANTES do preenchimento, e um stroke grosso na
   cor de fundo cerca o número. Só na Eficiência (.eff-chart) -- os demais
   gráficos ficam como estão -- e não mexe em geometria nenhuma. */
.eff-chart .chart-value {
  paint-order: stroke fill;
  stroke-linejoin: round;
  stroke-width: 3.5px;
}
.eff-chart .chart-value-budget { stroke: var(--surface-3); }
.eff-chart .chart-value-actual { stroke: var(--brand-sf); }
.chart-value-receitaOrcada { fill: var(--nav); }
.chart-grid-line { stroke: var(--line-2); stroke-width: 1.1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart-grid-line-zero { stroke: var(--muted-2); stroke-dasharray: none; }
.chart-grid-label { font-size: 9px; fill: var(--muted-2); }
.chart-axis-label { font-size: 9px; }
.chart-empty { fill: var(--muted-2); font-size: 12px; font-weight: 600; }

/* position:relative -- ancora o .bars-tooltip (position:absolute) dentro do
   próprio card, nunca solto no viewport inteiro (pedido do Diretor,
   02/09/2026). */
.analytics-chart { width: 100%; position: relative; }

/* Cascata do Resultado (gCascata do PCO): papel semântico da barra
   (total/increase/decrease) decide a cor, nunca um hex vindo do Worker. */
.waterfall-connector { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; }
.waterfall-bar { rx: 2; }
.waterfall-bar-total { fill: var(--muted); }
.waterfall-bar-increase { fill: var(--pos); }
.waterfall-bar-decrease { fill: var(--neg); }
.waterfall-value { font-size: 9.5px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.waterfall-axis { font-size: 9px; fill: var(--muted); text-anchor: middle; }

/* Resultado por negócio (gRanking do PCO): rótulo e valor na mesma linha,
   barra de largura inteira abaixo sobre um trilho claro. A primeira barra
   fica em destaque; o sinal do valor é papel semântico vindo da geometria. */
.rank-track { fill: var(--surface-3); rx: 2; }
.rank-bar { fill: var(--muted-2); rx: 2; }
.rank-bar-highlight { fill: var(--brand); }
.rank-label { font-size: 11px; fill: var(--ink); font-weight: 600; }
.rank-value { font-size: 11px; font-weight: 700; fill: var(--ink); }
.rank-value-positive { fill: var(--pos); }
.rank-value-negative { fill: var(--ink); }
.rank-value-neutral { fill: var(--muted); }

/* Tendência (spark do PCO) — só a linha, sem pontos, altura de linha de tabela. */
.spark-line { fill: none; stroke: var(--brand); stroke-width: 1.3; }
.spark-zero { stroke: var(--line); stroke-width: 1; }
.analytics-trend-col { min-width: 78px; }

/* Estrutura fixa × variável (gBarras do PCO): duas séries, papel semântico
   decide a cor. */
.bars-rect-a { fill: var(--ink); }
.bars-rect-b { fill: var(--brand); }
.bars-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend .bars-swatch-a { background: var(--ink); }
.legend .bars-swatch-b { background: var(--brand); }
/* Rótulos próprios (nunca .chart-grid-label/.chart-axis-label): o viewBox
   deste gráfico é bem menor que o da linha, então a mesma fonte em px ficava
   proporcionalmente maior/"com zoom" aqui (achado real, 02/09/2026). */
/* Tamanho MÉDIO (pedido do Diretor, 03/09/2026, terceira calibragem): 10.5px
   (o valor que vigorava por causa do bug de especificidade) ficava grande
   demais e 4.4px ficou pequeno demais. 7px em unidade de viewBox renderiza
   ~9px na tela na largura real do card (~518px para um viewBox de 400 =
   fator 1,295), que é o meio-termo pedido. */
/* CAUSA REAL do "ainda parece grande" (achado real, 03/09/2026, medido no
   navegador via Playwright): `.chart text` (base.css, especificidade
   classe+elemento) sempre vencia `.bars-grid-label`/`.bars-axis-label`
   (especificidade só-classe, MENOR) — o font-size 4.4px NUNCA chegou a
   ser aplicado, o rótulo sempre renderizou em 10.5px, não importa qual
   valor fosse escrito aqui. Qualificado com `.chart` na frente (duas
   classes) para especificidade maior que `.chart text` de propósito,
   nunca !important. */
.chart .bars-grid-label { font-size: 7px; fill: var(--muted-2); }
.chart .bars-axis-label { font-size: 7px; fill: var(--muted); }
/* Área de captura do tooltip: div HTML comum (recebe ponteiro em toda a
   área, inclusive onde o SVG é transparente -- ver comentário em
   analiseRenderBarsChart). Puramente estrutural, sem efeito visual. */
.bars-hit-area { display: block; }
.bars-rect { cursor: pointer; }
/* Tooltip de mouse-over (pedido do Diretor, 02/09/2026): fundo preto, segue
   o cursor mas preso ao PRÓPRIO card (position:absolute + .analytics-chart
   position:relative) -- nunca solto no viewport inteiro. Número colorido por
   sinal, mesma convenção .n-pos/.n-neg do resto do app, nunca uma cor nova. */
.bars-tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--nav); color: #fff; border-radius: 6px; padding: 5px 9px;
  font-size: 11px; font-weight: 600; display: flex; gap: 8px; align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.bars-tooltip-role { color: #fff; font-weight: 500; }
.bars-tooltip-value.n-pos { color: var(--pos); }
.bars-tooltip-value.n-neg { color: var(--neg); }
.bars-tooltip-value.n-zero { color: #fff; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; font-weight: 500; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.budget { background: var(--muted); }
.legend i.actual { background: var(--brand); }

.varbar { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-top: 4px; min-width: 56px; }
.varbar i { display: block; height: 100%; border-radius: 3px; }

.rank { display: flex; flex-direction: column; gap: 11px; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.rank-row .nm { font-size: 13px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .vl { font-size: 12.5px; font-weight: 700; letter-spacing: -.01em; }
.rank-row .bar { grid-column: 1/-1; height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.rank-row .bar i { display: block; height: 100%; background: #B7C0CE; border-radius: 4px; }
.rank-row .bar i.b { background: var(--brand); }

/* ---------- Chip / switch ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--line-2);
  border-radius: 20px; font-size: 11.5px; background: var(--surface); color: var(--muted); font-weight: 500; transition: .14s;
}
.chip:hover { border-color: var(--muted-2); }
.chip.on { background: var(--nav); border-color: var(--nav); color: #fff; font-weight: 600; }

.switch { position: relative; width: 36px; height: 20px; background: var(--line-2); border-radius: 20px; transition: .15s; flex: 0 0 36px; display: inline-block; }
.switch.on { background: var(--pos); }
.switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .15s; }
.switch.on i { left: 18px; }

/* ---------- Modal ---------- */

.modal-bg { position: fixed; inset: 0; background: rgba(27, 34, 48, .55); backdrop-filter: blur(3px); z-index: 90; display: grid; place-items: center; padding: 22px; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 580px; max-height: 88vh; overflow: auto; box-shadow: var(--sh-lg); }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-h h3 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.modal-b { padding: 16px 20px; }
.modal-f { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; background: var(--surface-2); }
/* Relatório de acessos: três tabelas e quatro KPIs não cabem em 580px. Só a
   largura muda — o resto do esqueleto do modal é o mesmo. */
.modal-wide { max-width: 900px; }
.modal-confirm { max-width: 420px; }
.modal-confirm .modal-b p { color: var(--ink); font-size: 13.5px; line-height: 1.6; margin: 0; }
.cfg-access-h { font-size: 13px; font-weight: 700; color: var(--ink); margin: 18px 0 8px; }
.modal-b .kpis { margin-bottom: 12px; }
.modal-b .note { color: var(--muted); font-size: 11.5px; line-height: 1.55; margin-top: 8px; }

/* ---------- Dropzone (Repositório de Dados) ---------- */

.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 40px 26px; text-align: center; cursor: pointer; transition: .16s; background: var(--surface-2); }
.dropzone:hover, .dropzone.ativa { border-color: var(--brand); background: var(--brand-sf); }
.dropzone h4 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 12px 0 6px; }
.dropzone p { font-size: 13px; color: var(--muted); max-width: 54ch; margin: 0 auto; line-height: 1.65; }
.repo-dropzone { width: 100%; color: inherit; font: inherit; }
.repo-dropzone:disabled { cursor: not-allowed; opacity: .55; }
.repo-upload-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand-sf); color: var(--brand); font-size: 24px; font-weight: 700; }
.repo-file { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.repo-file[hidden] { display: none; }
.repo-file strong, .repo-file span { display: block; overflow-wrap: anywhere; }
.repo-file span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.repo-kpi-val { font-size: 18px !important; overflow-wrap: anywhere; }
.repo-laudo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.repo-laudo-grid div { padding: 10px; background: var(--surface-2); border-radius: var(--r-sm); }
.repo-laudo-grid b, .repo-laudo-grid span { display: block; }
.repo-laudo-grid b { font-size: 18px; }
.repo-laudo-grid span { font-size: 11px; color: var(--muted); margin-top: 3px; }
.repo-issues { max-height: 230px; overflow: auto; margin: 12px 0; padding-left: 20px; color: var(--neg); font-size: 12px; line-height: 1.55; }
.repo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.repo-fin-section { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.repo-fin-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.repo-fin-section h4 { font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.repo-fin-section .tbl-wrap, .repo-fin-section table.t { width: 100%; }
.repo-fin-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px 16px; margin-bottom: 10px; font-size: 12px; }
.repo-fin-kv dt { color: var(--muted); }
.repo-fin-kv dd { margin: 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 900px) { .repo-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .repo-laudo-grid { grid-template-columns: 1fr; } .repo-file { align-items: flex-start; flex-direction: column; } }

/* ---------- Toggle segmentado (Só diferenças / Tudo) ---------- */

.actions-inline { display: flex; gap: 6px; flex-wrap: wrap; }
/* Regua de etapas do botao "Atualizar Dados" (31/08/2026).

   Estado por CLASSE, nunca por estilo calculado: a CSP e `style-src 'self'` sem
   hash nem nonce, entao o JS nao pode escrever `.style.width`. Uma barra de
   progresso proporcional exigiria exatamente isso; a regua de etapas resolve sem
   burlar nada e ainda diz ONDE o processo esta, o que uma barra nao diz.

   As etapas ja percorridas continuam visiveis de proposito: quando algo falha, o
   Diretor precisa ver em que ponto falhou. */
.repo-progress { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.repo-progress[hidden] { display: none; }
.repo-progress-step {
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface-2); color: var(--muted);
  font-size: 11.5px; font-weight: 700; letter-spacing: -.005em;
}
.repo-progress-step.is-done { background: var(--pos-sf); border-color: var(--pos-sf); color: var(--pos); }
.repo-progress-step.is-current { background: var(--brand-sf); border-color: var(--brand-sf); color: var(--brand-dp); }
.repo-progress-step.is-failed { background: var(--neg-sf); border-color: var(--neg-sf); color: var(--neg); }
/* Estimativa de progresso e duracao media — pedido do Diretor apos o teto
   de acompanhamento ter sido menor que a maior execucao real observada
   (24min contra um teto de 20min). Nunca e a mesma cor de erro: e um aviso
   de "isto e normal", nao uma falha. */
.repo-progress-hint { margin: -6px 0 12px; font-size: 11.5px; color: var(--muted); }
.repo-progress-hint[hidden] { display: none; }

.repo-history-date-label { font-size: 11px; color: var(--muted); align-self: center; }
.repo-history-date {
  padding: 6px 8px; border: 1px solid var(--line-2); border-radius: var(--r-xs);
  background: var(--surface); font-size: 12px;
}
.repo-history-date:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-sf); outline: none; }
.feedback { min-height: 18px; margin-bottom: 10px; font-size: 12.5px; color: var(--pos); }
.feedback.err { color: var(--neg); }
.feedback:empty { margin-bottom: 0; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; max-height: 160px; overflow: auto; padding: 2px; }

/* Toggle segmentado do PCO: trilho em surface-3 e pílula ativa em surface com
   sombra — não é borda com item ativo escuro (divergência V5 corrigida). */
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-xs); padding: 3px; gap: 2px; }
.seg button { padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-radius: 5px; transition: .14s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 34, 48, .09); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.seg button:disabled:hover { color: var(--muted); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
