/* =========================================================
   CentralizaFin — design tokens (paleta única para todas as telas)
   ========================================================= */
:root {
  /* Marca */
  --brand-900: #10204a;
  --brand-700: #1b3580;
  --brand-600: #2445a8;
  --brand-500: #3159d1;
  --brand-100: #e6ecfb;
  --brand-50:  #f3f6fd;

  /* Semântica financeira */
  --income-text: #136537;
  --income-bar:  #16703f;
  --income-bg:   #e4f4ea;
  --expense-text: #b42318;
  --expense-bar:  #ec7a6f;
  --expense-bg:   #fdeceb;

  /* Estados */
  --warning-text: #8a5a00;
  --warning-bg:   #fff4d6;
  --danger: #b42318;

  /* Neutros */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e1e6ef;
  --border-strong: #c9d1de;
  --text: #182033;
  --text-2: #4a5468;
  --muted: #6b7489;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 74, .06);
  --shadow: 0 1px 3px rgba(16, 32, 74, .08), 0 8px 24px rgba(16, 32, 74, .06);
  --focus: 0 0 0 3px rgba(49, 89, 209, .35);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1120px;
  --gutter: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; color: var(--brand-900); }
h1 { font-size: clamp(1.6rem, 2.5vw + 1rem, 2.4rem); letter-spacing: -.02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-600); }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.page { padding-top: 28px; padding-bottom: 48px; }
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 20px;
}
.page-head p { margin: 0; color: var(--text-2); }

