/* Cofre — design tokens ---------------------------------------------------- */
:root {
  --bg: oklch(0.972 0.006 275);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.965 0.008 275);
  --ink: oklch(0.2 0.03 270);
  --ink-2: oklch(0.42 0.025 270);
  --muted: oklch(0.52 0.02 270);
  --line: oklch(0.92 0.008 275);
  --line-strong: oklch(0.86 0.012 275);
  --accent: oklch(0.52 0.22 277);
  --accent-ink: oklch(1 0 0);
  --accent-soft: oklch(0.52 0.22 277 / 0.09);
  --pos: oklch(0.55 0.15 155);
  --pos-soft: oklch(0.55 0.15 155 / 0.1);
  --neg: oklch(0.56 0.19 25);
  --neg-soft: oklch(0.56 0.19 25 / 0.1);
  --warn: oklch(0.7 0.15 75);
  --shadow: 0 1px 0 oklch(0.2 0.03 270 / 0.04), 0 8px 24px -12px oklch(0.2 0.05 270 / 0.14);
  --shadow-pop: 0 2px 4px oklch(0.2 0.05 270 / 0.06), 0 24px 48px -16px oklch(0.2 0.05 270 / 0.28);
  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(0.155 0.02 270);
    --surface: oklch(0.2 0.022 270);
    --surface-2: oklch(0.24 0.024 270);
    --ink: oklch(0.96 0.005 270);
    --ink-2: oklch(0.82 0.012 270);
    --muted: oklch(0.7 0.02 270);
    --line: oklch(1 0 0 / 0.07);
    --line-strong: oklch(1 0 0 / 0.14);
    --accent: oklch(0.72 0.16 277);
    --accent-ink: oklch(0.16 0.03 270);
    --accent-soft: oklch(0.72 0.16 277 / 0.14);
    --pos: oklch(0.78 0.15 158);
    --pos-soft: oklch(0.78 0.15 158 / 0.13);
    --neg: oklch(0.73 0.16 25);
    --neg-soft: oklch(0.73 0.16 25 / 0.14);
    --shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset, 0 12px 32px -16px oklch(0 0 0 / 0.6);
    --shadow-pop: 0 28px 56px -16px oklch(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: oklch(0.155 0.02 270);
  --surface: oklch(0.2 0.022 270);
  --surface-2: oklch(0.24 0.024 270);
  --ink: oklch(0.96 0.005 270);
  --ink-2: oklch(0.82 0.012 270);
  --muted: oklch(0.7 0.02 270);
  --line: oklch(1 0 0 / 0.07);
  --line-strong: oklch(1 0 0 / 0.14);
  --accent: oklch(0.72 0.16 277);
  --accent-ink: oklch(0.16 0.03 270);
  --accent-soft: oklch(0.72 0.16 277 / 0.14);
  --pos: oklch(0.78 0.15 158);
  --pos-soft: oklch(0.78 0.15 158 / 0.13);
  --neg: oklch(0.73 0.16 25);
  --neg-soft: oklch(0.73 0.16 25 / 0.14);
  --shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset, 0 12px 32px -16px oklch(0 0 0 / 0.6);
  --shadow-pop: 0 28px 56px -16px oklch(0 0 0 / 0.7);
  color-scheme: dark;
}

