@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/instrument-sans-latin-700-normal.woff2") format("woff2"); }

/* ===== tokens ===== */
:root {
  --paper: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #F8F9FA;
  --ink: #161922;
  --muted: #626977;
  --line: #E2E5EA;
  --xandy: #2F5BEA;
  --tati: #D6336C;
  --good: #12805C;
  --good-bg: #E6F4EE;
  --warn: #8A5A00;
  --warn-bg: #FFF4D6;
  --bad: #C62F2F;
  --bad-bg: #FDECEC;
  --focus: #2F5BEA;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1014; --surface: #171A20; --surface-2: #1D2128; --ink: #EDEFF3; --muted: #9CA3AF; --line: #2A2F37;
    --xandy: #7392FF; --tati: #F2709C; --good: #47C796; --good-bg: #12291F; --warn: #F0C463; --warn-bg: #2E2410;
    --bad: #F27A7A; --bad-bg: #331718; --focus: #7392FF; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1014; --surface: #171A20; --surface-2: #1D2128; --ink: #EDEFF3; --muted: #9CA3AF; --line: #2A2F37;
  --xandy: #7392FF; --tati: #F2709C; --good: #47C796; --good-bg: #12291F; --warn: #F0C463; --warn-bg: #2E2410;
  --bad: #F27A7A; --bad-bg: #331718; --focus: #7392FF; color-scheme: dark;
}

/* ===== base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: 15px; line-height: 1.45; font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== shell ===== */
.shell { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-right: auto; }
.brand-mark { display: inline-flex; width: 22px; height: 8px; border-radius: 4px; overflow: hidden; }
.brand-mark i { flex: 1; }
.brand-mark i:first-child { background: var(--xandy); }
.brand-mark i:last-child { background: var(--tati); }
.month {
  display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; height: 38px;
}
.month button { border: 0; background: none; width: 36px; height: 36px; border-radius: 999px; font-size: 18px; color: var(--muted); }
.month button:hover { color: var(--ink); }
.month span { min-width: 108px; text-align: center; font-weight: 600; font-size: 14px; text-transform: capitalize; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted);
}
.icon-btn svg { width: 18px; height: 18px; }
main { max-width: 760px; margin: 0 auto; padding: 4px 16px 72px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 10px 0 16px; }
.section-title { font-size: 16px; font-weight: 600; margin: 28px 0 10px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none;
  color: var(--muted); font-size: 11px; font-weight: 500;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabbar a[aria-current="page"] svg { stroke-width: 2.2; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; align-items: start; padding-bottom: 40px; }
  .tabbar {
    position: sticky; top: 0; height: 100dvh; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 2px;
    padding: 76px 12px 12px; border-top: 0; border-right: 1px solid var(--line); background: var(--surface);
  }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
  .tabbar a[aria-current="page"] { background: var(--paper); }
  .topbar { grid-column: 2; grid-row: 1; padding-left: 24px; padding-right: 24px; }
  main { grid-column: 2; grid-row: 2; padding: 4px 24px 0; width: 100%; }
  .tabbar { grid-column: 1; }
}

/* ===== surfaces ===== */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.panel + .panel { margin-top: 12px; }

/* ===== acerto (elemento de assinatura) ===== */
.settle { padding: 20px 18px 18px; }
.settle-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.settle-sentence { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin: 10px 0 18px; }
.settle-sentence b { font-weight: 700; }
.who { font-weight: 700; }
.who-x { color: var(--xandy); }
.who-t { color: var(--tati); }
.split-row { margin-top: 14px; }
.split-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.split-label strong { color: var(--ink); font-weight: 600; }
.bar2 { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface); }
.bar2 i { display: block; height: 100%; transition: flex-basis .5s cubic-bezier(.2,.8,.2,1); }
.bar2 .x { background: var(--xandy); border-radius: 6px 0 0 6px; }
.bar2 .t { background: var(--tati); border-radius: 0 6px 6px 0; }
.bar2 .x:last-child { border-radius: 6px; }
.bar2 .t:first-child { border-radius: 6px; }
.bar2.empty { background: var(--line); }
.split-legend { display: flex; justify-content: space-between; font-size: 13px; margin-top: 6px; }
.split-legend span:last-child { text-align: right; }
.settle-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-top: 12px; }
.notice svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice a { font-weight: 600; }

