/* =============================================================================
 * legacy.css — identidade visual da Legacy Construtora (preto + dourado)
 * Carregado DEPOIS do styles.css: só troca cores, topo e marca.
 * ===========================================================================*/
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:wght@500;600&display=swap');

:root {
  --primary: #9b7a33;        /* dourado escuro: contraste bom com texto branco */
  --primary-dark: #7a5f25;
  --primary-soft: #f5efe0;
  --lg-preto: #1b1d1e;
  --lg-ouro: #d4b066;
}

/* topo preto com a marca dourada */
.topbar { background: var(--lg-preto); border-bottom: 1px solid #000; color: #eee; }
.topbar .nav-btn { color: #c9c9c9; }
.topbar .nav-btn:hover { background: rgba(212, 176, 102, .12); color: #fff; }
.topbar .nav-btn.active { background: rgba(212, 176, 102, .18); color: var(--lg-ouro); }
.topbar .user-nome { color: #fff; }
.topbar .user-papel { color: #a8a8a8; }
.topbar .btn-ghost { color: #ddd; border-color: #3a3c3e; background: transparent; }
.topbar .btn-ghost:hover { background: #2a2c2e; }
.topbar .busca-btn { background: #26282a; color: #ddd; border-color: #3a3c3e; }
.topbar .busca-btn kbd { background: #1b1d1e; color: #aaa; border-color: #3a3c3e; }

.brand-mark.lg-escudo { background: transparent !important; color: var(--lg-ouro); width: 30px; height: 34px; box-shadow: none; display: inline-flex; }
.brand-mark.lg-escudo svg { width: 100%; height: 100%; }
.brand-lg .brand-mark.lg-escudo { width: 46px; height: 52px; }
.brand-name { font-family: 'IBM Plex Serif', Georgia, serif; font-weight: 600; letter-spacing: .14em; display: inline-flex; flex-direction: column; line-height: 1; }
.brand-name small { font-family: Roboto, system-ui, sans-serif; font-size: 9px; letter-spacing: .32em; text-transform: uppercase; font-weight: 500; margin-top: 3px; opacity: .8; }
.topbar .brand-name { color: var(--lg-ouro); font-size: 19px; }
.brand-lg .brand-name { color: var(--lg-preto); font-size: 30px; }
.brand-lg .brand-name small { font-size: 11px; }

/* selo do modo demonstração */
.demo-selo { position: fixed; left: 12px; bottom: 12px; z-index: 9000; display: flex; align-items: center; gap: 8px; background: var(--lg-preto); color: var(--lg-ouro);
  border: 1px solid #3a3c3e; border-radius: 999px; padding: 5px 6px 5px 12px; font: 600 12px/1 Roboto, system-ui, sans-serif; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.demo-selo button { border: 0; border-radius: 999px; padding: 5px 10px; background: #2c2e30; color: #eee; font: inherit; cursor: pointer; }
.demo-selo button:hover { background: #3a3c3e; }
@media print { .demo-selo { display: none; } }

/* =============================================================================
 * FINANCEIRO (js/financeiro.js)
 * ===========================================================================*/
.fin-abas { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.fin-aba { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.fin-aba.on { background: var(--lg-preto); border-color: var(--lg-preto); color: var(--lg-ouro); font-weight: 600; }
.fin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.fin-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; font: inherit; color: var(--text); box-shadow: var(--shadow); }
.fin-card span { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.fin-card b { font-size: 21px; font-variant-numeric: tabular-nums; }
.fin-card small { font-size: 12px; color: var(--muted); }
.fin-card.saldo { border-top: 3px solid var(--lg-ouro); }
.fin-card.pagar b { color: #b3261e; }
.fin-card.receber b { color: #1b7f3b; }
.fin-card.alerta { border-color: #e7a2a0; background: #fff6f5; }
.fin-card.alerta b { color: #b3261e; }
.fin-grade2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; margin-bottom: 12px; }
.fin-bloco { padding: 12px 14px; }
.fin-bloco-tit { font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fin-graf { width: 100%; height: auto; display: block; }
.fin-graf-grade { stroke: var(--border); stroke-width: 1; }
.fin-graf-ent { fill: #2e7d4f; }
.fin-graf-sai { fill: #b3261e; }
.fin-graf-ent.prev { fill: #9fcdb1; }
.fin-graf-sai.prev { fill: #e7a2a0; }
.fin-graf-rot { font-size: 12px; fill: var(--muted); }
.fin-graf-rot.atual { fill: var(--text); font-weight: 700; }
.fin-leg { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.fin-leg span { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.fin-leg .ent { background: #2e7d4f; }
.fin-leg .sai { background: #b3261e; }
.fin-leg .prev { background: #ddd; }
.fin-mini { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.fin-mini td, .fin-mini th { padding: 6px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: left; }
.fin-mini th { font-size: 12px; color: var(--muted); font-weight: 600; }
.fin-mini tr.vencido td:first-child { color: #b3261e; font-weight: 700; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.pagar, .num.pagar { color: #b3261e; }
td.receber, .num.receber { color: #1b7f3b; }
.num.neg { color: #b3261e; }
.num.prev { opacity: .7; font-style: italic; }
.fin-barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.fin-espaco { flex: 1; }
.fin-filtros { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.fin-filtros .input { width: auto; min-width: 150px; }
.fin-filtros .fin-busca { flex: 1; min-width: 220px; }
.fin-per { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.fin-totais { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13.5px; padding: 8px 10px; background: var(--primary-soft); border-radius: 8px; margin-bottom: 8px; }
.fin-totais .pagar b { color: #b3261e; }
.fin-totais .receber b { color: #1b7f3b; }
.fin-tab-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.fin-tab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.fin-tab th { position: sticky; top: 0; background: #faf8f3; text-align: left; font-size: 12px; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.fin-tab td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.fin-tab tr:hover td { background: #fcfaf5; }
.fin-data { white-space: nowrap; }
.fin-l-vencido .fin-data { color: #b3261e; font-weight: 600; }
.fin-l-pago td { color: #5b5f6b; }
.fin-l-pago td b { color: var(--text); }
.fin-l-cancelado td { text-decoration: line-through; opacity: .55; }
.fin-acoes { white-space: nowrap; text-align: right; }
.fin-vazio-l { padding: 14px; }
.fin-vazio { padding: 18px; text-align: center; }
.fin-modal.modal-lg { max-width: 760px; }
.fin-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; }
.fin-form .fin-larga { grid-column: 1 / -1; }
.fin-tipo { grid-column: 1 / -1; display: flex; gap: 6px; margin-bottom: 6px; }
.fin-tipo button { flex: 1; border: 1px solid var(--border); background: var(--surface); padding: 9px; border-radius: 10px; font: inherit; cursor: pointer; }
.fin-tipo button.on { background: var(--lg-preto); color: var(--lg-ouro); border-color: var(--lg-preto); font-weight: 600; }
.fin-pago-info { background: #eef7f0; border: 1px solid #b9dcc4; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.fin-baixa-resumo { background: var(--primary-soft); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.modal-foot .fin-esq { margin-right: auto; }
.fin-upload { position: relative; overflow: hidden; cursor: pointer; }
.fin-conc-resumo { display: flex; gap: 10px; margin: 6px 0 10px; font-size: 13px; flex-wrap: wrap; }
.fin-conc-resumo span { padding: 4px 10px; border-radius: 999px; background: #f0f1f4; }
.fin-conc-resumo .pend { background: #fff4d6; }
.fin-conc-resumo .ok { background: #e6f4ea; }
.fin-conc-resumo .alerta { background: #fde8e7; }
.fin-conc { padding: 10px 12px; margin-bottom: 8px; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.4fr); gap: 12px; }
.fin-conc-ext { display: flex; flex-direction: column; gap: 2px; }
.fin-conc-ext .num { font-size: 17px; font-weight: 700; text-align: left !important; }
.fin-sug { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.fin-sug.melhor { background: #eef7f0; }
.fin-conc-acoes { display: flex; gap: 6px; margin-top: 6px; }
.fin-fx-saldo td { font-weight: 700; background: #faf8f3; }
.fin-fx-res td { font-weight: 600; border-top: 2px solid var(--border); }
.fin-fx-sep td { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-top: 14px; }
.fin-fluxo th.atual { color: var(--text); }
.fin-pv-pai td { font-weight: 700; background: #faf8f3; }
.fin-pv-filho td:first-child { padding-left: 24px; }
.fin-pv-in { width: 120px; text-align: right; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; font: inherit; background: transparent; }
.fin-pv-in:hover, .fin-pv-in:focus { border-color: var(--border); background: #fff; }
.fin-pv-barra { width: 120px; height: 8px; background: #eee; border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.fin-pv-barra span { display: block; height: 100%; background: #2e7d4f; }
.fin-pv-barra.quase span { background: #d08700; }
.fin-pv-barra.estouro span { background: #b3261e; }
.muted { color: var(--muted); }
.fin-cat-tit { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 12px 0 4px; letter-spacing: .05em; }
.fin-cat-pai { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.fin-cat-linha { display: flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: 13.5px; }
.fin-cat-filha { border-top: 1px dashed var(--border); padding-left: 22px; }
@media (max-width: 720px) {
  .fin-conc { grid-template-columns: 1fr; }
  .fin-form { grid-template-columns: 1fr 1fr; }
  .fin-grade2 { grid-template-columns: 1fr; }
}
.fin-barra select.input { width: auto; max-width: 360px; }

/* =============================================================================
 * PRESTAÇÃO DE CONTAS (js/prestacao.js)
 * ===========================================================================*/
.pc-barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pc-mes { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.pc-mes .input { width: auto; }
.pc-relatorio { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow); max-width: 1100px; }
.pc-cab { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid var(--lg-ouro); padding-bottom: 12px; margin-bottom: 16px; }
.pc-tit { font-family: 'IBM Plex Serif', Georgia, serif; font-size: 22px; font-weight: 600; color: var(--lg-preto); }
.pc-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.pc-emp { text-align: right; font-weight: 600; font-size: 13px; color: var(--lg-preto); }
.pc-emp span { font-weight: 400; color: var(--muted); font-size: 12px; }
.pc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.pc-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; background: #fcfbf8; }
.pc-card span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.pc-card b { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--lg-preto); }
.pc-card small { font-size: 11.5px; color: var(--muted); }
.pc-card.ok { border-top: 3px solid #2e7d4f; }
.pc-card.alerta { border-top: 3px solid #b3261e; }
.pc-card.receita b { color: #1b7f3b; }
.pc-sec { font-family: 'IBM Plex Serif', Georgia, serif; font-weight: 600; font-size: 15px; color: var(--lg-preto); margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.pc-curva { width: 100%; height: auto; display: block; }
.pc-grade { stroke: #eee; stroke-width: 1; }
.pc-hoje { stroke: var(--lg-ouro); stroke-width: 1.5; stroke-dasharray: 4 3; }
.pc-eixo { font-size: 11px; fill: var(--muted); }
.pc-eixo.atual { fill: var(--lg-preto); font-weight: 700; }
.pc-l-prev { fill: none; stroke: #9aa0ab; stroke-width: 2; stroke-dasharray: 6 4; }
.pc-l-real { fill: none; stroke: #9b7a33; stroke-width: 3; }
.pc-l-fin { fill: none; stroke: #1b1d1e; stroke-width: 2; }
.pc-ponto { fill: #9b7a33; stroke: #fff; stroke-width: 2; }
.pc-leg { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pc-leg span { width: 18px; height: 3px; display: inline-block; border-radius: 2px; }
.pc-leg .prev { background: #9aa0ab; } .pc-leg .real { background: #9b7a33; height: 4px; } .pc-leg .fin { background: #1b1d1e; }
.pc-tab { width: 100%; border-collapse: collapse; font-size: 13px; }
.pc-tab th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); background: #faf8f3; }
.pc-tab td { padding: 6px 8px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.pc-tab .pc-total td { font-weight: 700; border-top: 2px solid var(--border); background: #faf8f3; }
.pc-barrinha { display: inline-block; width: 60px; height: 6px; background: #eee; border-radius: 9px; overflow: hidden; margin-right: 6px; vertical-align: middle; }
.pc-barrinha i { display: block; height: 100%; background: #9b7a33; }
.pc-barrinha i.estouro { background: #b3261e; }
.pc-sit { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.pc-sit.ok { background: #e6f4ea; color: #1b5e20; } .pc-sit.atraso { background: #fde8e7; color: #b3261e; } .pc-sit.atencao { background: #fff4d6; color: #8a5a00; } .pc-sit.neutro { background: #f0f1f4; color: #666; }
.pc-grade2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pc-mini td { font-size: 12.5px; }
.pc-nota-in { width: 100%; }
.pc-nota { font-size: 13.5px; line-height: 1.5; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; min-height: 40px; }
.pc-impressao .pc-sec { break-after: avoid; }
.pc-impressao table { break-inside: auto; } .pc-impressao tr { break-inside: avoid; }
@media (max-width: 720px) { .pc-grade2 { grid-template-columns: 1fr; } .pc-relatorio { padding: 14px; } .pc-cab { flex-direction: column; } .pc-emp { text-align: left; } }
