/* Orçamento - Budget, Forecast e Realizado */

.orc-acoes { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.orc-barra { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem 1rem; margin-bottom: 1rem; }
.orc-campo { display: grid; gap: .2rem; font-size: .78rem; font-weight: 700; color: var(--muted); }
.orc-campo select { min-width: 150px; }
.orc-periodos { display: flex; gap: .35rem; }
.orc-periodos .segmento { padding: .4rem .85rem; }
#orc-resumo.ocupado, #orc-lanc.ocupado { opacity: .55; pointer-events: none; }

.orc-aviso { background: var(--obs-bg); color: var(--obs); padding: .55rem .8rem; border-radius: 9px; font-weight: 700; font-size: .88rem; margin: 0 0 .7rem; }
.orc-aviso a { color: inherit; }
.orc-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.orc-kpis .kpi { cursor: default; }
.orc-kpis .kpi-num { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.orc-legenda { margin: .6rem 0 0; font-size: .84rem; }
.orc-legenda .orc-tag { margin-left: 0; }
.orc-rev-linha { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem 1rem; margin: .7rem 0 .7rem; font-size: .84rem; }
.orc-h2 { font-size: 1rem; margin: 1.4rem 0 .6rem; }

.orc-tabela-wrap { overflow-x: auto; position: relative; }   /* relative: textos .sr-only da tabela ficam dentro da rolagem */
.orc-tabela { font-variant-numeric: tabular-nums; }
.orc-tabela .num { text-align: right; white-space: nowrap; }
.orc-tabela tbody th { font-size: .88rem; text-transform: none; letter-spacing: 0; color: var(--texto); background: none; font-weight: 700; }
.orc-tabela td, .orc-tabela th { vertical-align: middle; }
.orc-fechado th[scope=row] { color: var(--muted); }
.orc-tabela .orc-sub th, .orc-tabela .orc-sub td { background: var(--c-bg); font-weight: 700; }
.orc-tabela .orc-total th, .orc-tabela .orc-total td { background: var(--verde); color: #fff !important; font-weight: 800; border-bottom: 0; }
/* saldos: − vermelho-escuro, + verde-escuro (as mesmas cores do Excel); no tema escuro, as cores claras do tema */
:root { --orc-neg: #9c0006; --orc-pos: #006100; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --orc-neg: var(--nc); --orc-pos: var(--c); } }
:root[data-theme="dark"] { --orc-neg: var(--nc); --orc-pos: var(--c); }
.orc-neg { color: var(--orc-neg); font-weight: 700; }
.orc-pos { color: var(--orc-pos); font-weight: 700; }
.kpi .orc-neg, .kpi .orc-pos { font-weight: inherit; }
/* total do período (fundo verde): saldo em selo claro, como F:G da linha de total no Excel */
.orc-total .orc-neg, .orc-total .orc-pos { padding: .1rem .45rem; border-radius: 5px; color: #9c0006; background: #ffc7ce; }
.orc-total .orc-pos { color: #006100; background: #c6efce; }
.orc-tag { display: inline-block; min-width: 1.3rem; padding: 0 .3rem; margin-left: .25rem; border-radius: 5px; font-size: .68rem; font-weight: 800; text-align: center; background: var(--vazio-bg); color: var(--vazio); vertical-align: 1px; }
.orc-tag-r { background: var(--c-bg); color: var(--c); }
.orc-tag-p { background: var(--om-bg); color: var(--om); }

/* lançamentos */
.orc-filtros-lanc { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.orc-lanc tbody tr[data-id] { cursor: pointer; }
.orc-lanc tbody tr[data-id]:hover { background: var(--superficie-2); }
.orc-s-pago { background: var(--c-bg); color: var(--c); }
.orc-s-a_pagar { background: var(--om-bg); color: var(--om); }
.orc-s-atrasado { background: var(--nc-bg); color: var(--nc); }
.orc-s-sem_data { background: var(--vazio-bg); color: var(--vazio); }
.orc-b-aprovado { background: var(--c-bg); color: var(--c); }
.orc-b-aguardando { background: var(--om-bg); color: var(--om); }
.orc-alerta { display: inline-flex; align-items: center; justify-content: center; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--obs); color: #fff; font-size: .72rem; font-weight: 800; cursor: help; }
.orc-pag { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: .8rem; font-size: .88rem; }

/* budget */
.orc-grade { min-width: 1500px; }
.orc-grade td { padding: .3rem .25rem; }
.orc-grade input, .orc-grade select { width: 100%; box-sizing: border-box; padding: .3rem .35rem; font-size: .84rem; }
.orc-grade .orc-b-cc { min-width: 180px; }
.orc-grade input.num { text-align: right; min-width: 82px; }
.orc-grade input.invalido { border-color: var(--nc); background: var(--nc-bg); }
.orc-b-tl { font-weight: 700; padding-right: .6rem !important; }

/* forecast */
.orc-previa { display: grid; gap: .25rem; margin-bottom: 1rem; font-size: .9rem; border-left: 4px solid var(--om); }
.orc-detalhe > td { background: var(--superficie-2); }
.orc-mini { font-size: .84rem; }

/* importar */
.orc-imp { display: grid; gap: .6rem; margin-bottom: 1rem; }
.orc-imp input[type=file] { max-width: 100%; }
.orc-imp .orc-acoes { justify-content: flex-start; }
.orc-imp label { font-weight: 700; }
.orc-imp-res { margin-bottom: .8rem; }
.orc-imp-res h2 { font-size: 1rem; margin: 0 0 .4rem; }
.orc-imp-res p { margin: .3rem 0; font-size: .9rem; }
.orc-sec { margin-bottom: .6rem; padding: .6rem .9rem; }
.orc-sec summary { cursor: pointer; }
.orc-sec ul { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .86rem; display: grid; gap: .35rem; }
.orc-sec-obs { border-left: 4px solid var(--obs); }
.orc-sec-nc { border-left: 4px solid var(--nc); }

@media (max-width: 900px) {
  .orc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .orc-kpis, .orc-filtros-lanc { grid-template-columns: 1fr; }
}

/* mês do Resumo → Lançamentos do mês */
/* a célula inteira do mês é o link: sem recuo na célula, o mesmo recuo (th: .6rem .75rem) dentro do link */
.orc-tabela tbody th.orc-mes-cel { padding: 0; }
.orc-tabela th .orc-mes-link { display: block; padding: .6rem .75rem; color: inherit; text-decoration: none; cursor: pointer; }
.orc-tabela th .orc-mes-link:hover { color: var(--verde, #006636); text-decoration: none; }
.orc-tabela th .orc-mes-link:focus-visible { outline: 2px solid var(--petroleo); outline-offset: -3px; border-radius: 4px; }
.orc-filtro-mes { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .25rem .2rem .7rem; border: 1px solid var(--borda); border-radius: 999px; background: #E5F4EA; white-space: nowrap; }
.orc-filtro-mes-x { border: 0; background: transparent; font-size: 1.1rem; line-height: 1; padding: .1rem .4rem; border-radius: 999px; cursor: pointer; color: inherit; }
.orc-filtro-mes-x:hover, .orc-filtro-mes-x:focus-visible { background: rgba(0, 0, 0, .08); }
.orc-tabela tr.orc-mes-linha, .orc-tabela tr.orc-mes-linha td { cursor: pointer; }
.orc-tabela tr.orc-mes-linha:hover th, .orc-tabela tr.orc-mes-linha:hover td { background: color-mix(in srgb, var(--verde, #006636) 6%, transparent); }
/* subtotais e total não têm ação: cursor padrão (a regra geral "tbody tr" usa ponteiro) */
.orc-tabela tr.orc-sub, .orc-tabela tr.orc-total { cursor: default; }

/* Lançamentos: previsão de pagamento abaixo do vencimento quando difere dele (só apresentação) */
.orc-lanc .orc-prev { font-size: .8rem; color: var(--muted); white-space: nowrap; margin-top: .1rem; }

/* Formulário de lançamento: datas com ícone de orientação ao lado do rótulo e Vencimento bloqueado em cinza */
.orl-data { position: relative; }
.orl-rot { display: flex; align-items: center; gap: .3rem; }
.orl-rot > label { display: block; font-weight: 600; font-size: .9rem; white-space: nowrap; }   /* como .campo > label (o label global é grid) */
.orl-info-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; }
.orl-info-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.orl-info-btn:hover, .orl-info-btn[aria-expanded="true"] { color: var(--verde, #006636); background: rgba(0, 102, 54, .08); }
.orl-info-btn:focus-visible { outline: 2px solid var(--verde, #006636); outline-offset: 1px; }
.orl-info { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); padding: .55rem .7rem; font-size: .82rem;
  line-height: 1.35; color: var(--texto); background: var(--superficie); border: 1px solid var(--borda, #d6dbd8);
  border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
/* travado (só leitura): cores do tema, legível no claro e no escuro */
.orl-data input.orl-bloqueado { background: var(--superficie-2); color: var(--texto); border-color: var(--borda);
  cursor: default; opacity: 1; -webkit-text-fill-color: var(--texto); }

/* ---------- gráficos mensais (Resumo, Budget, Forecast) ---------- */
:root { --graf-budget: #2e8b57; --graf-forecast: #2563eb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --graf-budget: #3d9a66; --graf-forecast: #5b8def; } }
:root[data-theme="dark"] { --graf-budget: #3d9a66; --graf-forecast: #5b8def; }
.orc-graf { position: relative; padding: .7rem .9rem .3rem; margin: 0 0 var(--espaco-secao); min-width: 0; }
.orc-graf-svg { display: block; overflow: visible; }
.orc-graf-grade { stroke: var(--borda, #d6dbd8); stroke-width: 1; opacity: .6; }
.orc-graf-base { stroke: var(--muted); stroke-width: 1; }
.orc-graf-eixo { fill: var(--muted); font-size: 11px; }
.orc-graf-vazio { fill: var(--muted); font-size: 12px; font-weight: 600; }
.orc-graf-barra { fill: var(--graf-budget); }
.orc-graf-linha { stroke: var(--graf-forecast); stroke-width: 2; }
.orc-graf-linha.aberta { stroke-dasharray: 6 5; }
.orc-graf-ponto { fill: var(--graf-forecast); stroke: var(--superficie); stroke-width: 2; }
.orc-graf-ponto.aberto { fill: var(--superficie); stroke: var(--graf-forecast); }
.orc-graf-guia { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.orc-graf-alvo { fill: transparent; cursor: crosshair; outline: none; }
.orc-graf-alvo:focus-visible { fill: rgba(37, 99, 235, .08); }
.orc-graf-leg { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .82rem; margin-bottom: .3rem; }
.orc-graf-leg span { display: inline-flex; align-items: center; gap: .35rem; }
.orc-leg-barra { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--graf-budget); }
.orc-leg-linha { display: inline-block; width: 18px; border-top: 2px solid var(--graf-forecast); }
.orc-leg-linha.aberta { border-top-style: dashed; }
.orc-graf-dica { position: absolute; z-index: 6; min-width: 190px; pointer-events: none; padding: .5rem .65rem; font-size: .8rem;
  background: var(--superficie); color: var(--texto); border: 1px solid var(--borda, #d6dbd8); border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.orc-graf-dica-tit { font-weight: 700; margin-bottom: .25rem; }
.orc-graf-dica-l { display: flex; flex-direction: column; margin-top: .2rem; }
.orc-graf-dica-l span { color: var(--muted); font-size: .75rem; }
.orc-graf-dica-l.orc-neg strong { color: #9c0006; } .orc-graf-dica-l.orc-pos strong { color: #006100; }
.orc-kpi-txt { font-size: 1.15rem; line-height: 1.6; }
.orc-b-total { display: flex; align-items: baseline; gap: .8rem; margin: .2rem 0 .8rem; }
.orc-b-total .kpi-num { font-size: 1.5rem; }
.orc-h2-sub { font-size: .82rem; font-weight: 400; margin-left: .4rem; }
.orc-proposta { padding: .8rem 1rem; margin-bottom: .8rem; }
.orc-proposta-cab { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: .6rem; flex-wrap: wrap; }
.orc-pivo th[scope="row"] { white-space: nowrap; }
.orc-rev-atual { background: rgba(37, 99, 235, .06); }
.orc-decididas { margin: .4rem 0 1rem; font-size: .88rem; }
.dialogo-form.dialogo-largo { width: min(1180px, 100%); }
.orc-total .muted { color: inherit; opacity: .9; }   /* “Sem Budget aprovado” legível na linha de total */

/* Resumo: cartões com ícone de orientação junto ao título (texto explicativo na caixa) */
.orc-kpi { position: relative; }
.orc-kpi-rot { display: flex; align-items: center; gap: .3rem; }
.orc-kpi-rot .orl-info-btn { color: inherit; opacity: .75; }
.orc-kpi-rot .orl-info-btn:hover, .orc-kpi-rot .orl-info-btn[aria-expanded="true"] { opacity: 1; }
.orl-info.orc-kpi-info { top: 2.4rem; left: .8rem; right: .8rem; text-transform: none; letter-spacing: normal; font-weight: 400; }
.orc-kpi-sec { margin-top: .15rem; }
/* Budget › Aprovado: cabeçalhos padronizados e centralizados (meses inclusive); valores à direita */
.orc-tabela.orc-pivo thead th { text-align: center; vertical-align: middle; white-space: nowrap; height: 2.6rem;
  padding-top: .45rem; padding-bottom: .45rem; font-size: .78rem; letter-spacing: .03em; }
.orc-pivo tbody td.num, .orc-pivo tfoot td.num { text-align: right; }
.orc-h3 { font-size: .95rem; margin: 1.2rem 0 .5rem; }