/* Base --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font); font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.005em; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
input, select { caret-color: var(--accent); accent-color: var(--accent); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.muted { color: var(--muted); }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Shell -------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100dvh; padding: 24px 16px 20px;
  display: flex; flex-direction: column; gap: 28px; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; font-weight: 650; font-size: 1.1rem; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.brand-mark svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 500; transition: background .2s, color .2s;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 14px; }
.user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-strong); display: grid; place-items: center; font-weight: 600; font-size: .8rem; flex: none; }
.user b { display: block; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user small { color: var(--muted); }
.rail-foot .row { display: flex; gap: 4px; }
.rail-foot .row > * { flex: 1; }

.main { min-width: 0; padding: 28px clamp(16px, 3vw, 44px) 56px; max-width: 1360px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.topbar .tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sync-note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 3px var(--pos-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px oklch(0.7 0.15 75 / .15); }
.dot.bad { background: var(--neg); box-shadow: 0 0 0 3px var(--neg-soft); }

.month { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.month a, .month span { padding: 8px 10px; display: grid; place-items: center; }
.month a { color: var(--ink-2); border-radius: 999px; }
.month a:hover { background: var(--surface-2); text-decoration: none; }
.month span { padding: 8px 8px; font-weight: 600; min-width: 128px; text-align: center; text-transform: capitalize; }

/* Controles ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 550; box-shadow: var(--shadow);
  transition: transform .15s var(--ease), background .2s, border-color .2s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: color-mix(in oklch, var(--accent), black 8%); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: .88rem; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading .ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .82rem; font-weight: 550; color: var(--ink-2); }
.input, select.input {
  height: 44px; padding: 0 14px; width: 100%; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line-strong); transition: border-color .2s, box-shadow .2s;
}
.input:hover { border-color: color-mix(in oklch, var(--line-strong), var(--ink) 20%); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder { color: var(--muted); opacity: .8; }

/* Superfícies -------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.panel-head .muted { font-size: .85rem; }
.panel-body { padding: 16px 24px 24px; }

/* Dashboard ---------------------------------------------------------------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 20px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.hero { display: grid; grid-template-columns: 1.15fr 1fr; }
.hero > div { padding: 28px 28px 26px; min-width: 0; }
.hero > div + div { border-left: 1px solid var(--line); }
.label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.big { font-size: clamp(2.2rem, 4.4vw, 3.35rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; margin-top: 10px; }
.big small { font-size: .5em; font-weight: 500; color: var(--muted); letter-spacing: -0.01em; margin-left: 2px; }
.big .cur { font-size: .42em; font-weight: 500; color: var(--muted); margin-right: 6px; letter-spacing: 0; vertical-align: .55em; }
.compose { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 22px; }
.compose div { display: flex; flex-direction: column; gap: 2px; }
.compose b { font-weight: 600; font-size: 1rem; }
.compose span { font-size: .8rem; color: var(--muted); }

.runway { margin-top: 22px; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; position: relative; border: 1px solid var(--line); }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); transition: width .9s var(--ease); }
.bar.over > i { background: var(--neg); }
.bar.warn > i { background: var(--warn); }
.runway-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: .85rem; color: var(--muted); }
.runway-meta b { color: var(--ink); font-weight: 600; }
.perday { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--ink-2); font-size: .9rem; }
.perday b { color: var(--accent); font-weight: 650; }

.legend { display: flex; gap: 18px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.flow-totals { display: flex; gap: 32px; flex-wrap: wrap; padding: 14px 24px 0; }
.flow-totals div { display: flex; flex-direction: column; }
.flow-totals b { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.flow-totals span { font-size: .8rem; color: var(--muted); }
.chart { position: relative; padding: 8px 12px 12px 12px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .l-in { stroke: var(--pos); } .chart .l-out { stroke: var(--neg); }
.chart path.line { fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.chart .hit { fill: transparent; }
.chart .cursor { stroke: var(--line-strong); stroke-width: 1; opacity: 0; }
.tip {
  position: absolute; pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity .15s, transform .15s var(--ease); padding: 10px 12px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-size: .8rem; box-shadow: var(--shadow-pop); min-width: 150px; z-index: 3;
}
.tip b { display: block; margin-bottom: 4px; font-weight: 600; }
.tip div { display: flex; justify-content: space-between; gap: 14px; }

.cats { list-style: none; margin: 0; padding: 8px 24px 20px; }
.cat { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.cat:first-child { border-top: 0; }
.cat-name { display: flex; align-items: center; gap: 10px; font-weight: 550; min-width: 0; }
.cat-name i, .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cat-val { text-align: right; font-weight: 600; }
.cat-val small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.cat .bar { grid-column: 1 / -1; height: 6px; border: 0; }
.cat .bar > i { background: var(--c, var(--accent)); }
.cat .bar .mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .55; border-radius: 2px; }

.invoice { padding: 16px 24px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.invoice:first-of-type { border-top: 0; }
.invoice-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.invoice-top b { font-weight: 600; }
.invoice-top .amt { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; text-align: right; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 550; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.chip.warn { background: oklch(0.7 0.15 75 / .14); color: oklch(0.5 0.12 70); border-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.warn { color: oklch(0.85 0.12 80); } }
:root[data-theme="dark"] .chip.warn { color: oklch(0.85 0.12 80); }
.chip.bad { background: var(--neg-soft); color: var(--neg); border-color: transparent; }
.chip.ok { background: var(--pos-soft); color: var(--pos); border-color: transparent; }

/* Listas e tabelas --------------------------------------------------------- */
.tx { list-style: none; margin: 0; padding: 4px 8px 12px; }
.tx li { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 10px 16px; border-radius: 14px; }
.tx li:hover { background: var(--surface-2); }
.tx-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in oklch, var(--c, var(--muted)) 16%, transparent); color: var(--c, var(--muted)); font-weight: 650; font-size: .85rem; }
.tx-main { min-width: 0; }
.tx-main b { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-main span { color: var(--muted); font-size: .82rem; }
.tx-amt { font-weight: 600; text-align: right; }

.filters { display: grid; grid-template-columns: 1.6fr repeat(2, 1fr) auto; gap: 10px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: .78rem; font-weight: 550; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: var(--surface-2); }
.t td.r, .t th.r { text-align: right; }
.t .desc { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.t .cat-sel { height: 34px; padding: 0 10px; border-radius: 10px; font-size: .86rem; width: auto; min-width: 150px; }
.day-head td { background: var(--surface-2); font-size: .78rem; font-weight: 600; color: var(--muted); padding: 8px 16px; text-transform: capitalize; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

/* Contas ------------------------------------------------------------------- */
.conn { margin-bottom: 20px; }
.conn-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 24px; flex-wrap: wrap; }
.conn-head .who { display: flex; align-items: center; gap: 14px; }
.inst { width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 650; }
.acc-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--line); }
.acc-row .amt { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; text-align: right; }
.acc-row .bar { grid-column: 1 / -1; height: 6px; border: 0; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 14px; background: var(--neg-soft); color: var(--ink); margin: 0 24px 18px; font-size: .9rem; }
.notice .ico { color: var(--neg); margin-top: 1px; }

