/* Finanças — sistema visual (ver DESIGN.md).
   Fundo quente quase neutro, cards brancos de raio grande, painéis internos cinza,
   um acento laranja usado com parcimônia e preto como cor de ação. */

:root {
  --bg: #f1f1ef;
  --surface: #ffffff;
  --surface-2: #f6f6f4;
  --surface-3: #ececea;
  --border: #e9e9e6;
  --text: #141414;
  --muted: #84847f;
  --faint: #b9b9b4;
  --ink: #141414;          /* botões, nav ativa, tooltips */
  --ink-text: #ffffff;
  --accent: #ff5a1f;
  --accent-2: #ff8a4c;
  --accent-soft: #fff0e9;
  --accent-grad: linear-gradient(140deg, #ff8a4c 0%, #ff5a1f 55%, #f0430c 100%);
  --income: #16a34a;
  --income-soft: #e7f6ec;
  --expense: #e5484d;
  --expense-soft: #fdecec;
  --warn: #e8a317;
  --hatch: repeating-linear-gradient(-45deg, var(--surface-3) 0 5px, transparent 5px 10px);
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --display: 'Inter Tight', Inter, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0c;
    --surface: #171717;
    --surface-2: #1f1f1f;
    --surface-3: #2a2a2a;
    --border: #262626;
    --text: #f2f2f0;
    --muted: #8f8f8a;
    --faint: #55554f;
    --ink: #f2f2f0;
    --ink-text: #141414;
    --accent-soft: #2d1a12;
    --income: #3ccf74;
    --income-soft: #12291b;
    --expense: #ff6b6f;
    --expense-soft: #2e1515;
  }
}

* { box-sizing: border-box; }
/* `hidden` sempre vence: classes como .btn/.card definem display e anulariam o atributo. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
svg.lucide { width: 18px; height: 18px; flex: none; }

/* ---------- Sidebar ---------- */
.sidebar {
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font: 700 19px var(--display); letter-spacing: -.02em; }
.sidebar nav { display: flex; flex-direction: column; gap: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text small { font: 500 11px Inter, sans-serif; letter-spacing: .02em; color: var(--muted); margin-top: 4px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; background: var(--accent-grad);
  display: grid; place-items: center; color: #fff; font: 800 14px var(--display); letter-spacing: -.04em;
  box-shadow: 0 6px 16px -6px rgba(255, 90, 31, .7);
}
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-section .label { font-size: 11px; color: var(--muted); padding: 0 12px 6px; letter-spacing: .02em; }
.nav-section a {
  display: flex; align-items: center; gap: 11px;
  color: var(--muted); text-decoration: none; font-weight: 500;
  padding: 10px 12px; border-radius: 999px; transition: background .15s, color .15s;
}
.nav-section a:hover { background: var(--surface); color: var(--text); }
.nav-section a.active { background: var(--ink); color: var(--ink-text); }
.sidebar-foot { margin-top: auto; padding: 14px; border-radius: var(--r-md); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.sidebar-foot small { color: var(--muted); font-size: 12px; }

/* ---------- Topo ---------- */
main { padding: 22px 28px 56px 8px; min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 22px; flex-wrap: wrap; }
.topbar h1 { font: 600 34px/1.1 var(--display); letter-spacing: -.035em; margin: 0; }
.topbar .hello { color: var(--muted); margin-top: 6px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.month-picker { display: flex; align-items: center; gap: 2px; background: var(--surface); border-radius: 999px; padding: 4px; }
.month-picker span { min-width: 140px; text-align: center; font-weight: 600; }
.icon-btn {
  border: 0; background: transparent; width: 34px; height: 34px; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer; color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }

/* Modo oculto: botão do olho e campos que mostram valores digitados. */
.hide-btn { width: 42px; height: 42px; background: var(--surface); }
.hide-btn[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); }
.hide-btn[aria-pressed="true"]:hover { background: var(--ink); opacity: .88; }
.money.masked { letter-spacing: .02em; }
body.private input[data-budget]:not(:focus) { color: transparent; text-shadow: 0 0 9px var(--text); }

/* ---------- Estrutura ---------- */
.view { display: none; flex-direction: column; gap: 16px; }
.view.active { display: flex; }
.row { display: grid; gap: 16px; }
.row-hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3-2 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.row-2-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }

.card { background: var(--surface); border-radius: var(--r-lg); padding: 22px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card > h2 { font: 600 16px var(--display); letter-spacing: -.01em; margin: 0; }
.card > h2 { margin-bottom: 16px; }
.card-head .sub, .sub { color: var(--muted); font-size: 13px; }
.panel { background: var(--surface-2); border-radius: var(--r-md); padding: 16px; }
.muted { color: var(--muted); }
.pos { color: var(--income); }
.neg { color: var(--expense); }
.empty { color: var(--muted); padding: 28px 0; text-align: center; }

/* ---------- Números ---------- */
.money { font-family: var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.03em; white-space: nowrap; }
.money .cents { opacity: .38; }
.big { font-size: 40px; font-weight: 600; line-height: 1; }
.mid { font-size: 28px; font-weight: 600; line-height: 1.05; }

.chip {
  display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.chip svg.lucide { width: 13px; height: 13px; }
.chip.up { background: var(--income-soft); color: var(--income); }
.chip.down { background: var(--expense-soft); color: var(--expense); }
.chip.flat { background: var(--surface-3); color: var(--muted); }
.chip.ink { background: var(--ink); color: var(--ink-text); }
.chip.soft { background: var(--surface-3); color: var(--text); font-weight: 500; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); font-weight: 600; }
.chip.glass { background: rgba(255, 255, 255, .22); color: #fff; backdrop-filter: blur(6px); white-space: normal; }

/* ---------- Hero laranja ---------- */
.hero {
  background: var(--accent-grad); color: #fff; border-radius: var(--r-lg); padding: 24px;
  position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 300px;
}
.hero::after {
  content: ''; position: absolute; inset: auto -80px -140px auto; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%);
  pointer-events: none;
}
.hero .label { opacity: .85; font-weight: 500; }
.hero .headline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.hero .headline .money { font-size: 44px; font-weight: 600; }
.hero .headline .money .cents { opacity: .55; }
.hero .headline .tail { font-size: 15px; opacity: .9; }
.hero .chart-box { flex: 1; min-height: 160px; margin: 8px -6px -6px; }
.hero p { margin: 8px 0 0; opacity: .92; line-height: 1.5; max-width: 46ch; position: relative; z-index: 1; }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 500; }
.kpi .ico { width: 32px; height: 32px; border-radius: 999px; background: var(--surface); display: grid; place-items: center; color: var(--text); }
.kpi .ico svg.lucide { width: 16px; height: 16px; }
.kpi .money { font-size: 26px; font-weight: 600; }
.kpi .foot { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.kpi.feature { background: var(--ink); color: var(--ink-text); }
.kpi.feature .top, .kpi.feature .foot { color: inherit; opacity: .7; }
.kpi.feature .ico { background: rgba(127, 127, 127, .25); color: inherit; }

.bank-badges { display: flex; flex-wrap: wrap; gap: 6px; }
/* Pílulas no estilo do app do Nubank: logo redondo + valor; o nome do banco fica no tooltip. */
.bank-badges { margin-top: 4px; }
.bank-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 999px;
  background: rgba(127, 127, 127, .22); font-size: 14px; cursor: default; }
.bank-badge .bank-logo.sm { border-radius: 50%; width: 26px; height: 26px; }
.bank-badge b { font: 600 14px var(--display); font-variant-numeric: tabular-nums; }
.hero .bank-badges { position: relative; z-index: 1; margin-top: 10px; }
.hero .bank-badge { background: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(6px); }
.hero .bank-badge .bank-logo { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .7); }
.kpi.soon { background: transparent; border: 1.5px dashed var(--border); color: var(--muted); }
.kpi.soon .ico { background: var(--accent-soft); color: var(--accent); }
.soon-text { font: 600 18px var(--display); color: var(--faint); }
.chart-box { position: relative; height: 260px; }

