/* DRE do Financeiro: usa as variáveis e a tabela do Financeiro (financeiro.css). Dinheiro que sai em vermelho, resultado em destaque, "A classificar" em âmbar. */
.dre .dre-periodo { display: inline-flex; align-items: center; gap: 4px; }
.dre .dre-periodo .dre-seta { width: 34px; padding: 0; justify-content: center; font-size: 17px; line-height: 1; }
.dre .dre-periodo .dre-seta:disabled { opacity: 0.35; cursor: default; border-color: #d9dee5; }
.dre .dre-periodo-pop .fin-botao { min-width: 190px; justify-content: space-between; font-weight: 600; }
.dre .dre-periodo-pop .fin-pop { width: 272px; min-width: 272px; padding: 10px; }
.dre .dre-ano { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dre .dre-ano b { font-size: 14px; font-variant-numeric: tabular-nums; }
.dre .dre-ano button { width: 30px; height: 30px; border: none; border-radius: 8px; background: none; font-size: 17px; color: var(--tinta); cursor: pointer; }
.dre .dre-ano button:hover:not(:disabled) { background: #f4f6f8; }
.dre .dre-ano button:disabled { opacity: 0.3; cursor: default; }
.dre .dre-ano .dre-ano-todo { flex: 1; width: auto; margin: 0 6px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid #d9dee5; }
.dre .dre-ano .dre-ano-todo.ativo { background: var(--verde); border-color: var(--verde); color: #fff; }
.dre .dre-ano .dre-ano-todo.ativo:hover:not(:disabled) { background: var(--verde); }
.dre .dre-meses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.dre .dre-mes-celula { height: 36px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; font-size: 13px; color: var(--tinta); cursor: pointer; }
.dre .dre-mes-celula:hover:not(:disabled) { background: #f4f6f8; }
.dre .dre-mes-celula.hoje { font-weight: 700; }
.dre .dre-mes-celula.dentro { background: var(--verde-claro); color: var(--verde); }
.dre .dre-mes-celula.ponta { background: var(--verde); color: #fff; font-weight: 600; }
.dre .dre-mes-celula:disabled { opacity: 0.3; cursor: default; }
.dre .dre-atalhos { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--linha); }
.dre .dre-grupos { display: flex; flex-direction: column; gap: 4px; }
.dre .dre-grupo-linha { display: flex; align-items: center; gap: 2px; }
.dre .dre-grupo-linha input, .dre .dre-grupo-novo input { flex: 1; min-width: 0; height: 32px; border: 1px solid #d9dee5; border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--tinta); background: #fff; }
.dre .dre-grupo-linha input:focus, .dre .dre-grupo-novo input:focus { outline: none; border-color: var(--verde); }
.dre .dre-grupo-linha button { width: 26px; height: 32px; border: none; border-radius: 6px; background: none; color: var(--suave); font-size: 10px; cursor: pointer; }
.dre .dre-grupo-linha button:hover:not(:disabled) { background: #f4f6f8; color: var(--tinta); }
.dre .dre-grupo-linha button:disabled { opacity: 0.25; cursor: default; }
.dre .dre-grupo-linha [data-apagar]:hover:not(:disabled) { color: var(--neg); }
.dre .dre-grupo-novo { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--linha); }
.dre .dre-grupo-novo .aplicar { width: auto; margin: 0; padding: 0 12px; }
.dre .dre-grupo-erro { font-size: 12px; color: var(--neg); margin-top: 6px; }
.dre .dre-grupo-erro:empty { display: none; }
.dre .fin-barra .fin-pop:has(.dre-grupos) { width: 320px; }
.dre .motivo { display: block; font-size: 11px; font-weight: 500; color: var(--suave); }
.dre .motivo.sugestao { color: #8a5a00; }
.dre .motivo .usar { border: none; background: none; color: var(--verde); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; padding: 0 2px; }
.dre .dre-rodape { margin-top: 10px; font-size: 12px; color: var(--suave); font-variant-numeric: tabular-nums; }
.dre .dre-rodape.erro { color: var(--neg); font-weight: 600; }
.dre .dre-erro { color: var(--neg); }
.dre .dre-vazio { color: var(--suave); padding: 18px 4px; }
.dre .dre-situacoes { border-bottom: none; margin: 0; }
.dre .dre-decisao { height: 32px; min-width: 210px; border: 1px solid #d9dee5; border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: #fff; color: var(--tinta); }
.dre .dre-decisao.entra { border-color: var(--verde); background: var(--verde-claro); }
.dre .dre-decisao.fora { border-color: #c9ced6; background: #f4f6f8; color: #5b6573; }
.dre .fin-pop.dre-direita { left: auto; right: 0; }
.dre .dre-grupo-aviso { font-size: 13px; color: var(--suave); padding: 4px 2px; }
.dre .dre-aviso { margin-top: 8px; font-size: 12px; color: var(--suave); }
.dre .dre-aviso.erro { color: var(--neg); font-weight: 600; }
.dre .dre-pendencias { margin-top: 8px; font-size: 12px; color: #8a5a00; }
.dre .dre-pendencias summary { cursor: pointer; font-weight: 600; }
.dre .dre-pendencias ul { margin: 6px 0 0; padding-left: 18px; color: var(--suave); }

/* ---- Demonstrativo: tabela moderna ---- */
.dre { --z0: #ffffff; --z1: #f6f8fa; --separa: #e8ecf0; --hover: #edf5f0; }
.dre .dre-mapa th { position: static; }
.dre .dre-mapa th.esq { text-align: left; }
.dre .dre-mapa th.a-dir { text-align: right; }
.dre .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dre .neg { color: var(--neg); }
.dre .pos { color: var(--pos); }
.dre .suave { color: var(--suave); }
.dre .zero { color: #c3cad3; }
.dre .dre-quadro { overflow-x: auto; }
.dre .dre-card { display: block; width: 100%; border-radius: 16px; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 8px 24px -12px rgba(16, 24, 40, 0.12); }
.dre .dre-tabela { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.dre .dre-tabela th, .dre .dre-tabela td { position: static; padding: 0 14px; height: 38px; border-bottom: 1px solid var(--separa); }
.dre .dre-tabela th.a-dir, .dre .dre-tabela td.a-dir { text-align: center; min-width: 128px; }
.dre .dre-tabela .m-ini { border-left: 1px solid var(--separa); }
.dre .dre-tabela th.esq, .dre .dre-tabela td.esq { width: 290px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; z-index: 1; text-align: left; }
.dre .dre-tabela td.recuo { padding-left: 30px; }

/* cabeçalho */
.dre .dre-tabela thead th, .dre .dre-tabela tr:first-child th, .dre .dre-tabela tr.sub th { background: #f1f4f7; color: #3b4654; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.dre .dre-tabela tr:first-child th { height: 42px; border-bottom: 1px solid #dfe4ea; }
.dre .dre-tabela tr:first-child th.esq { z-index: 2; font-size: 11px; }
.dre .dre-tabela tr:first-child th.mes { text-align: center; color: var(--tinta); font-size: 12px; }
.dre .dre-tabela tr.sub th { height: 28px; font-size: 10px; font-weight: 600; color: #7a8594; border-bottom: 2px solid #dfe4ea; }
.dre .dre-tabela tr:first-child th.tot, .dre .dre-tabela tr.sub th.tot { background: #e8edf1; }

/* linhas de categoria: uma cor sim, outra não, com as mesmas linhas de separação em todas */
.dre .dre-tabela tr.cat td { background: var(--z0); }
.dre .dre-tabela tr.cat.z1 td { background: var(--z1); }
.dre .dre-tabela tr.cat:hover td { background: var(--hover); }
.dre .dre-tabela tr.cat td.tot { font-weight: 600; }
.dre .dre-tabela tr.cat.venda td { font-weight: 700; font-size: 14px; height: 44px; }
.dre .dre-tabela td.tot { box-shadow: inset 1px 0 0 var(--separa); }

/* blocos que abrem e fecham */
.dre .dre-tabela tr.grupo td { background: #eceff3; font-weight: 700; cursor: pointer; }
.dre .dre-tabela tr.grupo td:first-child { box-shadow: inset 3px 0 0 #9aa5b1; }
.dre .dre-tabela tr.grupo:hover td { background: #e3e8ee; }
.dre .dre-tabela tr.grupo .seta { display: inline-block; width: 18px; color: var(--suave); font-size: 11px; }
.dre .dre-tabela tr.grupo em { font-style: normal; font-size: 11px; font-weight: 600; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #fff; color: #5b6573; }
.dre .dre-tabela tr.grupo.classificar td { background: #fff3d6; color: #8a5a00; }
.dre .dre-tabela tr.grupo.classificar td:first-child { box-shadow: inset 3px 0 0 #e0a100; }
.dre .dre-tabela tr.grupo.classificar:hover td { background: #ffecc2; }
.dre .dre-tabela tr.grupo.classificar em { background: #ffe0a1; color: #8a5a00; }
.dre .dre-tabela tr.grupo.fora td { background: #f6f7f9; color: var(--suave); font-weight: 600; }
.dre .dre-tabela tr.grupo.fora td:first-child { box-shadow: inset 3px 0 0 #d3d8de; }

/* margem: mesma aparência das linhas de grupo (Venda, Despesas...), sem destaque; resultado: a única linha de destaque */
.dre .dre-tabela tr.margem td { background: #eceff3; font-weight: 700; }
.dre .dre-tabela tr.margem td:first-child { box-shadow: inset 3px 0 0 #9aa5b1; padding-left: 26px; }
.dre .dre-tabela tr.resultado td { background: #1f4d38; color: #fff; font-weight: 700; font-size: 14px; height: 54px; border-bottom: none; border-left-color: rgba(255, 255, 255, 0.14); }
.dre .dre-tabela tr.resultado td.neg { color: #ffb4a8; }
.dre .dre-tabela tr.resultado td.pos { color: #b9f0cf; }
.dre .dre-tabela tr.resultado td.zero { color: rgba(255, 255, 255, 0.4); }
.dre .dre-tabela tr.resultado td.tot { box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.14); }
.dre .dre-tabela tr:last-child td { border-bottom: none; }
.dre .dre-calculando { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 14px; border-radius: 12px; background: #fff7e0; border: 1px solid #f0d98a; color: #7a5200; font-size: 13px; font-weight: 600; }
.dre .dre-roda { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #e0b43a; border-top-color: transparent; animation: dre-gira 0.9s linear infinite; flex: none; }
@keyframes dre-gira { to { transform: rotate(360deg); } }
.dre .dre-tabela td.pct-col, .dre .dre-tabela th.a-dir { min-width: 0; }
.dre .dre-tabela td.pct-col { min-width: 84px; width: 84px; font-size: 12px; font-weight: 600; color: #6a7686; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dre .dre-tabela th.a-dir { min-width: 84px; }
.dre .dre-tabela td.num { min-width: 128px; }
.dre .dre-tabela tr.resultado td.pct-col { color: rgba(255, 255, 255, 0.85); font-weight: 700; }
.dre .dre-tabela td.pct-col.zero { color: #c3cad3; }
.dre .dre-tabela tr.resultado td.pct-col.zero { color: rgba(255, 255, 255, 0.4); }

/* Valor e % lado a lado: as duas colunas do mês têm a mesma largura; o valor encosta no meio pela direita e o % pela esquerda, formando um par centralizado sob o mês. */
.dre .dre-tabela { table-layout: fixed; }
.dre .dre-tabela th.esq, .dre .dre-tabela td.esq { width: 290px; min-width: 0; max-width: none; }
.dre .dre-tabela td.a-dir.val, .dre .dre-tabela th.a-dir.val { text-align: right; padding: 0 10px 0 14px; min-width: 0; }
.dre .dre-tabela td.a-dir.pct-col, .dre .dre-tabela th.a-dir.pct-col { text-align: left; padding: 0 14px 0 10px; min-width: 0; width: auto; }
.dre .dre-tabela td.a-dir.prev, .dre .dre-tabela th.a-dir.prev { text-align: center; padding: 0 14px; min-width: 0; }
.dre .dre-tabela td.pct-col.tot, .dre .dre-tabela tr.resultado td.pct-col.tot { box-shadow: none; }
.dre .dre-tabela .dre-prev { width: 100%; max-width: none; height: 30px; padding: 0 4px; border: 1px solid #cdd8d1; border-radius: 8px; background: #fff; color: var(--tinta); font: inherit; font-size: 13px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.dre .dre-tabela .dre-prev.pequeno { max-width: none; }
.dre .dre-tabela .dre-prev::placeholder { color: #a9b3bd; font-weight: 500; }
.dre .dre-tabela .dre-prev:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(47, 111, 79, 0.15); }
.dre .dre-tabela td.edit { cursor: default; }
.dre .dre-tabela td.edit, .dre .dre-tabela td.a-dir.edit { padding-left: 6px; padding-right: 6px; text-align: center; }
.dre .dre-tabela .dre-prev { font-size: 12.5px; }

/* Colunas justas: os 12 meses cabem com pouca rolagem (larguras vêm do <colgroup> em dre.js). */
.dre .dre-tabela { font-size: 12px; }
.dre .dre-tabela th, .dre .dre-tabela td { padding: 0 8px; }
.dre .dre-tabela td.a-dir.val, .dre .dre-tabela th.a-dir.val { padding: 0 6px 0 8px; }
.dre .dre-tabela td.a-dir.pct-col, .dre .dre-tabela th.a-dir.pct-col { padding: 0 8px 0 4px; }
.dre .dre-tabela td.a-dir.prev, .dre .dre-tabela th.a-dir.prev { padding: 0 6px; }
.dre .dre-tabela td.pct-col { font-size: 11px; }
.dre .dre-tabela td.recuo { padding-left: 24px; }
.dre .dre-tabela tr.resultado td { font-size: 13px; }
.dre .dre-tabela tr:first-child th.mes { font-size: 11px; }
.dre .dre-tabela tr:first-child th.mes { padding: 0 2px; white-space: nowrap; letter-spacing: 0.02em; }

/* ---- Abrir a categoria: o que ela soma, com o dia do pagamento ---- */
.dre .dre-tabela tr.cat.abre { cursor: pointer; }
.dre .dre-tabela .seta-cat { display: inline-block; width: 14px; margin-left: -14px; color: #9aa5b1; font-size: 10px; }
.dre .dre-tabela tr.cat.abre:hover .seta-cat { color: var(--tinta); }
.dre .dre-tabela tr.det td { background: #fbfcfd; height: 30px; font-size: 11.5px; color: #4b5563; border-bottom: 1px solid #f0f2f5; }
.dre .dre-tabela tr.det td.esq { padding: 5px 8px 5px 38px; height: auto; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; overflow-wrap: anywhere; }
.dre .dre-tabela tr.det .det-nome { font-weight: 600; color: var(--tinta); }
.dre .dre-tabela tr.det .det-nome.sem { font-weight: 500; color: #4b5563; }
.dre .dre-tabela tr.det td.val, .dre .dre-tabela tr.det td.prev { font-weight: 500; }
.dre .dre-tabela tr.det td.det-aviso { position: static; padding-left: 38px; color: var(--suave); font-style: italic; }
.dre .dre-tabela tr.det td.det-aviso.erro { color: var(--neg); font-style: normal; }

/* ---- Guia "Sem categoria" do Mapeamento: titular por mês, com os lançamentos de cada um ao abrir ---- */
.dre .dre-semcat th.a-dir, .dre .dre-semcat td.a-dir { text-align: right; white-space: nowrap; }
.dre .dre-semcat tr.sc-linha { cursor: pointer; }
.dre .dre-semcat tr.sc-linha:hover td { background: var(--hover); }
.dre .dre-semcat .seta-cat { display: inline-block; width: 14px; color: #9aa5b1; font-size: 10px; }
.dre .dre-semcat td.esq b.sem { font-weight: 500; }
.dre .dre-semcat .sc-qtd { font-style: normal; font-size: 11px; font-weight: 600; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #eceff3; color: #5b6573; }
.dre .dre-semcat .sc-prev { display: block; font-size: 11px; color: #8a6d1f; }
.dre .dre-semcat td.tot { font-weight: 700; }
.dre .dre-semcat tr.sc-total td { background: #eceff3; font-weight: 700; }
.dre .dre-semcat tr.sc-det td { background: #fbfcfd; padding: 4px 12px 10px 30px; }
.dre .dre-semcat .sc-itens { display: flex; flex-direction: column; gap: 4px; }
.dre .dre-semcat .sc-item { display: grid; grid-template-columns: 124px 190px 1fr 120px 130px; gap: 12px; align-items: baseline; font-size: 12px; color: #4b5563; }
.dre .dre-semcat .sc-quando { white-space: nowrap; font-weight: 700; color: var(--tinta); font-variant-numeric: tabular-nums; }
.dre .dre-semcat .sc-quando.previsto { color: #8a6d1f; }
.dre .dre-semcat .sc-valor { text-align: right; font-weight: 600; }
.dre .dre-semcat .sc-acao, .dre .sc-ignorados .sc-acao { justify-self: end; border: 1px solid #d9dee5; border-radius: 8px; background: #fff; color: #4b5563; font: inherit; font-size: 11px; font-weight: 600; padding: 2px 10px; cursor: pointer; }
.dre .dre-semcat .sc-acao:hover, .dre .sc-ignorados .sc-acao:hover { border-color: var(--verde); color: var(--verde); }
.dre .sc-ignorados { margin-top: 14px; }
.dre .sc-ignorados-botao { border: none; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--suave); cursor: pointer; padding: 4px 2px; }
.dre .sc-ignorados-botao:hover { color: var(--tinta); }
.dre .sc-ignorados .sc-itens { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px; }
.dre .sc-ignorados .sc-item { display: grid; grid-template-columns: 124px 190px 1fr 120px 130px; gap: 12px; align-items: baseline; font-size: 12px; color: #6b7480; }
.dre .sc-ignorados .sc-quando { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.dre .sc-ignorados .sc-valor { text-align: right; font-weight: 600; }