/* Orçamento ---------------------------------------------------------------- */
.budget-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px; gap: 16px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line); }
.budget-row:first-child { border-top: 0; }
.budget-row .bar { height: 6px; border: 0; margin-top: 8px; }
.budget-row .bar > i { background: var(--c); }
.budget-row .input { height: 38px; text-align: right; }

/* Vazio / login ------------------------------------------------------------ */
.empty { padding: 56px 24px; text-align: center; display: grid; justify-items: center; gap: 14px; }
.empty .ill { width: 64px; height: 64px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty .ill .ico { width: 30px; height: 30px; }
.empty h2 { font-size: 1.15rem; }
.empty p { color: var(--muted); max-width: 44ch; text-wrap: pretty; }

.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-art {
  position: relative; overflow: hidden; padding: 48px 48px 150px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 90% at 0% 0%, oklch(0.32 0.14 277) 0%, oklch(0.17 0.05 270) 60%);
  color: oklch(0.97 0.005 270);
}
.auth-art .brand-mark { background: oklch(0.97 0.005 270); color: oklch(0.3 0.12 277); }
.auth-art blockquote { margin: 0; font-size: clamp(1.8rem, 3vw, 2.7rem); line-height: 1.12; letter-spacing: -0.03em; font-weight: 600; max-width: 14ch; text-wrap: balance; }
.auth-art small { color: oklch(0.8 0.03 275); font-size: .9rem; }
.auth-art svg.wave { position: absolute; inset: auto -5% -8% -5%; width: 110%; opacity: .5; pointer-events: none; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-form form { width: min(100%, 380px); display: grid; gap: 18px; }
.auth-form h1 { font-size: 1.9rem; letter-spacing: -0.03em; }
.err { background: var(--neg-soft); color: var(--neg); padding: 10px 14px; border-radius: 12px; font-size: .9rem; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-pop); transition: .35s var(--ease); z-index: 30; font-weight: 500; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Tab bar mobile ----------------------------------------------------------- */
.tabbar { display: none; }

/* Movimento: uma entrada orquestrada --------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.reveal { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.chart path.line { animation: draw 1.4s var(--ease) .25s both; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .chart path.line { animation: none; }
  .bar > i, .btn, .tip { transition: none; }
}

/* Responsivo --------------------------------------------------------------- */
@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; padding: 6px;
    background: color-mix(in oklch, var(--surface), transparent 8%); backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow-pop);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 16px; font-size: .7rem; font-weight: 550; color: var(--muted); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  .hero { grid-template-columns: 1fr; }
  .hero > div { padding: 22px 20px; }
  .hero > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .panel-head { padding: 18px 20px 0; } .panel-body { padding: 14px 20px 20px; }
  .cats, .flow-totals { padding-left: 20px; padding-right: 20px; }
  .invoice, .acc-row, .conn-head, .budget-row { padding-left: 20px; padding-right: 20px; }
  .filters { grid-template-columns: 1fr 1fr; } .filters .field:first-child { grid-column: 1 / -1; }
  .budget-row { grid-template-columns: minmax(0, 1fr) 110px; } .budget-row .spent { display: none; }
  .t .hide-sm { display: none; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .topbar h1 { font-size: 1.3rem; }
  .chart .axis { font-size: 16px; }
  .chart path.line { stroke-width: 3.4; }
  .chart { padding: 8px 8px 12px; }
}
@media (max-width: 420px) {
  .big { font-size: 2.15rem; }
  .compose { gap: 10px 20px; }
}

