/* Pulso — tema escuro com vermelho neon */
:root {
  --bg: #07070a;
  --surface: #0e0e13;
  --surface2: #15151c;
  --border: #23232c;
  --ink: #f5f5f7;
  --ink2: #a1a1aa;
  --ink3: #6b6b76;
  --red: #ef4444;
  --red-strong: #dc2626;
  --red-soft: rgba(239, 68, 68, 0.12);
  --red-glow: rgba(239, 68, 68, 0.35);
  --green: #22c55e;
  --amber: #f59e0b;
  --radius: 14px;
  --mono: 'Consolas', 'Cascadia Mono', ui-monospace, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
/* o atributo hidden sempre esconde, mesmo em elementos com display de classe (.btn, .trial-banner, etc.) */
[hidden] { display: none !important; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; overflow: hidden; position: relative; }
.login-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 300px at 50% 110%, rgba(239,68,68,.18), transparent 70%),
    radial-gradient(400px 200px at 85% 0%, rgba(239,68,68,.08), transparent 70%);
}
.login-card {
  position: relative; width: min(360px, 92vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 36px 32px 32px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 0 60px rgba(239,68,68,.10), 0 20px 60px rgba(0,0,0,.6);
}
.logo { display: flex; align-items: center; gap: 10px; justify-content: center; }
.logo h1 { font-size: 26px; letter-spacing: 8px; font-weight: 700; }
.logo-pulse {
  width: 12px; height: 12px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 12px var(--red-glow); animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .6; } }
.login-sub { text-align: center; color: var(--ink3); letter-spacing: 3px; font-size: 11px; text-transform: uppercase; margin-top: -10px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink2); }
.login-error { color: var(--red); font-size: 13px; text-align: center; }