/* ---------- Distribuição (bolhas) ---------- */
.dist { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.bubbles svg { width: 100%; height: auto; display: block; overflow: visible; }
.bubbles text { fill: var(--text); font-family: var(--display); text-anchor: middle; pointer-events: none; }
.bubbles .b-name { font-weight: 500; }
.bubbles .b-pct { font-weight: 700; }
.bubbles g { cursor: pointer; transition: opacity .15s; }
.bubbles:hover g { opacity: .55; }
.bubbles g:hover { opacity: 1; }

.cat-list { display: flex; flex-direction: column; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.cat-item:last-child { border-bottom: 0; }
.cat-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cat-item .money { font-weight: 600; }

.cat-ico {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.cat-ico svg.lucide { width: 16px; height: 16px; }
.cat-ico.sm { width: 26px; height: 26px; border-radius: 8px; }
.cat-ico.sm svg.lucide { width: 14px; height: 14px; }

/* ---------- Barras e hachurado ---------- */
.track { height: 10px; border-radius: 999px; background: var(--hatch); background-color: var(--surface-2); overflow: hidden; }
.track .fill { height: 100%; border-radius: 999px; background: var(--accent-grad); }
.track .fill.ink { background: var(--ink); }
.track .fill.over { background: var(--expense); }
.track .fill.near { background: var(--warn); }

/* ---------- Faturas (overview) ---------- */
.bill-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bill-card { padding: 14px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.bill-card .head { display: flex; align-items: center; gap: 10px; }
.bill-card .head .grow { flex: 1; min-width: 0; }
.bill-card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-card .when { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bill-card .vals { display: flex; align-items: baseline; gap: 6px; }
.bill-card .vals .money { font-size: 18px; font-weight: 600; }
.mini-card {
  width: 38px; height: 26px; border-radius: 6px; flex: none; position: relative;
  background: radial-gradient(120% 90% at 85% 0%, #444 0%, #141414 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.mini-card.alt { background: var(--accent-grad); }
.mini-card::after { content: ''; position: absolute; left: 6px; top: 8px; width: 8px; height: 6px; border-radius: 2px; background: rgba(255, 255, 255, .55); }

.bill-topay { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 12px;
  border-radius: var(--r-sm); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); font-weight: 600; }
.bill-topay .money { font-size: 20px; }
.bill-closed { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 8px 10px; border-radius: var(--r-sm); }
.bill-closed > div { flex: 1; min-width: 0; }
.bill-closed.due { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.bill-closed.due .money { font-weight: 600; font-size: 14px; }
.bill-closed.paid { color: var(--muted); padding: 2px 0; justify-content: flex-start; }
.bill-closed.paid span:nth-child(2) { flex: 1; }
.bill-closed.paid svg.lucide { width: 14px; height: 14px; color: var(--income); }
.bill-total .muted { font-size: 13px; }
.bill-group { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); padding: 14px 0 4px; }
.bill-card.settled { opacity: .6; }
.bill-card .chip svg.lucide { width: 12px; height: 12px; }

/* ---------- Cartões físicos ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card-col { display: flex; flex-direction: column; gap: 12px; }
.plastic {
  aspect-ratio: 1.586; border-radius: 22px; padding: 20px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 85% 0%, #3a3a3a 0%, #141414 60%);
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .55);
}
.plastic.alt { background: radial-gradient(120% 90% at 85% 0%, #ffb07a 0%, #ff5a1f 45%, #e23a06 100%); }
.plastic::before {
  content: ''; position: absolute; right: -60px; bottom: -90px; width: 240px; height: 240px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 0 0 40px rgba(255, 255, 255, .04);
}
.plastic .top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.plastic .brand-name { font: 700 15px var(--display); letter-spacing: .04em; font-style: italic; opacity: .9; }
.plastic .chipset { width: 38px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, #f5d7a1, #c99b54); position: relative; }
.plastic .name { font: 600 17px var(--display); letter-spacing: -.01em; position: relative; }
.plastic .bottom { display: flex; justify-content: space-between; align-items: flex-end; position: relative; gap: 10px; }
.plastic .num { font: 500 15px var(--display); letter-spacing: .14em; opacity: .9; }
.plastic .cycle { text-align: right; }
.plastic .cycle small { display: block; font-size: 11px; opacity: .7; margin-bottom: 2px; }
.plastic .cycle .money { font-size: 22px; font-weight: 600; }

dl.facts { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; font-size: 13px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.hist { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.hist div { display: flex; justify-content: space-between; }

/* ---------- Bancos ---------- */
.bank-logo {
  --bank: #64748b;
  display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--bank); color: #fff; font: 700 12px var(--display); letter-spacing: -.02em;
}
.bank-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bank-logo.xs { width: 16px; height: 16px; border-radius: 5px; font-size: 8px; margin-right: 5px; vertical-align: -3px; }
.bank-logo.sm { width: 22px; height: 22px; border-radius: 7px; font-size: 9px; }
.bank-logo.lg { width: 42px; height: 42px; border-radius: 13px; font-size: 14px; }
.acct-name { display: inline-flex; align-items: center; }
.meta .bank-logo.xs { margin-right: 3px; }

.plastic.branded {
  background: radial-gradient(120% 95% at 85% 0%,
    color-mix(in srgb, var(--bank) 55%, #fff) 0%, var(--bank) 48%, color-mix(in srgb, var(--bank) 70%, #000) 100%);
}
.plastic .bank-tag { display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--display); }
.plastic .bank-tag .bank-logo { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55); }
.plastic .name { margin-top: 10px; }

/* ---------- Faixa de meses (extrato) ---------- */
.strip-wrap { position: relative; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
.strip-wrap::-webkit-scrollbar { display: none; }
.strip { position: relative; display: flex; width: max-content; }
.strip svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.strip .m {
  width: 92px; height: 112px; border: 0; background: transparent; cursor: pointer; border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 10px 0;
}
.strip .m:hover { background: var(--surface-2); }
.strip .m.sel { background: var(--ink); color: var(--ink-text); }
.strip .m .lbl { font-size: 12px; font-weight: 500; text-transform: capitalize; }
.strip .m .val { font: 600 13px var(--display); }
.strip .m.future .val, .strip .m.future .lbl { opacity: .55; }
.strip .m.sel .val { color: inherit !important; }

.tabs { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 2px; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.tabs button.active { background: var(--ink); color: var(--ink-text); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .field { position: relative; flex: 1 1 220px; }
.toolbar .field svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.toolbar .field input { width: 100%; padding-left: 36px; }
.toolbar select { flex: 0 1 190px; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.summary { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; margin-left: auto; }
.summary span { display: inline-flex; gap: 6px; align-items: center; }
.summary b { color: var(--text); font-family: var(--display); }

input, select {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid transparent; border-radius: 999px; padding: 9px 14px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); background: var(--surface); }

.day-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; padding: 18px 4px 6px; }
.tx { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.tx:last-child { border-bottom: 0; }
.tx .desc { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .meta { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tx .amt { font: 600 14px var(--display); text-align: right; min-width: 104px; font-variant-numeric: tabular-nums; }
.tx.dim { opacity: .5; }
.tx.dim .amt { color: var(--muted); }

.pill-select {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer;
  padding: 5px 12px; font-size: 12px; font-weight: 600; border-radius: 999px; max-width: 210px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
}
.pill-select:focus { background: color-mix(in srgb, var(--c) 22%, transparent); border: 0; }

.ring { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--accent); }
.ring svg { width: 16px; height: 16px; transform: rotate(-90deg); }

details.prev { background: var(--accent-soft); border-radius: var(--r-md); padding: 4px 14px; margin-top: 8px; }
details.prev summary { cursor: pointer; padding: 10px 0; display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 13px; list-style: none; }
details.prev summary::-webkit-details-marker { display: none; }
details.prev .tx { border-color: color-mix(in srgb, var(--accent) 15%, transparent); }

.group-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-sm); cursor: pointer; overflow: hidden; }
.group-row::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: color-mix(in srgb, var(--c) 10%, transparent); border-radius: inherit; }
.group-row > * { position: relative; }
.group-row:hover { background: var(--surface-2); }
.group-row .name { flex: 1; font-weight: 500; }
.group-row .money { font-weight: 600; }

/* ---------- Comparativo ---------- */
.cmp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cmp-kpis .kpi { background: var(--surface); }
.cmp-kpis .kpi.feature { background: var(--ink); }
.cmp-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: -6px 0 8px; }
.cmp-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot.cur { background: var(--accent); }
.dot.prev { background: var(--faint); }
.cmp-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cmp-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.cmp-top .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-bar { height: 6px; border-radius: 999px; min-width: 2px; }
.cmp-bar.cur { background: var(--accent-grad); }
.cmp-bar.prev { background: var(--faint); opacity: .7; }
.cmp-vals { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--display); font-variant-numeric: tabular-nums; }
.cmp-vals span { font-size: 12px; color: var(--muted); }

/* Card laranja: total com caixinhas no rodapé */
.hero-foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid rgba(255, 255, 255, .25); position: relative; z-index: 1; opacity: .95; }
.hero-foot b { font: 600 18px var(--display); }

/* Selo de assinatura no extrato */
.chip.sub-tag { background: var(--accent-soft); color: var(--accent); }
.chip svg.lucide { width: 12px; height: 12px; }

/* ---------- Recorrentes ---------- */
.rec-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.rec-cols h3 { font: 600 15px var(--display); margin: 0 0 6px; }
.rec-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.rec-item:last-child { border-bottom: 0; }
.rec-item .desc { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-item .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.rec-item .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.rec-item .right .money { font-weight: 600; }
.rec-item.done .desc { color: var(--muted); }
.rename { display: flex; align-items: center; gap: 6px; cursor: text; }
.rename span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rename svg.lucide { width: 13px; height: 13px; color: var(--muted); opacity: 0; transition: opacity .15s; flex: none; }
.rec-item:hover .rename svg.lucide, .rename:focus-within svg.lucide { opacity: 1; }
.rename-input { width: 100%; padding: 5px 10px; font-weight: 500; border-color: var(--accent); background: var(--surface); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--faint); }
.status-dot.ok { background: var(--income); }
.status-dot.warn { background: var(--warn); }
.rec-item .meta .status-dot { margin-right: 2px; vertical-align: 1px; }

.acct-row { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); overflow: hidden; margin-bottom: 6px; background: var(--surface-2); }
.acct-row::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--accent-soft); }
.acct-row > * { position: relative; }
.acct-row .money { font-weight: 600; }

