/* Controle Financeiro — folha de estilo única
   Identidade: livro-caixa em tinta azul-marinho, verde de conta e marca-texto amarelo
   na aba do mês. Tipografia única: Manrope (OFL, arquivo local). */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --surface-3: #e8edf3;
  --ink: #132033;
  --ink-2: #4a5668;
  --ink-3: #6f7a8a;
  --line: #dbe1e9;
  --line-strong: #c3ccd8;
  --brand: #0e6b5c;
  --brand-2: #0b5a4d;
  --brand-soft: #e1f1ed;
  --on-brand: #ffffff;
  --marker: #f2c94c;
  --marker-soft: #fdf3cf;
  --income: #12805c;
  --expense: #b4432b;
  --pending: #9a6200;
  --pending-soft: #fdf1d8;
  --good: #0ca30c;
  --critical: #d03b3b;
  --critical-soft: #fbe5e5;
  --focus: #2a78d6;
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 14px;
  --shadow: 0 1px 2px rgba(19, 32, 51, .06), 0 4px 16px rgba(19, 32, 51, .05);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 236px;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d141d;
    --surface: #141e2a;
    --surface-2: #192533;
    --surface-3: #22303f;
    --ink: #e7edf4;
    --ink-2: #a9b4c2;
    --ink-3: #8592a3;
    --line: #26344a;
    --line-strong: #344660;
    --brand: #3fbfa4;
    --brand-2: #58d0b6;
    --brand-soft: #143a35;
    --on-brand: #06231e;
    --marker: #e8bd3a;
    --marker-soft: #3a3115;
    --income: #4cc38a;
    --expense: #f07a5f;
    --pending: #f0b44c;
    --pending-soft: #3a2c12;
    --critical: #ef6b6b;
    --critical-soft: #3c1d1f;
    --focus: #6da7ec;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d141d;
  --surface: #141e2a;
  --surface-2: #192533;
  --surface-3: #22303f;
  --ink: #e7edf4;
  --ink-2: #a9b4c2;
  --ink-3: #8592a3;
  --line: #26344a;
  --line-strong: #344660;
  --brand: #3fbfa4;
  --brand-2: #58d0b6;
  --brand-soft: #143a35;
  --on-brand: #06231e;
  --marker: #e8bd3a;
  --marker-soft: #3a3115;
  --income: #4cc38a;
  --expense: #f07a5f;
  --pending: #f0b44c;
  --pending-soft: #3a2c12;
  --critical: #ef6b6b;
  --critical-soft: #3c1d1f;
  --focus: #6da7ec;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 750; }