/* ===== kpis ===== */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-top: 12px; }
.kpi { background: var(--surface); padding: 14px 16px; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi-value.neg { color: var(--bad); }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

.alerts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip-alert { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; }
.chip-alert.bad { background: var(--bad-bg); color: var(--bad); }
.chip-alert.warn { background: var(--warn-bg); color: var(--warn); }
.chip-alert.good { background: var(--good-bg); color: var(--good); }

/* ===== donut ===== */
.donut-wrap { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center; }
.donut { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font-size: 18px; font-weight: 700; }
.donut-center span { font-size: 12px; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.legend li:last-child { border-bottom: 0; }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; }
.legend .pct { color: var(--muted); font-size: 13px; width: 40px; text-align: right; }
@media (min-width: 640px) { .donut-wrap { grid-template-columns: 220px 1fr; } }

/* ===== lançamentos ===== */
.toolbar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px 12px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.search { width: 100%; height: 42px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: 0 14px; margin-bottom: 10px; }
.totals { display: flex; flex-wrap: wrap; white-space: nowrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin: 0 2px 6px; }
.totals strong { color: var(--ink); }
.day { font-size: 13px; color: var(--muted); font-weight: 600; margin: 18px 2px 6px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.row { display: grid; grid-template-columns: 36px 1fr auto 32px; gap: 10px; align-items: center; padding: 11px 8px 11px 12px; border-bottom: 1px solid var(--line); position: relative; }
.row:last-child { border-bottom: 0; }
.row.overdue { background: var(--bad-bg); }
.row.soon { background: var(--warn-bg); }
.row-main { min-width: 0; text-align: left; background: none; border: 0; padding: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; }
.row-meta .tag { padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.row-meta .late { color: var(--bad); font-weight: 600; }
.row-meta .near { color: var(--warn); font-weight: 600; }
.row-amount { font-weight: 700; text-align: right; font-size: 14px; }
.row-amount.in { color: var(--good); }
.row-amount small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.dot-x, .dot-t, .dot-c { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; }
.dot-x { background: var(--xandy); }
.dot-t { background: var(--tati); }
.dot-c { background: linear-gradient(90deg, var(--xandy) 50%, var(--tati) 50%); }
.check {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: transparent; transition: background .15s, border-color .15s;
}
.check svg { width: 16px; height: 16px; }
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.row.overdue .check:not(.on) { border-color: var(--bad); }
.row.soon .check:not(.on) { border-color: var(--warn); }
.trash { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.trash:hover { color: var(--bad); background: var(--bad-bg); }
.trash svg { width: 17px; height: 17px; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); z-index: 25;
  height: 56px; padding: 0 22px 0 18px; border-radius: 999px; border: 0; background: var(--ink); color: var(--paper);
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; box-shadow: 0 8px 24px -8px rgba(22, 25, 34, .45);
}
.fab svg { width: 22px; height: 22px; }
@media (min-width: 960px) { .fab { bottom: 28px; right: 32px; } }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* ===== botões e formulários ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-weight: 600; text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-danger { color: var(--bad); }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 46px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2);
  padding: 0 14px; font-size: 16px; appearance: none; -webkit-appearance: none;
}
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea.input { height: 80px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.amount-input { height: 64px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; height: 38px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.seg button[data-v="p1"][aria-pressed="true"] { color: var(--xandy); }
.seg button[data-v="p2"][aria-pressed="true"] { color: var(--tati); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); margin-bottom: 14px; font-weight: 600; }
.switch input { width: 46px; height: 28px; appearance: none; -webkit-appearance: none; background: var(--line); border-radius: 999px; position: relative; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--good); }
.switch input:checked::after { transform: translateX(18px); }
.form-error { color: var(--bad); font-size: 14px; margin: -4px 0 12px; }

/* ===== sheet (dialog) ===== */
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh; background: var(--surface); color: var(--ink);
  border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px -10px rgba(0,0,0,.3);
}
.sheet[open] { animation: up .22s cubic-bezier(.2,.8,.2,1); }
.sheet::backdrop { background: rgba(10, 12, 16, .45); }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-inner { display: flex; flex-direction: column; max-height: 92dvh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.sheet-head h2 { font-size: 18px; }
.sheet-body { padding: 8px 18px 8px; overflow-y: auto; }
.sheet-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet-foot .btn-primary { flex: 1; }
.sheet-small { max-width: 420px; }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 24px; } }