.sum-list { display: flex; flex-direction: column; gap: 12px; }
.sum-list div { display: flex; justify-content: space-between; align-items: center; }
.sum-list .total { border-top: 1px solid var(--border); padding-top: 12px; font-weight: 600; }

/* ---------- Assinaturas ---------- */
.sub-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 11px 8px; border-bottom: 1px solid var(--border); border-radius: var(--r-sm); transition: background .15s; }
.sub-row:last-child { border-bottom: 0; }
.sub-row .meta { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sub-row .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.sub-row .right .money { font-weight: 600; }
.sub-row .icon-btn { width: 30px; height: 30px; color: var(--muted); opacity: 0; transition: opacity .15s; }
.sub-row:hover .icon-btn, .sub-row .icon-btn:focus-visible { opacity: 1; }
.sub-row .icon-btn svg.lucide { width: 15px; height: 15px; }
.sub-row:hover .rename svg.lucide { opacity: 1; }
.sub-row.on { background: var(--accent-soft); }
.sub-row.on .right .money { text-decoration: line-through; text-decoration-color: var(--accent); color: var(--muted); }
.sub-row.gone { opacity: .55; }

.switch { position: relative; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.sim-bar { height: 12px; border-radius: 999px; margin-top: auto; position: relative; z-index: 1;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .35) 0 5px, rgba(255, 255, 255, .12) 5px 10px); overflow: hidden; }
.sim-bar span { display: block; height: 100%; border-radius: 999px; background: #fff; transition: width .3s; }
.hero p + .sim-bar { margin-top: 14px; }

details.hidden-subs { margin-top: 12px; color: var(--muted); font-size: 13px; }
details.hidden-subs summary { cursor: pointer; padding: 8px 4px; }

/* ---------- Orçamento ---------- */
.budget-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 140px auto; gap: 8px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.budget-row:last-child { border-bottom: 0; }
.budget-row .track { grid-column: 2 / 3; }
.budget-row .info { font-size: 12px; color: var(--muted); margin-top: 2px; }
.budget-row input[type=number] { width: 140px; }
.budget-row label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; cursor: pointer; }
.budget-row.ignored { opacity: .45; }