h2 { font-size: 1.08rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }
img, svg { display: block; }
.ico { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 99; border-radius: 6px; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--income); }
.neg { color: var(--expense); }
.right { text-align: right; }
[hidden] { display: none !important; }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--ink); color: #c9d3df;
  display: flex; flex-direction: column; padding: 18px 12px 14px;
}
:root[data-theme="dark"] .sidebar { background: #0a1018; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sidebar { background: #0a1018; } }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 10px 18px; font-weight: 750; line-height: 1.1; font-size: .98rem; }
.brand svg { width: 30px; height: 30px; color: var(--marker); }
.brand:hover { color: #fff; }
.nav-group { font-size: .75rem; color: #8090a5; margin: 14px 10px 6px; font-weight: 600; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: #c9d3df; text-decoration: none; font-weight: 550; font-size: .92rem;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--marker); }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; }
.sidebar-foot .who { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { background: none; border: 0; color: #c9d3df; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.link-btn:hover { color: #fff; }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 16px 28px;
  background: var(--bg); position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search { position: relative; }
.search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 16px; height: 16px; }
.search input { padding-left: 32px; width: 240px; background: var(--surface); }
.topbar .menu-btn { display: none; }
main { padding: 22px 28px 60px; max-width: 1360px; width: 100%; }
main:focus { outline: none; }
.scrim { display: none; }

/* ---------- Componentes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 .9rem/1 var(--font); padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--on-brand); }
.btn-danger { color: var(--critical); }
.btn-danger:hover { border-color: var(--critical); color: var(--critical); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { padding: 7px 10px; font-size: .84rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 7px;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn.danger:hover { color: var(--critical); background: var(--critical-soft); }
.icon-btn .ico { width: 17px; height: 17px; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; width: 100%;
  min-height: 40px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; min-height: 0; accent-color: var(--brand); margin: 0; }
input[type="color"] { padding: 3px; width: 48px; }
label { display: grid; gap: 5px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 550; color: var(--ink); }
.hint { font-size: .82rem; color: var(--ink-3); margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
legend { font-weight: 700; font-size: .95rem; color: var(--ink); margin-bottom: 4px; padding: 0; }
.form-grid { display: grid; gap: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; flex-wrap: wrap; }
.panel-head p { margin: 0; }
.panel-body { padding: 16px 18px 18px; }
.panel + .panel, .stack > * + * { margin-top: 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.grid-3-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
.grid-2 > .panel + .panel, .grid-3-1 > .panel + .panel { margin-top: 0; }
.section-gap { margin-top: 18px; }

.flash { border-radius: var(--radius); padding: 11px 14px; margin-bottom: 14px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; font-weight: 550; border: 1px solid; }
.flash-success { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); color: var(--ink); }
.flash-error { background: var(--critical-soft); border-color: color-mix(in srgb, var(--critical) 40%, transparent); color: var(--ink); display: block; }
.flash-info { background: var(--surface); border-color: var(--line-strong); }
.flash-warning { background: var(--pending-soft); border-color: color-mix(in srgb, var(--pending) 40%, transparent); }
.flash-x { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--ink-2); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 650; padding: 3px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge-pago { background: var(--brand-soft); color: var(--brand); }
.badge-pendente { background: var(--pending-soft); color: var(--pending); }
.badge-cancelado { background: var(--surface-3); color: var(--ink-3); text-decoration: line-through; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--ink-2); }

.empty { text-align: center; padding: 38px 16px; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 4px; }

/* ---------- Tabelas (livro-caixa) ---------- */
.table-wrap { overflow-x: auto; position: relative; }
table { border-collapse: collapse; width: 100%; }
.ledger th {
  text-align: left; font-size: .76rem; font-weight: 650; color: var(--ink-3);
  padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; background: var(--surface);
}
.ledger th.right { text-align: right; }
.ledger td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .92rem; }
.ledger tbody tr:hover td { background: var(--surface-2); }
.ledger tr.is-cancel td { color: var(--ink-3); }
.ledger tr.is-cancel .desc { text-decoration: line-through; }
.ledger tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line-strong); }
.ledger .desc { font-weight: 600; }
.ledger .desc small { display: block; font-weight: 500; color: var(--ink-3); font-size: .78rem; }
.ledger .actions { white-space: nowrap; text-align: right; width: 1%; }
.ledger .actions form { display: inline; }
.ledger .w-check { width: 1%; }
.ledger .amount { text-align: right; font-weight: 650; }
.status-toggle { background: none; border: 0; padding: 0; cursor: pointer; }
.status-toggle:hover .badge { outline: 1px solid currentColor; }
.cat-cell { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tag-list { color: var(--ink-3); font-size: .78rem; }

/* ---------- Aba de meses (o elemento-assinatura) ---------- */
.month-bar { display: flex; align-items: flex-end; gap: 8px; margin-bottom: -1px; position: relative; z-index: 2; }
.month-nav { flex: none; display: flex; gap: 2px; padding-bottom: 6px; }
.month-strip {
  position: relative;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0;
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  padding: 0 20px;
}
.month-strip::-webkit-scrollbar { display: none; }
.month-tab {
  flex: none; padding: 8px 14px 9px; border-radius: 10px 10px 0 0; text-decoration: none;
  color: var(--ink-2); font-weight: 650; font-size: .86rem; border: 1px solid transparent; border-bottom: 0;
  position: relative;
}
.month-tab:hover { background: var(--surface-3); color: var(--ink); }
.month-tab.is-now::before { content: ""; position: absolute; left: 50%; top: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--brand); }
.month-tab[aria-current="page"] {
  background: var(--surface); color: var(--ink); border-color: var(--line);
  box-shadow: inset 0 3px 0 var(--marker);
}
.month-tab .yr { font-weight: 500; color: var(--ink-3); }
.month-panel { border-top-left-radius: 0; }
.month-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.month-title h2 { font-size: 1.6rem; font-weight: 780; letter-spacing: -.02em; }

/* ---------- Faixa de totais ---------- */
.totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.totals > div { padding: 14px 18px; }
.totals > div + div { border-left: 1px solid var(--line); }
.totals dt { font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.totals dd { margin: 3px 0 0; font-size: 1.28rem; font-weight: 750; letter-spacing: -.01em; }
.totals dd small { display: block; font-size: .78rem; font-weight: 550; color: var(--ink-3); letter-spacing: 0; }
.totals .lead dd { font-size: 1.6rem; }

/* ---------- Lançamento rápido ---------- */
.quick { padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.quick-row { display: grid; grid-template-columns: auto minmax(160px, 2.2fr) minmax(110px, 1fr) minmax(130px, 1.2fr) minmax(130px, 1.2fr) auto auto; gap: 10px; align-items: end; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); height: 40px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: flex; align-items: center; padding: 0 12px; cursor: pointer; font-size: .86rem; font-weight: 650; color: var(--ink-2); }
.seg input:checked + label { background: var(--ink); color: var(--surface); }
.seg input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: -2px; }
.seg input[value="receita"]:checked + label { background: var(--income); color: #fff; }
.seg input[value="despesa"]:checked + label { background: var(--expense); color: #fff; }
.more-toggle { font-size: .86rem; }
.quick-more { margin-top: 14px; display: grid; gap: 12px; }
.repeat-box { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.money { text-align: right; }

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 12px 18px; }
.filters label { min-width: 140px; }
.filters .grow { flex: 1; min-width: 180px; }
.bulk-bar { display: flex; gap: 8px; align-items: center; padding: 10px 18px; background: var(--marker-soft); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bulk-bar select, .bulk-bar input { width: auto; min-height: 34px; padding: 6px 9px; }

/* ---------- Dashboard ---------- */
.hero-month { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; }
.hero-month .balance { padding: 22px 22px 20px; border-right: 1px solid var(--line); }
.hero-month .balance .label { color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.hero-month .balance .big { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 6px; }
.flow { display: grid; gap: 8px; margin-top: 16px; }
.flow-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; font-size: .9rem; }
.flow-bar { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.flow-bar span { display: block; height: 100%; border-radius: 99px; }
.hero-month .side { display: grid; grid-auto-rows: 1fr; }
.hero-month .side > div { padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero-month .side > div + div { border-top: 1px solid var(--line); }
.hero-month .side .k { color: var(--ink-2); font-size: .88rem; font-weight: 600; }
.hero-month .side .v { font-size: 1.15rem; font-weight: 750; }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 340px; }
.chart-box.short { height: 220px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; }

.meter { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.meter.warn span { background: var(--pending); }
.meter.over span { background: var(--critical); }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .sub { font-size: .8rem; color: var(--ink-3); }
.budget-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.budget-row:last-child { border-bottom: 0; }
.budget-row .top { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }

.plan-card { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.plan-card:last-child { border-bottom: 0; }
.plan-card .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.plan-card .meta { font-size: .82rem; color: var(--ink-3); display: flex; gap: 14px; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.kv > div { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.kv dt { font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.kv dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 750; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.tabs a { padding: 12px 12px 10px; text-decoration: none; color: var(--ink-2); font-weight: 650; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--brand); }

.checklist { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 6px; font-size: .9rem; }
.checklist li { display: flex; gap: 8px; align-items: center; }
.checklist .ok .ico { color: var(--good); }
.checklist .bad { color: var(--critical); }

dialog { border: 0; border-radius: var(--radius-l); padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 16, 24, .5); }
dialog .panel-body { padding: 20px; }

.qr { background: #fff; padding: 12px; border-radius: var(--radius); display: inline-block; }
.qr svg, .qr img { width: 180px; height: 180px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; word-break: break-all; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; font-size: .9rem; }
.code-input { font-size: 1.4rem; letter-spacing: .3em; text-align: center; }

/* ---------- Telas soltas (login/instalação) ---------- */
body.bare { min-height: 100vh; display: grid; place-items: center; background: var(--ink); background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(255, 255, 255, .035) 31px 32px); }
.bare-main { width: min(440px, calc(100vw - 32px)); padding: 32px 0; }
.bare-main:has(.wide) { width: min(640px, calc(100vw - 32px)); }
.bare-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 750; font-size: 1.05rem; margin-bottom: 18px; }
.bare-brand svg { width: 30px; height: 30px; color: var(--marker); }
.bare-card { background: var(--surface); border-radius: var(--radius-l); padding: 26px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.bare-card h1 { margin-bottom: 14px; }
.bare .flash { margin-bottom: 14px; }

/* ---------- Impressão ---------- */
@media print {
  .sidebar, .topbar, .quick, .filters, .bulk-bar, .actions, .no-print, .month-nav, .w-check { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .panel { border: 0; }
  .month-strip { display: none; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .quick-row { grid-template-columns: auto 1fr 1fr; }
  .quick-row .q-desc { grid-column: span 2; }
  .totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .totals > div:nth-child(4) { border-left: 0; }
  .totals > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .scrim:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(10, 16, 24, .45); z-index: 40; }
  .topbar .menu-btn { display: inline-grid; }
  .grid-2, .grid-3-1, .hero-month { grid-template-columns: minmax(0, 1fr); }
  .hero-month .balance { border-right: 0; border-bottom: 1px solid var(--line); }
  .search input { width: 180px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar h1 { font-size: 1.15rem; }
  .search { display: none; }
  main { padding: 16px 16px 60px; }
  .row-2, .row-3, .row-4 { grid-template-columns: 1fr; }
  .quick-row { grid-template-columns: 1fr 1fr; }
  .quick-row .q-type, .quick-row .q-desc { grid-column: 1 / -1; }
  .totals { grid-template-columns: 1fr 1fr; }
  .totals > div { border-left: 0 !important; border-top: 1px solid var(--line); }
  .totals > div:nth-child(-n+2) { border-top: 0; }
  .totals .lead { grid-column: 1 / -1; }
  .ledger .hide-sm { display: none; }
  .panel-head, .panel-body { padding-left: 14px; padding-right: 14px; }
  .filters { padding: 12px 14px; }
  .filters label { min-width: 0; flex: 1 1 40%; }
  .month-title h2 { font-size: 1.3rem; }
  .flow-row { grid-template-columns: 80px 1fr auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.steps-list { margin: 0 0 14px; padding-left: 1.3em; display: grid; gap: 6px; }
.steps-list li::marker { color: var(--brand); font-weight: 700; }
