/* ---------- Menu unificado ---------- */
.top nav a.on { background: rgba(255,255,255,.24); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 3px; border-radius: 999px;
  background: #fff; color: #C4155F; font-size: .72rem; font-weight: 800; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(255,255,255,.35); } }
@media (prefers-reduced-motion: reduce) { .badge { animation: none; } }

/* ---------- Financeiro ---------- */
:root { --pos: #13804A; --pos-bg: #E6F6EC; --neg: #C0263A; --neg-bg: #FDE8EA; --amber: #B26A00; --amber-bg: #FFF4D6; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.fin-tabs { margin-bottom: 16px; align-items: center; }
.fin-tabs .add-btn { margin-left: auto; background: var(--magenta); color: #fff; border-color: var(--magenta); }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: .78rem; color: var(--muted); font-weight: 700; }
.kpi b { font-size: 1.35rem; color: var(--plum); font-variant-numeric: tabular-nums; }
.kpi.pos b { color: var(--pos); } .kpi.neg b { color: var(--neg); }
.kpi.warn { background: var(--amber-bg); } .kpi.warn b { color: var(--amber); }
.kpi.big.pos { background: var(--pos-bg); border-color: #bfe5cd; } .kpi.big.neg { background: var(--neg-bg); border-color: #f3c3c9; }
.kpi small { font-size: .75rem; font-weight: 700; color: var(--muted); }

.alert-block { margin-bottom: 18px; }
.alert-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.alert-head h2 { margin: 0; } .alert-head h2 small { color: var(--muted); font-weight: 600; }
.empty-ok { background: var(--pos-bg); border-color: #bfe5cd; color: #1E5A30; margin-bottom: 18px; }

.fin-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.fin-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-left: 5px solid #d8c6cf; border-radius: 12px; padding: 8px 12px 8px 10px; }
.fin-row.st-vencido { border-left-color: var(--neg); background: #fffafa; }
.fin-row.st-hoje { border-left-color: #F07B1D; }
.fin-row.st-breve { border-left-color: #F2B705; }
.fin-row.st-pago { border-left-color: var(--pos); opacity: .82; }
.fin-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); }
.fin-date { width: 48px; flex: none; text-align: center; line-height: 1.1; }
.fin-date b { display: block; color: var(--plum); font-size: .95rem; } .fin-date small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.fin-desc { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fin-desc b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-desc small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-desc .inst { color: var(--magenta); font-size: .75rem; font-weight: 700; }
.fin-desc .kind { font-weight: 700; color: var(--plum); }
.fin-val { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.fin-val b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill-st { font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #f3ece9; color: var(--muted); white-space: nowrap; }
.st-vencido .pill-st { background: var(--neg-bg); color: var(--neg); }
.st-hoje .pill-st { background: #FFE6D2; color: #A34B00; }
.st-breve .pill-st { background: var(--amber-bg); color: var(--amber); }
.st-pago .pill-st { background: var(--pos-bg); color: var(--pos); }
.btn.pay { padding: 7px 12px; font-size: .85rem; white-space: nowrap; border-color: #bfe5cd; color: var(--pos); }
.btn.pay:hover { background: var(--pos-bg); border-color: var(--pos); }
.btn.ghost { background: transparent; padding: 6px 10px; }
.small-btn { padding: 6px 10px; font-size: .82rem; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.quick-card { border-radius: var(--radius); padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 3px; border: 1px dashed; }
.quick-card b { font-size: 1.05rem; } .quick-card small { color: var(--muted); }
.q-pagar { border-color: #f0b7bf; color: var(--neg); background: #fff7f8; }
.q-receber { border-color: #a9dcbc; color: var(--pos); background: #f5fcf7; }

.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav b { min-width: 150px; text-align: center; color: var(--plum); font-size: 1.05rem; }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.filters .tabs { margin: 0; }
.filter-form { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-form select { width: auto; } .filter-form input { width: 240px; }

.fin-form { max-width: 680px; }
.fin-form .seg label { position: relative; min-width: 0; }
.fin-form .seg input { width: 1px; height: 1px; }
.fin-form .seg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kind-seg label:nth-child(1) input:checked + span { background: var(--neg); color: #fff; }
.kind-seg label:nth-child(2) input:checked + span { background: var(--pos); color: #fff; }
.repeat { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; display: grid; gap: 10px; margin: 0; }
.repeat legend { font-weight: 700; color: var(--plum); font-size: .9rem; padding: 0 4px; }
.repeat .seg label input:checked + span { background: var(--plum); color: #fff; }
.danger-zone { display: flex; gap: 8px; margin-top: 14px; max-width: 680px; justify-content: flex-end; }
.danger-zone select { width: auto; }
.fin-dlg { border: 0; border-radius: 18px; padding: 0; width: min(460px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(40,10,25,.28); }
.fin-dlg::backdrop { background: rgba(30,10,20,.35); }
.fin-dlg form { display: grid; gap: 12px; padding: 16px 18px 18px; }
.fin-dlg label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--plum); }

.real-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.real { border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 4px; color: #fff; }
.real span { font-weight: 700; font-size: .85rem; opacity: .92; }
.real b { font-size: 1.75rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.real small { font-size: .78rem; opacity: .9; }
.real .delta { width: fit-content; background: rgba(255,255,255,.9); padding: 1px 8px; border-radius: 999px; font-weight: 700; margin-top: 4px; opacity: 1; }
.real .delta.pos { color: var(--pos); } .real .delta.neg { color: var(--neg); }
.r-desp { background: linear-gradient(150deg, #4A1030, #6B3350); }
.r-pago { background: linear-gradient(150deg, #C0263A, #E2475A); }
.r-rec { background: linear-gradient(150deg, #13804A, #2BA866); }
.r-bal.pos { background: linear-gradient(150deg, #0E6B3D, #13804A 55%, #8FBF3C 130%); box-shadow: 0 6px 18px rgba(19,128,74,.25); }
.r-bal.neg { background: linear-gradient(150deg, #8A1426, #C0263A); box-shadow: 0 6px 18px rgba(192,38,58,.25); }
.r-bal .verdict { font-size: .95rem; font-weight: 800; opacity: 1; }
.forecast-line { margin-bottom: 14px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.split h2 { margin-top: 0; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1.5fr) 2fr auto 38px; gap: 8px; align-items: center; margin: 7px 0; font-size: .86rem; }
.bar-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row small { color: var(--muted); text-align: right; }
.bar { height: 10px; background: #f3ece9; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.bar i.pos { background: var(--pos); } .bar i.neg { background: var(--neg); }
.moves summary { cursor: pointer; } .moves .fin-list { margin-top: 12px; }

.late-note { background: var(--amber-bg); border-color: #f1d999; margin-bottom: 14px; }
.chart { margin-bottom: 14px; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.pos { background: var(--pos); } .legend i.neg { background: var(--neg); } .legend i.acc { background: var(--gold); }
.cols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; align-items: end; }
.col { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--ink); border-radius: 10px; padding: 4px 2px; }
.col:hover { background: #fdf1ec; }
.pair { height: 170px; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.pair i { width: min(26px, 38%); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.pair i.pos { background: var(--pos); } .pair i.neg { background: var(--neg); }
.col b { font-size: .74rem; white-space: nowrap; } .col small { color: var(--muted); font-weight: 700; font-size: .75rem; text-transform: capitalize; }
.table-wrap { overflow-x: auto; padding: 0; margin-bottom: 8px; }
.fin-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fin-table th { text-align: left; background: var(--plum); color: #fff; font-size: .8rem; padding: 10px 12px; }
.fin-table td { padding: 9px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.fin-table th:not(:first-child), .fin-table td:not(:first-child) { text-align: right; }

.cat-list { display: grid; gap: 6px; margin-bottom: 12px; }
.cat { display: flex; align-items: center; gap: 8px; }
.cat .inline-form { margin: 0; flex: 1; } .cat .inline-form input { width: 100%; }
.cat.off input { color: var(--muted); text-decoration: line-through; }
.fin-tag { background: #EFE7FF !important; color: #4b2a85 !important; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi.big { grid-column: 1 / -1; }
  .real-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpis.three, .real-grid, .quick { grid-template-columns: 1fr; }
  .real b { font-size: 1.5rem; }
  .fin-row { flex-wrap: wrap; }
  .fin-row .btn.pay { width: 100%; }
  .fin-date { width: 40px; }
  .filter-form input { width: 100%; }
  .fin-tabs .add-btn { margin-left: 0; }
  .month-nav b { min-width: 0; }
  .pair { height: 120px; }
  .col b { font-size: .62rem; }
}