/* ===== fixas ===== */
.gen { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.gen p { margin: 4px 0 0; font-size: 13px; color: var(--muted); max-width: 46ch; }
.fx-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.fx-row:last-child { border-bottom: 0; }
.fx-row.off { opacity: .5; }
.day-badge { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-content: center; text-align: center; line-height: 1; }
.day-badge b { font-size: 16px; }
.day-badge small { font-size: 10px; color: var(--muted); margin-top: 2px; }
.sum-line { display: flex; justify-content: space-between; padding: 10px 2px 0; font-size: 14px; color: var(--muted); }
.sum-line strong { color: var(--ink); }

/* ===== metas ===== */
.goal { padding: 16px 18px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; display: block; }
.goal:last-child { border-bottom: 0; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.goal-name { font-weight: 600; font-size: 16px; }
.goal-pct { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.track { height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 10px 0 8px; }
.track i { display: block; height: 100%; background: var(--ink); border-radius: 5px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.track.done i { background: var(--good); }
.goal-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 13px; color: var(--muted); }
.goal-nums strong { display: block; color: var(--ink); font-size: 14px; }
.goal-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ===== cenários ===== */
.sc-list { display: grid; gap: 0; }
.sc { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; }
.sc:last-child { border-bottom: 0; }
.sc[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink); }
.sc-name { font-weight: 600; }
.sc-val { font-weight: 700; text-align: right; }
.sc-val.neg { color: var(--bad); }
.sc-bar { grid-column: 1 / -1; position: relative; height: 8px; }
.sc-bar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.sc-bar i { position: absolute; top: 0; height: 8px; border-radius: 4px; background: var(--ink); }
.sc-bar i.neg { background: var(--bad); }
.sc-sub { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.sc-detail .kpis { margin-top: 0; }
.items { margin-top: 12px; }
.item { display: grid; grid-template-columns: 1fr 132px 32px; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .input { height: 40px; font-size: 15px; text-align: right; padding: 0 10px; }
.item-name { font-size: 14px; min-width: 0; }
.item-name small { display: block; color: var(--muted); font-size: 12px; }
.grp-head { padding: 10px 12px 6px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }

/* ===== ajustes ===== */
.set-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.set-row:last-child { border-bottom: 0; }
.set-row small { display: block; color: var(--muted); font-size: 12px; }

/* ===== login ===== */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-mark { display: flex; height: 14px; width: 64px; border-radius: 7px; overflow: hidden; gap: 3px; margin-bottom: 28px; }
.login-mark i { flex: 1; }
.login-mark i:first-child { background: var(--xandy); border-radius: 7px 0 0 7px; }
.login-mark i:last-child { background: var(--tati); border-radius: 0 7px 7px 0; }
.login h1 { font-size: 30px; letter-spacing: -0.025em; }
.login p { color: var(--muted); margin: 6px 0 26px; }
.who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.who-pick button { height: 64px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.who-pick button[aria-pressed="true"][data-v="xandy"] { border-color: var(--xandy); box-shadow: 0 0 0 1px var(--xandy); color: var(--xandy); }
.who-pick button[aria-pressed="true"][data-v="tati"] { border-color: var(--tati); box-shadow: 0 0 0 1px var(--tati); color: var(--tati); }

/* ===== toast ===== */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 88px); z-index: 100; background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; max-width: calc(100% - 32px); box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); }
.toast.bad { background: var(--bad); color: #fff; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: max-content; min-width: min(340px, calc(100% - 32px)); }
.toast[hidden] { display: none; }
.toast button { flex: none; border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; padding: 4px 2px; }

.skeleton { height: 120px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite linear; border: 1px solid var(--line); }
.skeleton + .skeleton { margin-top: 12px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ===== caixa no acerto ===== */
.settle-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.cash { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cash-grid > div { background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.cash-grid span { font-size: 12px; color: var(--muted); }
.cash-grid strong { font-size: 16px; font-weight: 700; }
@media (min-width: 640px) { .cash-grid { grid-template-columns: repeat(4, 1fr); } }
.cash-accounts { margin-top: 14px; }
.cash-accounts ul { list-style: none; margin: 0; padding: 0; }
.cash-accounts li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cash-accounts li:last-child { border-bottom: 0; }
.cash-accounts li > span:first-child { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.cash-forecast { display: flex; justify-content: space-between; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.neg { color: var(--bad) !important; }
.in { color: var(--good); }
.warn-text { color: var(--warn); }

/* ===== cards do resumo clicáveis ===== */
button.kpi { border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.kpi:hover { background: var(--surface-2); }
.kpi-label { display: flex; justify-content: space-between; align-items: center; }
.kpi-more { font-size: 18px; line-height: 1; color: var(--muted); }
.sheet-sub { font-size: 14px; font-weight: 600; margin: 16px 0 4px; display: flex; justify-content: space-between; }
.breakdown li { grid-template-columns: 1fr auto auto; cursor: pointer; border-radius: 8px; }
.breakdown li:hover { background: var(--surface-2); }
.bd-name { min-width: 0; }
.bd-name small { display: block; font-size: 12px; color: var(--muted); }
.calc li { grid-template-columns: 1fr auto; }
.calc .calc-total { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }

/* ===== pagamentos parciais ===== */
.check.part { border-color: var(--good); background: conic-gradient(var(--good) var(--p, 50%), transparent 0); color: transparent; }
.pay-head { margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.pay-list { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; background: var(--surface-2); }
.pay-list ul { list-style: none; margin: 6px 0 10px; padding: 0; }
.pay-list li { display: grid; grid-template-columns: 1fr auto 32px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pay-list li:last-child { border-bottom: 0; }
.pay-list li small { display: block; color: var(--muted); font-size: 12px; }

/* ===== períodos ===== */
.archived-list { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; }
.totals small { font-size: 12px; color: var(--muted); }
button.kpi { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }


/* ===== conta, administração e segurança ===== */
.me-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.me-head small { display: block; color: var(--muted); font-size: 13px; }
.list.inset { border-radius: var(--radius); }
a.set-row { text-decoration: none; color: inherit; }
.badge-ok, .badge-warn, .badge-bad, .badge-off { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-ok { background: var(--good-bg); color: var(--good); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.back { display: inline-block; margin: 10px 0 -4px; color: var(--muted); text-decoration: none; font-size: 14px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); font-size: 16px; font-weight: 600; letter-spacing: .04em; text-align: center; }
.qr { display: grid; place-items: center; margin: 4px 0 10px; }
.qr img { border-radius: 12px; background: #fff; padding: 6px; }
.steps { margin: 0 0 12px; padding-left: 20px; font-size: 14px; }
.steps li { margin-bottom: 6px; }
.secret { font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; user-select: all; }
.code-input { text-align: center; font-size: 26px; letter-spacing: .3em; font-weight: 700; height: 60px; }
.login-links { display: flex; justify-content: space-between; margin-top: 14px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 6px 0; font-size: 14px; }
.version { text-align: center; font-size: 12px; margin: 28px 0 0; }
.matrix { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.matrix-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.matrix-row:last-child { border-bottom: 0; }
.matrix-mod { font-weight: 600; font-size: 14px; }
.matrix-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: var(--surface-2); cursor: pointer; }
.pchip input { margin: 0; accent-color: var(--ink); }
.pchip:has(input:checked) { border-color: var(--ink); background: var(--surface); font-weight: 600; }
.pchip:has(input:disabled) { cursor: default; opacity: .85; }
@media (min-width: 640px) { .matrix-row { grid-template-columns: 200px 1fr; align-items: center; } }
.audit-row { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.audit-row:last-child { border-bottom: 0; }
.audit-row small { display: block; color: var(--muted); font-size: 12px; }
.audit-when { font-size: 12px; color: var(--muted); }
.audit-row.fail { box-shadow: inset 3px 0 0 var(--bad); }
.audit-row.fail strong { color: var(--bad); }
@media (min-width: 640px) { .audit-row { grid-template-columns: 150px 1fr; align-items: start; } }
.check:disabled { opacity: .5; cursor: default; }
a.chip { text-decoration: none; }
