/* Visual: fundo neutro, painel branco arredondado, cartões com borda fina e
   cabeçalho com ícone, botões em pílula, tipografia leve. */
:root {
  color-scheme: light;
  --app-bg: #f3f3f4;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f6f7;
  --nav-active: #e7e7ea;
  --border: #ebebed;
  --border-strong: #dcdcdf;
  --text: #141416;
  --text-2: #55565c;
  --muted: #8a8b91;
  --primary: #141416;
  --primary-ink: #ffffff;
  --primary-soft: #eef3ff;
  --link: #2f6fed;
  --income: #16a34a;
  --income-soft: #e8f7ee;
  --expense: #e5484d;
  --expense-soft: #fdeced;
  --warning: #a16207;
  --warning-soft: #fdf3dc;
  --info: #2f6fed;
  --info-soft: #eaf0fe;
  --focus: #2f6fed;
  --chart-income: #22b35e;
  --chart-expense: #e5484d;
  --chart-1: #2f6fed;
  --chart-2: #9a9ba1;
  --chart-grid: #f0f0f2;
  --chart-axis: #e3e3e6;
  --radius: 12px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --app-bg: #0c0c0e; --bg: #151517; --surface: #18181b; --surface-2: #202024; --nav-active: #232327;
    --border: #2a2a2f; --border-strong: #36363c; --text: #f2f2f3; --text-2: #c2c3c8; --muted: #8e8f96;
    --primary: #f2f2f3; --primary-ink: #141416; --primary-soft: #1b2440; --link: #7aa2ff;
    --income: #3fcf7a; --income-soft: #12291c; --expense: #ff6b70; --expense-soft: #341a1c;
    --warning: #f5c451; --warning-soft: #33290f; --info: #7aa2ff; --info-soft: #1b2440; --focus: #7aa2ff;
    --chart-income: #2fbf6b; --chart-expense: #ef5a5f; --chart-1: #6b9bff; --chart-2: #6f7077;
    --chart-grid: #222226; --chart-axis: #2e2e33;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #0c0c0e; --bg: #151517; --surface: #18181b; --surface-2: #202024; --nav-active: #232327;
  --border: #2a2a2f; --border-strong: #36363c; --text: #f2f2f3; --text-2: #c2c3c8; --muted: #8e8f96;
  --primary: #f2f2f3; --primary-ink: #141416; --primary-soft: #1b2440; --link: #7aa2ff;
  --income: #3fcf7a; --income-soft: #12291c; --expense: #ff6b70; --expense-soft: #341a1c;
  --warning: #f5c451; --warning-soft: #33290f; --info: #7aa2ff; --info-soft: #1b2440; --focus: #7aa2ff;
  --chart-income: #2fbf6b; --chart-expense: #ef5a5f; --chart-1: #6b9bff; --chart-2: #6f7077;
  --chart-grid: #222226; --chart-axis: #2e2e33;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--app-bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 1000; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 4rem; text-align: center; color: var(--muted); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.income { color: var(--income); }
.expense { color: var(--expense); }
.nowrap { white-space: nowrap; }
.icon { flex: none; vertical-align: middle; }
kbd { font: 500 .72rem var(--font); border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 .35rem; color: var(--muted); background: var(--surface); }

/* Ocultar valores */
:root[data-hide-values] main :is(.value, .big-balance, .num, .kpi strong, .dot-list strong, .hbars .num, .money),
:root[data-hide-values] main .chart :is(svg, table) { filter: blur(7px); user-select: none; }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { padding: .9rem .7rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .6rem; background: var(--app-bg); }
.brand { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .9rem .45rem 1rem; color: var(--text); text-decoration: none; }
.brand-symbol { width: auto; height: 32px; }
.brand-name { width: auto; height: 19px; margin-top: 3px; }
/* A logo é preta com fundo transparente: no tema escuro é invertida para branco. */
.logo-img { display: block; }
:root[data-theme="dark"] .logo-img { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-img { filter: invert(1); } }
.auth-logo { display: flex; justify-content: center; margin: .25rem 0 1.25rem; }
.auth-logo img { width: 120px; height: auto; }
.nav-search { display: flex; align-items: center; gap: .45rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 .55rem; color: var(--muted); }
.nav-search input { border: 0; background: transparent; padding: .45rem 0; min-height: 36px; }
.nav-search input:focus { outline: none; }
.nav-search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.nav-scroll { flex: 1; overflow-y: auto; margin: 0 -.2rem; padding: 0 .2rem; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 1rem .65rem .35rem; font-weight: 600; }
.nav { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.nav a { display: flex; gap: .65rem; align-items: center; padding: .45rem .65rem; border-radius: var(--radius); color: var(--text-2); text-decoration: none; }
.nav a .icon { color: var(--muted); }
.nav a:hover { background: var(--nav-active); color: var(--text); }
.nav a[aria-current="page"] { background: var(--nav-active); color: var(--text); font-weight: 600; }
.nav a[aria-current="page"] .icon { color: var(--text); }
.nav-bottom { border-top: 1px solid var(--border); padding-top: .5rem; display: grid; gap: .5rem; }
.user-card { display: flex; gap: .6rem; align-items: center; padding: .4rem .45rem; border-radius: 12px; }
.user-card .grow { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.user-card .grow span { font-size: .78rem; color: var(--muted); }
.main-wrap { min-width: 0; padding: .55rem .55rem .55rem 0; }
.panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); min-height: calc(100vh - 1.1rem); display: flex; flex-direction: column; overflow: clip; }
.topbar { display: flex; gap: .5rem; align-items: center; padding: .7rem 1.5rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; background: var(--bg); flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.crumbs { display: flex; gap: .45rem; align-items: center; color: var(--muted); font-size: .9rem; }
.crumbs strong { color: var(--text); font-weight: 600; }
.quick { display: flex; gap: .35rem; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none; padding: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.user-chip { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--border); border-radius: 12px; padding: .2rem .65rem .2rem .25rem; color: var(--text); text-decoration: none; font-weight: 550; min-height: 36px; }
.user-chip:hover { background: var(--surface-2); }
.menu-btn { display: none; }
main { padding: 1.75rem 1.75rem 2.5rem; width: 100%; }
main:focus { outline: none; }
.page-head { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head p { color: var(--text-2); margin: 0; }
.demo-banner { background: var(--warning-soft); color: var(--warning); padding: .5rem 1.5rem; font-size: .88rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.demo-banner .btn-dark { background: var(--warning); color: var(--bg); }

.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #1f2937; font-weight: 700; font-size: .78rem; flex: none; letter-spacing: .02em; }
.avatar.round { border-radius: 50%; }
/* Avatar com logo do banco: fundo claro fixo para os logos manterem as cores (também no tema escuro). */
.avatar.bank { background: #fff !important; border: 1px solid var(--border); padding: 5px; overflow: hidden; }
.avatar.bank.small { padding: 3px; }
.avatar.bank img { width: 100%; height: 100%; object-fit: contain; display: block; }
h1.acc-cell, h2 .acc-cell { display: inline-flex; align-items: center; gap: .55rem; }
h2 a.acc-cell { color: inherit; text-decoration: none; }
h2 a.acc-cell:hover span { text-decoration: underline; }
td .acc-cell { display: inline-flex; align-items: center; gap: .5rem; vertical-align: middle; }
td .acc-cell .avatar.small { width: 26px; height: 26px; font-size: .6rem; }
/* Seletor de logo do banco */
.logo-field .row { gap: .75rem; }
.logo-search { width: auto; max-width: 200px; min-height: 32px; padding: .2rem .6rem; font-size: .85rem; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .4rem; max-height: 236px; overflow-y: auto; padding: .15rem; }
.logo-opt { display: flex; flex-direction: column; align-items: center; gap: .25rem; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: .45rem .25rem .35rem; cursor: pointer; font: inherit; color: var(--text-2); min-width: 0; }
.logo-opt:hover { background: var(--surface-2); }
.logo-opt[aria-checked="true"] { border-color: var(--income); box-shadow: 0 0 0 1px var(--income); background: var(--income-soft); color: var(--text); }
.logo-opt[hidden] { display: none; }
.icon-field[hidden] { display: none; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: .35rem; max-height: 196px; overflow-y: auto; padding: .15rem; }
.icon-opt { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 50%; cursor: pointer; color: var(--text-2); padding: 0; }
.icon-opt:hover { background: var(--surface-2); color: var(--text); }
.icon-opt[aria-checked="true"] { background: var(--pick, var(--income)); border-color: var(--pick, var(--income)); color: #fff; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--pick, var(--income)); }
.icon-none { font-size: .72rem; font-weight: 700; }
.cat-head { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.logo-tile { width: 36px; height: 36px; border-radius: 10px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; padding: 4px; }
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.logo-tile.initials { font-weight: 700; font-size: .75rem; color: #1f2937; background: #e5e7eb; }
.logo-name { font-size: .7rem; line-height: 1.15; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.small { width: 28px; height: 28px; font-size: .7rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .main-wrap { padding: 0; }
  .panel { border-radius: 0; border: 0; min-height: 100vh; }
  main { padding: 1.1rem 1rem 2rem; }
  .topbar { padding: .55rem 1rem; }
  .topbar .qa-label, .crumbs { display: none; }
}

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; min-width: 0; }
.card h2 { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card h2 a { font-size: .82rem; font-weight: 500; }
/* Cartão com cabeçalho: ícone + título, divisória, corpo */
.card.boxed { padding: 0; display: flex; flex-direction: column; }
.card-head { display: flex; align-items: center; gap: .55rem; padding: .95rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; font-size: .95rem; flex: 1; }
.card-head > .icon { color: var(--text); }
.card-head .head-link { font-size: .8rem; text-decoration: none; }
.card-body { padding: 1rem 1.25rem 1.15rem; flex: 1; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1200px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }
.stat .label { color: var(--text-2); font-size: .84rem; display: flex; gap: .35rem; align-items: center; }
.stat .value { font-size: 1.5rem; font-weight: 600; margin: .15rem 0; letter-spacing: -.02em; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { display: flex; gap: .75rem; justify-content: space-between; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .sub { display: block; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 550; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: .42rem 1rem; cursor: pointer; text-decoration: none; min-height: 36px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { opacity: .88; }
.btn.danger { color: var(--expense); border-color: color-mix(in srgb, var(--expense) 45%, var(--border)); }
.btn.danger.solid { background: var(--expense); color: #fff; border-color: var(--expense); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: .18rem .7rem; min-height: 30px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: progress; }
.pill { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: .3rem .75rem; font: inherit; font-size: .85rem; font-weight: 550; cursor: pointer; min-height: 36px; }
.pill:hover { background: var(--surface-2); }
.income-btn .icon { color: var(--income); }
.expense-btn .icon { color: var(--expense); }
.btn-group { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); padding: 3px; gap: 2px; }
.btn-group button { border: 0; border-radius: var(--radius); background: transparent; padding: .3rem .85rem; font: inherit; font-size: .85rem; color: var(--text-2); cursor: pointer; min-height: 30px; }
.btn-group button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.badge { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; padding: .05rem .55rem; font-size: .76rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge.ok { background: var(--income-soft); color: var(--income); }
.badge.pending { background: var(--info-soft); color: var(--info); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--expense-soft); color: var(--expense); }
.badge.neutral { background: var(--surface-2); color: var(--text-2); }
.badge.demo { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }

.alert { border-radius: 12px; padding: .65rem .85rem; display: flex; gap: .55rem; align-items: flex-start; border: 1px solid transparent; }
.alert.info { background: var(--info-soft); color: var(--text); }
.alert.warning { background: var(--warning-soft); color: var(--text); }
.alert.critical, .alert.error { background: var(--expense-soft); color: var(--text); }
.alert .ico { font-weight: 700; }
.alert a { color: inherit; }

.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--chart-1); border-radius: 999px; }
.progress.alerta > span { background: #e0a100; }
.progress.excedido > span { background: var(--expense); }
.progress.ok > span { background: var(--income); }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface); position: sticky; top: 0; }
tr:hover td { background: var(--surface-2); }
td .sub { display: block; font-size: .79rem; color: var(--muted); }
tfoot td { font-weight: 650; }
@media (max-width: 720px) {
  table.responsive thead { display: none; }
  table.responsive tr { display: block; border-bottom: 1px solid var(--border); padding: .45rem 0; }
  table.responsive td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .2rem .25rem; text-align: right; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; }
}

/* Formulários */
form .fields { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
form .fields .full { grid-column: 1 / -1; }
@media (max-width: 560px) { form .fields { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field label, .field .label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: .77rem; color: var(--muted); }
.field .error { font-size: .79rem; color: var(--expense); font-weight: 600; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--expense); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: .45rem .7rem; min-height: 38px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
textarea { min-height: 72px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; min-height: 0; accent-color: var(--primary); }
input[type="color"] { padding: .2rem; }
.check { display: flex; gap: .5rem; align-items: center; font-size: .9rem; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { min-width: 140px; flex: 1 1 140px; max-width: 240px; }
.form-error { margin-bottom: .75rem; }
.splits-row { display: grid; grid-template-columns: 1fr 140px auto; gap: .5rem; align-items: end; margin-bottom: .5rem; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 12, .4); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 1rem; z-index: 100; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); border: 1px solid var(--border); }
.modal.wide { max-width: 860px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem .65rem; border-bottom: 1px solid var(--border); }
.modal header h2 { margin: 0; }
.modal .body { padding: 1rem 1.25rem; }
.modal footer { display: flex; gap: .5rem; justify-content: flex-end; padding: .8rem 1.25rem 1rem; border-top: 1px solid var(--border); flex-wrap: wrap; }

.toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 200; max-width: min(92vw, 380px); }
.toast { background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: .9rem; }
.toast.error { background: var(--expense); color: #fff; }

.empty { text-align: center; padding: 1.75rem 1rem; color: var(--muted); }
.empty .big { display: none; }
.empty h3 { margin-top: .25rem; color: var(--text-2); font-weight: 500; }
.loading { padding: 2rem; text-align: center; color: var(--muted); }
.loading::before { content: ""; display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: .5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation: none; } .sidebar { transition: none; } }

/* Autenticação */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth .card { width: 100%; max-width: 420px; padding: 1.75rem; }
.auth form .fields { grid-template-columns: 1fr; }
.code-box { font: 600 1.15rem ui-monospace, Consolas, monospace; letter-spacing: .08em; background: var(--surface-2); border: 1px dashed var(--border-strong); padding: .75rem; border-radius: 12px; text-align: center; user-select: all; }

/* Gráficos */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; max-height: 320px; }
.chart text { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .grid line { stroke: var(--chart-grid); }
.chart .axis { stroke: var(--chart-axis); }
.chart .hit { fill: transparent; cursor: pointer; }
.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .78rem; color: var(--text-2); margin: .1rem 0 .5rem; }
.legend.right { justify-content: flex-end; margin: 0; }
.legend .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; vertical-align: 1px; }
.legend .sw.dash { height: 0; border-top: 2px dashed currentColor; border-radius: 0; width: 14px; vertical-align: 3px; }
.chart-tip { position: fixed; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: .45rem .65rem; font-size: .8rem; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 300; white-space: nowrap; }
.hbars .hbar { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: .6rem; align-items: center; padding: .25rem 0; font-size: .86rem; }
.hbars .track { background: var(--surface-2); border-radius: 999px; height: 8px; overflow: hidden; }
.hbars .fill { height: 100%; border-radius: 999px; }
details.table-toggle summary { cursor: pointer; font-size: .8rem; color: var(--muted); margin-top: .5rem; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 1.25rem; align-items: center; }
.donut-wrap svg { width: 150px; height: 150px; }
@media (max-width: 420px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .86rem; }
.donut-legend li { display: grid; grid-template-columns: 10px 1fr auto; gap: .5rem; align-items: center; }
.donut-legend .sw { width: 10px; height: 10px; border-radius: 50%; }

/* Painel (dashboard) */
.hello { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.hello h1 { font-size: 1.9rem; font-weight: 400; margin: 0; }
.hello h1 strong { font-weight: 650; }
.hello p { color: var(--text-2); margin: .2rem 0 0; font-size: 1.02rem; }
.hello-actions { display: flex; gap: .5rem; align-items: center; }
.month-nav { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; gap: .25rem; background: var(--surface); }
.month-nav .lbl { min-width: 150px; text-align: center; font-weight: 600; font-size: 1rem; text-transform: capitalize; }
.month-nav .icon-btn { border-radius: 50%; width: 32px; height: 32px; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; }
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.dash > .col { display: grid; gap: 1rem; min-width: 0; }
@media (max-width: 1200px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dash { grid-template-columns: 1fr; } }
.big-balance { font-size: 2.1rem; font-weight: 650; letter-spacing: -.03em; margin: .1rem 0 .2rem; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 1rem 0 .75rem; }
.kpi { padding: .7rem .75rem .7rem 0; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--border); padding-left: .9rem; }
.kpi span { font-size: .78rem; color: var(--text-2); }
.kpi strong { font-size: .98rem; font-weight: 600; white-space: nowrap; }
.dot-list { list-style: none; padding: 0; margin: 0; }
.dot-list li { display: flex; justify-content: space-between; gap: .75rem; padding: .4rem 0; font-size: .86rem; color: var(--text-2); }
.dot-list li > span { display: flex; align-items: center; gap: .55rem; }
.dot-list strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.expand { display: block; margin: .4rem auto 0; border: 0; background: none; color: var(--text-2); font: inherit; font-size: .82rem; cursor: pointer; }
.expand .icon { transition: transform .15s; }
.expand[aria-expanded="true"] .icon { transform: rotate(180deg); }
.row-item { display: flex; align-items: center; gap: .75rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.row-item:last-child { border-bottom: 0; }
a.row-item:hover { background: var(--surface-2); }
.row-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.row-item .grow span { font-size: .78rem; color: var(--muted); }
.row-item .amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.add-row { color: var(--text-2); }
.add-row .plus { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--income-soft); color: var(--income); }
.empty-mini { text-align: center; color: var(--muted); padding: .5rem 0 1rem; font-size: .9rem; }
.chart-caption { color: var(--text-2); font-size: .92rem; margin: .5rem 0 0; }
.lead { color: var(--text-2); font-size: .9rem; margin-bottom: .75rem; }
.lead strong { color: var(--text); }

/* Movimentações */
.ghost-btn { border-color: transparent; background: transparent; }
.icon-btn.round { border-radius: 50%; list-style: none; }
.tx-head h1 { font-size: 1.6rem; }
/* Abas segmentadas (Fluxo de caixa / Todos os lançamentos; Geral / Cartões / Contas) */
.seg { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; margin-bottom: 1.25rem; }
.seg button { border: 0; background: transparent; font: inherit; font-size: .88rem; color: var(--text-2); padding: .38rem .8rem; border-radius: var(--radius); cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; min-height: 32px; }
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg-sm { margin: 0; }
/* Cartões de resumo */
.kpi-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-card { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.25rem; }
.kpi-card > div > span { display: block; font-size: .8rem; color: var(--text-2); }
.kpi-card strong { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.kpi-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.kpi-ico.expense-soft { background: var(--expense-soft); color: var(--expense); }
.kpi-ico.income-soft { background: var(--income-soft); color: var(--income); }
.kpi-ico.neutral-soft { background: var(--surface-2); color: var(--text); }
.kpi-ico.info-soft { background: var(--info-soft); color: var(--info); }
.kpi-card em { display: block; font-style: normal; font-size: .76rem; color: var(--muted); margin-top: .1rem; }
/* Saldo negativo: mesmo vermelho do lançamento atrasado; positivo: verde claro */
.kpi-card.neg { background: color-mix(in srgb, var(--expense-soft) 60%, var(--surface)); border-color: color-mix(in srgb, var(--expense) 18%, var(--border)); }
.kpi-card.pos { background: color-mix(in srgb, var(--income-soft) 60%, var(--surface)); border-color: color-mix(in srgb, var(--income) 18%, var(--border)); }
.kpi-card.neg .kpi-ico { background: var(--expense-soft); color: var(--expense); }
.kpi-card.pos .kpi-ico { background: var(--income-soft); color: var(--income); }
/* Seletor de mês com setas (Movimentações) */
.month-pick { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-height: 38px; }
.mp-arrow { width: 34px; height: 36px; border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; border-radius: var(--radius); }
.mp-arrow:hover { background: var(--surface-2); color: var(--text); }
.month-pick .dd > summary.mp-label { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .5rem; min-width: 150px; justify-content: center; font-weight: 600; font-size: .9rem; border-radius: var(--radius); }
.month-pick .dd > summary.mp-label:hover { background: var(--surface-2); }
/* Botão "joinha" para marcar como pago direto na lista */
.col-paid { width: 48px; text-align: center !important; padding-left: 0 !important; padding-right: 0 !important; }
.thumb-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; padding: 0; transition: background .12s, color .12s, border-color .12s; }
.thumb-btn:hover { border-color: var(--income); color: var(--income); background: var(--income-soft); }
.thumb-btn.on { background: var(--income); border-color: var(--income); color: #fff; }
.thumb-btn.on:hover { filter: brightness(1.08); color: #fff; }
.thumb-btn.is-card { cursor: default; border-style: dashed; }
.thumb-btn.is-card:hover { background: var(--surface); color: var(--muted); border-color: var(--border-strong); }
.thumb-btn:disabled { opacity: .5; cursor: progress; }
:root[data-hide-values] main :is(.kpi-card strong, .col-val .money) { filter: blur(7px); }
/* Barra de ferramentas */
.tx-tools-row { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tx-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: .5rem; border: 1px solid var(--border); border-radius: 12px; padding: 0 .75rem; background: var(--surface); color: var(--muted); }
.tx-search:focus-within { outline: 2px solid var(--focus); outline-offset: 0; }
.tx-search input { border: 0; padding: .45rem 0; background: transparent; }
.tx-search input:focus { outline: none; }
.tx-tools-row > .btn, .tx-tools-row .dd > .btn, .tx-head .btn { border-radius: 12px; border-color: var(--border); font-size: .88rem; }
.tx-head .btn.primary { border-color: var(--primary); }
.tx-tools-row > .btn.tx-add { border-color: var(--primary); min-height: 40px; padding-inline: 1.1rem; }
.period-menu { min-width: 260px; }
/* Resumo + ferramentas fixos ao rolar a lista (e compactos) */
.tx-sticky { position: sticky; top: var(--tx-top, 0px); z-index: 15; background: var(--bg); margin: 0 -1.75rem; padding: 0 1.75rem; }
.tx-sticky.compact { padding-top: .6rem; padding-bottom: .1rem; box-shadow: 0 8px 18px -12px rgba(0,0,0,.35); border-bottom: 1px solid var(--border); margin-bottom: .9rem; }
.tx-sticky.compact .kpi-cards { gap: .6rem; margin-bottom: .6rem; }
.tx-sticky.compact .kpi-card { padding: .4rem .8rem; gap: .55rem; }
.tx-sticky.compact .kpi-card > div { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.tx-sticky.compact .kpi-card > div > span { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sticky.compact .kpi-card strong { font-size: .98rem; white-space: nowrap; }
.tx-sticky.compact .kpi-card em { display: none; }
.tx-sticky.compact .kpi-ico { width: 26px; height: 26px; }
.tx-sticky.compact .kpi-ico .icon { width: 14px; height: 14px; }
.tx-sticky.compact .tx-tools-row { gap: .45rem; margin-bottom: .6rem; flex-wrap: nowrap; }
.tx-sticky.compact .tx-tools-row > * { flex-shrink: 0; }
.tx-sticky.compact .tx-search { flex: 1 1 auto; flex-shrink: 1; min-width: 120px; }
.tx-sticky.compact .month-pick .dd > summary.mp-label { min-width: 120px; font-size: .84rem; }
.tx-sticky.compact .tx-tools-row > .btn, .tx-sticky.compact .tx-tools-row .seg button { min-height: 32px; padding-block: .25rem; font-size: .82rem; }
.tx-sticky.compact .tx-tools-row > .btn.tx-add { min-height: 32px; padding-inline: .85rem; }
.tx-sticky.compact .tx-search input { padding: .25rem 0; min-height: 30px; }
.tx-sticky.compact .month-pick { min-height: 32px; }
.tx-sticky.compact .mp-arrow { height: 30px; }
.tx-sticky.compact .bulk-bar { margin-bottom: .6rem; }
.tx-table-card .tx-table thead th { top: var(--tx-head, 0px); z-index: 5; }
@media (max-width: 900px) { .tx-sticky { margin: 0 -1rem; padding: 0 1rem; } }
@media (max-width: 760px) {
  .tx-sticky.compact .kpi-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tx-sticky.compact .kpi-card { padding: .35rem .5rem; }
  .tx-sticky.compact .kpi-card > div { flex-direction: column; gap: 0; }
  .tx-sticky.compact .kpi-ico { display: none; }
  .tx-sticky.compact .tx-tools-row .seg, .tx-sticky.compact .tx-tools-row > [data-filters] { display: none; }
}
.period-month { display: flex; align-items: center; justify-content: space-between; padding: .25rem .25rem .5rem; }
.period-month .icon-btn { width: 30px; height: 30px; border-radius: 50%; }
.period-custom { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .25rem .4rem .4rem; align-items: end; }
.period-custom .btn { grid-column: 1 / -1; }
/* Menus suspensos */
.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; }
.dd > summary::-webkit-details-marker { display: none; }
.dd-count { background: var(--text); color: var(--bg); border-radius: 999px; font-size: .7rem; padding: 0 .4rem; line-height: 1.5; font-weight: 600; }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 220px; max-height: 360px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: .4rem; display: flex; flex-direction: column; }
.dd-right .dd-menu { left: auto; right: 0; }
.dd-item { display: flex; align-items: center; gap: .55rem; padding: .4rem .55rem; border-radius: var(--radius); cursor: pointer; font-size: .9rem; min-width: 0; }
.dd-item:hover { background: var(--surface-2); }
.dd-item .avatar.small { width: 22px; height: 22px; font-size: .6rem; }
.dd-link { border: 0; background: none; font: inherit; font-size: .88rem; color: var(--text); text-align: left; padding: .45rem .6rem; border-radius: var(--radius); cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.dd-link:hover { background: var(--surface-2); }
.dd-link.danger-link { color: var(--expense); }
.dd-menu hr { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; width: 100%; }
.bulk-bar { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; padding: .55rem .9rem; background: var(--info-soft); border-radius: 12px; flex-wrap: wrap; }
.bulk-bar .spacer { flex: 1; }
/* Tabela */
.tx-table-card { padding: 0; }
.tx-table-card .table-wrap { overflow: visible; }
.tx-table th { background: var(--surface); text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 500; color: var(--text-2); padding: .75rem .75rem; border-bottom: 1px solid var(--border); }
.tx-table th:first-child { border-top-left-radius: var(--radius); }
.tx-table th:last-child { border-top-right-radius: var(--radius); }
.tx-table td { vertical-align: middle; padding: .55rem .75rem; }
.tx-table tbody tr:last-child td { border-bottom: 0; }
.tx-table tr.inv-row { cursor: pointer; }
.tx-table tr.inv-row .cell-main { font-weight: 650; }
.inv-avatar.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.inv-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.inv-summary > div { display: flex; flex-direction: column; gap: .2rem; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.inv-summary span { font-size: .75rem; color: var(--muted); }
.inv-summary strong { font-size: .95rem; }
@media (max-width: 560px) { .inv-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.inv-list { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; margin: 0 -.25rem; }
.inv-item { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .5rem; border: 0; border-bottom: 1px solid var(--border); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; border-radius: var(--radius); }
.inv-item:last-child { border-bottom: 0; }
.inv-item:hover { background: var(--surface-2); }
.inv-item .grow { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.inv-item .money { font-weight: 650; white-space: nowrap; }
.inv-sub { font-size: .85rem; margin: 1rem 0 .25rem; color: var(--text-2); }
.tx-table tr.overdue td { background: color-mix(in srgb, var(--expense-soft) 60%, var(--surface)); }
.tx-table tr.overdue:hover td { background: var(--expense-soft); }
.tx-table.grouped tbody tr.overdue[data-id] td:is(:first-child, :last-child) { border-radius: 0; }
.tx-table tr.sel td { background: var(--info-soft); }
.col-check { width: 40px; padding-left: 1rem !important; }
.col-date { width: 80px; white-space: nowrap; }
.col-cat { width: 16%; }
.col-acc { width: 18%; }
.col-status { width: 120px; }
.col-val { width: 130px; font-weight: 600; }
.col-act { width: 44px; text-align: right; }
.cell-main { display: block; font-size: .92rem; color: var(--text); }
.cell-sub { display: block; font-size: .76rem; color: var(--muted); }
.cell-sub .icon { vertical-align: -2px; }
.desc-btn { display: flex; align-items: center; gap: .7rem; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; min-width: 0; max-width: 100%; }
.desc-btn:hover .cell-main { text-decoration: underline; text-underline-offset: 2px; }
.desc-text { min-width: 0; display: flex; flex-direction: column; }
.cat-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex: none; color: #fff; }
.cat-dot.small { width: 28px; height: 28px; }
.cat-dot.neutral { background: var(--surface-2); color: var(--text-2); }
.cat-dot.tiny { width: 20px; height: 20px; font-size: .62rem; }
.cat-dot.tiny .icon { width: 12px; height: 12px; }
.acc-cell { display: flex; align-items: center; gap: .5rem; min-width: 0; font-size: .9rem; }
.acc-cell .avatar.small { width: 24px; height: 24px; font-size: .6rem; }
.badge-btn { cursor: pointer; font: inherit; font-size: .76rem; font-weight: 600; }
.badge-btn:hover { filter: brightness(.96); outline: 1px solid var(--border-strong); }
.badge-btn:disabled { opacity: .5; }
.row-menu .dd-menu { min-width: 230px; }
/* Agrupamento por data: cabeçalho "01/10/26" com linha; sem divisória entre lançamentos do mesmo dia. */
.tx-table .day-row th { position: static; background: transparent; text-transform: none; letter-spacing: 0; font-size: .76rem; font-weight: 600; color: var(--muted); padding: 1.1rem 1rem .3rem; border-bottom: 0; }
.tx-table tbody .day-row:first-child th { padding-top: .7rem; }
.tx-table .day-row span { display: flex; align-items: center; gap: .75rem; }
.tx-table .day-row span::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.tx-table .day-row:hover th { background: transparent; }
.tx-table.grouped tbody tr[data-id] td { border-bottom: 0; padding-top: .45rem; padding-bottom: .45rem; }
.tx-table.grouped tbody tr[data-id] td:first-child { border-radius: 12px 0 0 12px; }
.tx-table.grouped tbody tr[data-id] td:last-child { border-radius: 0 12px 12px 0; }
.tx-table.grouped tbody tr:last-child td { padding-bottom: .8rem; }
/* Nas últimas linhas o menu abre para cima, para não ser cortado pela borda do painel. */
.tx-table tbody tr:nth-last-child(-n+3):not(:nth-child(-n+3)) .row-menu .dd-menu { top: auto; bottom: calc(100% + 6px); }
.table-more { text-align: center; padding: 1rem; border-top: 1px solid var(--border); }
.filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.filter-grid fieldset { border: 1px solid var(--border); border-radius: 12px; padding: .5rem .5rem .6rem; margin: 0; min-width: 0; }
.filter-grid fieldset.scroll { max-height: 280px; overflow-y: auto; }
.filter-grid legend { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 0 .35rem; }
@media (max-width: 1100px) { .col-cat { display: none; } }
@media (max-width: 900px) {
  .kpi-cards { grid-template-columns: 1fr; gap: .6rem; }
  .tx-head .btn:not(.primary) { padding: .4rem .7rem; }
}
@media (max-width: 760px) {
  .filter-grid { grid-template-columns: 1fr; }
  .tx-search { order: 3; flex-basis: 100%; }
  /* Tabela vira lista de cartões no celular */
  .tx-table thead { display: none; }
  .tx-table, .tx-table tbody { display: block; }
  .tx-table tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 36px 30px; grid-template-areas: "chk desc val paid act" "chk meta status paid act"; gap: .15rem .5rem; padding: .7rem .75rem; border-bottom: 1px solid var(--border); align-items: center; }
  .tx-table .col-paid { grid-area: paid; width: auto; }
  .tx-table tr.day-row { display: block; padding: 0; border-bottom: 0; }
  .tx-table tr.day-row th { display: block; padding: .9rem .75rem .2rem; }
  .tx-table.grouped tbody tr[data-id] { border-bottom: 0; }
  .tx-table.grouped .col-date { display: none; }
  .tx-table td { display: block; border: 0; padding: 0; }
  .tx-table .col-check { grid-area: chk; padding: 0 !important; width: auto; }
  .tx-table .col-desc { grid-area: desc; min-width: 0; }
  .tx-table .col-val { grid-area: val; width: auto; }
  .tx-table .col-status { grid-area: status; width: auto; text-align: right; }
  .tx-table .col-act { grid-area: act; width: auto; }
  .tx-table .col-date { grid-area: meta; font-size: .78rem; color: var(--muted); padding-left: 2.6rem; }
  .tx-table .col-date .cell-main, .tx-table .col-date .cell-sub { display: inline; font-size: .78rem; color: var(--muted); }
  .tx-table .col-date .cell-sub::before { content: " "; }
  .tx-table .col-cat, .tx-table .col-acc { display: none; }
  .dd-menu { position: fixed; left: 1rem !important; right: 1rem !important; top: auto; bottom: 1rem; max-height: 60vh; }
}

.tx-table tbody tr { cursor: pointer; }
.tx-table tr.active td { background: var(--surface-2); }
.tx-table tr.active td:first-child { box-shadow: inset 3px 0 0 var(--text); }

/* Janela lateral (detalhes da movimentação) */
body.drawer-open { overflow: hidden; }
.drawer-root { position: fixed; inset: 0; z-index: 90; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 12, .35); backdrop-filter: blur(2px); animation: fadeIn .16s ease-out; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--bg); border-left: 1px solid var(--border); box-shadow: -20px 0 50px rgba(0,0,0,.18); animation: slideIn .18s ease-out; display: flex; }
.drawer-root.closing .drawer { animation: slideOut .16s ease-in forwards; }
.drawer-root.closing .drawer-backdrop { animation: fadeOut .16s ease-in forwards; }
@keyframes slideIn { from { transform: translateX(100%); } }
@keyframes slideOut { to { transform: translateX(100%); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop, .drawer-root.closing .drawer { animation: none; } }
.drawer-inner { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: 1.1rem 1.25rem .9rem; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 1.05rem; margin: 0; }
.drawer-head p { margin: .1rem 0 0; font-size: .88rem; max-width: 320px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: grid; gap: .9rem; align-content: start; }
.drawer-foot { border-top: 1px solid var(--border); padding: .75rem 1.25rem 1rem; display: grid; gap: .5rem; }
.drawer-foot .btn.primary { border-radius: 12px; min-height: 44px; }
.save-state { text-align: center; }
.dw-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: .85rem 1rem; }
.dw-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin: 0 0 .5rem; }
.dw-hero { text-align: center; padding: 1.25rem 1rem 1rem; display: grid; justify-items: center; gap: .35rem; }
.hero-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; margin-bottom: .2rem; }
.hero-title { text-align: center; font-weight: 600; font-size: 1.02rem; }
.hero-cat { color: var(--muted); font-size: .84rem; margin: 0; }
.hero-amount { display: flex; align-items: baseline; justify-content: center; gap: .3rem; font-size: 1.8rem; font-weight: 650; letter-spacing: -.02em; margin: .25rem 0; }
.hero-amount > span:first-child { font-size: 1.5rem; }
.hero-amount input { font: inherit; color: inherit; letter-spacing: inherit; width: 8ch; field-sizing: content; min-width: 4ch; text-align: left; padding: 0 .2rem; }
.hero-chips { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: center; margin-bottom: .5rem; }
.hero-chips .icon { vertical-align: -2px; }
.dw-hero > .btn.block { border-radius: 12px; margin-top: .25rem; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; width: 100%; }
.hero-actions .btn { border-radius: 12px; }
/* Campo "invisível": parece texto, vira campo ao passar o mouse/focar. */
.inline { border: 1px solid transparent; background: transparent; border-radius: var(--radius); min-height: 32px; padding: .25rem .45rem; color: var(--text); font: inherit; width: 100%; transition: background .12s, border-color .12s; }
.inline:hover { background: var(--surface-2); }
.inline:focus { background: var(--surface); border-color: var(--border-strong); outline: 2px solid var(--focus); outline-offset: 0; }
.inline[aria-invalid="true"] { border-color: var(--expense); background: var(--expense-soft); }
select.inline { cursor: pointer; appearance: none; text-align: right; text-align-last: right; padding-right: .45rem; }
.inline-error { grid-column: 1 / -1; color: var(--expense); font-size: .78rem; font-weight: 600; text-align: right; }
.dw-hero .inline-error { text-align: center; }
.info-list { display: grid; }
.info-row { display: grid; grid-template-columns: 40% 60%; align-items: center; padding: .3rem 0; border-bottom: 1px solid var(--border); min-height: 44px; }
.info-row:last-child { border-bottom: 0; }
.info-row > label, .info-label { color: var(--muted); font-size: .88rem; }
.info-row > .inline { text-align: right; }
.info-value { text-align: right; font-size: .92rem; padding: 0 .45rem; }
.info-row.stacked { grid-template-columns: 1fr; gap: .25rem; padding-top: .55rem; }
.info-row.stacked textarea { min-height: 54px; resize: vertical; }
.inline-with-avatar { display: flex; align-items: center; gap: .35rem; justify-content: flex-end; min-width: 0; }
.inline-with-avatar .avatar.small { width: 22px; height: 22px; font-size: .58rem; }
.inline-with-avatar select { width: auto; max-width: 100%; }
.link-btn { border: 0; background: none; color: var(--link); font: inherit; cursor: pointer; padding: 0 .2rem; text-decoration: underline; }
.quick-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; background: var(--surface-2); border-radius: var(--radius); padding: .6rem .75rem; font-size: .92rem; }
.switch { width: 40px; height: 22px; border-radius: 999px; border: 0; background: var(--border-strong); position: relative; cursor: pointer; flex: none; padding: 0; transition: background .15s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--income); }
.switch[aria-checked="true"] span { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.upload-btn { display: flex; align-items: center; gap: .5rem; border: 1px dashed var(--border-strong); border-radius: 12px; padding: .6rem .8rem; cursor: pointer; font-size: .9rem; margin-top: .4rem; flex-wrap: wrap; }
.upload-btn:hover { background: var(--surface-2); }
.upload-btn:focus-within { outline: 2px solid var(--focus); }
.dw-history summary { cursor: pointer; margin: 0; }
.dw-history[open] summary { margin-bottom: .5rem; }
:root[data-hide-values] .drawer .hero-amount { filter: blur(8px); }

/* Janela "Nova movimentação" */
/* Variante centralizada: cartão flutuante no meio da tela. */
.drawer-root.centered .drawer { top: 50%; left: 50%; right: auto; bottom: auto; width: min(470px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); height: auto;
  transform: translate(-50%, -50%); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 24px 70px rgba(0,0,0,.28); animation: popIn .16s ease-out; overflow: hidden; }
.drawer-root.centered .drawer .drawer-inner { max-height: calc(100vh - 2rem); }
.drawer-root.centered.closing .drawer { animation: popOut .14s ease-in forwards; }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
@keyframes popOut { to { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .drawer-root.centered .drawer, .drawer-root.centered.closing .drawer { animation: none; } }
@media (max-width: 560px) {
  .drawer-root.centered .drawer { top: 0; left: 0; width: 100vw; height: 100%; max-height: none; transform: none; border-radius: 0; border: 0; }
  .drawer-root.centered .drawer .drawer-inner { max-height: none; }
  @keyframes popIn { from { opacity: 0; } }
  @keyframes popOut { to { opacity: 0; } }
}
.cr-head { display: flex; align-items: center; justify-content: space-between; padding: 1.4rem 1.6rem .4rem; }
.cr-head h2 { font-size: 1.2rem; margin: 0; }
.cr-head .icon-btn { color: var(--muted); }
.kind-tabs { display: flex; gap: .35rem; padding: .3rem 1.6rem .2rem; flex-wrap: wrap; }
.kind-tab { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: .22rem .7rem; font: inherit; font-size: .8rem; font-weight: 550; color: var(--text-2); cursor: pointer; }
.kind-tab:hover { background: var(--surface-2); }
.kind-tab.expense .icon { color: var(--expense); }
.kind-tab.income .icon { color: var(--income); }
.kind-tab[aria-checked="true"] { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); font-weight: 650; }
.cr-body { gap: .95rem; padding: .8rem 1.6rem 1rem; }
.cr-body .field > label, .cr-body .field > .label, .tool-panel > label, .tool-panel > .label { font-size: .88rem; color: var(--text-2); font-weight: 500; }
.cr-body input:not([type=checkbox]), .cr-body select, .cr-body textarea { border-radius: 12px; min-height: 48px; border-color: var(--border-strong); font-size: .95rem; }
.cr-body input:focus, .cr-body select:focus, .cr-body textarea:focus { outline: none; border-color: var(--income); box-shadow: 0 0 0 1px var(--income); }
.cr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 420px) { .cr-grid { grid-template-columns: 1fr; } }
.prefix-input { display: flex; align-items: center; gap: .35rem; border: 1px solid var(--border-strong); border-radius: 12px; padding: 0 .8rem; background: var(--surface); min-height: 48px; }
.prefix-input:focus-within { border-color: var(--income); box-shadow: 0 0 0 1px var(--income); }
.prefix-input span { color: var(--muted); }
.cr-body .prefix-input input { border: 0; box-shadow: none !important; padding: 0; min-height: 46px; background: transparent; font-weight: 600; }
.prefix-input.expense input { color: var(--expense); }
.prefix-input.income input { color: var(--income); }
.switch-row { display: flex; align-items: center; gap: .6rem; font-size: .9rem; cursor: pointer; width: fit-content; }
.paid-note { margin: 0; display: flex; align-items: center; gap: .35rem; }
.select-avatar { position: relative; display: flex; align-items: center; }
.select-avatar .avatar { position: absolute; left: .7rem; pointer-events: none; width: 24px; height: 24px; font-size: .6rem; }
.cr-body .select-avatar select { padding-left: 2.6rem; }
.combo { position: relative; }
.cr-body .combo input { padding-right: 2.2rem; }
.combo-chev { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.combo-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 220px; z-index: 30; max-height: 240px; overflow-y: auto; margin: 0; padding: .35rem; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.15); }
.combo-list li { display: flex; align-items: center; gap: .5rem; padding: .45rem .55rem; border-radius: var(--radius); cursor: pointer; font-size: .88rem; }
.combo-list li.sub { padding-left: 1.2rem; }
.combo-list li:hover, .combo-list li.active { background: var(--surface-2); }
.combo-list li[aria-selected="true"] { font-weight: 650; }
.combo-empty { color: var(--muted); cursor: default !important; }
.combo-parent { color: var(--muted); font-weight: 400; }
/* Seletor elegante aplicado a todo <select> (controls.js). O <select> real fica escondido, mas no formulário. */
select.select-hidden { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; clip-path: inset(50%); }
.pick-btn.native-pick { justify-content: space-between; min-height: 38px; padding: .45rem .7rem; border-radius: var(--radius); font-size: inherit; }
.pick-btn.native-pick .pick-label { min-width: 0; flex: 1; text-align: left; }
.pick-btn.native-pick > .icon { flex: none; color: var(--muted); transition: transform .15s; }
.pick-btn.native-pick[aria-expanded="true"] > .icon { transform: rotate(180deg); }
.pick-btn.native-pick:hover:not(:disabled) { border-color: color-mix(in srgb, var(--text) 30%, var(--border-strong)); }
.pick-btn.native-pick:disabled { opacity: .6; cursor: not-allowed; }
.pick-btn.native-pick[aria-invalid] { border-color: var(--expense); box-shadow: 0 0 0 1px var(--expense); }
.cr-body .pick-btn.native-pick { min-height: 48px; border-radius: 12px; font-size: .95rem; }
.pick-btn.native-pick.compact { display: inline-flex; width: auto; max-width: 100%; min-height: 32px; padding: .25rem .55rem; gap: .4rem; border-radius: var(--radius); font-size: .88rem; }
.info-row .pick-btn.native-pick.compact, .inline-with-avatar .pick-btn.native-pick.compact { background: transparent; border-color: transparent; margin-left: auto; }
.info-row .pick-btn.native-pick.compact:hover, .inline-with-avatar .pick-btn.native-pick.compact:hover { background: var(--surface-2); }
.pick-list li.disabled { opacity: .45; cursor: not-allowed; }
.pick-list li[aria-selected="true"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--income); flex: none; }
.pick-btn { display: flex; align-items: center; gap: .55rem; width: 100%; min-height: 48px; padding: .45rem 2.2rem .45rem .7rem; font: inherit; font-size: .95rem; color: var(--text); text-align: left; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; }
.pick-btn:focus-visible, .pick-btn[aria-expanded="true"] { outline: none; border-color: var(--income); box-shadow: 0 0 0 1px var(--income); }
.pick-btn .avatar, .combo-list .avatar { width: 24px; height: 24px; font-size: .6rem; flex: none; }
.combo-list .combo-group { cursor: default; padding: .55rem .55rem .25rem; font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.combo-list .combo-group:hover { background: none; }
.combo-list .combo-group:not(:first-child) { margin-top: .3rem; border-top: 1px solid var(--border); padding-top: .65rem; border-radius: 0; }
.card-note { display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border-radius: 12px; padding: .5rem .75rem; font-size: .84rem; color: var(--text-2); margin-top: -.3rem; }
.cr-body .card-note select { width: auto; min-height: 30px; padding: .1rem .4rem; border-radius: var(--radius); display: inline-block; font-size: .84rem; }
.tools { display: flex; justify-content: space-around; padding: .4rem 0 .2rem; }
.tool-btn { position: relative; width: 52px; height: 52px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.tool-btn:hover { background: var(--surface-2); color: var(--text); }
.tool-btn[aria-pressed="true"] { border-color: var(--text); color: var(--text); }
.tool-btn.on { background: var(--income-soft); border-color: var(--income); color: var(--income); }
.tool-dot { position: absolute; top: 3px; right: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--income); border: 2px solid var(--surface); }
.tool-panel { display: grid; gap: .45rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.tool-panel .inline-label { font-size: .85rem; color: var(--text-2); }
.file-row { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.file-row .ellipsis { flex: 1; min-width: 0; }
.date-field { position: relative; display: flex; }
.cr-body .date-field input { padding-right: 2.8rem; cursor: pointer; }
.cal-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.cal-btn:hover { background: var(--surface-2); color: var(--text); }
.cal-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 272px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.15); padding: .6rem; }
/* Listas flutuantes da janela de criação: ficam sobre tudo (fora da área rolável). Posição definida via JS. */
.float-pop { position: fixed !important; right: auto !important; bottom: auto !important; z-index: 140; overflow-y: auto; box-shadow: 0 16px 44px rgba(0,0,0,.22) !important; }
.float-pop[hidden] { display: none !important; }
.combo-list.float-pop { font-size: .9rem; color: var(--text); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.cal-head .icon-btn { width: 30px; height: 30px; border-radius: 50%; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: .72rem; color: var(--muted); font-weight: 600; padding: .2rem 0; }
.cal-day { border: 0; background: none; border-radius: var(--radius); height: 34px; font: inherit; font-size: .86rem; color: var(--text); cursor: pointer; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--border-strong); font-weight: 650; }
.cal-day.sel { background: var(--income); color: #fff; font-weight: 650; }
.cal-foot { display: flex; gap: 1rem; justify-content: center; padding-top: .4rem; border-top: 1px solid var(--border); margin-top: .4rem; }
.chips-input { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; border: 1px solid var(--border-strong); border-radius: 12px; padding: .3rem .45rem; min-height: 48px; background: var(--surface); }
.chips-input:focus-within { border-color: var(--income); box-shadow: 0 0 0 1px var(--income); }
.cr-body .chips-input input { border: 0; flex: 1; min-width: 120px; min-height: 34px; padding: .2rem .3rem; background: transparent; box-shadow: none !important; }
.chip-tag { display: inline-flex; align-items: center; gap: .2rem; background: var(--surface-2); border-radius: 999px; padding: .1rem .2rem .1rem .6rem; font-size: .82rem; font-weight: 550; }
.chip-tag button { border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; padding: 0; }
.chip-tag button:hover { background: var(--border); color: var(--text); }
.seg-full { display: flex; width: 100%; margin: 0; }
.seg-full button { flex: 1; justify-content: center; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cr-actions { display: flex; align-items: center; justify-content: center; gap: 2.2rem; padding: 1rem 1.6rem 1.4rem; border-top: 1px solid var(--border); margin: 0 1.6rem; }
.round-act { width: 46px; height: 46px; border-radius: var(--radius); border: 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.round-act:hover { background: var(--border); color: var(--text); }
.round-act.primary-act { width: 66px; height: 66px; background: var(--income); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--income) 35%, transparent); }
.round-act.primary-act:hover { filter: brightness(1.06); background: var(--income); color: #fff; }
.round-act:disabled { opacity: .5; cursor: progress; }
.round-act.danger-act:hover { background: color-mix(in srgb, var(--expense) 14%, transparent); color: var(--expense); }
.kind-tab:disabled { opacity: .45; cursor: not-allowed; }
.kind-tab:disabled:hover { background: var(--surface); }
.cr-badge { font-size: .72rem; vertical-align: middle; margin-left: .35rem; }
.tool-panel > .file-row + .file-row, .tool-panel > .file-row + .link-btn { margin-top: .4rem; }
.cr-body .form-error { margin: 0; }

/* Calendário */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar .dow { font-size: .74rem; color: var(--muted); text-align: center; font-weight: 600; }
.calendar .day { min-height: 86px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 5px; font-size: .74rem; overflow: hidden; }
.calendar .day.out { opacity: .45; }
.calendar .day.today { border-color: var(--text); }
.calendar .day .n { font-weight: 700; color: var(--text-2); }
.calendar .ev { display: block; border-radius: 6px; padding: 1px 5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; width: 100%; text-align: left; font: inherit; cursor: pointer; text-decoration: none; }
.calendar .ev.expense { background: var(--expense-soft); color: var(--expense); }
.calendar .ev.income { background: var(--income-soft); color: var(--income); }
.calendar .ev.other { background: var(--surface-2); color: var(--text-2); }
@media (max-width: 720px) { .calendar .day { min-height: 56px; } .calendar .ev { font-size: .64rem; } }

/* Boas-vindas */
.steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; }
.steps li { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-2); }
.steps li.done { background: var(--text); }

@media print {
  .sidebar, .topbar, .no-print, .demo-banner, .toasts { display: none !important; }
  .shell { display: block; }
  .main-wrap { padding: 0; }
  .panel { border: 0; }
  body { background: #fff; color: #000; }
  .card { break-inside: avoid; }
  main { padding: 0; max-width: none; }
}

/* ===== Visual "soft" de todas as páginas internas (cinza quente, cards claros translúcidos, pílulas e botão preto).
   Tokens no .panel; regras específicas do Painel em .dash-v2; regras gerais em ".panel main". ===== */
.panel { --dash-bg: #edebe8; --dash-card: rgba(255,255,255,.62); --dash-card-solid: #f7f6f4; --dash-line: rgba(0,0,0,.06); --dash-pill: rgba(255,255,255,.7); background: var(--dash-bg); }
:root[data-theme="dark"] .panel { --dash-bg: #111113; --dash-card: rgba(255,255,255,.035); --dash-card-solid: #1b1b1e; --dash-line: rgba(255,255,255,.07); --dash-pill: rgba(255,255,255,.06); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .panel { --dash-bg: #111113; --dash-card: rgba(255,255,255,.035); --dash-card-solid: #1b1b1e; --dash-line: rgba(255,255,255,.07); --dash-pill: rgba(255,255,255,.06); } }
.panel .topbar { background: var(--dash-bg); border-bottom-color: var(--dash-line); }
.dash-v2 { --r: 12px; }
.dash-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 1.5rem; flex-wrap: wrap; margin: .25rem 0 1.6rem; }
.dash-hero h1 { font-size: 2rem; font-weight: 400; letter-spacing: -.02em; margin: 0; }
.dash-hero p { color: var(--muted); margin: .35rem 0 0; font-size: .92rem; }
.dash-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.dash-v2 .month-nav { background: var(--dash-pill); border: 1px solid var(--dash-line); padding: 3px; }
.dash-v2 .month-nav .lbl { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-width: 128px; font-size: .86rem; font-weight: 500; color: var(--text-2); cursor: pointer; }
.dash-v2 .month-nav .icon-btn { width: 30px; height: 30px; border: 0; background: transparent; }
.pill-group { display: inline-flex; gap: .35rem; }
.pill-group button { border: 1px solid var(--dash-line); background: var(--dash-pill); color: var(--muted); font: inherit; font-size: .84rem; padding: .5rem .95rem; border-radius: var(--radius); cursor: pointer; }
.pill-group button:hover { color: var(--text); }
.pill-group button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.dash-v2 .round-btn { width: 40px; height: 40px; background: var(--dash-pill); border: 1px solid var(--dash-line); }
.btn-dark { display: inline-flex; align-items: center; gap: .45rem; background: var(--text); color: var(--bg); border: 0; border-radius: 12px; padding: .7rem 1.15rem; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-dark:hover { filter: brightness(1.15); }
.btn-dark.small { padding: .42rem .8rem; font-size: .78rem; border-radius: var(--radius); }
.dash-subbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 1rem 3rem; }
.stat-x { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: .55rem; row-gap: .2rem; min-width: 0; }
.stat-x .chip { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--dash-pill); border: 1px solid var(--dash-line); color: var(--text-2); }
.stat-x strong { font-size: 1.75rem; font-weight: 450; letter-spacing: -.025em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-x > span:last-child { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
/* Cor dos destaques: saldo verde/vermelho, receitas verde, despesas vermelho, investido azul */
.stat-x.tone-income strong { color: var(--income); }
.stat-x.tone-expense strong { color: var(--expense); }
.stat-x.tone-info strong { color: var(--info); }
.stat-x.tone-income .chip { background: var(--income-soft); color: var(--income); border-color: transparent; }
.stat-x.tone-expense .chip { background: var(--expense-soft); color: var(--expense); border-color: transparent; }
.stat-x.tone-info .chip { background: var(--info-soft); color: var(--info); border-color: transparent; }
.dash-filters { margin: 0; gap: .5rem; }
.dash-filters .field { min-width: 195px; max-width: 240px; }
.dash-filters .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.dash-filters .pick-btn.native-pick { border-radius: var(--radius); min-height: 38px; background: var(--dash-pill); border-color: var(--dash-line); font-size: .84rem; padding-inline: .95rem; }
.dash-v2 .card { background: var(--dash-card); border: 1px solid var(--dash-line); border-radius: var(--r); box-shadow: 0 1px 2px rgba(0,0,0,.03); backdrop-filter: blur(10px); }
.dash-v2 .card-head { border-bottom: 0; padding: 1.15rem 1.3rem .35rem; align-items: flex-start; flex-wrap: wrap; row-gap: .4rem; }
.dash-v2 .card-head .head-text { flex-basis: 170px; }
.dash-v2 .card-head > .icon { display: none; }
.dash-v2 .card-head .head-text { flex: 1; min-width: 0; }
.dash-v2 .card-head h2 { font-size: 1.04rem; font-weight: 600; letter-spacing: -.01em; }
.dash-v2 .card-head p { margin: .15rem 0 0; font-size: .76rem; color: var(--muted); }
.dash-v2 .card-head .head-link { border: 1px solid var(--dash-line); background: var(--dash-pill); border-radius: var(--radius); padding: .35rem .8rem; font-size: .76rem; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.dash-v2 .card-head .head-link:hover { color: var(--text); background: var(--surface); }
.dash-v2 .card-head .legend { font-size: .72rem; flex-basis: 100%; justify-content: flex-start; margin: 0; }
.dash-v2 .card-body { padding: .6rem 1.3rem 1.2rem; }
.dash-v2 .card-body.flush { padding: .35rem .55rem .65rem; }
.dash-v2 .row-item { border-bottom: 1px solid var(--dash-line); padding: .7rem .75rem; border-radius: 12px; }
.dash-v2 .row-item:hover { background: var(--dash-pill); }
.dash-v2 .row-item .grow strong { font-weight: 550; font-size: .9rem; }
.dash-v2 .dot-list li { border-bottom: 1px solid var(--dash-line); padding: .55rem 0; }
.dash-v2 .dot-list li:last-child { border-bottom: 0; }
.dash-v2 .progress { background: var(--dash-line); height: 6px; border-radius: 999px; }
.dash-v2 .progress > span { background: var(--text); border-radius: 999px; }
.dash-v2 .progress.alerta > span { background: #e0a100; }
.dash-v2 .progress.excedido > span { background: var(--expense); }
.dash-v2 .alert { border-radius: var(--radius); }
.dash-v2 .btn.block { border-radius: 12px; }
.dash-v2 .add-row .plus { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--dash-pill); border: 1px dashed var(--border-strong); }
@media (max-width: 1100px) { .dash-stats { grid-template-columns: repeat(2, minmax(0, auto)); } }
@media (max-width: 640px) {
  .dash-hero h1 { font-size: 1.55rem; }
  .dash-tools { width: 100%; }
  .dash-tools .btn-dark { flex: 1; justify-content: center; }
  .stat-x strong { font-size: 1.35rem; }
  .dash-stats { gap: 1rem 1.5rem; width: 100%; }
  .dash-filters { width: 100%; }
  .dash-filters .field { flex: 1 1 140px; max-width: none; min-width: 0; }
}

/* --- Padrão "soft" aplicado a todas as páginas internas --- */
.panel main .card { background: var(--dash-card); border: 1px solid var(--dash-line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.03); backdrop-filter: blur(10px); }
.panel main .card h2 { font-size: 1.04rem; font-weight: 600; letter-spacing: -.01em; }
.panel main .card-head { border-bottom-color: var(--dash-line); }
.panel main .page-head { align-items: flex-end; margin: .25rem 0 1.5rem; }
.panel main .page-head h1 { font-size: 2rem; font-weight: 400; letter-spacing: -.02em; margin: 0; }
.panel main .page-head p { color: var(--muted); font-size: .92rem; margin-top: .35rem; }
/* Botões: secundário em pílula clara; principal preto, cantos arredondados como na referência */
.panel main .btn { background: var(--dash-pill); border-color: var(--dash-line); font-weight: 500; }
.panel main .btn:hover { background: var(--surface); }
.panel main .btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); border-radius: 12px; font-weight: 600; }
.panel main .btn.primary:hover { background: var(--text); filter: brightness(1.15); opacity: 1; }
.panel main .btn.ghost { background: transparent; border-color: transparent; }
.panel main .btn.ghost:hover { background: var(--dash-pill); }
.panel main .btn.danger { background: transparent; border-color: color-mix(in srgb, var(--expense) 35%, transparent); }
.panel main .btn.danger.solid { background: var(--expense); color: #fff; }
/* Abas e grupos de botões em pílulas */
.panel main :is(.seg, .btn-group) { background: var(--dash-pill); border-color: var(--dash-line); border-radius: var(--radius); }
.panel main :is(.seg, .btn-group) button { border-radius: var(--radius); color: var(--muted); }
.panel main :is(.seg, .btn-group) button:hover { color: var(--text); }
.panel main :is(.seg button[aria-selected="true"], .seg button[aria-pressed="true"], .btn-group button[aria-pressed="true"]) { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
/* Números de destaque mais leves e grandes */
.panel main .stat .value { font-size: 1.7rem; font-weight: 450; letter-spacing: -.025em; }
.panel main .stat .label { color: var(--muted); }
/* Linhas, listas e tabelas com divisórias suaves */
.panel main :is(th, td) { border-bottom-color: var(--dash-line); }
.panel main th { background: var(--dash-card-solid); color: var(--muted); }
.panel main .list > li, .panel main .dot-list li { border-bottom-color: var(--dash-line); }
.panel main .row-item { border-bottom-color: var(--dash-line); }
.panel main .progress { background: var(--dash-line); }
.panel main .month-nav, .panel main .month-pick, .panel main .tx-search { background: var(--dash-pill); border-color: var(--dash-line); }
.panel main .alert { border-radius: var(--radius); }
.panel main .empty { background: transparent; }
/* Movimentações: faixa fixa e tabela sobre o fundo cinza */
.panel main .tx-sticky { background: var(--dash-bg); }
.panel main .tx-table th, .panel main .tx-table .day-row th { background: var(--dash-card-solid); }
.panel main .tx-table tbody tr[data-id]:not(.overdue):not(.sel):not(.active):hover td, .panel main .tx-table tr.inv-row:not(.overdue):hover td { background: var(--dash-pill); }
.panel main .kpi-card:not(.neg):not(.pos) { background: var(--dash-card); }
.panel main .card.kpi-card.neg { background: color-mix(in srgb, var(--expense-soft) 75%, var(--surface)); border-color: color-mix(in srgb, var(--expense) 18%, transparent); }
.panel main .card.kpi-card.pos { background: color-mix(in srgb, var(--income-soft) 75%, var(--surface)); border-color: color-mix(in srgb, var(--income) 18%, transparent); }

/* --- Configurações: menu lateral + seção --- */
.settings { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.set-nav { position: sticky; top: calc(var(--tx-top, 60px) + 1rem); background: var(--dash-card); border: 1px solid var(--dash-line); border-radius: var(--radius); padding: .6rem .7rem .7rem; display: flex; flex-direction: column; min-height: min(72vh, 660px); backdrop-filter: blur(10px); }
.set-nav-head { padding: 0 .55rem .9rem; border-bottom: 1px solid var(--dash-line); margin-bottom: .6rem; }
.set-nav-head h1 { font-size: 1.15rem; font-weight: 600; margin: 0; }
.set-nav-head p { margin: .2rem 0 0; font-size: .8rem; color: var(--muted); }
.set-group { margin-top: .5rem; }
.set-group-title { display: block; padding: .4rem .6rem; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.set-group ul { list-style: none; margin: 0; padding: 0; }
.set-nav a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: var(--radius); color: var(--text-2); text-decoration: none; font-size: .87rem; }
.set-nav a:hover { background: var(--dash-pill); color: var(--text); }
.set-nav a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.set-nav a span { flex: 1; }
.set-nav .tag { font-style: normal; font-size: .6rem; font-weight: 700; letter-spacing: .04em; padding: .1rem .4rem; border-radius: 6px; background: var(--warning-soft); color: var(--warning); }
.set-nav .tag.plus { background: var(--warning-soft); }
.set-nav-foot { margin-top: auto; border-top: 1px solid var(--dash-line); padding-top: .5rem; }
.set-nav-foot a .icon:last-child { color: var(--muted); }
.set-main { min-width: 0; position: relative; }
/* Tela inteira: as caixas ocupam toda a largura, em duas colunas quando há espaço. */
.set-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; padding-bottom: 4.5rem; }
.set-wrap > .set-head, .set-wrap > .set-photo, .set-wrap > p, .set-wrap > .set-empty { grid-column: 1 / -1; }
.set-wrap > form { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; gap: 1rem; align-items: start; } /* mesma distância entre todas as caixas */
.set-wrap .set-card.wide { grid-column: 1 / -1; }
.set-head { border-bottom: 1px solid var(--dash-line); padding-bottom: 1rem; margin-bottom: .25rem; }
.set-head h2 { font-size: 1.35rem; font-weight: 500; letter-spacing: -.015em; margin: 0; }
.set-head p { margin: .3rem 0 0; color: var(--muted); }
.set-empty { min-height: 60vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: .5rem; color: var(--muted); }
.set-empty.small-empty { min-height: 40vh; }
.set-empty strong { color: var(--text); font-size: 1rem; }
.set-empty p { margin: 0; max-width: 380px; font-size: .9rem; }
.set-empty-ico { width: 48px; height: 48px; border-radius: var(--radius); display: grid; place-items: center; background: var(--dash-pill); border: 1px solid var(--dash-line); color: var(--text-2); margin-bottom: .4rem; }
.panel main .set-card { padding: 0; }
.set-card-head { display: flex; gap: .85rem; align-items: flex-start; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--dash-line); }
.set-card-head h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.set-card-head p { margin: .15rem 0 0; font-size: .8rem; color: var(--muted); }
.set-ico { width: 34px; height: 34px; border-radius: var(--radius); display: grid; place-items: center; background: var(--dash-pill); border: 1px solid var(--dash-line); color: var(--text-2); flex: none; }
.set-card-body { padding: 1.1rem 1.25rem 1.25rem; display: grid; gap: .8rem; }
.set-card .fields { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.set-card .fields .full { grid-column: 1 / -1; }
.sw-field { flex-direction: row !important; align-items: center; justify-content: space-between; align-self: end; min-height: 38px; }
.sw-field .label { font-weight: 600; font-size: .86rem; }
input.readonly, input[readonly] { background: var(--surface-2); color: var(--muted); }
.set-photo { display: flex; align-items: center; gap: 1rem; }
.set-photo > div { display: grid; gap: .3rem; }
.avatar.xl { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar.photo { overflow: hidden; padding: 0; background: var(--surface-2); }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.danger-row { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.danger-zone .set-ico { color: var(--expense); }
.set-head { position: relative; padding-right: 9rem; }
.set-status { position: absolute; right: 0; top: .35rem; white-space: nowrap; }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.theme-opt { display: grid; gap: .6rem; padding: .7rem; border: 1px solid var(--dash-line); border-radius: 12px; background: var(--dash-pill); cursor: pointer; font-size: .9rem; }
.theme-opt:has(input:checked) { border-color: var(--info); box-shadow: 0 0 0 1px var(--info); background: var(--surface); }
.theme-opt input { width: auto; min-height: 0; margin: 0 .4rem 0 0; accent-color: var(--info); }
/* O cartão inteiro já mostra a escolha: sem o contorno quadrado de foco em volta da bolinha. */
.theme-opt input:focus { outline: none; }
.theme-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-prev { height: 72px; border-radius: 8px; position: relative; overflow: hidden; border: 1px solid rgba(0,0,0,.08); background: #fafafa; display: block; }
.theme-prev.dark { background: #1b1b1f; }
.theme-prev.system { background: linear-gradient(90deg, #fafafa 50%, #1b1b1f 50%); }
.theme-prev i { position: absolute; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: #c9c9cc; }
.theme-prev i:nth-child(1) { left: 8px; } .theme-prev i:nth-child(2) { left: 16px; } .theme-prev i:nth-child(3) { left: 24px; }
.theme-prev b { position: absolute; left: 8px; right: 8px; top: 20px; bottom: 0; border: 1px solid #d6d6da; border-bottom: 0; border-radius: 6px 6px 0 0; background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(150,150,155,.35) 10px 14px) bottom / 100% 40% no-repeat; }
.theme-prev.dark b { border-color: #3a3a40; }
.sw-line { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem .2rem; }
.sw-line > div { display: grid; gap: .1rem; }
.sw-line strong { font-size: .92rem; font-weight: 600; }
.sw-line span { font-size: .78rem; color: var(--muted); }
.set-sub { display: grid; gap: .1rem; }
.set-sub strong { font-size: .95rem; }
.set-sub span { font-size: .8rem; color: var(--muted); }
.set-card hr { border: 0; border-top: 1px solid var(--dash-line); margin: .4rem 0; width: 100%; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.opt-card { border: 1px solid var(--dash-line); border-radius: 12px; padding: .9rem; display: grid; gap: .5rem; align-content: start; background: var(--dash-pill); }
.opt-card strong { display: inline-flex; align-items: center; gap: .4rem; font-size: .92rem; }
.opt-card p { margin: 0; font-size: .82rem; color: var(--muted); }
.opt-card .btn { justify-self: start; }
.badge.dark { background: var(--text); color: var(--bg); }
.wa-row input { max-width: 280px; }
@media (max-width: 1180px) { .set-wrap { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .settings { grid-template-columns: 1fr; }
  .set-nav { position: static; min-height: 0; }
  .set-head { padding-right: 0; }
  .set-status { position: static; display: block; margin-top: .35rem; }
}
@media (max-width: 560px) {
  .set-card .fields, .opt-grid, .theme-grid { grid-template-columns: 1fr; }
  .danger-row { justify-content: stretch; } .danger-row .btn { flex: 1; }
}

/* ---- Cartões: lista com miniaturas e janela de cadastro com prévia ---------------- */
.cc-mini { --cc: #1d1d1f; position: relative; flex: none; width: 58px; height: 38px; border-radius: 7px; display: block;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 82%, #fff) 0%, var(--cc) 55%, color-mix(in srgb, var(--cc) 80%, #000) 100%);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--cc) 35%, transparent), inset 0 0 0 1px rgba(255,255,255,.08); }
.cc-chip { position: absolute; left: 8px; top: 9px; width: 11px; height: 8px; border-radius: 2px; background: linear-gradient(135deg, #f3d98b, #c9a24a); opacity: .9; }
.cc-mini.md { width: 44px; height: 29px; border-radius: 6px; }
.cc-mini.md .cc-chip { left: 6px; top: 7px; width: 9px; height: 7px; }
.cc-mini.sm { width: 30px; height: 20px; border-radius: 4px; }
.cc-mini.sm .cc-chip { left: 4px; top: 5px; width: 7px; height: 5px; border-radius: 1.5px; }
.acc-cell .cc-mini:not(.sm) { width: 46px; height: 30px; }
.acc-cell .cc-mini:not(.sm) .cc-chip { left: 6px; top: 7px; width: 9px; height: 7px; }

.cc-panel { padding: 1.5rem 1.75rem; }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.cc-head h2 { margin: 0; font-size: 1.15rem; }
.btn.soft-ok { background: color-mix(in srgb, var(--income) 16%, transparent); color: color-mix(in srgb, var(--income) 75%, var(--text)); border-color: transparent; font-weight: 600; }
.btn.soft-ok:hover { background: color-mix(in srgb, var(--income) 24%, transparent); }
.cc-list { display: grid; }
.cc-row { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 1.1rem; padding: .85rem .6rem; border-radius: 12px; color: inherit; text-decoration: none; }
.cc-row + .cc-row { border-top: 1px solid var(--dash-line, var(--border)); }
.cc-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.cc-info { display: grid; gap: .1rem; min-width: 0; }
.cc-info strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-info > span, .cc-col > span:first-child { font-size: .82rem; color: var(--muted); }
.cc-col { display: grid; gap: .15rem; justify-items: start; min-width: 0; }
.cc-col strong { font-variant-numeric: tabular-nums; }
.cc-limit .progress { width: 100%; max-width: 180px; margin: .2rem 0 0; }
.cc-go { color: var(--muted); }
.cc-sub { display: flex; align-items: center; gap: .45rem; margin: 1.4rem 0 .4rem .6rem; font-size: .92rem; font-weight: 500; color: var(--text-2); }
.cc-list.archived .cc-row { grid-template-columns: auto minmax(0, 1fr); opacity: .62; padding: .6rem; }
.cc-list.archived .cc-mini { filter: grayscale(.85); width: 46px; height: 30px; }
.cc-list.archived .cc-row:hover { opacity: .9; }
.cc-empty { margin: .25rem .6rem 0; }

.modal.cc-modal { max-width: 560px; }
.cc-stage { margin: -.25rem -.25rem 1.25rem; padding: 1.25rem; border-radius: var(--radius); background: var(--surface-2); display: grid; place-items: center; }
.cc-big { --cc: #1d1d1f; position: relative; width: min(100%, 360px); aspect-ratio: 1.586; border-radius: 16px; padding: 1.1rem 1.25rem; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--cc) 70%, #fff) 0%, transparent 55%), linear-gradient(135deg, var(--cc) 0%, color-mix(in srgb, var(--cc) 70%, #000) 100%);
  box-shadow: 0 18px 32px -14px color-mix(in srgb, var(--cc) 70%, #000); transition: background .25s, box-shadow .25s; }
.cc-big.light, .cc-mini.light { color: #1d1d1f; }
.cc-big-name { font-size: 1.1rem; font-weight: 600; max-width: 75%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-big .cc-chip { position: static; width: 38px; height: 28px; border-radius: 6px; }
.cc-big-foot { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.cc-big-foot small { display: block; font-size: .72rem; opacity: .75; }
.cc-big-foot b { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cc-big-foot .ta-r { text-align: right; }
.cc-swatches { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: .45rem; }
.cc-sw { position: relative; cursor: pointer; }
.cc-sw input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.cc-sw span:first-of-type { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.cc-sw span:first-of-type::after { content: ""; width: 42%; aspect-ratio: 1; border-radius: 50%; background: var(--sw); }
.cc-sw:hover span:first-of-type { border-color: var(--border-strong); }
.cc-sw input:checked + span { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.cc-sw input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 900px) {
  .cc-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cc-row .cc-col:not(.cc-limit) { display: none; }
  .cc-limit { justify-items: end; } .cc-limit .progress { display: none; }
  .cc-go { display: none; }
}
@media (max-width: 560px) {
  .cc-panel { padding: 1.1rem; }
  .cc-swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ---- Painel: arrastar e soltar os cards e escolher o que aparece ---------------- */
.drag-grip { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin: -.1rem -.2rem 0 -.55rem; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: grab; touch-action: none; opacity: .35; transition: opacity .15s, background .15s; }
.card:hover > .card-head .drag-grip, .drag-grip:focus-visible { opacity: 1; }
.drag-grip:hover { background: var(--dash-pill, var(--surface-2)); color: var(--text); }
@media (hover: none) { .drag-grip { opacity: .8; } }
.dash [data-card].dragging { box-shadow: 0 18px 40px -12px rgba(0,0,0,.28); transform: rotate(.6deg); opacity: .96; cursor: grabbing; }
body.dragging-card, body.dragging-card * { cursor: grabbing !important; user-select: none; }
.dash-ph { border: 2px dashed var(--border-strong); border-radius: var(--radius); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.dash.is-dragging > .col { min-height: 120px; align-content: start; }
.dash-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.dash-pick-item { display: flex; align-items: center; gap: .6rem; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-size: .9rem; }
.dash-pick-item:has(input:checked) { border-color: var(--text); background: var(--surface-2); }
.dash-none { margin-top: .5rem; }
@media (max-width: 560px) { .dash-pick { grid-template-columns: 1fr; } }
@media print { .drag-grip { display: none; } }
/* ---- Lançamentos da fatura: colunas e linha clicável para editar ----------------- */
.inv-table { table-layout: fixed; width: 100%; }
.inv-table .c-date { width: 120px; }
.inv-table .c-cat { width: 22%; }
.inv-table .c-val { width: 20%; }
.inv-table td { overflow: hidden; text-overflow: ellipsis; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
tr.clickable:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (max-width: 760px) { .inv-table { table-layout: auto; } }
/* Botão de voltar (ex.: página de faturas → Cartões). */
a.btn-dark { text-decoration: none; }
.btn-dark.back-btn { width: 38px; height: 38px; padding: 0; justify-content: center; flex: none; margin-right: .6rem; }
/* ---- Boas-vindas: mesmo visual das telas internas -------------------------------- */
.ob-wrap { max-width: 1080px; margin: 0 auto; }
.ob-hero { margin-bottom: 1.2rem; }
.ob-steps { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.4rem; flex-wrap: wrap; }
.ob-steps li { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .9rem .45rem .45rem; border: 1px solid var(--dash-line); border-radius: var(--radius); background: var(--dash-pill); font-size: .85rem; color: var(--muted); }
.ob-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 600; background: var(--surface); border: 1px solid var(--dash-line); color: var(--text-2); }
.ob-steps li.current { color: var(--text); font-weight: 600; background: var(--dash-card); border-color: var(--border-strong); }
.ob-steps li.current .ob-num { background: var(--text); color: var(--bg); border-color: var(--text); }
.ob-steps li.done .ob-num { background: color-mix(in srgb, var(--income) 18%, transparent); color: var(--income); border-color: transparent; }
.ob-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.ob-actions { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .4rem; padding-top: 1rem; border-top: 1px solid var(--dash-line); }
.ob-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.ob-tips li { display: flex; gap: .75rem; align-items: flex-start; }
.ob-tips .set-ico { width: 30px; height: 30px; }
.ob-tips strong { display: block; font-size: .9rem; font-weight: 600; }
.ob-tips span:not(.set-ico) { font-size: .82rem; color: var(--muted); }
.ob-next .opt-card strong .set-ico { width: 28px; height: 28px; }
@media (max-width: 900px) { .ob-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .ob-steps li > span:last-child { display: none; } .ob-steps li { padding: .35rem; } .ob-actions .btn-dark { width: 100%; justify-content: center; } }
/* Boas-vindas: sem menu lateral, sem atalhos de lançamento e sem agenda. */
.shell.onboarding { grid-template-columns: 1fr; }
.shell.onboarding .sidebar, .shell.onboarding .menu-btn, .shell.onboarding .quick, .shell.onboarding .agenda-btn { display: none; }
.shell.onboarding .main-wrap { padding-left: .55rem; }
/* Balão de comentário (data-note) */
.note-tip { display: inline-flex; vertical-align: -2px; color: var(--muted); cursor: help; }
.note-tip:hover { color: var(--text); }
.note-bubble { position: fixed; z-index: 3000; max-width: 280px; padding: .55rem .75rem; border-radius: var(--radius); background: var(--text); color: var(--bg); font-size: .82rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 8px 24px rgba(0,0,0,.18); pointer-events: none; animation: noteIn .12s ease-out; }
@keyframes noteIn { from { opacity: 0; } }
.note-bubble::after { content: ""; position: absolute; left: calc(var(--arrow-x, 50%) - 6px); border: 6px solid transparent; }
.note-bubble.above::after { top: 100%; border-top-color: var(--text); }
.note-bubble.below::after { bottom: 100%; border-bottom-color: var(--text); }