/* Tela Financeiro de SOSPROCESSOS (pixel erp-financeiro).
   Usa os tokens do portal-login (--surface, --ink, --rule...). As cores das
   séries do gráfico têm passo próprio no claro e no escuro, validados contra
   a superfície de cada modo (entradas, saídas e posição: separação para
   daltonismo ΔE >= 9). A hachura marca o previsto sem depender só da cor. */

.erp {
  --erp-entrada: #2F6B46;
  --erp-saida:   #0B1F3A;
  --erp-posicao: #C9A227;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .erp {
    --erp-entrada: #7FC79B;
    --erp-saida:   #8FB0E0;
    --erp-posicao: #E3C76E;
  }
}
:root[data-theme="dark"] .erp {
  --erp-entrada: #7FC79B;
  --erp-saida:   #8FB0E0;
  --erp-posicao: #E3C76E;
}

.erp .erp-escopo { margin-bottom: 1rem; }
.erp .erp-kpis { margin-bottom: 1.25rem; }
.erp .indicador dd { font-size: clamp(1.25rem, 2.4vw, 1.7rem); overflow-wrap: anywhere; }
.erp .erp-negativo { color: var(--stop); }
.erp .erp-bloco { margin-bottom: 1.25rem; }
.erp .erp-espaco { margin-top: 1.75rem; }

.erp .erp-filtros { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: end; margin-inline-start: auto; }
.erp .erp-filtros-linha { margin: 1.25rem 0 .5rem; }
.erp .erp-campo-curto { margin: 0; min-width: 9rem; }
.erp .erp-campo-curto span { font-size: .78rem; }

/* gráfico */
.erp .erp-grafico { position: relative; width: 100%; min-height: 280px; }
.erp .erp-svg { display: block; width: 100%; height: auto; overflow: visible; }
.erp .erp-grade { stroke: var(--rule-soft); stroke-width: 1; }
.erp .erp-eixo { stroke: var(--rule-strong); stroke-width: 1; }
.erp .erp-fronteira { stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.erp .erp-rotulo { fill: var(--muted); font: 500 11px var(--f-body); font-variant-numeric: tabular-nums; }
.erp .erp-rotulo-hoje { fill: var(--ink); font-weight: 700; }
.erp .erp-rotulo-forte { fill: var(--ink); font-weight: 700; }
.erp .erp-barra { stroke: var(--surface); stroke-width: 0; }
.erp .erp-barra.erp-s-entrada { fill: var(--erp-entrada); }
.erp .erp-barra.erp-s-saida { fill: var(--erp-saida); }
.erp .erp-barra.erp-previsto { fill-opacity: .45; }
.erp .erp-linha { fill: none; stroke: var(--erp-posicao); stroke-width: 2; stroke-linejoin: round; }
.erp .erp-ponto { fill: var(--erp-posicao); stroke: var(--surface); stroke-width: 2; }
.erp .erp-hachura-fundo { fill: transparent; }
.erp .erp-hachura-linha { stroke: var(--surface); stroke-width: 2; }
.erp .erp-alvo { fill: transparent; cursor: crosshair; }
.erp .erp-alvo:focus { outline: none; }
.erp .erp-mira { stroke: var(--rule-strong); stroke-width: 1; pointer-events: none; }
.erp .erp-dica {
  position: absolute; top: 3.5rem; z-index: 2; width: 16rem; max-width: calc(100% - 1rem);
  display: grid; gap: .2rem; padding: .6rem .75rem; pointer-events: none;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: var(--shadow); font-size: .85rem; font-variant-numeric: tabular-nums;
}
.erp .quadro-corpo { position: relative; }
.erp .erp-dica b { color: var(--ink); }

.erp .erp-legenda { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: 0 0 .75rem; padding: 0; color: var(--ink-2); font-size: .85rem; }
.erp .erp-legenda li { display: inline-flex; align-items: center; gap: .4rem; }
.erp .erp-amostra { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; }
.erp .erp-amostra.erp-s-entrada { background: var(--erp-entrada); }
.erp .erp-amostra.erp-s-saida { background: var(--erp-saida); }
.erp .erp-amostra-linha { height: 2px; width: 1.1rem; background: var(--erp-posicao); border-radius: 1px; }
.erp .erp-amostra-previsto {
  background: repeating-linear-gradient(45deg, var(--muted) 0 2px, transparent 2px 5px);
  border: 1px solid var(--muted); opacity: .8;
}
.erp .erp-tabela-alt { margin-top: .75rem; }
.erp .erp-tabela-alt summary { cursor: pointer; color: var(--accent); font-weight: 600; }

/* abas */
.erp .erp-abas { display: flex; flex-wrap: wrap; gap: .25rem; margin: .5rem 0 .75rem; border-bottom: 1px solid var(--rule); }
.erp .erp-abas button {
  appearance: none; border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 600;
  padding: .6rem .85rem; min-height: 2.75rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.erp .erp-abas button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.erp .erp-abas button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* tabelas e ações */
.erp .erp-tabela td.num, .erp .erp-tabela th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.erp .erp-acoes { display: inline-flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.erp .erp-acoes-col { display: flex; flex-direction: column; align-items: stretch; min-width: 14rem; }
.erp .erp-lancar { display: flex; gap: .35rem; }
.erp .erp-btn-mini { min-height: 2.2rem; padding: .3rem .7rem; font-size: .85rem; text-align: left; }
.erp .erp-sel-mini { min-height: 2.2rem; flex: 1; }
.erp .erp-total { text-align: right; font-variant-numeric: tabular-nums; }
.erp form.forma-conta { margin-top: 1.25rem; }

.erp .erp-dialogo { border: 1px solid var(--rule); border-radius: 14px; padding: 1.25rem; max-width: min(32rem, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); }
.erp .erp-dialogo::backdrop { background: rgba(0, 0, 0, .35); }
.erp .erp-dialogo-acoes { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

@media (max-width: 40rem) {
  .erp .erp-filtros { margin-inline-start: 0; width: 100%; }
  .erp .erp-campo-curto { flex: 1; min-width: 0; }
  .erp .erp-acoes-col { min-width: 11rem; }
}

/* a tela nunca alarga a página: tabela larga rola dentro do próprio quadro */
.tela.erp { min-width: 0; max-width: 100%; }
.erp .quadro, .erp .quadro-corpo, .erp .tabela-rolo, .erp .erp-grafico { min-width: 0; max-width: 100%; }
.erp .tabela-rolo { overflow-x: auto; }