/* Gastos fixos ------------------------------------------------------------- */
details.panel > summary { list-style: none; } details.panel > summary::-webkit-details-marker { display: none; }
details.panel:not([open]) > summary { padding-bottom: 20px !important; }
.fixed-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 0 24px 24px; }
.fixed-danger { display: flex; gap: 8px; padding: 0 24px 22px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; padding: 8px 14px; border-radius: 9px; font-weight: 550; font-size: .9rem; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-inst][hidden] { display: none; }
.fixed-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 8px 16px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line); }
.fixed-row:first-of-type { border-top: 0; }
.fixed-row.compact { grid-template-columns: minmax(0, 1fr) auto auto; }
.dayc { display: grid; justify-items: center; line-height: 1.1; padding: 6px 0; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.dayc b { font-size: 1.05rem; } .dayc span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fixed-main { min-width: 0; } .fixed-main b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fixed-main span { font-size: .84rem; }
.fixed-amt { font-weight: 600; text-align: right; font-size: 1.02rem; }
.fixed-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .fixed-form { grid-template-columns: 1fr 1fr; padding: 0 20px 20px; }
  .fixed-form > [style*="span 2"], .fixed-form > .err { grid-column: 1 / -1 !important; }
  .fixed-row { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 14px 20px; }
  .fixed-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .fixed-row.compact { grid-template-columns: minmax(0, 1fr) auto; } .fixed-row.compact .btn { grid-column: 1 / -1; justify-self: start; }
  .fixed-danger { padding: 0 20px 20px; }
  .tabbar a { font-size: .66rem; }
}

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .95rem; color: var(--ink); font-weight: 550; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.check small { font-weight: 400; }
[data-card][hidden] { display: none; }
.src { display: block; font-size: .72rem; font-weight: 450; color: var(--muted); letter-spacing: 0; }
.setvalue { display: inline-flex; gap: 6px; align-items: center; }
.setvalue .input { height: 34px; width: 112px; text-align: right; border-radius: 10px; font-size: .88rem; }

.fixed-row > .setvalue { grid-column: 2 / -1; justify-self: end; margin-top: -2px; }
@media (max-width: 860px) { .fixed-row > .setvalue { grid-column: 1 / -1; justify-self: start; } }