/* ---------- Conexões ---------- */
.item-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: 0; }
.item-row img { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: var(--surface-2); }
.item-row .grow { flex: 1; min-width: 0; }
.acc-line { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.acc-line:last-child { border-bottom: 0; }

/* ---------- Botões, banner, toast ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 600; cursor: pointer;
  background: var(--ink); color: var(--ink-text); display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.accent { background: var(--accent-grad); color: #fff; }
.btn.small { padding: 7px 12px; font-size: 12px; }
.btn.danger { background: transparent; color: var(--expense); }

#banner:empty { display: none; }
.banner { padding: 14px 18px; border-radius: var(--r-md); background: var(--accent-soft); margin-bottom: 16px; }
.banner a { color: var(--accent); font-weight: 600; }

#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(90px);
  background: var(--ink); color: var(--ink-text); padding: 11px 18px; border-radius: 999px;
  transition: transform .25s; font-weight: 500; z-index: 10; max-width: calc(100% - 32px);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- Revisar ---------- */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-badge[hidden] { display: none; }
.rv-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: stretch; }
.rv-vs { align-self: center; font: 700 18px var(--display); color: var(--accent); }
.rv-side { background: var(--surface-2); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rv-desc { font: 600 15px var(--display); overflow-wrap: anywhere; }
.rv-acct { font-size: 12px; color: var(--muted); }
.rv-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.rv-stats b { color: var(--text); }
.rv-hist { font-size: 12px; border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.rv-hist div { display: flex; justify-content: space-between; }
.rv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.rv-name { flex: 1 1 220px; position: relative; }
.rv-name svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 15px; height: 15px; }
.rv-name input { width: 100%; padding-left: 34px; }
.rv-group { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rv-group:last-child { border-bottom: 0; }

/* ---------- Login ---------- */
/* Enquanto trancado, nada do app é desenhado (nem a "casca"): só a tela de login. */
body.locked > :not(#auth-screen):not(script) { display: none !important; }
.auth-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); padding: 24px; overflow-y: auto; }

/* Cartão dividido: vitrine laranja à esquerda, formulário à direita. */
.auth-card {
  width: min(1180px, 100%); min-height: min(720px, calc(100vh - 48px));
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--surface); border-radius: 32px; padding: 8px;
  box-shadow: 0 30px 80px -40px rgba(20, 20, 20, .25);
}

.auth-art {
  position: relative; overflow: hidden; border-radius: 26px; color: #fff;
  padding: 48px 56px 40px; display: flex; flex-direction: column;
  /* gradiente "fluido": camadas de luz sobre o laranja do Dash! */
  background:
    radial-gradient(60% 45% at 18% 12%, rgba(255, 200, 150, .55), transparent 70%),
    radial-gradient(55% 60% at 85% 30%, rgba(255, 120, 60, .9), transparent 70%),
    radial-gradient(70% 55% at 30% 75%, rgba(224, 52, 0, .95), transparent 70%),
    radial-gradient(50% 45% at 90% 95%, rgba(255, 160, 90, .8), transparent 70%),
    linear-gradient(140deg, #ff8a4c 0%, #ff5a1f 45%, #d93a05 100%);
}
.auth-art::before, .auth-art::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(50px); pointer-events: none;
  animation: auth-drift 16s ease-in-out infinite alternate;
}
.auth-art::before { width: 60%; height: 55%; left: -10%; top: 30%; background: rgba(255, 220, 190, .35); }
.auth-art::after { width: 55%; height: 50%; right: -12%; bottom: 10%; background: rgba(200, 40, 0, .45); animation-delay: -8s; }
@keyframes auth-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(8%, -6%) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .auth-art::before, .auth-art::after, .auth-marquee-track { animation: none; } }