/* ---------- inputs / botões ---------- */
input, select {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--ink); padding: 10px 12px; font-size: 14px; outline: none; width: 100%;
}
input:focus, select:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
input[type="checkbox"] { width: auto; accent-color: var(--red); }
.btn {
  border: 1px solid var(--border); background: var(--surface2); color: var(--ink);
  border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 600;
  transition: all .15s ease; display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { border-color: var(--ink3); }
.btn-red { background: var(--red-strong); border-color: var(--red-strong); color: #fff; }
.btn-red:hover { background: var(--red); border-color: var(--red); box-shadow: 0 0 18px var(--red-glow); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: var(--red-soft); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { justify-content: flex-start; padding: 0 10px 18px; }
.sidebar .logo h1 { font-size: 18px; letter-spacing: 5px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: none; border: none; color: var(--ink2); font-size: 13.5px; font-weight: 500;
  text-align: left; width: 100%;
}
.nav-btn:hover { color: var(--ink); background: var(--surface2); }
.nav-btn.active { color: #fff; background: var(--red-soft); box-shadow: inset 2px 0 0 var(--red); }
.nav-btn .ico { width: 18px; text-align: center; color: var(--red); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--red-soft); color: var(--red);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 1px solid rgba(239,68,68,.3);
}
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { font-size: 11px; color: var(--ink3); }

.main { padding: 22px 26px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h2 { font-size: 19px; font-weight: 700; margin-right: auto; }
.month-nav { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.month-nav button { background: none; border: none; color: var(--ink2); font-size: 15px; padding: 5px 10px; border-radius: 7px; }
.month-nav button:hover { color: var(--ink); background: var(--surface2); }
.month-nav .label { font-weight: 600; font-size: 13.5px; min-width: 128px; text-align: center; text-transform: capitalize; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; position: relative; overflow: hidden;
}
.kpi::before { content: ''; position: absolute; top: 0; left: 16px; right: 16px; height: 2px; border-radius: 2px; background: var(--border); }
.kpi.hot::before { background: var(--red); box-shadow: 0 0 10px var(--red-glow); }
.kpi .k-label { font-size: 11px; color: var(--ink3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 7px; }
.kpi .k-value { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 11px; color: var(--ink3); margin-top: 4px; }
.k-value.neg { color: var(--red); }
.k-value.pos { color: var(--green); }

/* ---------- grid de painéis ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; min-width: 0;
}
.panel h3 { font-size: 12px; color: var(--ink2); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel h3::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--red); box-shadow: 0 0 8px var(--red-glow); }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
@media (max-width: 1100px) { .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar .logo { padding: 0 10px; }
  .nav-btn { width: auto; }
  .sidebar-foot { margin: 0 0 0 auto; border: none; padding: 0; }
}
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 280px; }

/* ranking de categorias */
.rank { display: flex; flex-direction: column; gap: 11px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.rank::-webkit-scrollbar { width: 5px; }
.rank::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.rank-row { display: grid; grid-template-columns: 110px 1fr 84px; align-items: center; gap: 10px; font-size: 12.5px; }
.rank-row .r-name { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .r-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.r-bar { height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.r-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--red-strong), var(--red)); box-shadow: 0 0 8px var(--red-glow); }
.r-bar i.pos { background: linear-gradient(90deg, #15803d, var(--green)); box-shadow: 0 0 8px rgba(34, 197, 94, 0.3); }

/* heatmap calendário */
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat .h-dow { font-size: 10px; color: var(--ink3); text-align: center; text-transform: uppercase; }
.heat .h-cell {
  aspect-ratio: 1.4; border-radius: 5px; background: var(--surface2); border: 1px solid transparent;
  display: grid; place-items: center; font-size: 10px; color: var(--ink3); position: relative; cursor: default;
}
.heat .h-cell[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #000; border: 1px solid var(--border); color: var(--ink); padding: 5px 9px; border-radius: 7px;
  font-size: 11px; white-space: nowrap; z-index: 30; box-shadow: 0 8px 20px rgba(0,0,0,.5);
}
.heat .h-empty { background: transparent; }

/* cartões */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.ccard {
  border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px;
  background: linear-gradient(135deg, var(--surface2), var(--surface));
}
.ccard .c-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ccard .c-top b { font-size: 13.5px; }
.ccard .c-top .c-inv { font-weight: 700; font-variant-numeric: tabular-nums; }
.ccard .c-meta { font-size: 11px; color: var(--ink3); margin-bottom: 8px; }
.limit-bar { height: 6px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden; }
.limit-bar i { display: block; height: 100%; background: var(--red); border-radius: 3px; }
.limit-bar i.warn { background: var(--amber); }

/* ---------- tabela ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--ink3); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.04); white-space: nowrap; }
tr:hover td { background: rgba(255,255,255,.02); }
td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
th.num { text-align: right; }
td .muted { color: var(--ink3); font-size: 11.5px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.chip-paid { background: rgba(34,197,94,.12); color: var(--green); }
.chip-pend { background: rgba(245,158,11,.12); color: var(--amber); }
.chip-renda { background: rgba(34,197,94,.12); color: var(--green); }
.chip-card { background: var(--red-soft); color: var(--red); }
.chip-cat { background: var(--surface2); color: var(--ink2); }
.chip-off { background: var(--surface2); color: var(--ink3); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { background: none; border: 1px solid transparent; color: var(--ink3); border-radius: 7px; padding: 4px 7px; font-size: 13px; }
.icon-btn:hover { color: var(--ink); border-color: var(--border); background: var(--surface2); }
.icon-btn.danger:hover { color: var(--red); border-color: rgba(239,68,68,.4); }

/* filtros */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select { width: auto; padding: 7px 10px; font-size: 12.5px; }

/* filtro múltiplo de categorias */
.mfilter { position: relative; }
.mfilter-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 70;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; display: none; flex-direction: column; gap: 4px;
  min-width: 220px; max-height: 320px; overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}
.mfilter-panel.open { display: flex; }
.mf-row {
  display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink2);
  padding: 6px 8px; border-radius: 8px; cursor: pointer;
}
.mf-row:hover { background: var(--surface2); color: var(--ink); }
.mf-row input { width: auto; accent-color: var(--red); }
.mf-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mf-actions { display: flex; gap: 6px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.mf-actions .btn { flex: 1; }

/* resumo dos limites no topo da aba cartões */
.cards-summary { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.sum-tag {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 13px;
}
.sum-tag .s-label { font-size: 10px; color: var(--ink3); text-transform: uppercase; letter-spacing: .8px; }
.sum-tag .s-value { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-tag.used .s-value { color: var(--amber); }
.sum-tag.free .s-value { color: var(--green); }

/* ---------- modais ---------- */
dialog {
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 16px;
  padding: 0; width: min(440px, 94vw); box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 40px rgba(239,68,68,.06);
}
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.dlg-head h3 { font-size: 16px; }
.dlg-body { padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 13px; }
.dlg-body label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink2); }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: none; background: none; color: var(--ink2); padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.seg button.active { background: var(--red-strong); color: #fff; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); flex-direction: row !important; }
.invoice-hint {
  font-size: 12px; color: var(--ink2); margin-top: 8px;
  background: var(--red-soft); border: 1px solid rgba(239,68,68,.25);
  border-radius: 9px; padding: 8px 11px; line-height: 1.5;
}
.invoice-hint b { color: var(--red); }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 22px 22px; }
.form-error { color: var(--red); font-size: 12.5px; }

/* seção BI */
.bi-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.bi-hero select { width: 110px; }
.empty { color: var(--ink3); font-size: 13px; text-align: center; padding: 26px 10px; }

/* arrastar cartões */
.drag-handle {
  cursor: grab; touch-action: none; user-select: none;
  color: var(--ink3); font-size: 15px; padding: 2px 8px 2px 2px;
  margin-right: 2px; border-radius: 6px;
}
.drag-handle:hover { color: var(--red); background: var(--surface2); }
#cardGrid .panel { will-change: transform; }
#cardGrid .panel.dragging {
  transition: none !important; z-index: 50; position: relative;
  box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 24px var(--red-glow);
  border-color: var(--red); opacity: .95; cursor: grabbing;
}
#recTable tr { will-change: transform; }
#recTable tr.dragging {
  transition: none !important; position: relative; z-index: 50; cursor: grabbing;
}
#recTable tr.dragging td {
  background: var(--red-soft);
  border-top: 1px solid rgba(239, 68, 68, 0.4);
  border-bottom: 1px solid rgba(239, 68, 68, 0.4);
}

/* botão atualizar girando */
@keyframes spin { to { transform: rotate(360deg); } }
#refreshIco { display: inline-block; }
#refreshIco.spinning { animation: spin .7s linear infinite; }

/* banner de teste grátis */
.trial-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(239,68,68,.14), rgba(239,68,68,.05));
  border: 1px solid rgba(239,68,68,.35); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 16px; font-size: 13px;
}
.trial-banner b { color: var(--red); }

/* paywall / planos */
.paywall {
  position: fixed; inset: 0; z-index: 90; overflow-y: auto;
  background: var(--bg);
  padding: 40px 20px 60px;
}
.paywall::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(700px 340px at 50% 0%, rgba(239,68,68,.14), transparent 70%);
}
.paywall-inner { position: relative; max-width: 900px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; gap: 18px; }
.paywall-inner h2 { font-size: clamp(22px, 4vw, 32px); }
.paywall-sub { color: var(--ink2); font-size: 14.5px; max-width: 520px; margin: 0 auto; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 10px 0; }
.plan-grid.single { grid-template-columns: minmax(260px, 380px); justify-content: center; }
.plan-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px 20px; text-align: left; display: flex; flex-direction: column; gap: 12px; position: relative;
}
.plan-card.popular { border-color: var(--red); box-shadow: 0 0 30px rgba(239,68,68,.12); }
.plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--red-strong); color: #fff; font-size: 10.5px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.plan-card h4 { font-size: 16px; }
.plan-price { font-size: 28px; font-weight: 800; }
.plan-price small { font-size: 12px; color: var(--ink3); font-weight: 500; }
.plan-card ul { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--ink2); flex: 1; }
.plan-card ul li::before { content: '✓  '; color: var(--red); font-weight: 700; }
.plan-card.current { border-color: var(--green); }
.plan-card .chip { align-self: flex-start; }
.plan-note { font-size: 12px; color: var(--ink2); margin-top: -4px; }
.plan-note b { color: var(--red); }
.paywall-foot { color: var(--ink3); font-size: 12.5px; }

