/* Meu Financeiro — estilos */
:root {
  --bg: #f6f2ee;
  --surface: #ffffff;
  --surface-2: #fbf8f5;
  --line: #ece4dc;
  --line-2: #e2d8ce;
  --text: #1f1a17;
  --muted: #7a716a;
  --primary: #f26a1b;
  --primary-600: #dc5a0e;
  --primary-soft: #fdeadb;
  --green: #2e8b3e;
  --green-soft: #eaf5e8;
  --red: #cf3f24;
  --red-soft: #fce9e4;
  --amber: #b86e00;
  --amber-soft: #fff2d9;
  --blue: #2f6fb5;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .04), 0 6px 18px rgba(60, 40, 20, .05);
  --shadow-lg: 0 20px 60px rgba(40, 25, 10, .22);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar: 248px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161311; --surface: #1f1b18; --surface-2: #26211d; --line: #332c26; --line-2: #3d352e;
    --text: #f3ede7; --muted: #a59a90; --primary-soft: #3a2415; --green: #5cbf6a; --green-soft: #1d2e1f;
    --red: #f07a62; --red-soft: #3a1f19; --amber: #f0b44c; --amber-soft: #36290f;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161311; --surface: #1f1b18; --surface-2: #26211d; --line: #332c26; --line-2: #3d352e;
  --text: #f3ede7; --muted: #a59a90; --primary-soft: #3a2415; --green: #5cbf6a; --green-soft: #1d2e1f;
  --red: #f07a62; --red-soft: #3a1f19; --amber: #f0b44c; --amber-soft: #36290f;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hidden { display: none !important; }

/* ------------------------------ layout ------------------------------ */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: var(--surface-2);
  padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 700; font-size: 18px; }
.brand .logo { width: 28px; height: 28px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--text);
  font-weight: 500; position: relative;
}
.nav-link .ic { color: var(--muted); }
.nav-link:hover { background: var(--surface); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-600); font-weight: 600; }
.nav-link.active .ic { color: var(--primary); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 12px; font-weight: 700;
  background: var(--primary); color: #fff; display: inline-grid; place-items: center;
}
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; font-size: 12.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 28px; position: sticky; top: 0;
  z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
}
.topbar .m-title { display: none; font-weight: 700; font-size: 20px; margin-right: auto; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 6px 10px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface);
}
.sync-pill .ic { width: 16px; height: 16px; }
.sync-pill.off { color: var(--amber); border-color: var(--amber-soft); background: var(--amber-soft); }
.sync-pill.err { color: var(--red); }
.sync-pill.spin .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: inline-grid; place-items: center;
  position: relative; color: var(--text);
}
.icon-btn:hover { background: var(--surface); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-600); font-weight: 700;
  display: grid; place-items: center; border: 0;
}
.content { padding: 4px 28px 40px; max-width: 1280px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 700; }
.month-pick { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 16px; margin-top: 2px; }
.month-pick button { border: 0; background: transparent; padding: 4px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.month-pick button:hover { background: var(--surface); color: var(--text); }
.month-pick span { min-width: 150px; text-align: center; color: var(--text); font-weight: 500; }

.bottom-nav { display: none; }
.fab { display: none; }

/* ------------------------------ botões ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14.5px; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(242, 106, 27, .28); }
.btn.primary:hover { background: var(--primary-600); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.link { color: var(--primary-600); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; }
.link .ic { width: 16px; height: 16px; }

/* ------------------------------ cards ------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 18px; font-weight: 700; }
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.row-2 { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); margin-bottom: 18px; }
.row-2b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.kpi { display: flex; gap: 14px; align-items: flex-start; padding: 18px; cursor: pointer; transition: transform .12s; }
.kpi:hover { transform: translateY(-1px); }
.kpi .ic { width: 26px; height: 26px; margin-top: 2px; }
.kpi .lbl { font-size: 14px; color: var(--text); opacity: .85; }
.kpi .val { font-size: 23px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.green { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 20%, transparent); }
.kpi.green .ic { color: var(--green); }
.kpi .ic.i-green { color: var(--green); }
.kpi .ic.i-orange { color: var(--primary); }

.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; margin-bottom: 12px; font-size: 14px;
  border: 1px solid transparent;
}
.alert .ic { margin-top: 1px; }
.alert.danger { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert.warn { background: var(--amber-soft); color: var(--amber); }
.alert.info { background: var(--primary-soft); color: var(--primary-600); }
.alert b { font-weight: 700; }
.alert .alert-body { color: var(--text); flex: 1; }
.alert .alert-body p { margin: 3px 0 0; }
.alert a.link { margin-left: auto; align-self: center; }

.proj-strip { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin: -4px 0 18px; padding: 12px 16px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: 12px; }
.proj-strip b { color: var(--text); font-size: 15px; display: block; }

/* ------------------------------ listas ------------------------------ */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer;
  min-width: 0;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item .ico {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary);
}
.item .ico.in { background: var(--green-soft); color: var(--green); }
.item .ico.out { background: var(--primary-soft); color: var(--primary); }
.item .ico.neutral { background: var(--surface-2); color: var(--muted); }
.item .ico .ic { width: 20px; height: 20px; }
.item .main-t { flex: 1; min-width: 0; }
.item .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.item .amt { font-weight: 700; }
.item .actions { display: flex; gap: 6px; }
.group-title { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 18px 4px 4px; display: flex; justify-content: space-between; }
.group-title:first-child { margin-top: 0; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.open { background: var(--primary-soft); color: var(--primary-600); }
.chip.late { background: var(--red-soft); color: var(--red); }
.chip.sched { background: var(--green-soft); color: var(--green); }
.chip.paid { background: var(--green-soft); color: var(--green); }
.chip.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip .ic { width: 13px; height: 13px; }

.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; opacity: .6; }
.empty p { margin: 8px 0 0; }