/* "Vídeo": canvas WebGL por trás do conteúdo; com ele ativo, as manchas em CSS saem de cena. */
.auth-video { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.auth-art.has-video::before, .auth-art.has-video::after { display: none; }
.auth-brand, .auth-pitch, .auth-partners { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 10px; font: 700 18px var(--display); }
.auth-brand .brand-mark { background: rgba(255, 255, 255, .22); box-shadow: none; backdrop-filter: blur(6px); }
.auth-brand small { font: 500 12px Inter, sans-serif; opacity: .8; margin-left: 2px; }
.auth-pitch { margin-top: 56px; }
.auth-kicker { font-size: 15px; opacity: .9; }
.auth-pitch h2 { font: 600 46px/1.08 var(--display); letter-spacing: -.035em; margin: 12px 0 0; max-width: 12ch; }

.auth-partners { margin-top: auto; text-align: center; }
.auth-partners-label { font-size: 13px; opacity: .85; }
.auth-partners-label b { font-weight: 600; }
.auth-marquee {
  margin-top: 18px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.auth-marquee-track { display: flex; gap: 28px; width: max-content; animation: auth-marquee 28s linear infinite; }
.auth-marquee-track { align-items: center; gap: 44px; }
.auth-marquee-track .logo { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font: 700 18px var(--display); letter-spacing: -.02em; }
/* Qualquer logo colorido vira silhueta branca, como na referência. */
.auth-marquee-track img { height: 22px; width: auto; display: block; filter: brightness(0) invert(1); opacity: .95; }
.auth-marquee-track .logo.tall img { height: 34px; }
@keyframes auth-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 7vw, 110px); }
.auth-form h1 { font: 600 44px/1.05 var(--display); letter-spacing: -.035em; margin: 0; }
.auth-sub { color: var(--muted); margin: 10px 0 26px; }
.auth-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.auth-field label { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.auth-field-head { display: flex; justify-content: space-between; align-items: center; }
.auth-field input, .auth-input-icon input {
  width: 100%; border-radius: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border);
}
.auth-input-icon { position: relative; }
.auth-input-icon svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.auth-form input:disabled { cursor: not-allowed; background: var(--surface-2); color: var(--faint); }
.soon-chip { font: 700 9px Inter, sans-serif; letter-spacing: .08em; padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.auth-link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; }
.auth-link.disabled { opacity: .45; cursor: not-allowed; }
.auth-check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 4px 0 22px; }
.auth-check.disabled { opacity: .5; cursor: not-allowed; }
.auth-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.auth-submit {
  width: 100%; justify-content: center; padding: 14px; border-radius: 12px; font-size: 15px;
  background: var(--accent-grad); color: #fff;
}
.auth-submit:disabled { opacity: .45; cursor: not-allowed; }
.auth-submit .soon-chip { background: rgba(255, 255, 255, .25); color: #fff; }
.auth-invite { text-align: center; font-size: 14px; color: var(--muted); margin: 16px 0 0; }
.auth-invite b { color: var(--accent); }
.auth-or { display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: 13px; margin: 22px 0; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-google {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  font: 500 15px Inter, sans-serif; color: var(--text); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.auth-google:hover { border-color: var(--accent); box-shadow: 0 6px 18px -10px rgba(255, 90, 31, .6); }
.auth-google:disabled { opacity: .6; cursor: wait; }
.auth-google svg { width: 20px; height: 20px; }
.auth-status { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 0; min-height: 1.2em; }
#auth-logout { align-self: center; margin-top: 8px; }

@media (max-width: 900px) {
  .auth-screen { padding: 12px; place-items: start center; }
  .auth-card { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-art { padding: 28px 24px 22px; min-height: 0; }
  .auth-pitch { margin-top: 22px; }
  .auth-pitch h2 { font-size: 30px; max-width: none; }
  .auth-partners { margin-top: 26px; }
  .auth-form { padding: 28px 20px 24px; }
  .auth-form h1 { font-size: 34px; }
}

/* ---------- Casa: visão, pessoas e visibilidade ---------- */
.scope-select { font-weight: 600; background: var(--surface); }
.me { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; font-size: 12px; }
.acc-right { display: flex; align-items: center; gap: 12px; }
.vis-toggle { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); }
.vis-toggle.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.vis-toggle svg.lucide { width: 13px; height: 13px; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: 0; }
.member-row img, .member-row .avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.member-row .avatar { display: grid; place-items: center; background: var(--surface-2); font-weight: 700; color: var(--muted); }
.member-row .avatar svg.lucide { width: 16px; height: 16px; }
.member-row .grow { flex: 1; min-width: 0; }
.member-row.pending { opacity: .75; }
.invite-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.invite-form input { flex: 1 1 240px; }

/* ---------- Chat ---------- */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 20; width: 56px; height: 56px; border: 0; border-radius: 50%;
  background: var(--accent-grad); color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 12px 28px -10px rgba(255, 90, 31, .75); transition: transform .2s, opacity .2s;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab.hide { opacity: 0; pointer-events: none; transform: scale(.8); }
.chat-fab svg.lucide { width: 24px; height: 24px; }

.chat {
  position: fixed; right: 16px; bottom: 16px; top: 16px; z-index: 21; width: min(420px, calc(100vw - 32px));
  background: var(--surface); border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .35), 0 0 0 1px var(--border);
  transform: translateX(calc(100% + 24px)); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.chat.open { transform: none; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--border); }
.chat-head .grow { flex: 1; display: flex; flex-direction: column; }
.chat-model { appearance: none; -webkit-appearance: none; border: 0; background: transparent; padding: 0 14px 0 0; margin-top: 1px;
  font-size: 11px; color: var(--muted); cursor: pointer; border-radius: 0; width: fit-content;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 4px center, right 0 center; background-size: 4px 4px; background-repeat: no-repeat; }
.chat-model:focus { border: 0; background-color: transparent; outline: none; color: var(--text); }
.chat-orb { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-grad); color: #fff; display: grid; place-items: center; flex: none; }
.chat-orb.sm { width: 30px; height: 30px; }
.chat-orb.sm svg.lucide { width: 15px; height: 15px; }

.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; line-height: 1.5; font-size: 14px; overflow-wrap: anywhere; }
.chat-msg.me { align-self: flex-end; background: var(--ink); color: var(--ink-text); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.chat-msg.ai { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.chat-msg.ai p { margin: 0 0 6px; }
.chat-msg.ai p:last-child { margin: 0; }
.chat-msg.ai ul { margin: 4px 0 6px; padding-left: 18px; }
.chat-msg.ai code { font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
body.private .chat-msg.ai { filter: blur(6px); }
.chat-tool { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 2px 4px; }
.chat-tool svg.lucide { width: 13px; height: 13px; }
.chat-note { align-self: center; font-size: 12px; color: var(--muted); }
.chat-typing { align-self: flex-start; display: flex; align-items: center; gap: 4px; padding: 10px 14px; background: var(--surface-2); border-radius: 18px; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
.chat-typing em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 6px; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.chat-empty { margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; }
.chat-empty p { margin: 0; font-size: 13px; line-height: 1.5; }
.chat-empty code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.chat-suggest { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; width: 100%; }
.chat-suggest button { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 9px 12px; text-align: left; cursor: pointer; font-size: 13px; }
.chat-suggest button:hover { border-color: var(--accent); }

.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-form textarea {
  flex: 1; resize: none; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid transparent;
  border-radius: 18px; padding: 10px 14px; max-height: 140px; outline: none;
}
.chat-form textarea:focus { border-color: var(--accent); background: var(--surface); }
.chat-form .btn { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 50%; }
.chat-form.disabled { opacity: .5; pointer-events: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .row-hero, .row-3-2, .row-2-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  body { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 14px 16px 0; gap: 12px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { flex-direction: row; gap: 4px; overflow-x: auto; flex: 1 1 100%; order: 3; scrollbar-width: none; }
  .nav-section { flex-direction: row; }
  .nav-section .label { display: none; }
  .nav-section a { white-space: nowrap; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; background: none; flex-direction: row; align-items: center; }
  .sidebar-foot small { display: none; }
  main { padding: 16px; }
  .topbar h1 { font-size: 28px; }
  .row-2, .dist, .rec-cols { grid-template-columns: minmax(0, 1fr); }
  .kpi .money { font-size: 21px; }
  .hero .headline .money { font-size: 36px; }
  .tx { grid-template-columns: auto minmax(0, 1fr) auto; }
  .tx .pill-select { grid-column: 2 / 4; justify-self: start; }
  .tx .amt { grid-row: 1; grid-column: 3; }
  .budget-row { grid-template-columns: auto minmax(0, 1fr); }
  .sub-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .sub-row .right { grid-column: 2; grid-row: 2; align-items: flex-start; flex-direction: row; gap: 8px; }
  .sub-row .icon-btn { display: none; }
  .sub-row .switch { grid-column: 3; grid-row: 1 / 3; }
  .budget-row .track { grid-column: 1 / -1; }
  .summary { margin-left: 0; }
  .cmp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-pair { grid-template-columns: minmax(0, 1fr); }
  .rv-vs { justify-self: center; }
  .chat { inset: 0; width: 100%; border-radius: 0; }
  .chat-fab { right: 16px; bottom: 16px; }
  .toolbar select { flex: 1 1 100%; }
}

/* ---------- Recorrentes: 3 colunas e cadastro manual ---------- */
/* Empilhadas por padrão; lado a lado só onde cada coluna tem espaço para o nome. */
.rec-cols { grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 1500px) { .rec-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rec-item:has(.rec-x) { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.rec-item .rec-x { width: 28px; height: 28px; color: var(--muted); opacity: 0; transition: opacity .15s; }
.rec-item .rec-x svg.lucide { width: 14px; height: 14px; }
.rec-item:hover .rec-x, .rec-item .rec-x:focus-visible { opacity: 1; }
button.chip { border: 0; cursor: pointer; font: inherit; }
.tx .rec-add { opacity: 0; transition: opacity .15s; }
.tx:hover .rec-add, .tx .rec-add:focus-visible { opacity: 1; }
@media (hover: none) { .tx .rec-add, .rec-item .rec-x { opacity: 1; } }

.dialog { border: 0; border-radius: var(--r-lg, 24px); padding: 22px; width: min(560px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 48px));
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.dialog::backdrop { background: rgba(10, 10, 10, .45); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.dialog-head h2 { margin: 0; }
.rd-search { position: relative; display: block; }
.rd-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.rd-search input { width: 100%; padding-left: 36px; }
.rd-list { display: flex; flex-direction: column; margin-top: 10px; max-height: 380px; overflow-y: auto; }
.rd-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; padding: 10px 8px;
  border: 0; border-bottom: 1px solid var(--border); background: transparent; color: inherit; font: inherit; cursor: pointer; border-radius: var(--r-sm); }
.rd-item:hover { background: var(--surface-2); }
.rd-item .desc, .rd-tx .desc { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-item .meta, .rd-tx .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 2px; }
.rd-tx { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; background: var(--surface-2); border-radius: var(--r-md); }
.rd-label { display: block; font-weight: 600; font-size: 13px; margin: 16px 0 6px; }
#rd-name { width: 100%; }
.rd-note { margin: 12px 0 0; font-size: 13px; }
.rd-actions { display: flex; gap: 8px; align-items: center; margin-top: 18px; }

/* ---------- Assinaturas: cancelamentos ---------- */
.sub-row { grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; }
.sub-row .icon-btn.keep { opacity: .55; }
.sub-row .icon-btn.keep:hover { opacity: 1; color: var(--expense); }
.sub-row.cancelled .right .money { color: var(--income); }
.hero .hero-btn { position: relative; z-index: 1; align-self: flex-start; margin-top: 12px; }
.save-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.save-value .money { font: 600 32px var(--display); color: var(--income); }
@media (max-width: 900px) {
  .sub-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .sub-row .icon-btn.keep { display: grid; grid-column: 3; grid-row: 1 / 3; }
  .sub-row .switch { grid-column: 4; }
}

/* Distribuição na coluna estreita: bolhas em cima, lista embaixo. */
.dist.dist-narrow { grid-template-columns: minmax(0, 1fr); }
.dist-narrow .bubbles { width: 100%; max-width: 440px; margin: 0 auto; }

/* ---------- Elo Dash! (Beta) ---------- */
.beta-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; color: var(--accent); background: var(--accent-soft); }
.beta-badge.light { color: #fff; background: rgba(255, 255, 255, .25); }
.elo-nav { display: flex; flex-direction: column; gap: 2px; }
.elo-ico { width: 18px; height: 18px; flex: none; }
.chip .elo-ico, .btn .elo-ico, .link-btn .elo-ico, .goal-link .elo-ico { width: 14px; height: 14px; }
.cat-ico .elo-ico, .kpi .ico .elo-ico { width: 16px; height: 16px; }

.chip.elo-chip { gap: 5px; background: var(--surface-3); color: var(--text); font-weight: 600; }
.chip.elo-chip.on { background: var(--accent-soft); color: var(--accent); }
.chip.elo-chip.add { opacity: 0; transition: opacity .15s; }
.tx:hover .elo-chip.add, .rec-item:hover .elo-chip.add, .sub-row:hover .elo-chip.add, .elo-chip.add:focus-visible { opacity: 1; }
@media (hover: none) { .chip.elo-chip.add { opacity: 1; } }
.split-chips { display: inline-flex; gap: 6px; font-weight: 600; }
.split-chips span { display: inline-flex; align-items: center; gap: 3px; }
.split-chips i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); display: inline-block; }

.elo-avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; font-weight: 700;
  color: #fff; background: var(--c, #a8a29e); box-shadow: 0 0 0 2px var(--surface); }
.elo-stack { display: inline-flex; }
.elo-stack .elo-avatar + .elo-avatar { margin-left: -8px; }
.hero .elo-stack .elo-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }

.elo-kpi { text-decoration: none; color: inherit; border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent); cursor: pointer; }
.elo-kpi:hover { border-color: var(--accent); }
.elo-kpi .ico { background: var(--accent-soft); color: var(--accent); }
.elo-kpi .soon-text { font: 600 20px var(--display); }

.settle-row { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.settle-row .grow { flex: 1; min-width: 0; font-size: 14px; }
.settle-row svg.lucide { width: 16px; height: 16px; }
.settle-ok { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.radar-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.radar-row:last-child { border-bottom: 0; }
.radar-row .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.radar-row .ico svg.lucide { width: 15px; height: 15px; }

.elo-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.elo-toolbar .tabs { flex-wrap: wrap; }
.tx.elo-tx { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.tx.elo-tx.mine { cursor: pointer; }
.tx.elo-tx.mine:hover { background: var(--surface-2); }
.elo-share { font-size: 12px; white-space: nowrap; }
.tx .meta .elo-avatar { box-shadow: none; }

.split-editor { display: flex; flex-direction: column; gap: 14px; }
.split-row { display: flex; gap: 12px; align-items: center; }
.split-row .grow { flex: 1; min-width: 0; }
.split-name { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.split-row input[type=range] { width: 100%; accent-color: var(--c); padding: 0; border: 0; background: none; }
.split-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.split-modes { display: flex; flex-direction: column; gap: 8px; }
.split-mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; border: 1.5px solid transparent; }
.split-mode.on { border-color: var(--accent); background: var(--accent-soft); }
.split-mode input { margin-top: 3px; accent-color: var(--accent); }
.split-now { display: flex; gap: 14px; flex-wrap: wrap; }
.split-now span { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }

.elo-hero { min-height: 280px; }
.elo-slots { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0 10px; position: relative; z-index: 1; }
.elo-slots .slot { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.elo-slots .slot:not(.filled)::before { content: ""; width: 64px; height: 64px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .6); box-sizing: border-box; }
.elo-slots .slot:not(.filled) svg.lucide { position: absolute; top: 22px; width: 20px; height: 20px; opacity: .8; }
.elo-slots .slot small { font-size: 12px; font-weight: 600; white-space: nowrap; }
.elo-slots .slot .elo-avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, .8); }
.slot-x { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #fff; color: #141414; display: grid; place-items: center; cursor: pointer; }
.slot-x svg.lucide { width: 12px; height: 12px; }
.elo-title-input { font: 700 36px var(--display); color: #fff; background: transparent; border: 0; border-bottom: 1.5px dashed rgba(255, 255, 255, .5);
  border-radius: 0; padding: 4px 0; margin: 8px 0 0; width: 100%; position: relative; z-index: 1; }
.elo-title-input:focus { background: transparent; border-color: #fff; outline: none; }
.elo-hero p { position: relative; z-index: 1; }
.elo-create { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.elo-join { display: flex; gap: 8px; }
.elo-join input, .auth-elo-row input { flex: 1; min-width: 0; font: 600 16px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
.invite-code { font: 700 34px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; text-align: center; padding: 18px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1.5px dashed var(--border); margin-bottom: 12px; }
.invite-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-link { margin: 12px 0 4px; font-size: 12px; color: var(--muted); word-break: break-all; }

.goal-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.goal-form input { width: 100%; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; }
.goal-card h2 { display: flex; gap: 8px; align-items: center; }
.goal-card h2 svg.lucide { width: 18px; height: 18px; color: var(--accent); }
.goal-value { font-size: 15px; margin: 4px 0 10px; }
.goal-value .money { font: 600 28px var(--display); }
.goal-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; }
.goal-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent-grad); }
.goal-people { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; font-size: 13px; }
.goal-people span { display: inline-flex; gap: 6px; align-items: center; }
.goal-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 10px; border-radius: var(--r-sm); background: var(--surface-2); margin-bottom: 12px; }
.goal-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.goal-actions input { width: 110px; }
.goal-actions select { flex: 1 1 100%; }

.join-preview { text-align: center; padding: 8px 0 4px; }
.join-preview h2 { margin: 12px 0 4px; font-size: 24px; }
.join-preview .elo-stack { justify-content: center; }

.auth-elo { margin-top: 16px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.auth-elo label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.auth-elo-row { display: flex; gap: 8px; }
#auth-elo-preview { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
#auth-elo-preview span { color: var(--muted); }
#auth-elo-preview .err { color: var(--expense); }

@media (max-width: 1180px) { .elo-create { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .elo-nav { flex-direction: row; }
  .tx.elo-tx { grid-template-columns: auto minmax(0, 1fr) auto; }
  .tx.elo-tx .elo-share { grid-column: 2; grid-row: 2; }
  .invite-code { font-size: 26px; }
  .goal-grid { grid-template-columns: minmax(0, 1fr); }
}
.elo-hero .headline { font-weight: 700; line-height: 1.05; }

/* Visão do Elo: Despesas (laranja), Renda e Acerto lado a lado */
.elo-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); }
.elo-money { min-height: 260px; }
.elo-income-value .money { font: 600 34px var(--display); color: var(--income); }
.elo-income-value { margin: 2px 0 10px; }
.elo-income .elo-left { border-top: 1px solid var(--border); border-bottom: 0; margin-top: 4px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
b.neg { color: var(--expense); }
@media (max-width: 1180px) { .elo-top { grid-template-columns: minmax(0, 1fr); } }

/* Saldo/Despesas (4/12) e Resumo (8/12): o card laranja não precisa de tanto espaço. */
.row-4-8 { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.elo-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.elo-kpis .elo-mine { grid-column: span 2; }
@media (max-width: 1180px) { .row-4-8 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .elo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Telas do Elo: o conteúdo é montado num contêiner, que precisa do mesmo espaçamento da .view */
#elo-overview, #elo-expenses, #elo-goals, #elo-manage { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.elo-item { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.elo-item.pending { opacity: .7; }
.elo-item .rec-x { opacity: .6; }
.elo-filter { width: auto; padding: 6px 30px 6px 12px; font-size: 13px; }
.elo-list-foot { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0 0; margin-top: 4px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.elo-list-foot > b { color: var(--text); font-size: 15px; }

/* Nome editável no extrato e pergunta de nome na Revisar */
.tx .desc.rename { display: flex; gap: 6px; align-items: center; cursor: text; }
.tx .desc.rename span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .desc.rename svg.lucide { width: 13px; height: 13px; opacity: 0; color: var(--muted); flex: none; transition: opacity .15s; }
.tx:hover .desc.rename svg.lucide { opacity: 1; }
.name-hist { margin: 12px 0 14px; }

/* Situação das despesas do Elo */
.status-select { width: auto; padding: 2px 22px 2px 8px; font-size: 12px; font-weight: 600; border-radius: 999px; margin-top: 2px; }
.status-select.st-pago { color: var(--income); }
.status-select.st-fatura { color: var(--warn); }
.status-select.st-prevista { color: var(--muted); }
.tx.elo-tx.pending { opacity: .75; }

/* Coluna ao lado das Despesas do Elo: Acerto em cima, radar embaixo, juntos na altura da lista */
.elo-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.elo-side > .card:last-child { flex: 1; }

.prev-hint { font-weight: 400; color: var(--muted); margin-left: 6px; }
details.prev .day-label { margin-top: 6px; }

/* ---------- Login simplificado (1.0.0) ---------- */
.auth-mobile-brand { display: none; }
.auth-form .auth-submit { margin-top: 4px; }

/* ---------- Carregando (tela cheia) ---------- */
.app-loader { display: none; }
.auth-screen.loading .auth-card { display: none; }
.auth-screen.loading { place-items: center; }
.auth-screen.loading .app-loader { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; animation: loader-in .4s ease both; }
.loader-orb { position: relative; width: 132px; height: 132px; display: grid; place-items: center; margin-bottom: 10px; }
.loader-orb .brand-mark { width: 56px; height: 56px; border-radius: 18px; font-size: 22px; position: relative; z-index: 1;
  animation: loader-pulse 1.8s ease-in-out infinite; box-shadow: 0 12px 40px -8px rgba(255, 90, 31, .8); }
.loader-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; }
.loader-ring.r1 { border-top-color: var(--accent); border-right-color: color-mix(in srgb, var(--accent) 40%, transparent); animation: loader-spin 1.1s linear infinite; }
.loader-ring.r2 { inset: 14px; border-bottom-color: #ffa06b; border-left-color: color-mix(in srgb, #ffa06b 35%, transparent); animation: loader-spin 1.6s linear infinite reverse; }
.loader-ring.r3 { inset: -14px; border: 1px dashed color-mix(in srgb, var(--accent) 30%, transparent); animation: loader-spin 9s linear infinite; }
.loader-title { font: 600 22px var(--display); letter-spacing: -.02em; }
.loader-step { color: var(--muted); font-size: 14px; min-height: 1.3em; }
.loader-bar { width: 200px; height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.loader-bar span { display: block; width: 40%; height: 100%; border-radius: 999px; background: var(--accent-grad); animation: loader-slide 1.3s ease-in-out infinite; }
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes loader-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes loader-slide { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@keyframes loader-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .loader-ring, .loader-orb .brand-mark, .loader-bar span { animation: none; }
}

/* ---------- Celular: barra + menu lateral ---------- */
.mobile-bar, .menu-scrim { display: none; }
@media (max-width: 900px) {
  /* Login: logo no box laranja, formulário e por último o box com slogan e bancos */
  .auth-screen { grid-template-columns: minmax(0, 1fr); }
  .auth-card { display: flex; flex-direction: column; width: 100%; max-width: 560px; justify-self: center; }
  .auth-form, .auth-art { min-width: 0; }
  .auth-form { order: 1; }
  .auth-art { order: 2; }
  .auth-art .auth-brand { display: none; }
  .auth-art .auth-pitch { margin-top: 0; }
  .auth-mobile-brand { display: flex; align-items: center; justify-content: center; gap: 10px; align-self: stretch; padding: 22px; margin-bottom: 26px;
    border-radius: 22px; background: var(--accent-grad); color: #fff; font: 700 20px var(--display); }
  .auth-mobile-brand .brand-mark { background: rgba(255, 255, 255, .22); box-shadow: none; }
  .auth-mobile-brand small { font: 500 12px Inter, sans-serif; opacity: .85; }

  body.locked .mobile-bar { display: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 30;
    padding: 10px 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
  .mobile-bar .brand { padding: 0; font-size: 17px; }
  .mobile-bar .brand-mark { width: 30px; height: 30px; font-size: 12px; border-radius: 10px; }
  .mobile-bar .hide-btn { width: 38px; height: 38px; }
  .topbar .hide-btn { display: none; }

  /* O menu volta a ser a coluna do computador, só que deslizando da esquerda */
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(300px, 84vw); height: 100%; overflow-y: auto;
    padding: 20px 14px; gap: 18px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; background: var(--bg);
    transform: translateX(-102%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  body.menu-open .sidebar { transform: none; }
  .sidebar nav { flex-direction: column; gap: 18px; overflow: visible; flex: none; order: 0; }
  .nav-section { flex-direction: column; }
  .nav-section .label { display: block; }
  .nav-section .label .beta-badge { display: inline-block; }
  .elo-nav { flex-direction: column; }
  .sidebar-foot { margin: auto 0 0; padding: 14px; background: var(--surface); flex-direction: column; align-items: stretch; }
  .sidebar-foot small { display: block; }
  .menu-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .menu-scrim { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
}

/* ---------- Categorias ---------- */
.view-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cat-block { border-bottom: 1px solid var(--border); }
.cat-block:last-child { border-bottom: 0; }
.cat-block.ignored { opacity: .55; }
.cat-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; gap: 14px; align-items: center; padding: 12px 6px; cursor: pointer; border-radius: var(--r-sm); position: relative; }
.cat-row:hover { background: var(--surface-2); }
.cat-row::after { content: ""; position: absolute; left: 6px; bottom: 4px; height: 3px; width: calc(var(--w) * .5); max-width: 50%; border-radius: 999px; background: var(--c); opacity: .5; }
.cat-name { font-weight: 600; }
.cat-row .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cat-amount { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.cat-amount .money { font-weight: 600; }
.cat-amount .meta { font-size: 11px; }
.cat-caret { color: var(--muted); transition: transform .2s; }
.cat-block.open .cat-caret { transform: rotate(180deg); }
.mini-bars { width: 54px; height: 24px; }
.cat-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 28px; padding: 4px 6px 16px 52px; }
.cat-sub { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.cat-edit-sm { width: 24px; height: 24px; opacity: .5; }
.cat-edit-sm svg.lucide { width: 12px; height: 12px; }
.cat-sub:hover .cat-edit-sm { opacity: 1; }
.cat-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.cat-ignore { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); cursor: pointer; margin-left: auto; }
.cat-preview { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.cat-colors { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
#cat-color-custom { width: 34px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.cat-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; }
.icon-pick { height: 38px; border-radius: 10px; border: 1.5px solid transparent; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; }
.icon-pick.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
#cat-name { width: 100%; }
@media (max-width: 900px) {
  .cat-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cat-row .mini-bars, .cat-row .cat-delta, .cat-row .cat-caret { display: none; }
  .cat-detail { grid-template-columns: minmax(0, 1fr); padding-left: 6px; }
}

/* ---------- 1.1.0: abas de página, rodapé do menu, Cobranças e Configurações ---------- */
.page-tabs { display: flex; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin: -8px 0 18px; }
.page-tabs a { border: 0; padding: 8px 16px; border-radius: 999px; font-weight: 500; color: var(--muted); display: flex; gap: 6px; align-items: center; text-decoration: none; white-space: nowrap; }
.page-tabs a svg.lucide { width: 15px; height: 15px; }
.page-tabs a:hover { color: var(--text); }
.page-tabs a.active { background: var(--ink); color: var(--ink-text); }
#tx-tabs { display: none; }

.sidebar-foot { gap: 12px; }
.me-card { display: flex; gap: 12px; align-items: center; min-width: 0; }
.me-card .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.me-card b { font: 600 15px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-card small { color: var(--muted); font-size: 11.5px; }
.me-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text); font: 700 16px var(--display); }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-card.big .me-avatar { width: 56px; height: 56px; font-size: 22px; }
.me-card.big { margin: 6px 0 12px; }
.foot-sync { justify-content: center; background: #fff; color: #141414; }
.foot-sep { height: 1px; background: var(--border); }
.foot-row { display: flex; gap: 8px; }
.btn.outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border); justify-content: center; text-decoration: none; }
.btn.outline:hover { box-shadow: inset 0 0 0 1.5px var(--text); opacity: 1; }
.btn.outline.active { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.foot-data { flex: 1; }
.btn.icon-only { width: 42px; padding: 0; flex: none; }
.btn.danger-outline { color: var(--expense); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--expense) 70%, transparent); }
.btn.danger-outline:hover { box-shadow: inset 0 0 0 1.5px var(--expense); }
.foot-copy { text-align: center; color: var(--muted); font-size: 11px; }

/* Cobranças: Despesas fixas / Parcelas usam a tela de Recorrentes; Assinaturas / Simular, a de Assinaturas */
#view-recurring[data-mode] .rec-summary-row, #view-recurring[data-mode] .rec-col-subs { display: none; }
#view-recurring[data-mode="fixed"] .rec-col-inst, #view-recurring[data-mode="inst"] .rec-col-fixed { display: none; }
#view-recurring[data-mode="inst"] [data-rec-add] { display: none; }
#view-recurring[data-mode] .rec-cols { grid-template-columns: minmax(0, 1fr); }
#view-recurring[data-mode] .rec-cols h3 { display: none; }
#view-subscriptions[data-mode="subs"] .sim-only, #view-subscriptions[data-mode="subs"] .sub-row .switch { display: none; }
#view-subscriptions[data-mode="sim"] .subs-only, #view-subscriptions[data-mode="sim"] .sub-row .icon-btn { display: none; }
#view-subscriptions[data-mode="sim"] .row-3-2 { grid-template-columns: minmax(0, 1fr); }

.pref-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.pref-row:last-child { border-bottom: 0; }
.pref-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.pref-row small { color: var(--muted); font-size: 12px; }
.sidebar-foot .btn { white-space: nowrap; font-size: 13px; padding: 10px 14px; }
.sidebar-foot .btn.icon-only { padding: 0; }

/* Convite do Elo: botão do WhatsApp e prévia da mensagem */
.btn.wa-btn { background: #25d366; color: #0b2e17; text-decoration: none; }
.invite-preview { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); font-size: 13px; }
.invite-preview p { margin: 4px 0 0; line-height: 1.45; }