/* ---------- Topbar ---------- */
.topbar { background: var(--brand-900); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
/* Logo: o mesmo desenho do ícone do app. "Fin" na cor do ponto (verde-menta, a cor de destaque da marca). */
.logo-mark { width: 32px; height: 32px; flex: none; display: block; }
.brand-plus { color: #86efac; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .nav button.link {
  color: #d6def5; text-decoration: none; padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: .95rem; background: none; border: 0; font: inherit; cursor: pointer;
}
.nav a:hover, .nav button.link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.14); }
.nav-user { display: flex; align-items: center; gap: 8px; padding-left: 12px; margin-left: 8px; border-left: 1px solid rgba(255,255,255,.18); }
.nav-user .who { font-size: .85rem; color: #b9c5e6; line-height: 1.2; text-align: right; }
.nav-user .who strong { display: block; color: #fff; font-weight: 600; }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.25);
  color: #fff; border-radius: var(--radius-sm); padding: 6px 10px; font: inherit; cursor: pointer;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn:focus-visible, .input:focus-visible, select:focus-visible, .seg input:focus-visible + span, a:focus-visible, button:focus-visible {
  outline: none; box-shadow: var(--focus);
}
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary { background: var(--surface); color: var(--brand-700); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--brand-500); background: var(--brand-50); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger-ghost:hover { background: var(--expense-bg); }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .875rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: 24px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; font-size: 1.05rem; }
.stack > * + * { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-weight: 600; font-size: .9rem; color: var(--text); }
.field .hint { font-size: .8rem; color: var(--muted); }
.req { color: var(--danger); }
.input, select.input {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
select.input { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:hover { border-color: var(--muted); }
.input:focus { border-color: var(--brand-500); }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.input-prefix .input { padding-left: 42px; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.field.has-error .input { border-color: var(--danger); background: #fffafa; }
.field-error { color: var(--danger); font-size: .85rem; font-weight: 500; display: flex; gap: 6px; align-items: center; }
.field-error:empty { display: none; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); font-weight: 600; color: var(--text-2);
  background: var(--surface);
}
.seg .dot { width: 10px; height: 10px; border-radius: 50%; }
.seg .receita .dot { background: var(--income-bar); }
.seg .despesa .dot { background: var(--expense-text); }
.seg input:checked + span.receita { border-color: var(--income-bar); background: var(--income-bg); color: var(--income-text); }
.seg input:checked + span.despesa { border-color: var(--expense-text); background: var(--expense-bg); color: var(--expense-text); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; padding-top: 4px; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .925rem; border: 1px solid; }
.alert-error { background: var(--expense-bg); border-color: #f5c2bd; color: var(--expense-text); }
.alert-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.alert-success { background: var(--income-bg); border-color: #b8e0c6; color: var(--income-text); }
.alert:empty { display: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-receita, .badge-ok { background: var(--income-bg); color: var(--income-text); }
.badge-despesa, .badge-bad { background: var(--expense-bg); color: var(--expense-text); }
.badge-warn { background: var(--warning-bg); color: var(--warning-text); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.amount-receita { color: var(--income-text); font-weight: 700; }
.amount-despesa { color: var(--expense-text); font-weight: 700; }

/* ---------- KPIs ---------- */
.kpi { padding: 20px 22px; }
.kpi .kpi-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .9rem; font-weight: 600; }
.kpi .kpi-label i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.kpi .kpi-value { font-size: clamp(1.35rem, 1.2vw + 1rem, 1.75rem); font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: -.01em; }
.kpi .kpi-sub { color: var(--muted); font-size: .85rem; }
.kpi-income .kpi-label i { background: var(--income-bar); }
.kpi-expense .kpi-label i { background: var(--expense-bar); }
.kpi-balance .kpi-label i { background: var(--brand-600); }
.kpi-value.pos { color: var(--income-text); }
.kpi-value.neg { color: var(--expense-text); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th {
  text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--brand-50); }
.table tr.row-link { cursor: pointer; }
.table .ta-r { text-align: right; }
.table .desc { color: var(--text-2); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table code, code.lic { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- Filtros ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.toolbar .field { min-width: 180px; }
.toolbar .spacer { flex: 1; }
.filter-summary { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 12px 24px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .9rem; color: var(--text-2); }
.filter-summary strong { font-variant-numeric: tabular-nums; }

/* ---------- Gráfico ---------- */
.chart { margin: 0; }
.chart-title { font-weight: 700; color: var(--brand-900); font-size: 1.05rem; }
.chart-sub { color: var(--muted); font-size: .875rem; margin-top: 2px; }
.chart-svg { display: block; width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.chart-svg .grid-line { stroke: var(--border); stroke-width: 1; }
.chart-svg .baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart-svg .cat { fill: var(--text-2); font-size: 14px; font-weight: 600; font-family: var(--font); }
.chart-svg .val { fill: var(--text); font-size: 14px; font-weight: 700; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-svg .bar-receita { fill: var(--income-bar); }
.chart-svg .bar-despesa { fill: var(--expense-bar); }
.chart-svg .bar-group:hover .bar, .chart-svg .bar-group:focus .bar { opacity: .85; }
.chart-svg .bar-group { outline: none; }
.chart-svg .hit { fill: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: .875rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .l-receita { background: var(--income-bar); }
.legend .l-despesa { background: var(--expense-bar); }
.chart-wrap { position: relative; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--brand-900); color: #fff; font-size: .85rem;
  padding: 8px 10px; border-radius: var(--radius-sm); box-shadow: var(--shadow); white-space: nowrap;
  transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s;
}
.chart-tip.show { opacity: 1; }
.chart-tip strong { display: block; font-size: .95rem; }

/* ---------- Landing ---------- */
.hero { background: linear-gradient(180deg, var(--brand-900) 0%, var(--brand-700) 100%); color: #fff; padding: 64px 0 80px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9fb6ff; background: rgba(159,182,255,.12); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4vw + 1rem, 3.4rem); letter-spacing: -.03em; margin-bottom: 18px; }
.hero h1 .hl { color: #9fe0b7; }
.hero .lead { font-size: clamp(1.02rem, .5vw + .9rem, 1.2rem); color: #d6def5; max-width: 34em; margin-bottom: 28px; }
.hero .btn-primary { background: #fff; color: var(--brand-700); }
.hero .btn-primary:hover { background: var(--brand-100); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-actions .note { color: #b9c5e6; font-size: .9rem; }
.hero-points { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 24px; color: #d6def5; font-size: .95rem; }
.hero-points li::before { content: "✓"; color: #9fe0b7; font-weight: 800; margin-right: 8px; }
.mock { background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: 0 30px 60px rgba(0,0,0,.25); padding: 22px; }
.mock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mock-head span { font-weight: 700; color: var(--brand-900); }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.mock-kpis div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.mock-kpis small { color: var(--muted); display: block; font-size: .72rem; }
.mock-kpis b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.mock-rows { margin-top: 14px; display: grid; gap: 8px; font-size: .85rem; }
.mock-rows div { display: flex; justify-content: space-between; }
.features { padding-top: 56px; padding-bottom: 64px; }
.features h2 { text-align: center; font-size: clamp(1.3rem, 1.5vw + 1rem, 1.8rem); margin-bottom: 8px; }
.features > p { text-align: center; color: var(--text-2); margin-bottom: 32px; }
.feature { padding: 24px; }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-100); color: var(--brand-600); display: grid; place-items: center; margin-bottom: 14px; }
.feature .ico svg { width: 22px; height: 22px; }
.feature p { color: var(--text-2); margin: 0; }
.site-foot { border-top: 1px solid var(--border); padding: 20px 0; color: var(--muted); font-size: .85rem; background: var(--surface); }

/* ---------- Login ---------- */
.auth-wrap { display: grid; place-items: center; padding: 48px var(--gutter); min-height: calc(100vh - 60px); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card-body { padding: 32px; }
.auth-card h1 { font-size: 1.6rem; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 50; right: 16px; bottom: 16px; display: grid; gap: 10px; max-width: calc(100vw - 32px); }
.toast { background: var(--brand-900); color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: .95rem; display: flex; gap: 10px; align-items: center; animation: toast-in .2s ease-out; }
.toast.ok::before { content: "✓"; color: #9fe0b7; font-weight: 800; }
.toast.err { background: var(--expense-text); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Admin ---------- */
.meter { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 6px; width: 120px; }
.meter > div { height: 100%; background: var(--brand-500); }
.meter.full > div { background: var(--warning-text); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: .95rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }
.details-json { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; color: var(--text-2); word-break: break-word; max-width: 360px; }
.integrity { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.hidden { display: none !important; }
.loading { padding: 48px; text-align: center; color: var(--muted); }

/* =========================================================
   Responsivo
   ========================================================= */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { max-width: 520px; }
  .grid-dash { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 16px; }
}

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; align-items: stretch;
    background: var(--brand-900); padding: 8px var(--gutter) 16px; border-top: 1px solid rgba(255,255,255,.1); gap: 2px;
  }
  .nav.open { display: flex; }
  .nav a, .nav button.link { padding: 12px; text-align: left; }
  .nav-user { border-left: 0; margin: 8px 0 0; padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,.12); justify-content: space-between; }
  .nav-user .who { text-align: left; }
}

@media (max-width: 680px) {
  :root { --gutter: 16px; }
  .page { padding-top: 20px; }
  .card-body { padding: 18px; }
  .card-head, .toolbar, .filter-summary { padding-left: 16px; padding-right: 16px; }
  .form-row, .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .toolbar .field { min-width: 0; flex: 1 1 140px; }
  .toolbar .spacer { display: none; }
  .toolbar .btn { flex: 1 1 100%; }
  .form-actions .btn { flex: 1 1 auto; }
  .hero { padding: 40px 0 56px; }
  .mock-kpis b { font-size: .8rem; }
  .auth-card .card-body { padding: 22px; }

  /* Tabelas viram cartões empilhados no celular */
  table.table.responsive thead { display: none; }
  table.table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; font-weight: 600; text-align: left; flex-shrink: 0; }
  .table.responsive td.ta-r { text-align: right; }
  .table.responsive td.desc { max-width: none; white-space: normal; }
  .table.responsive td.actions::before { content: none; }
  .table.responsive td.actions { justify-content: flex-end; }
  .details-json { max-width: none; text-align: right; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
}
.form-card { max-width: 780px; }
.mt { margin-top: 20px; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.recent li:last-child { border-bottom: 0; }
.recent li > div { min-width: 0; display: grid; }
.recent li strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 680px) { .recent li { padding: 12px 16px; } }
.btn.disabled { opacity: .6; }
.form-row { align-items: start; }
.field { align-content: start; }

/* ---------- Campo de data (dd/mm/aaaa) ---------- */
.date-input { position: relative; }
.date-input .input { padding-right: 46px; font-variant-numeric: tabular-nums; }
.date-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: var(--radius-sm); cursor: pointer;
}
.date-btn:hover { background: var(--surface-2); color: var(--brand-600); }
.date-btn svg { width: 18px; height: 18px; }
.date-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; pointer-events: none; }

/* ---------- Nova categoria ---------- */
.link-btn {
  justify-self: start; background: none; border: 0; padding: 2px 0; font: inherit; font-size: .875rem; font-weight: 600;
  color: var(--brand-600); cursor: pointer; border-radius: 4px;
}
.link-btn:hover { text-decoration: underline; }
.cat-new { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: center; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--brand-50); }
.cat-new .input, .cat-new .hint { grid-column: 1 / -1; }
/* No campo categoria, o destaque de erro vale só para o nome da nova categoria. */
.field.has-error .cat-new ~ .field-error, .field.has-error .cat-new .input { color: var(--danger); }
.field.has-error:has(.cat-new:not(.hidden)) > select.input { border-color: var(--border-strong); background: var(--surface); }
@media (max-width: 680px) {
  .cat-new { grid-template-columns: 1fr 1fr; }
}

/* ---------- Extrato: ações e período ---------- */
.icon-btn { width: 34px; padding: 0; }
.edited { display: inline-block; margin-left: 6px; font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; vertical-align: 1px; }
.toolbar .custom-range { min-width: 160px; max-width: 190px; }
.toolbar .field-error { font-size: .78rem; }
.form-actions .push-left { margin-right: auto; }
@media (max-width: 680px) {
  .toolbar .custom-range { max-width: none; }
  .form-actions .push-left { flex: 1 1 100%; order: 3; }
}

/* ---------- Períodos fechados ---------- */
.alert-warn { background: var(--warning-bg); border-color: #f0d68a; color: var(--warning-text); display: flex; gap: 10px; align-items: flex-start; }
.alert-warn svg, .alert-info svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.alert-warn a { color: inherit; font-weight: 600; }
.locked-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 0 6px; }
.locked-tag svg { width: 14px; height: 14px; }

/* ---------- Painel: filtros, variação e categorias ---------- */
.toolbar-flat { border-bottom: 0; }
.period-label { align-self: center; }
.delta { display: block; margin-top: 6px; font-size: .82rem; font-weight: 600; }
.delta.good { color: var(--income-text); }
.delta.bad { color: var(--expense-text); }
.delta .muted { font-weight: 400; }
.mb { margin-bottom: 20px; }
.seg-mini { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg-mini button { border: 0; background: var(--surface); padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg-mini button + button { border-left: 1px solid var(--border-strong); }
.seg-mini button[aria-pressed="true"] { background: var(--brand-600); color: #fff; }
.cat-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cat-row {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 8px 10px; margin: 0 -10px; width: calc(100% + 20px); background: none; border: 0; border-radius: var(--radius-sm);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.cat-row:hover { background: var(--brand-50); }
.cat-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-val { font-size: .9rem; font-weight: 600; white-space: nowrap; }
.cat-track { grid-column: 1 / -1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.cat-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.cat-fill.despesa { background: var(--expense-bar); }
.cat-fill.receita { background: var(--income-bar); }
.cat-delta { grid-column: 1 / -1; }
.cat-delta .delta { margin-top: 0; font-size: .78rem; }
.cat-total { margin: 12px 0 0; }
.alert-info { display: flex; gap: 10px; align-items: flex-start; }

/* ---------- Gráfico de barras horizontais (por categoria) ---------- */
.chart-svg.ranked { margin-top: 4px; }
.chart-svg .cat-label { fill: var(--text); font-size: 13px; font-weight: 600; font-family: var(--font); }
.chart-svg .val-sm { fill: var(--text); font-size: 13px; font-weight: 600; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-svg .val-sm .share { fill: var(--muted); font-weight: 400; }
.chart-svg .prev-mark { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.chart-svg .rank-row[data-cat] { cursor: pointer; }
.chart-svg .rank-row:hover .hit, .chart-svg .rank-row:focus .hit { fill: var(--brand-50); }
.chart-svg .rank-row:focus-visible .hit { stroke: var(--brand-500); stroke-width: 2; }
.legend .l-prev { width: 3px; height: 14px; border-radius: 2px; background: var(--text); }
.chart-svg .prev-ring { stroke: var(--surface); stroke-width: 6.5; stroke-linecap: round; }

/* ---------- Gráfico de linhas e marcadores ---------- */
.chart-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .line.dashed { stroke-dasharray: 6 4; }
.chart-svg .line-receitas { stroke: var(--income-bar); }
.chart-svg .line-despesas { stroke: var(--expense-line); }
.chart-svg .line-resultado, .chart-svg .line-saldo { stroke: var(--brand-500); stroke-width: 2.5; }
.chart-svg .dot { stroke: var(--surface); stroke-width: 2; }
.chart-svg .dot-receitas { fill: var(--income-bar); }
.chart-svg .dot-despesas { fill: var(--expense-line); }
.chart-svg .dot-resultado, .chart-svg .dot-saldo { fill: var(--brand-500); }
.chart-svg .end-label { font-size: 12px; font-weight: 600; font-family: var(--font); fill: var(--text-2); }
.chart-svg .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .hit-area { fill: transparent; }
.chart-svg .zero-line { stroke: var(--expense-text); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-svg .budget-mark { stroke: var(--brand-600); stroke-width: 2; stroke-dasharray: 3 2; }
.chart-svg .bar-despesa.over { fill: var(--expense-text); }
.chart-svg:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.legend .l-line { width: 18px; height: 3px; border-radius: 2px; }
.legend .l-line.l-receitas { background: var(--income-bar); }
.legend .l-line.l-despesas { background: repeating-linear-gradient(90deg, var(--expense-line) 0 6px, transparent 6px 9px); }
.legend .l-line.l-resultado, .legend .l-line.l-saldo { background: var(--brand-500); height: 4px; }
.legend .l-budget { width: 3px; height: 14px; background: repeating-linear-gradient(180deg, var(--brand-600) 0 3px, transparent 3px 5px); }
.chart-tip .tip-row { display: block; font-size: .82rem; }
.chart-tip .tip-row strong { display: inline; font-size: .85rem; }
.chart-tip { text-align: left; }
:root { --expense-line: #e0645a; }

/* ---------- Menu suspenso (Gestão / usuário) ---------- */
.nav-menu { position: relative; }
.nav-menu > summary {
  list-style: none; cursor: pointer; color: #d6def5; padding: 8px 12px; border-radius: var(--radius-sm); font-size: .95rem;
  display: flex; align-items: center; gap: 6px;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after { content: "▾"; font-size: .75rem; opacity: .8; }
.nav-menu > summary:hover, .nav-menu[open] > summary { color: #fff; background: rgba(255,255,255,.08); }
.nav-menu > summary[aria-current="page"] { color: #fff; background: rgba(255,255,255,.14); }
.nav-menu-list {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; z-index: 30; display: grid; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.nav-menu-list.right { left: auto; right: 0; }
.nav .nav-menu-list a, .nav .nav-menu-list button.link { color: var(--text); padding: 9px 12px; border-radius: var(--radius-sm); text-align: left; }
.nav .nav-menu-list a:hover, .nav .nav-menu-list button.link:hover { background: var(--brand-50); color: var(--brand-700); }
.nav .nav-menu-list a[aria-current="page"] { background: var(--brand-100); color: var(--brand-700); }
.nav .btn-new { background: #fff; color: var(--brand-700); margin-left: 6px; min-height: 36px; }
.nav .btn-new:hover { background: var(--brand-100); color: var(--brand-700); }
.nav .btn-new svg { width: 16px; height: 16px; }
.nav-user-menu { margin-left: 8px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.18); }
.nav-user-menu > summary .who { font-size: .82rem; color: #b9c5e6; line-height: 1.2; text-align: right; }
.nav-user-menu > summary .who strong { display: block; color: #fff; font-weight: 600; font-size: .9rem; }
@media (max-width: 1080px) {
  .nav-menu > summary { padding: 12px; }
  .nav-menu-list { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 12px; }
  .nav .nav-menu-list a, .nav .nav-menu-list button.link { color: #d6def5; }
  .nav .nav-menu-list a:hover, .nav .nav-menu-list button.link:hover { background: rgba(255,255,255,.08); color: #fff; }
  .nav .nav-menu-list a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }
  .nav .btn-new { margin: 8px 0; justify-content: center; }
  .nav-user-menu { margin: 8px 0 0; padding: 8px 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .nav-user-menu > summary .who { text-align: left; }
  .nav-menu:not([open]) .nav-menu-list { display: none; }
}

/* ---------- Diálogo ---------- */
.dialog { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  box-shadow: 0 24px 60px rgba(16, 32, 74, .28); background: var(--surface); color: var(--text); overflow: hidden; }
.dialog[open] { animation: dialog-in .18s ease-out; }
.dialog::backdrop { background: rgba(16, 32, 74, .5); backdrop-filter: blur(2px); }
.dialog-form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; font-size: 1.1rem; color: var(--brand-900); }
.dialog-danger .dialog-head h2 { color: var(--danger); }
.dialog-x { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.dialog-x:hover { background: var(--surface-2); color: var(--text); }
.dialog-x:focus-visible { outline: none; box-shadow: var(--focus); }
.dialog-x svg { width: 18px; height: 18px; }
.dialog-body { display: grid; gap: 16px; padding: 20px 24px; overflow-y: auto; color: var(--text-2); line-height: 1.5; }
.dialog-body > p, .dialog-body p { margin: 0; }
.dialog-body .field label { color: var(--text); }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 24px; background: var(--surface-2); border-top: 1px solid var(--border); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dialog[open] { animation: none; } }
/* No celular a janela vira um painel que sobe do rodapé, com os botões ocupando a largura. */
@media (max-width: 600px) {
  .dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0; }
  .dialog-foot { flex-direction: column-reverse; }
  .dialog-foot .btn { width: 100%; }
  @keyframes dialog-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; }

/* ---------- Alertas ---------- */
.alerts { display: grid; gap: 8px; margin-bottom: 20px; }
.alert-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); text-decoration: none;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left-width: 4px; font-size: .93rem;
}
.alert-item:hover { background: var(--brand-50); }
.alert-item .alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.alert-item .alert-go { margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.alert-item.danger { border-left-color: var(--expense-text); } .alert-item.danger .alert-dot { background: var(--expense-text); }
.alert-item.warn { border-left-color: #d49a00; } .alert-item.warn .alert-dot { background: #d49a00; }
.alert-item.info { border-left-color: var(--brand-500); } .alert-item.info .alert-dot { background: var(--brand-500); }

/* ---------- Utilidades de layout ---------- */
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi a.kpi-link { font-size: .82rem; font-weight: 600; text-decoration: none; display: inline-block; margin-top: 6px; }
.kpi-cash .kpi-label i { background: var(--text); }
.section-title { font-size: 1.05rem; margin: 28px 0 12px; }
.tabs { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.tabs button, .tabs a { border: 0; background: none; padding: 8px 16px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--text-2); cursor: pointer; text-decoration: none; }
.tabs > * + * { border-left: 1px solid var(--border-strong); }
.tabs [aria-pressed="true"], .tabs [aria-current="page"] { background: var(--brand-600); color: #fff; }
.group-head td { background: var(--surface-2); font-weight: 700; font-size: .85rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-600); }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--brand-600); padding: 4px 0; list-style: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
details.more > .form-row, details.more > .field { margin-top: 14px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form .field { flex: 1 1 160px; }
.num-input { max-width: 160px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }
.text-right { text-align: right; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid-4 { grid-template-columns: 1fr; } .num-input { max-width: none; } }

/* ---------- Formulário de lançamento ---------- */
.seg-status span { font-size: .92rem; }
.seg-status input:checked + span { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); }
.cat-new select.input { grid-column: 1 / -1; }
.attach-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.attach-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attach-list li svg { width: 16px; height: 16px; color: var(--muted); }
.file-btn { position: relative; cursor: pointer; }
.attach-count { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: .8rem; margin-left: 6px; vertical-align: -2px; }
.attach-count svg { width: 13px; height: 13px; }
.desc-cell strong { font-weight: 600; }
.amount-receita.pending, .amount-despesa.pending { opacity: .75; font-weight: 600; }
.toolbar .field { min-width: 150px; }

/* ---------- Relatórios ---------- */
.table.dre th { text-align: left; font-weight: 500; padding: 10px 16px; border-bottom: 1px solid var(--border); background: none; text-transform: none; letter-spacing: 0; font-size: .93rem; color: var(--text); }
.table.dre td { padding: 10px 16px; }
.dre-subtotal th, .dre-subtotal td { font-weight: 700 !important; background: var(--surface-2); }
.dre-total th, .dre-total td { font-weight: 800 !important; background: var(--brand-50); font-size: 1rem !important; border-top: 2px solid var(--brand-100); }
.dre-base th, .dre-base td { font-weight: 700 !important; }
.dre-empty { color: var(--muted); }
.dre-empty th { color: var(--muted) !important; }
.dre-cat th { padding-left: 36px !important; font-size: .87rem !important; color: var(--text-2) !important; }
.dre-cat td { font-size: .87rem; color: var(--text-2); }
.dre-toggle { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.dre-toggle::before { content: "▸ "; color: var(--muted); }
.dre-toggle[aria-expanded="true"]::before { content: "▾ "; }
.dre-note { padding: 12px 16px; margin: 0; }
.indicator { padding: 14px 0; border-bottom: 1px solid var(--border); }
.indicator:first-child { padding-top: 0; }
.indicator:last-child { border-bottom: 0; padding-bottom: 0; }
.ind-title { font-size: .85rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.ind-value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.indicator.good .ind-value { color: var(--income-text); }
.indicator.bad .ind-value { color: var(--expense-text); }
.indicator p { margin: 0; color: var(--text-2); font-size: .88rem; }
.mt-sm { margin-top: 12px; }
.table.compact td, .table.compact th { padding: 8px 12px; }
@media (max-width: 680px) { .table.dre th, .table.dre td { padding: 9px 12px; } .dre-cat th { padding-left: 24px !important; } }

/* ---------- Contas e orçamentos ---------- */
.total-card { max-width: 420px; }
.account-card.inactive { opacity: .65; }
.acc-head { display: flex; gap: 12px; align-items: center; }
.acc-head > div { display: grid; }
.acc-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-100); color: var(--brand-600); display: grid; place-items: center; flex-shrink: 0; }
.acc-icon svg { width: 20px; height: 20px; }
.acc-balance { font-size: 1.5rem; font-weight: 700; margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
.acc-actions { margin-top: 12px; justify-content: flex-start; }
.month-picker { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.month-picker select { width: auto; }
.month-picker [data-mp-month] { min-width: 132px; }
.mp-arrow { font-size: 1.15rem; min-width: 36px; justify-content: center; }
.budget-input { max-width: 200px; }
.budget-input .input { font-size: .95rem; min-height: 40px; }
.usage { display: flex; align-items: center; gap: 8px; }
.usage .meter { margin-top: 0; width: 110px; }
.usage.near .meter > div { background: #d49a00; }
.usage.over .meter > div { background: var(--expense-text); }
.usage.over .small { color: var(--expense-text); font-weight: 700; }
@media (max-width: 680px) { .budget-input { max-width: none; } }

/* ---------- Conciliação e configurações ---------- */
.file-input { padding: 8px; }
.import-help { margin: 12px 0 0; }
.recon-list { list-style: none; margin: 0; padding: 0; }
.recon-item { padding: 16px 24px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.recon-item:last-child { border-bottom: 0; }
.recon-main { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.recon-main > div { display: grid; }
.recon-actions { display: grid; gap: 8px; }
.recon-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.recon-suggest .badge { margin-left: 4px; }
.recon-create { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.recon-create .input { max-width: 260px; min-height: 36px; padding: 6px 10px; }
.recon-rule { margin-top: 8px; }
.card-foot { padding: 12px 20px 16px; margin: 0; border-top: 1px solid var(--border); }
.rule-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.rule-form .field { margin: 0; flex: 1 1 180px; }
.rule-form .check { min-height: 42px; }
.recon-rule summary { cursor: pointer; color: var(--brand-700); font-weight: 600; width: fit-content; }
.recon-rule-body { display: grid; gap: 6px; margin-top: 8px; max-width: 520px; }
.recon-rule-body .input { min-height: 36px; padding: 6px 10px; }
.input-sm { min-height: 36px; padding: 6px 30px 6px 10px; font-size: .9rem; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: .9rem; font-weight: 600; }
.chip.off { opacity: .55; text-decoration: line-through; }
.chip button { border: 0; background: var(--surface-2); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: .78rem; cursor: pointer; color: var(--text-2); }
@media (max-width: 680px) { .recon-item { padding: 14px 16px; } .recon-create .input { max-width: none; flex: 1 1 100%; } }
.cash-row { margin-bottom: 20px; }
.kpi-link-card { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.kpi-link-card:hover { border-color: var(--brand-500); box-shadow: var(--shadow); }
.link-like { color: var(--brand-600); font-weight: 600; }
.table.dre th { white-space: normal; }

/* ---------- Ajustes de acabamento ---------- */
.nav a, .nav .nav-menu > summary { white-space: nowrap; }
.nav { gap: 2px; }
.menu-who { display: grid; padding: 8px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: .85rem; color: var(--text-2); }
.menu-who strong { color: var(--text); font-size: .95rem; }
.table.dre .dre-subtotal th, .table.dre .dre-subtotal td { background: var(--surface-2); }
.table.dre .dre-total th, .table.dre .dre-total td { background: var(--brand-50); }
.legend .l-over { background: var(--expense-text); }
.alerts-more > summary { cursor: pointer; font-weight: 600; color: var(--brand-600); font-size: .9rem; padding: 2px 4px; list-style: none; }
.alerts-more > summary::before { content: "▸ "; }
.alerts-more[open] > summary::before { content: "▾ "; }
.alerts-more .alerts { margin: 8px 0 0; }
@media (max-width: 1080px) { .menu-who { color: #b9c5e6; border-color: rgba(255,255,255,.12); } .menu-who strong { color: #fff; } }

/* ---------- Planos e cadastro ---------- */
.pricing { background: var(--surface); border-top: 1px solid var(--border); padding: 56px 0 64px; }
.pricing h2 { text-align: center; font-size: clamp(1.3rem, 1.5vw + 1rem, 1.8rem); }
.pricing-sub { text-align: center; color: var(--text-2); max-width: 640px; margin: 0 auto 20px; }
.pricing-toggle { display: flex; justify-content: center; margin-bottom: 24px; }
.pricing-foot { text-align: center; color: var(--muted); font-size: .9rem; margin: 24px auto 0; max-width: 720px; }
.cycle-toggle .save { background: var(--income-bg); color: var(--income-text); border-radius: 999px; padding: 1px 7px; font-size: .75rem; margin-left: 4px; }
.cycle-toggle [aria-pressed="true"] .save { background: rgba(255,255,255,.2); color: #fff; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; align-items: stretch; }
.plan-card { position: relative; display: flex; }
.plan-inner { flex: 1; display: flex; flex-direction: column; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.plan-card.popular .plan-inner { border-color: var(--brand-500); box-shadow: var(--shadow); }
.plan-flag { position: absolute; top: -11px; left: 24px; background: var(--brand-600); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan-flag.current { left: auto; right: 24px; background: var(--income-bar); }
.plan-inner h3 { font-size: 1.2rem; margin: 4px 0 4px; }
.plan-tagline { color: var(--text-2); font-size: .9rem; min-height: 2.6em; margin-bottom: 14px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; color: var(--brand-900); }
.plan-price strong { font-size: 2.2rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-currency { font-weight: 700; }
.plan-price span:last-child { color: var(--muted); }
.plan-billing { color: var(--muted); font-size: .85rem; margin: 2px 0 16px; }
.plan-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; font-size: .92rem; flex: 1; align-content: start; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list svg { width: 16px; height: 16px; color: var(--income-text); flex-shrink: 0; margin-top: 3px; }
.plan-cta { width: 100%; }
.plan-card.selectable { cursor: pointer; }
.plan-card.selectable input { position: absolute; opacity: 0; }
.plan-card.selectable input:checked + .plan-inner { border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); background: var(--brand-50); }
.plan-card.selectable input:focus-visible + .plan-inner { box-shadow: var(--focus); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.extra-field { margin-top: 20px; }
.order-summary { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 6px; }
.order-summary > div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pending-order { border-color: #f0d68a; }
.meter.wide { width: 100%; }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; width: 100%; }
.btn-google:hover { background: #f8f9fa; }
.g-icon { width: 20px !important; height: 20px !important; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.center { text-align: center; }
.signup-hint { margin: 18px 0 0; }
.link-light { color: #b9c5e6; }
.sub-banner { background: var(--brand-100); color: var(--brand-900); font-size: .9rem; padding: 8px 0; }
.sub-banner.warn { background: var(--warning-bg); color: var(--warning-text); }
.sub-banner.danger { background: var(--expense-bg); color: var(--expense-text); }
.sub-banner a { color: inherit; font-weight: 700; }
@media (max-width: 960px) { .plans { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }

/* ---------- paginação ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 24px; border-top: 1px solid var(--border); }
.pager-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-numbers { display: inline-flex; align-items: center; gap: 4px; }
.pager-btn { min-width: 36px; justify-content: center; font-variant-numeric: tabular-nums; }
.pager-gap { color: var(--muted); padding: 0 4px; }
.pager-jump { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); white-space: nowrap; }
.pager-jump select { width: auto; min-width: 72px; }
.pager-info { margin-left: auto; }
[aria-busy="true"] { opacity: .55; transition: opacity .15s; }
.toolbar .field-search { min-width: 220px; }
@media (max-width: 640px) {
  .pager { padding: 12px 16px; }
  .pager-numbers { display: none; } /* no celular: setas e a lista de páginas */
  .pager-info { margin-left: 0; width: 100%; text-align: center; }
}
.kpi-value-sm { font-size: 1.25rem; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85em; background: var(--surface-2, #f1f4f9); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.pix-box { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; padding: 16px; margin: 12px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.pix-box img { width: 200px; height: 200px; background: #fff; border-radius: 8px; image-rendering: pixelated; }
.pix-code { flex: 1 1 260px; min-width: 0; }
.pix-code label { display: block; font-weight: 600; margin-bottom: 6px; }
.pix-code .inline-form { display: flex; gap: 8px; }
.pix-code .input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }

/* ---------- textos legais e privacidade ---------- */
.legal { max-width: 860px; }
.legal-body h1 { margin-bottom: 4px; }
.legal-body h2 { font-size: 1.1rem; margin: 28px 0 8px; }
.legal-body p, .legal-body li { line-height: 1.6; }
.legal-body ul { padding-left: 20px; display: grid; gap: 6px; }
.legal-table td, .legal-table th { white-space: normal; vertical-align: top; }
.legal-missing { background: var(--warning-bg); color: var(--warning-text); padding: 0 4px; border-radius: 4px; }
.legal-foot { text-align: center; margin-top: 16px; }
.legal-links { display: grid; gap: 8px; padding-left: 20px; margin: 12px 0 20px; }
.narrow { max-width: 640px; }
.form-actions.start { justify-content: flex-start; }
.card-danger { border-color: #f0b8b2; }
.closure-form { max-width: 520px; display: grid; gap: 12px; margin-top: 12px; }
.site-foot a { color: inherit; }
.closure-admin { align-items: center; justify-content: space-between; display: flex; gap: 12px; flex-wrap: wrap; }
.card-danger .alert { margin-bottom: 12px; }

/* ---------- verificação em duas etapas ---------- */
.code-input { font-family: ui-monospace, Consolas, monospace; font-size: 1.35rem; letter-spacing: .25em; text-align: center; max-width: 220px; }
.mfa-steps { padding-left: 20px; display: grid; gap: 16px; margin-top: 16px; }
.mfa-qr { margin: 12px 0 4px; }
.mfa-qr svg { display: block; border: 1px solid var(--border); border-radius: 8px; max-width: 100%; height: auto; }
.mfa-secret { font-size: .95em; letter-spacing: .05em; }
.mfa-confirm { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; flex-wrap: wrap; }
.recovery { margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; padding-left: 24px; margin: 12px 0; }
.recovery-codes code { font-size: 1rem; }

/* ---------- saúde do sistema ---------- */
.health-chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.health-chart .hc-req { fill: var(--brand-500); }
.health-chart .hc-err { fill: var(--expense-bar); }
.health-chart .hc-axis { stroke: var(--border); }
.health-chart .hc-label { font-size: 10px; fill: var(--muted, #64748b); }
.chart-legend { display: flex; gap: 16px; margin-top: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chart-legend .lg-req { background: var(--brand-500); }
.chart-legend .lg-err { background: var(--expense-bar); }
pre.stack { white-space: pre-wrap; font-size: .75rem; margin: 8px 0 0; color: var(--muted, #64748b); }

/* ---------- parceiros e sugestões ---------- */
.partner-banner { background: var(--income-bg); color: var(--income-text); border-bottom: 1px solid #bfe3cc; padding: 10px 0; font-size: .95rem; }
.partner-link { display: flex; gap: 8px; align-items: center; }
.partner-link .input { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.feedback-msg { white-space: pre-wrap; max-width: 520px; }

/* ---------- app no celular: barra de atalhos no rodapé ---------- */
.tabbar { display: none; }
@media (max-width: 720px) {
  .tabbar:not(.hidden) {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(16, 32, 74, .06);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); text-decoration: none; padding: 4px 0; min-height: 44px; justify-content: center; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--brand-500); font-weight: 700; }
  .tabbar .tab-new { align-self: center; justify-self: center; width: 52px; height: 52px; min-height: 0; border-radius: 50%; background: var(--brand-500); color: #fff; margin-top: -22px; box-shadow: 0 6px 16px rgba(49, 89, 209, .35); }
  .tabbar .tab-new svg { width: 26px; height: 26px; }
  body.has-tabbar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.has-tabbar .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ---------- cobranças ---------- */
.copy-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-line .input { flex: 1 1 220px; min-width: 0; font-size: .85rem; }
.copy-line code { overflow-wrap: anywhere; }
ol.steps { padding-left: 20px; display: grid; gap: 8px; margin: 10px 0; }
fieldset.field { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
fieldset.field legend { font-weight: 600; margin-bottom: 6px; font-size: .9rem; }

/* ---------- Open Finance ---------- */
.bank-conn + .bank-conn { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.bank-conn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- Logo da empresa ---------- */
.company-logo {
  display: inline-flex; align-items: center; height: 36px; padding: 3px 8px; border-radius: 8px;
  background: #fff; margin-left: 4px; text-decoration: none;
}
.company-logo img { max-height: 30px; max-width: 120px; object-fit: contain; display: block; }
.logo-preview {
  display: grid; place-items: center; min-height: 96px; padding: 12px; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 12px;
}
.logo-preview img { max-height: 80px; max-width: 240px; object-fit: contain; }
.report-brand { align-items: center; gap: 16px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 2px solid var(--brand-900); }
.report-brand img { max-height: 56px; max-width: 180px; object-fit: contain; }
.report-brand strong { display: block; font-size: 1.2rem; }
.report-brand span { color: var(--text-2); }
.print-only { display: none !important; }

/* ---------- Impressão (relatórios em papel ou PDF) ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; }
  #topbar, #tabbar, #toasts, .no-print, .toolbar, .sub-banner { display: none !important; }
  .print-only { display: flex !important; }
  .page { padding: 0 !important; }
  .container { max-width: none !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #d9dde6 !important; break-inside: avoid; }
  .grid-dash { grid-template-columns: 1fr !important; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Fechamento: arquivos para o contador ---------- */
.closing-help { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--border); }
.closing-help svg { width: 20px; height: 20px; flex: none; color: var(--brand-500); margin-top: 1px; }

/* ---------- Página inicial: seções ---------- */
.btn-ghost-light { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.45); }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.hero-note { color: #b9c5e6; font-size: .9rem; margin: 12px 0 0; }
.mock-alert { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--income-bg); color: var(--income-text); font-size: .85rem; }
.mock-alert svg { width: 16px; height: 16px; flex: none; }
.landing-steps, .landing-audience, .landing-faq { padding-top: 56px; padding-bottom: 56px; }
.landing-steps h2, .landing-audience h2, .landing-faq h2, .cta-band h2 { text-align: center; font-size: clamp(1.3rem, 1.5vw + 1rem, 1.8rem); margin-bottom: 28px; }
.steps-row { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.steps-row li { text-align: center; padding: 0 8px; }
.steps-row h3 { font-size: 1.05rem; margin: 12px 0 6px; }
.steps-row p { color: var(--text-2); margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-600); color: #fff; font-weight: 800; }
.landing-band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature { display: flex; flex-direction: column; }
.feature h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature-tag { align-self: flex-start; margin-top: 14px; font-size: .75rem; font-weight: 700; color: var(--brand-700); background: var(--brand-100); padding: 3px 10px; border-radius: 999px; }
.audience { border-left: 3px solid var(--income-bar); padding: 4px 0 4px 16px; }
.audience h3 { font-size: 1.05rem; margin-bottom: 4px; }
.audience p { color: var(--text-2); margin: 0; }
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--brand-900); }
.faq details p { color: var(--text-2); margin: 10px 0 0; }
.cta-band { background: linear-gradient(180deg, var(--brand-700) 0%, var(--brand-900) 100%); color: #fff; text-align: center; padding: 56px 0; }
.cta-band h2 { color: #fff; margin-bottom: 10px; }
.cta-band p { color: #d6def5; margin: 0 auto 22px; max-width: 560px; }
.cta-band .btn-primary { background: #fff; color: var(--brand-700); }
.cta-band .btn-primary:hover { background: var(--brand-100); }
@media (max-width: 760px) { .steps-row { grid-template-columns: 1fr; } }

/* ---------- Guia de uso ---------- */
.guide-card .meter { margin-bottom: 14px; }
.guide-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.guide-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.guide-steps p { margin: 2px 0 0; color: var(--text-2); font-size: .9rem; }
.guide-steps li.done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.guide-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; margin-top: 1px; }
.guide-steps li.done .guide-check { background: var(--income-bar); border-color: var(--income-bar); color: #fff; }
.guide-check svg { width: 14px; height: 14px; }
.guide-grid { align-items: start; }
.routine { margin-bottom: 18px; }
.routine h3 { font-size: 1rem; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.routine ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.routine li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; font-size: .92rem; }
.routine-who { font-size: .72rem; font-weight: 700; text-align: center; border-radius: 999px; padding: 2px 6px; height: fit-content; background: var(--brand-100); color: var(--brand-700); }
.routine-who.equipe { background: var(--income-bg); color: var(--income-text); }
.routine-who.todos { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.guide-tips { margin: 0; padding-left: 18px; color: var(--text-2); display: grid; gap: 6px; font-size: .92rem; }
@media (max-width: 640px) { .guide-steps li { grid-template-columns: 26px minmax(0, 1fr); } .guide-steps li > .guide-actions { grid-column: 2; justify-content: flex-start; } }
.guide-check { font-size: .78rem; font-weight: 700; color: var(--text-2); }
.guide-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.guide-actions:empty { display: none; }
.guide-phase { margin: 18px 0 10px; font-size: 1rem; color: var(--brand-900); }
.guide-phase:first-child { margin-top: 0; }

/* ---------- Material para parceiros (tela e impressão A4) ---------- */
.kit { background: var(--bg, #f5f7fb); min-height: 100vh; padding-bottom: 40px; }
.kit-wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.kit-toolbar { position: sticky; top: 0; z-index: 5; background: var(--brand-900); color: #fff; padding: 10px 0; margin-bottom: 24px; }
.kit-toolbar .kit-wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.kit-toolbar .btn-primary { background: #fff; color: var(--brand-700); }
.kit-cover { background: linear-gradient(180deg, var(--brand-900) 0%, var(--brand-700) 100%); color: #fff; border-radius: var(--radius-lg); padding: 36px 32px; margin-bottom: 20px; }
.kit-cover h1 { color: #fff; font-size: clamp(1.6rem, 3vw + 1rem, 2.4rem); margin: 18px 0 8px; }
.kit-cover .muted { color: #b9c5e6; }
.kit-brand { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.kit-brand .logo-mark rect { stroke: none; }
.kit-io { color: #86efac; }
.kit-lead { color: #d6def5; font-size: 1.05rem; max-width: 36em; }
.kit-offer { background: rgba(255,255,255,.12); display: inline-block; padding: 6px 12px; border-radius: 999px; }
.kit-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px; break-inside: avoid; }
.kit-section h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.kit-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-600); color: #fff; font-size: .85rem; flex: none; }
.kit-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.kit-cards p { margin: 2px 0 0; color: var(--text-2); font-size: .92rem; }
.kit-table-wrap { overflow-x: auto; }
.kit-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .88rem; }
.kit-table th, .kit-table td { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; }
.kit-table td:first-child { color: var(--muted); font-weight: 600; white-space: nowrap; }
.kit-table ul { margin: 0; padding-left: 16px; }
.kit-list { padding-left: 20px; display: grid; gap: 8px; }
.kit-link { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 6px; overflow-wrap: anywhere; }
.kit-steps { padding-left: 20px; display: grid; gap: 8px; }
.kit-steps span { display: block; color: var(--text-2); font-size: .9rem; }
.kit-tips { color: var(--text-2); padding-left: 18px; display: grid; gap: 4px; font-size: .9rem; }
.kit-faq dt { font-weight: 700; margin-top: 10px; }
.kit-faq dd { margin: 2px 0 0; color: var(--text-2); }
.kit-foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 20px; }
@media (max-width: 640px) { .kit-cards { grid-template-columns: 1fr; } .kit-cover { padding: 24px 18px; } .kit-section { padding: 18px; } .kit-table { font-size: .8rem; } .kit-table td:first-child { white-space: normal; } }
@media print {
  .no-print { display: none !important; }
  .kit { background: #fff; padding: 0; }
  .kit-wrap { max-width: none; padding: 0; }
  .kit-cover, .kit-n, .kit-toolbar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kit-table { min-width: 0; }
  .kit-section { border: none; padding: 12px 0; border-bottom: 1px solid #ddd; border-radius: 0; }
  @page { size: A4; margin: 16mm; }
}

/* ---------- Perfis de acesso ---------- */
.perm-list { display: grid; gap: 10px; border: none; padding: 0; margin: 0; }
.perm-list legend { font-weight: 700; margin-bottom: 6px; }
.perm-list .check { align-items: flex-start; font-weight: 400; }
.perm-list .check input { margin-top: 3px; flex: none; }

/* ---------- Aprovação em níveis ---------- */
.approval-steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: .82rem; color: var(--text-2); }
.approval-steps li::before { content: "○ "; color: var(--muted); }
.approval-steps li.done::before { content: "✓ "; color: var(--income-text); font-weight: 700; }
.approval-steps li span { font-weight: 600; }
.level-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 12px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--border); }
.level-row .field { margin: 0; }
.level-n { font-weight: 700; color: var(--brand-700); padding-bottom: 10px; }
@media (max-width: 640px) { .level-row { grid-template-columns: 1fr; } .level-n { padding-bottom: 0; } }

.dre-regime-note { margin: 0; padding: 10px 20px 0; }

.company-pick { display: grid; gap: 10px; border: none; padding: 0; margin: 0; }
.company-pick .check { align-items: flex-start; font-weight: 400; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.company-pick .check input { margin-top: 3px; flex: none; }

/* ---------- Meus clientes (contador) ---------- */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.client-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.client-head h2 { font-size: 1.1rem; margin: 0 0 2px; }
.client-facts { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: .92rem; color: var(--text-2); }
.client-facts .badge svg { width: 12px; height: 12px; margin-right: 4px; }

/* ---------- Grupo de empresas ---------- */
.group-dre th, .group-dre td { white-space: nowrap; }
.group-dre .dre-subtotal td, .group-dre .dre-total td, .group-dre .dre-balance td { font-weight: 700; background: var(--surface-2); }
.group-dre .dre-total td { color: var(--brand-900); }

/* Contabilidade: código contábil de cada categoria e conta */
.acct-code { max-width: 180px; font-variant-numeric: tabular-nums; }

/* Página inicial: quadro de previsão de caixa (ilustração) */
.mock-kpis-2 { grid-template-columns: repeat(2, 1fr); }
.mock-chart { display: block; width: 100%; height: auto; }
.mock-chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.mock-chart .base { stroke: var(--border-strong); stroke-width: 1; }
.mock-chart .area { fill: var(--brand-100); }
.mock-chart .line { fill: none; stroke: var(--brand-600); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mock-chart .low { fill: var(--brand-600); stroke: var(--surface); stroke-width: 2; }
.mock-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: .7rem; color: var(--muted); }
.mock-rows small { color: var(--muted); margin-left: 4px; }

/* Parceiros: ações em até duas linhas, sem rolar a tabela para o lado */
.partner-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; min-width: 220px; max-width: 320px; margin-left: auto; }

/* Indicações: botões de envio do convite */
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) { .share-actions .btn { flex: 1 1 100%; } }

.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* Menus: títulos de seção, número de aprovações pendentes e abas de Configurações */
.nav-menu-title { padding: 10px 12px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-menu-title:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 12px; }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; }
.nav-count.hidden { display: none; }
.page-tabs { display: flex; width: fit-content; max-width: 100%; overflow-x: auto; }
@media (max-width: 1080px) {
  .nav-menu-title { color: #8fa0cc; }
  .nav-menu-title:not(:first-child) { border-top-color: rgba(255,255,255,.12); }
}

/* Página do guia (coluna estreita): botões do passo embaixo do texto */
.guide-grid .guide-steps li { grid-template-columns: 26px minmax(0, 1fr); }
.guide-grid .guide-actions { grid-column: 2; justify-content: flex-start; }

/* Marca nos textos: "CentralizaFin" sempre em destaque */
.brand-name { font-weight: 700; color: inherit; white-space: nowrap; }

/* Faixa de homologação: sempre visível, para ninguém confundir com produção */
.env-ribbon { position: sticky; top: 0; z-index: 60; padding: 6px 16px; text-align: center; font-size: .85rem; font-weight: 700;
  background: #fde68a; color: #713f12; border-bottom: 1px solid #f59e0b; }
@media print { .env-ribbon { display: none; } }