/* ------------------------------ filtros ------------------------------ */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 180px; position: relative; }
.toolbar .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; }
.toolbar .search input { padding-left: 36px; }
.totals { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.totals .t { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 140px; }
.totals .t small { color: var(--muted); display: block; font-size: 12.5px; }
.totals .t b { font-size: 17px; }

/* ------------------------------ formulários ------------------------------ */
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 11px;
  padding: 10px 12px; outline: none; min-height: 42px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
.toolbar select, .toolbar input { width: auto; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.fields .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; margin: 4px 0 12px; cursor: pointer; }
.money-in { position: relative; }
.money-in span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-in input { padding-left: 40px; font-weight: 700; font-size: 17px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.form-actions .left { margin-right: auto; }
.hint { font-size: 12.5px; color: var(--muted); margin: -6px 0 12px; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 8px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button.on.out { color: var(--primary-600); }
.seg button.on.in { color: var(--green); }
details.more { margin: 2px 0 10px; }
details.more summary { cursor: pointer; color: var(--primary-600); font-weight: 600; font-size: 14px; margin-bottom: 10px; }

.attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.attach {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 8px 6px 6px;
  background: var(--surface-2); max-width: 100%; font-size: 13px;
}
.attach img, .attach .thumb { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; background: var(--surface); display: grid; place-items: center; color: var(--muted); }
.attach .name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.attach button { border: 0; background: none; color: var(--muted); padding: 2px; display: grid; }
.attach button .ic { width: 16px; height: 16px; }
.attach-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------ modal ------------------------------ */
.modal-wrap {
  position: fixed; inset: 0; background: rgba(20, 12, 6, .42); z-index: 100; display: grid; place-items: center; padding: 20px;
  opacity: 0; transition: opacity .18s;
}
.modal-wrap.show { opacity: 1; }
.modal {
  background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex;
  flex-direction: column; box-shadow: var(--shadow-lg); transform: translateY(8px); transition: transform .2s;
}
.modal.wide { max-width: 760px; }
.modal-wrap.show .modal { transform: none; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modal header h3 { font-size: 19px; }
.modal-body { padding: 8px 18px 18px; overflow-y: auto; }
.confirm-text { margin: 4px 0 16px; }

#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #2a221c; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: all .25s; max-width: 90vw; }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--red); }

/* ------------------------------ gráficos ------------------------------ */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { fill: var(--muted); font-size: 11.5px; font-family: var(--font); }
.ch-hit:hover { fill: color-mix(in srgb, var(--text) 4%, transparent); }
.legend { display: flex; justify-content: center; gap: 22px; margin-top: 8px; font-size: 14px; }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg i, .donut-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.donut { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; }
.donut-svg { position: relative; flex: none; }
.donut-svg svg { width: 100%; height: 100%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center b { font-size: 16px; }
.donut-center small { color: var(--muted); font-size: 12px; }
.donut-legend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; }
.donut-legend li { display: flex; align-items: center; gap: 9px; }
.donut-legend span { flex: 1; }

/* ------------------------------ diversos ------------------------------ */
.acc-card { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.acc-card .top { display: flex; align-items: center; gap: 10px; }
.acc-card .sw { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.acc-card .sw .ic { width: 18px; height: 18px; }
.acc-card .bal { font-size: 21px; font-weight: 700; }
.acc-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.inv-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.inv-table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.inv-table td { padding: 12px 6px; border-bottom: 1px solid var(--line); }
.inv-table tr:last-child td { border-bottom: 0; }
.inv-table tr[data-id] { cursor: pointer; }
.inv-table tr[data-id]:hover td { background: var(--surface-2); }
.tr { text-align: right; }
.settings-sec { margin-bottom: 18px; }
.settings-sec h3 { font-size: 17px; margin-bottom: 4px; }
.settings-sec p.muted { margin: 0 0 12px; font-size: 14px; }
.code-box { display: flex; gap: 8px; align-items: center; }
.code-box input { font-family: ui-monospace, monospace; font-size: 12.5px; }
.steps { padding-left: 20px; margin: 8px 0; font-size: 14px; }
.steps li { margin-bottom: 6px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.more-grid a { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.more-grid a .ic { color: var(--primary); width: 24px; height: 24px; }
.notif-item.unread .t1::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 7px; vertical-align: middle; }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-tabs button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 20px; padding: 6px 13px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.pill-tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.bar-track i { display: block; height: 100%; border-radius: 6px; background: var(--primary); }

/* ------------------------------ login ------------------------------ */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 400px; padding: 28px; }
.login .brand { padding: 0 0 6px; font-size: 22px; }
.login p.muted { margin: 0 0 20px; }
.login .err { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }

.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

/* ------------------------------ responsivo ------------------------------ */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-2, .row-2b { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 12px 16px 8px; padding-top: max(12px, env(safe-area-inset-top)); }
  .topbar .m-title { display: block; }
  .topbar .sync-pill .lbl { display: none; }
  .content { padding: 0 16px calc(var(--nav-h) + 90px); }
  .page-head { margin: 0 0 16px; }
  .page-head h1 { display: none; }
  .page-head .btn.primary.desk { display: none; }
  .kpis { gap: 12px; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi .ic { width: 20px; height: 20px; }
  .kpi .val { font-size: 18px; }
  .kpi.big { grid-column: 1 / -1; }
  .kpi.big .val { font-size: 27px; }
  .kpis .kpi.big ~ .kpi:last-child:nth-child(even) { grid-column: 1 / -1; }
  .card { padding: 16px; }
  .fields { grid-template-columns: 1fr; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; color: var(--muted); font-weight: 500; position: relative; }
  .bottom-nav a.active { color: var(--primary); font-weight: 700; }
  .bottom-nav a .ic { width: 23px; height: 23px; }
  .bottom-nav .badge { position: absolute; top: 6px; left: 54%; margin: 0; height: 17px; min-width: 17px; font-size: 10.5px; }
  .fab {
    display: flex; position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); z-index: 25;
    height: 50px; border-radius: 14px; border: 0; background: var(--primary); color: #fff; font-weight: 700; font-size: 16px;
    align-items: center; justify-content: center; gap: 8px; box-shadow: 0 8px 22px rgba(242, 106, 27, .35);
  }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; max-height: 94vh; max-width: none; padding-bottom: env(safe-area-inset-bottom); transform: translateY(40px); }
  .modal.wide { max-width: none; }
  .donut { gap: 16px; }
  .inv-table .hide-m { display: none; }
  #toasts { bottom: calc(var(--nav-h) + 80px); }
  .item .hide-m { display: none; }
}

/* ------------------------------ tabelas de lançamentos ------------------------------ */
.ic.mini { width: 15px; height: 15px; vertical-align: -3px; }
.icon-btn.sm { width: 32px; height: 32px; }
.show-m { display: none; }
.tx-table { padding: 6px 14px 10px; }
.tx-row {
  display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.2fr) minmax(0, 1.3fr) minmax(110px, 1fr) 112px 92px;
  gap: 12px; align-items: center; padding: 11px 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14.5px;
}
.tx-row:hover:not(.tx-headrow) { background: var(--surface-2); }
.tx-headrow { cursor: default; font-weight: 700; font-size: 13.5px; color: var(--text); border-bottom: 1px solid var(--line-2); }
.tx-day { background: var(--surface-2); border-radius: 8px; padding: 7px 10px; margin: 10px 0 2px; font-size: 13.5px; color: var(--muted); }
.tx-day b { color: var(--text); }
.tx-desc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tx-desc .t1 { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; min-width: 0; }
.tx-desc .arr { flex: none; display: grid; place-items: center; }
.tx-desc .arr.pos { color: var(--green); }
.tx-desc .arr.out { color: var(--primary); }
.tx-desc .arr.muted { color: var(--muted); }
.tx-cat, .tx-acc { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-row .amt { font-weight: 700; }
.bills .tx-row { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(110px, 1fr) 112px 100px; }
.mini-seg { margin: 0; padding: 3px; }
.mini-seg a { padding: 6px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.mini-seg a.on { background: var(--primary); color: #fff; }

/* calendário */
.cal-h, .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-h span { text-align: center; font-size: 13px; color: var(--muted); padding: 4px 0 8px; }
.cal-g { border-top: 1px solid var(--line); }
.cal-c {
  min-height: 56px; border: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; font-size: 14px;
}
.cal-c:nth-child(7n) { border-right: 0; }
.cal-c.empty { cursor: default; }
.cal-c b { font-weight: 500; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.cal-c.has b { font-weight: 700; }
.cal-c.today b { background: var(--primary-soft); color: var(--primary-600); }
.cal-c.sel { background: var(--surface-2); }
.cal-c small { font-size: 10.5px; font-weight: 600; display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.cal-c small i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.cal-c small.open { color: var(--primary-600); }
.cal-c small.late { color: var(--red); }
.cal-c small.paid { color: var(--green); }

/* detalhes */
.det-head { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.det-t { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.det-t .ic { color: var(--primary); }
.det-v { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 8px; }
.det-box { border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; margin-bottom: 12px; }
.det-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.det-row:last-child { border-bottom: 0; }
.det-row .ic { color: var(--muted); }
.det-row span { flex: 1; color: var(--muted); }
.det-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

/* investimentos */
.inv-name { display: flex; align-items: center; gap: 12px; }
.inv-logo { width: 36px; height: 36px; border-radius: 10px; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.inv-quick { display: none; gap: 10px; margin-bottom: 16px; }
.inv-quick .btn { flex: 1; }
.total-row td { background: var(--green-soft); }

@media (max-width: 860px) {
  .show-m { display: block; font-weight: 400; }
  .hide-m { display: none !important; }
  .tx-table { padding: 4px 12px; }
  .tx-row, .bills .tx-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "d a" "d s"; row-gap: 3px; padding: 11px 2px; }
  .tx-row .tx-desc { grid-area: d; }
  .tx-row .amt { grid-area: a; }
  .tx-row .tx-st { grid-area: s; justify-self: end; }
  .tx-headrow { display: none; }
  .toolbar .month-pick { width: 100%; justify-content: center; }
  .toolbar .pill-tabs { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 2px; }
  .toolbar .pill-tabs button { flex: none; }
  .toolbar select { width: 100%; }
  .cal-c { min-height: 46px; padding: 4px 0; }
  .cal-c small { font-size: 0; }
  .cal-c small i { width: 7px; height: 7px; }
  .inv-quick { display: flex; }
  .page-head .attach-btns .btn.primary { display: inline-flex; }
}

/* ------------------------------ lançamento rápido ------------------------------ */
.amount-hero { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.amount-hero .money-in span { font-size: 22px; left: 16px; }
.amount-hero .money-in input { border: 0; background: transparent; box-shadow: none; text-align: center; font-size: 34px; font-weight: 800; letter-spacing: -.02em; padding-left: 40px; min-height: 54px; }
.amount-hero .money-in input:focus { box-shadow: none; }

/* capturas */
.match-hint { margin-top: 6px; font-size: 13px; padding: 6px 9px; border-radius: 8px; background: var(--surface-2); color: var(--muted); white-space: normal; }
.match-hint.ok { background: var(--green-soft); color: var(--green); }
.match-hint b { color: var(--text); }
.inbox-actions { flex-direction: row !important; flex-wrap: wrap; justify-content: flex-end; max-width: 230px; }

/* contas */
.acc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; font-size: 12.5px; flex-wrap: wrap; }
.acc-foot .link { font-size: 13px; }

/* importação */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; border: 2px dashed var(--line-2); border-radius: 14px;
  cursor: pointer; text-align: center; margin-top: 6px; background: var(--surface-2);
}
.dropzone .ic { width: 30px; height: 30px; color: var(--primary); }
.dropzone:hover { border-color: var(--primary); }
.dropzone.disabled { opacity: .5; cursor: not-allowed; }
.totals .t.warn { border-color: var(--amber); background: var(--amber-soft); }
.totals .t.ok { border-color: color-mix(in srgb, var(--green) 40%, transparent); background: var(--green-soft); }
.totals .t small:last-child { margin-top: 2px; }
.imp-table { padding: 4px 12px; }
.imp-row {
  display: grid; grid-template-columns: 26px 78px minmax(0, 2.2fr) 150px minmax(0, 1.3fr) 120px 150px; gap: 10px; align-items: center;
  padding: 9px 2px; border-bottom: 1px solid var(--line);
}
.imp-row:last-child { border-bottom: 0; }
.imp-row.off { opacity: .5; }
.imp-row input:not([type=checkbox]), .imp-row select { min-height: 36px; padding: 6px 9px; font-size: 14px; }
.imp-desc { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imp-desc small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-date { font-size: 13.5px; color: var(--muted); }
.imp-amt { text-align: right; font-weight: 700; }
.imp-st { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imp-st small { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* metas */
.goal { display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.goal-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bar-track.lg { height: 12px; }
.check-list { display: flex; flex-direction: column; gap: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.check-list .check { margin: 6px 0; }

/* bloqueio */
.lock-screen { position: fixed; inset: 0; z-index: 500; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.lock-box { text-align: center; width: 100%; max-width: 300px; }
.lock-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 10px; }
.lock-ico .ic { width: 28px; height: 28px; }
.lock-box h3 { font-size: 20px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 6px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.on { background: var(--primary); border-color: var(--primary); }
.lock-err { color: var(--red); min-height: 20px; font-size: 14px; margin: 4px 0 8px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keypad button { height: 62px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); font-size: 24px; font-weight: 600; display: grid; place-items: center; }
.keypad button:active { background: var(--primary-soft); }
.keypad button.ghost-key { border: 0; background: transparent; }
.keypad button .ic { width: 26px; height: 26px; color: var(--primary); }

@media (max-width: 860px) {
  .imp-row { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "c d a" "c t t" "c g g" "c s s"; row-gap: 6px; padding: 12px 0; }
  .imp-inc { grid-area: c; align-self: start; padding-top: 8px; }
  .imp-date { display: none; }
  .imp-desc { grid-area: d; }
  .imp-amt { grid-area: a; align-self: start; padding-top: 8px; }
  .imp-type { grid-area: t; }
  .imp-target { grid-area: g; }
  .imp-st { grid-area: s; flex-direction: row; align-items: center; gap: 8px; }
  .inbox-actions { max-width: none; }
  .item:has(.inbox-actions) { flex-wrap: wrap; }
  .item:has(.inbox-actions) .inbox-actions { width: 100%; justify-content: flex-start; padding-left: 52px; }
}
