/* ===== COMPONENTES COMPARTILHADOS (usados em várias telas; dependem das variáveis do style.css) ===== */
.page-head { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; margin-bottom:24px; }
.page-title { font-size:1.8rem; font-weight:800; margin:0 0 4px; letter-spacing:-.02em; }
.page-sub { color:var(--muted); margin:0; }
.acoes { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.acoes form { display:flex; gap:8px; }
.ano-input { width:96px; }
.btn-brand { background:var(--brand); border:0; color:#fff; font-weight:700; padding:11px 18px; display:inline-flex; align-items:center; gap:8px; }
.btn-brand:hover { filter:brightness(1.08); color:#fff; }
.btn-suave { background:var(--surface); border:1px solid var(--line); color:var(--text); font-weight:600; }
.btn-suave:hover { background:var(--surface-2); color:var(--text); }
.painel, .kpi, .investimento-card { background:var(--surface); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); color:var(--text); }
.painel { padding:22px 24px; height:100%; }
.painel-topo { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; }
.painel-titulo { font-size:1.05rem; font-weight:800; margin:0; display:flex; align-items:center; gap:10px; }
.painel-titulo i { color:var(--brand-ink); }
.link-suave { background:none; border:0; color:var(--brand-ink); font-weight:700; font-size:.88rem; padding:4px 0; }
.vazio { color:var(--muted); font-size:.92rem; padding:18px; text-align:center; background:var(--surface-2); border-radius:14px; }
.kpi { padding:22px 24px; height:100%; display:flex; flex-direction:column; justify-content:space-between; gap:10px; }
.kpi-label { color:var(--muted); font-size:.88rem; font-weight:600; margin:0; display:flex; align-items:center; gap:8px; }
.kpi-valor { font-size:1.8rem; font-weight:800; line-height:1.1; margin:0; letter-spacing:-.02em; }
.kpi-nota { color:var(--muted); font-size:.85rem; }
.kpi-hero { background:var(--hero); border:0; color:#fff; position:relative; overflow:hidden; }
.kpi-hero::after { content:""; position:absolute; right:-60px; top:-60px; width:220px; height:220px; border-radius:50%; background:rgba(255,255,255,.08); }
.kpi-hero .kpi-label, .kpi-hero .kpi-nota { color:rgba(255,255,255,.82); }
.kpi-hero .kpi-valor { font-size:2.8rem; color:#fff; }
.meta-track { height:8px; border-radius:999px; background:rgba(255,255,255,.25); overflow:hidden; }
.meta-fill { height:100%; border-radius:999px; background:#fff; transition:width .4s ease; }
.barra { height:8px; border-radius:999px; background:var(--surface-2); overflow:hidden; }
.barra > span { display:block; height:100%; border-radius:999px; background:var(--brand); }
.barra .ok { background:var(--ganho); }
.barra .atencao { background:var(--alerta); }
.barra .estourou { background:var(--gasto); }
.chip { display:inline-block; font-size:.76rem; font-weight:700; padding:2px 10px; border-radius:999px; background:var(--brand-soft); color:var(--brand-ink); }
.chip.atrasada { background:color-mix(in srgb, var(--gasto) 14%, transparent); color:var(--gasto); }
.chip.hoje { background:color-mix(in srgb, var(--alerta) 16%, transparent); color:var(--alerta); }
.alerta-box { border-radius:14px; padding:14px 16px; border:1px solid transparent; }
.alerta-danger { background:color-mix(in srgb, var(--gasto) 10%, transparent); border-color:color-mix(in srgb, var(--gasto) 28%, transparent); color:var(--gasto); }
.alerta-success { background:color-mix(in srgb, var(--ganho) 10%, transparent); border-color:color-mix(in srgb, var(--ganho) 28%, transparent); color:var(--ganho); }
.chart-box { position:relative; height:260px; }
.section-title { font-size:1.05rem; font-weight:800; margin:0; display:flex; align-items:center; gap:10px; }
.section-title i { color:var(--brand-ink); }
.label-dashboard { color:var(--muted); font-weight:600; }
.modal-dashboard { border-radius:18px; }
@media (max-width:576px) {
  .page-title { font-size:1.5rem; }
  .kpi-hero .kpi-valor { font-size:2.2rem; }
  .kpi-valor { font-size:1.55rem; }
  .painel { padding:18px; }
}

.campo-ajuda { color:var(--muted); font-size:.8rem; }
.btn-brand:disabled { opacity:.65; }

/* lançamentos / categorias (Dashboard e Extrato) */
.lanc-item { display:flex; align-items:center; gap:14px; padding:11px 0; border-bottom:1px solid var(--line); }
.lanc-item:last-child { border-bottom:0; }
.lanc-ico { width:40px; height:40px; border-radius:12px; display:grid; place-items:center; font-weight:800; flex-shrink:0; background:var(--surface-2); color:var(--brand-ink); }
.lanc-ico.entrada { background:color-mix(in srgb, var(--ganho) 14%, transparent); color:var(--ganho); }
.lanc-ico.saida { background:color-mix(in srgb, var(--gasto) 12%, transparent); color:var(--gasto); }
.lanc-desc { flex:1; min-width:0; }
.lanc-desc strong { display:block; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lanc-desc small { color:var(--muted); }
.lanc-valor { font-weight:800; white-space:nowrap; }
.cat-linha, .orc-item { margin-bottom:16px; }
.cat-linha:last-child, .orc-item:last-child { margin-bottom:0; }
.cat-cabeca { display:flex; justify-content:space-between; gap:10px; margin-bottom:6px; font-weight:600; }
.cat-cabeca small { color:var(--muted); font-weight:500; }

/* linhas de resumo e foto (Diário e Extrato) */
.mini-linha { display:flex; justify-content:space-between; gap:12px; padding:9px 0; border-bottom:1px solid var(--line); font-size:.92rem; }
.mini-linha:last-child { border-bottom:0; }
.mini-linha span:first-child { color:var(--muted); }
.mini-linha strong { text-align:right; }
.foto-linha { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:8px; }

/* ---------- Página de erro (404/500) ---------- */
.erro-pagina { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px 16px; background:var(--bg, transparent); }
.erro-card { width:100%; max-width:440px; text-align:center; }
.erro-card .erro-logo { width:64px; height:64px; object-fit:contain; margin-bottom:14px; }
.erro-card .erro-codigo { display:inline-block; font-weight:800; font-size:.8rem; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); background:var(--surface-2, rgba(0,0,0,.05)); border-radius:999px; padding:4px 12px; margin-bottom:12px; }
.erro-card h1 { font-size:1.7rem; font-weight:800; letter-spacing:-.02em; margin:0 0 8px; }
.erro-card p { color:var(--muted); margin:0 0 24px; }
.erro-acoes { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.erro-acoes .btn { min-width:160px; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