/* orçamentos do mês (dashboard) */
.bud-list { display: flex; flex-direction: column; gap: 11px; }
.bud-row { display: grid; grid-template-columns: minmax(110px, 170px) 1fr auto; align-items: center; gap: 12px; font-size: 12.5px; }
.bud-name { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 7px; }
.bud-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.bud-bar { height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.bud-bar i { display: block; height: 100%; border-radius: 4px; }
.bud-bar i.ok { background: linear-gradient(90deg, #15803d, var(--green)); }
.bud-bar i.warn { background: linear-gradient(90deg, #b45309, var(--amber)); }
.bud-bar i.over { background: linear-gradient(90deg, var(--red-strong), var(--red)); box-shadow: 0 0 8px var(--red-glow); }
.bud-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bud-pct.ok { color: var(--green); }
.bud-pct.warn { color: var(--amber); }
.bud-pct.over { color: var(--red); }

/* categorias na config: chip + orçamento por categoria de despesa */
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cat-bud { display: inline-flex; align-items: center; gap: 7px; }
.cat-bud small { color: var(--ink3); font-size: 11px; }
.bud-input { width: 110px; padding: 6px 9px; font-size: 12.5px; }

/* modal de importação de extrato */
dialog.dlg-wide { width: min(780px, 96vw); }
.imp-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.imp-controls select { width: auto; padding: 6px 9px; font-size: 12.5px; }
.imp-tbl { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
#impTable select { width: auto; padding: 4px 7px; font-size: 12px; }
#impTable .imp-desc { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

/* olhinho de privacidade: esconde os valores monetários com blur */
body.money-hidden .mny { filter: blur(7px); user-select: none; }
#btnHideMoney span { display: inline-flex; }
#btnHideMoney svg { display: block; }

/* chip de casa vencida (admin) */
.chip-late { background: var(--red-soft); color: var(--red); }

/* mapa múndi de assinantes (admin) */
.map-wrap { position: relative; }
.map-wrap canvas { display: block; width: 100%; }
.map-tip {
  position: absolute; z-index: 40; pointer-events: none;
  transform: translate(-50%, -130%);
  background: #000; border: 1px solid var(--border); border-left: 3px solid var(--red);
  color: var(--ink); padding: 7px 11px; border-radius: 9px; font-size: 12px;
  white-space: nowrap; box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.map-tip b { display: block; font-size: 12.5px; }
.map-tip span { color: var(--ink3); font-size: 11px; }

/* banner de supervisão parental (responsável vendo a casa do filho) */
.supervise-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  position: sticky; top: 10px; z-index: 60;
  background: linear-gradient(90deg, rgba(239,68,68,.20), rgba(239,68,68,.08));
  backdrop-filter: blur(6px);
  border: 1px solid rgba(239,68,68,.45); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 16px; font-size: 13px;
}
.supervise-banner b { color: var(--red); }

/* linha de casa supervisionada na Config */
.guard-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: 13px;
}
.guard-row b { color: var(--red); }

/* modo somente leitura: esconde tudo que escreve na casa supervisionada */
body.readonly .nav-btn[data-view="bi"],
body.readonly #btnImport,
body.readonly #btnNewTx,
body.readonly #btnNewCard,
body.readonly #btnNewRec,
body.readonly #btnNewInv,
body.readonly #btnNewMeta,
body.readonly #btnNewConsorcio,
body.readonly #btnNewAsset,
body.readonly #btnAhNewValue,
body.readonly #btnHistContribute,
body.readonly .drag-handle,
body.readonly .row-actions,
body.readonly [data-action],
body.readonly #view-config .panel:not(#panelGuardian) { display: none !important; }

/* ---------- Metas ---------- */
.goal-card { position: relative; display: flex; flex-direction: column; gap: 11px; overflow: hidden; }
.goal-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--goal-color, var(--red)); opacity: .8; }
.goal-top { display: flex; align-items: center; gap: 8px; }
.goal-emoji { font-size: 25px; line-height: 1; }
.goal-name { font-size: 15px; font-weight: 700; color: var(--ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-top .row-actions { flex: 0 0 auto; }
.goal-ring-wrap { position: relative; width: 150px; height: 150px; margin: 2px auto; }
.goal-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.goal-ring .ring-track { fill: none; stroke: var(--border); stroke-width: 10; }
.goal-ring .ring-fill { fill: none; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 326.726; filter: drop-shadow(0 0 6px var(--red-glow)); }
.goal-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 31px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.goal-pct small { font-size: 14px; font-weight: 600; color: var(--ink3); margin-left: 2px; }
.goal-amounts { text-align: center; font-size: 13px; color: var(--ink2); }
.goal-amounts b { color: var(--ink); font-size: 15.5px; font-variant-numeric: tabular-nums; }
.goal-remaining { text-align: center; font-size: 12px; color: var(--ink3); }
.goal-meta-row { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.goal-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--surface2); color: var(--ink2); }
.goal-hint { font-size: 11.5px; color: var(--ink3); text-align: center; line-height: 1.45; }
.goal-hint.vencido { color: var(--amber); font-weight: 600; }
.goal-badge { display: inline-flex; align-items: center; gap: 6px; align-self: center; padding: 5px 13px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #fcd34d; background: linear-gradient(90deg, rgba(251,191,36,.18), rgba(245,158,11,.10)); border: 1px solid rgba(245,158,11,.45); }
.goal-card.goal-done { border-color: rgba(245,158,11,.5); box-shadow: 0 0 26px rgba(245,158,11,.10); }
.goal-card.goal-done::after { background: linear-gradient(90deg, #fcd34d, #f59e0b); opacity: 1; }
.goal-card.goal-done .ring-fill { filter: drop-shadow(0 0 7px rgba(245,158,11,.5)); }
.goal-save-btn { width: 100%; margin-top: auto; }
.goal-card { cursor: pointer; }
.goal-card .row-actions .icon-btn, .goal-card .drag-handle, .goal-save-btn { cursor: pointer; }
/* empty state */
.goal-empty { text-align: center; padding: 34px 18px; }
.goal-empty h2 { font-size: 20px; margin-bottom: 6px; }
.goal-empty p { color: var(--ink2); font-size: 13.5px; margin-bottom: 18px; }
.goal-empty .goal-examples { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Consórcios (reaproveitam .goal-card / .goal-ring) ---------- */
.cons-card .cons-title { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
.cons-card .cons-title .goal-name { flex: none; max-width: 100%; }
.cons-sub { font-size: 11.5px; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cons-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.goal-badge.cons-badge-quit { color: #4ade80; background: linear-gradient(90deg, rgba(74,222,128,.18), rgba(22,163,74,.10)); border-color: rgba(74,222,128,.45); }
.cons-split { display: flex; justify-content: center; gap: 16px; font-size: 12px; color: var(--ink3); }
.cons-split b { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 3px; }
.cons-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cons-actions { display: flex; gap: 8px; margin-top: auto; }
.cons-actions .btn { flex: 1; cursor: pointer; }
.cons-contbtn.on { color: #fcd34d; border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.08); }
.cons-card.cons-cont::after { background: linear-gradient(90deg, #fcd34d, #f59e0b); opacity: 1; }
.cons-card.cons-cont .ring-fill { filter: drop-shadow(0 0 7px rgba(245,158,11,.45)); }
.cons-card.cons-quit { border-color: rgba(74,222,128,.4); box-shadow: 0 0 24px rgba(34,197,94,.08); }
.cons-card.cons-quit::after { background: linear-gradient(90deg, #4ade80, #16a34a); opacity: 1; }
.cons-card.cons-quit .ring-fill { filter: drop-shadow(0 0 7px rgba(74,222,128,.5)); }

/* seletor de emoji + cores (modal) */
.dlg-sublabel { font-size: 12px; color: var(--ink2); display: block; margin-bottom: 8px; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.emoji-opt { width: 38px; height: 38px; font-size: 19px; border: 1px solid var(--border); background: var(--surface2); color: var(--ink); border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.emoji-opt:hover { border-color: var(--ink3); }
.emoji-opt.active { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 10px var(--red-glow); }
.emoji-input { width: 70px; height: 38px; text-align: center; font-size: 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg), 0 0 10px rgba(255,255,255,.22); transform: scale(1.12); }
/* mini card no modal de aporte */
.goal-mini { display: flex; align-items: center; gap: 11px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; }
.goal-mini .gm-emoji { font-size: 24px; }
.goal-mini .gm-name { font-weight: 700; }
.goal-mini .gm-sub { font-size: 12px; color: var(--ink3); }
/* histórico de aportes */
.hist-summary { font-size: 13px; color: var(--ink2); margin-bottom: 10px; }
.hist-summary b { color: var(--ink); }
#histTable td { padding: 8px 8px; }
/* comemoração */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 2000; }

/* ---------- Patrimônio ---------- */
.pat-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; margin-bottom: 16px; }
.pat-net {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(239,68,68,.15), rgba(239,68,68,.03) 60%, transparent), var(--surface);
  border: 1px solid rgba(239,68,68,.35); border-radius: var(--radius);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 5px; justify-content: center;
  box-shadow: 0 0 34px rgba(239,68,68,.08);
}
.pat-net::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--red); box-shadow: 0 0 12px var(--red-glow); }
.pat-net-label { font-size: 11px; color: var(--ink3); text-transform: uppercase; letter-spacing: 1.4px; }
.pat-net-value { font-size: clamp(27px, 4.2vw, 40px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.12; }
.pat-net-value.neg { color: var(--red); }
.pat-delta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.pat-delta-sub { color: var(--ink3); font-size: 12px; }
.pat-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pat-mini {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; justify-content: center;
}
.pat-mini .k-label { font-size: 11px; color: var(--ink3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 7px; }
.pat-mini .k-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pat-mini .k-sub { font-size: 11px; color: var(--ink3); margin-top: 4px; }
@media (max-width: 900px) { .pat-hero { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .pat-side { grid-template-columns: 1fr; } }

/* variação (sobe verde, desce vermelho; nas dívidas o sentido é invertido no JS) */
.pat-trend { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pat-trend.up { color: var(--green); }
.pat-trend.down { color: var(--red); }
.pat-trend.flat { color: var(--ink3); }

/* listas de bens e dívidas */
.pat-list { display: flex; flex-direction: column; gap: 8px; }
.pat-row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center; gap: 10px; cursor: pointer; position: relative; overflow: hidden;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  will-change: transform;
}
.pat-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pat-color, var(--red)); opacity: .85; }
.pat-row:hover { border-color: var(--ink3); }
.pat-row.dragging {
  transition: none !important; z-index: 50; cursor: grabbing;
  border-color: var(--red); box-shadow: 0 16px 40px rgba(0,0,0,.6), 0 0 20px var(--red-glow);
}
.pat-ico { color: var(--pat-color, var(--red)); display: inline-flex; }
.pat-ico .ico-svg { width: 22px; height: 22px; vertical-align: 0; }
.pat-main { min-width: 0; }
.pat-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pat-sub { display: flex; align-items: center; gap: 7px; margin-top: 4px; flex-wrap: wrap; }
.pat-share { font-size: 11px; color: var(--ink3); }
.pat-note { font-size: 11.5px; color: var(--ink3); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pat-vals { text-align: right; }
.pat-value { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pat-var { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; font-size: 11.5px; margin-top: 3px; }
.pat-var-sub { color: var(--ink3); font-size: 11px; }
.pat-row .row-actions { flex: none; }
@media (max-width: 560px) {
  .pat-row { grid-template-columns: auto auto minmax(0, 1fr) auto; }
  .pat-row .row-actions { grid-column: 1 / -1; }
}

/* estado vazio do patrimônio */
.pat-empty { text-align: center; padding: 34px 18px; }
.pat-empty h2 { font-size: 20px; margin-bottom: 6px; }
.pat-empty p { color: var(--ink2); font-size: 13.5px; line-height: 1.55; max-width: 520px; margin: 0 auto 18px; }
.pat-examples { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pat-examples .btn .ico-svg { margin-right: 6px; }

/* histórico de avaliações */
#ahTable td { padding: 8px 8px; vertical-align: top; }
.ah-dif { font-size: 11px; margin-top: 3px; }
.ah-ico .ico-svg { width: 20px; height: 20px; vertical-align: -0.22em; }

/* toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #000; border: 1px solid var(--border); border-left: 3px solid var(--red);
  color: var(--ink); padding: 12px 18px; border-radius: 10px; font-size: 13px;
  transition: transform .25s ease; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ícones padronizados (SVG monocromático) no lugar dos emojis */
.ico-svg { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.18em; flex: none; }
.goal-emoji .ico-svg { width: 30px; height: 30px; vertical-align: 0; }
.gm-emoji .ico-svg { width: 24px; height: 24px; vertical-align: 0; }
.emoji-opt .ico-svg { width: 22px; height: 22px; vertical-align: 0; }
.goal-examples .btn .ico-svg { margin-right: 6px; }
