/* ---------- Cores: claro, escuro e paletas ---------- */
:root {
  --font-d: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-b: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --bg: #F3F2FA;
  --bg-page: radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), #F3F2FA;
  --surface: #FFFFFF;
  --surface-2: #F7F6FC;
  --ink: #17183A;
  --ink-2: #3D4066;
  --muted: #676A8E;
  --line: #E4E2F0;
  --line-strong: #C3C2DA;
  --in: #1C8C62; --in-soft: #E3F4EC; --in-ink: #145C42;
  --out: #D0435B; --out-soft: #FCE9EC; --out-ink: #8C2537;
  --due: #B7791F; --due-soft: #FBF1DE; --due-ink: #6A4D17;
  --parc: #8C7AD1;
  --scrim: rgba(12, 12, 40, .45);
  --shadow: rgba(23, 24, 58, .12);
  --glass: rgba(255, 255, 255, .9);
  --card-shadow: 0 1px 2px rgba(23, 24, 58, .04), 0 8px 24px -12px rgba(23, 24, 58, .12);
  color-scheme: light;
}
:root, [data-accent="nebulosa"] { --accent: #6C4CF1; --accent-strong: #5636D6; --hero-a: #2A1B6E; --hero-b: #7B4DFF; --hero-c: #C25BFF; }
[data-accent="galaxia"] { --accent: #3446C9; --accent-strong: #26359E; --hero-a: #0E1650; --hero-b: #2E44C8; --hero-c: #4FA3FF; }
[data-accent="aurora"]  { --accent: #0F8F86; --accent-strong: #0B6F68; --hero-a: #0C2A4A; --hero-b: #0F8F86; --hero-c: #7B61FF; }
[data-accent="grafite"] { --accent: #4B5574; --accent-strong: #353D57; --hero-a: #15192A; --hero-b: #3A4260; --hero-c: #7D86A8; }
:root { --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface)); --accent-glow: color-mix(in srgb, var(--accent) 45%, transparent); }

[data-theme="dark"] {
  --bg: #0E1027;
  --bg-page: radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--hero-b) 28%, transparent), transparent 65%),
             radial-gradient(700px 400px at -10% 30%, color-mix(in srgb, var(--hero-c) 14%, transparent), transparent 60%), #0A0C1E;
  --surface: #141733;
  --surface-2: #1A1E3F;
  --ink: #ECEBFA;
  --ink-2: #C9C9E6;
  --muted: #9C9EC4;
  --line: #262B52;
  --line-strong: #3A4072;
  --in: #3DD39A; --in-soft: rgba(61, 211, 154, .12); --in-ink: #8FF0C8;
  --out: #FF6B85; --out-soft: rgba(255, 107, 133, .12); --out-ink: #FFB3C1;
  --due: #F2B451; --due-soft: rgba(242, 180, 81, .12); --due-ink: #F7D394;
  --parc: #A08CFF;
  --scrim: rgba(0, 0, 8, .6);
  --shadow: rgba(0, 0, 0, .4);
  --glass: rgba(16, 18, 42, .88);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 30px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
[data-theme="dark"][data-accent="nebulosa"], [data-theme="dark"]:not([data-accent]) { --accent: #A58BFF; --accent-strong: #BBA6FF; }
[data-theme="dark"][data-accent="galaxia"] { --accent: #7E93FF; --accent-strong: #9DADFF; }
[data-theme="dark"][data-accent="aurora"]  { --accent: #3ED6C6; --accent-strong: #6BE3D6; }
[data-theme="dark"][data-accent="grafite"] { --accent: #AEB7D4; --accent-strong: #C8CFE6; }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .fab, [data-theme="dark"] .done .check { color: #0E1027; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--ink);
  font: 15px/1.5 var(--font-b);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  min-height: 100vh;
}
a { color: var(--accent); }
h1, h2 { font-family: var(--font-d); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.05rem; }
small { font-size: .82rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Estrutura ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1rem; display: grid; gap: 1rem; }
.cols { display: grid; gap: 1rem; }
@media (min-width: 900px) { .wrap { padding: 0 1.25rem; } .cols { grid-template-columns: 1fr 1fr; align-items: start; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.15rem; }
.panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-top: .5rem; }
.empty { color: var(--muted); margin: .25rem 0; }

/* ---------- Painel principal ---------- */
.hero { padding: .5rem .25rem .5rem; }
.monthnav { display: flex; align-items: center; gap: .35rem; }
.monthnav span { font-weight: 600; min-width: 9.5rem; text-align: center; }
.hero .monthnav { margin: 0 0 1.25rem -.4rem; }
.hero-label { margin: 0; color: var(--muted); }
.hero-value {
  margin: .1rem 0 .6rem; font-family: var(--font-d); font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 4rem); line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.hero-value.neg { color: var(--out); }
.hero-split { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; color: var(--muted); }
.hero-split strong { color: var(--ink); font-weight: 600; margin-left: .2rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.dot.in { background: var(--in); } .dot.out { background: var(--out); } .dot.due { background: var(--due); }

.who { margin-top: 1.6rem; }
.who-title { margin: 0 0 .5rem; font-weight: 600; }
.who-bar { display: flex; gap: 3px; height: 22px; }
.who-bar span { border-radius: 6px; min-width: 6px; }
.who-bar span:first-child { border-radius: 11px 6px 6px 11px; }
.who-bar span:last-child { border-radius: 6px 11px 11px 6px; }
.who-bar span:only-child { border-radius: 11px; }
.who-legend { list-style: none; padding: 0; margin: .65rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.who-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .45rem; }
.who-legend strong { font-weight: 600; margin-left: .15rem; }
.who-legend span { color: var(--muted); font-size: .85rem; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: .3rem .5rem; }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 500; }
.bar-track { grid-column: 1 / -1; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: 99px; }

/* ---------- Vencimentos ---------- */
.bills { list-style: none; margin: 0; padding: 0; }
.bill { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .3rem .85rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.bill:first-child { border-top: 0; padding-top: 0; }
.bill-day {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg); font-family: var(--font-d); font-size: 1.1rem;
}
.bill-main { display: flex; flex-direction: column; min-width: 0; }
.bill-main small { color: var(--muted); }
.bill-amt { font-variant-numeric: tabular-nums; font-weight: 500; }
.st-atrasada .bill-day { background: var(--out-soft); color: var(--out); }
.st-atrasada small { color: var(--out); font-weight: 500; }
.st-hoje .bill-day, .st-logo .bill-day { background: var(--due-soft); color: var(--due); }
.st-hoje small, .st-logo small { color: var(--due); font-weight: 500; }
.st-paga { opacity: .55; }
.st-paga .bill-main span { text-decoration: line-through; }
.bill-act, .pay { grid-column: 1 / -1; justify-self: end; }
.pay[open] { justify-self: stretch; }
.pay summary { list-style: none; float: right; }
.pay summary::-webkit-details-marker { display: none; }
.pay[open] summary { display: none; }
.pay-form { clear: both; margin-top: .5rem; padding: .9rem; background: var(--bg); border-radius: 14px; }

.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.plain li:first-child { border-top: 0; }
.plain li > span { display: flex; flex-direction: column; }
.plain small { color: var(--muted); }
.plain .paused { opacity: .55; }
.plain form { display: flex; gap: .75rem; flex-shrink: 0; }

/* ---------- Lançamentos ---------- */
.txlist { list-style: none; margin: 0; padding: 0; }
.panel.txlist { padding: .3rem 1.15rem; }
.tx { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; color: inherit; text-decoration: none; }
.txlist li + li .tx { border-top: 1px solid var(--line); }
a.tx:hover .tx-desc { color: var(--accent); }
.tx-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-desc { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .6rem; color: var(--muted); font-size: .82rem; }
.tx-side { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.tx-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.tx-amt.receita { color: var(--in); }
.tx-date { color: var(--muted); font-size: .78rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: 0 .5rem 0 .4rem; border-radius: 99px;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: var(--ink); font-size: .75rem; line-height: 1.6;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters select { width: auto; flex: 1 1 10rem; }
.totals { display: flex; gap: 1.25rem; margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.totals .in { color: var(--in); } .totals .out { color: var(--out); }
.day-title { font-family: var(--font-b); font-size: .85rem; font-weight: 600; color: var(--muted); margin: .25rem 0 .4rem .25rem; }

/* ---------- Formulários ---------- */
.form { display: grid; gap: .8rem; }
.field { display: grid; gap: .3rem; margin: 0; min-width: 0; border: 0; padding: 0; }
.field > span, .field > legend { font-size: .82rem; font-weight: 600; color: var(--muted); padding: 0; }
.field small { color: var(--muted); }
input, select {
  width: 100%; min-width: 0; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem;
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="color"] { padding: .2rem; height: 44px; width: 56px; cursor: pointer; }
.grid2, .grid3 { display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 639px) { .grid3 { grid-template-columns: 1fr; } }
.inline-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); grid-template-columns: 1fr; align-items: end; }
@media (min-width: 640px) { .inline-form { grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); } .inline-form .field-color { max-width: 4.5rem; } }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.danger-zone { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: .65rem 1.1rem; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-ghost-danger { background: transparent; color: var(--out); padding-left: 0; padding-right: 0; }
.btn-block { width: 100%; padding: .85rem; }
.link-sm { background: none; border: 0; padding: 0; font: inherit; font-size: .88rem; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: none; }
.link-sm.danger { color: var(--out); }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: 0; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--accent-soft); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border-radius: 12px; padding: 4px; }
.seg label { position: relative; }
.seg input, .who-pick input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg span { display: block; text-align: center; padding: .5rem; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px var(--shadow); }
.seg input:focus-visible + span { outline: 2.5px solid var(--accent); }

.who-pick { display: flex; flex-wrap: wrap; gap: .5rem; }
.who-pick legend { margin-bottom: .3rem; }
.who-pick label { position: relative; }
.who-pick span {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border-radius: 99px;
  border: 1.5px solid var(--line); cursor: pointer; font-weight: 500;
}
.who-pick span::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.who-pick input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 20%, var(--surface)); }
.who-pick input:focus-visible + span { outline: 2.5px solid var(--accent); }

.copy { display: flex; gap: .5rem; margin: .5rem 0; }
.copy input { font-size: .85rem; color: var(--muted); }

.cats { list-style: none; margin: 0; padding: 0; }
.cat-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .4rem .75rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.cats li:first-child .cat-row { border-top: 0; }
.cat-row input[type="color"] { width: 36px; height: 36px; border-radius: 50%; }
.cat-name { display: flex; flex-direction: column; }
.cat-name small { color: var(--muted); }
.cat-row input[name="keywords"] { grid-column: 1 / -1; font-size: .9rem; padding: .45rem .6rem; }
@media (min-width: 760px) {
  .cat-row { grid-template-columns: auto 10rem 1fr auto auto; }
  .cat-row input[name="keywords"] { grid-column: auto; }
}

/* ---------- Avisos ---------- */
.toast {
  margin: .25rem 0 0; padding: .7rem 1rem; border-radius: 12px; background: var(--in-soft); color: var(--in-ink); font-weight: 500;
  animation: toast-out 0.4s ease 4s forwards;
}
@keyframes toast-out { to { opacity: 0; height: 0; padding: 0; margin: 0; } }
.alert { padding: .7rem 1rem; border-radius: 12px; background: var(--out-soft); color: var(--out-ink); }

.auth { max-width: 420px; margin: 8vh auto 0; width: 100%; display: grid; gap: .6rem; }
.auth.wide { max-width: 620px; margin-top: 3vh; }
.auth p { margin: 0; }
.person { border: 1px solid var(--line); border-radius: 14px; padding: .9rem; display: grid; gap: .8rem; margin: 0; }
.person legend { font-weight: 600; padding: 0 .35rem; }

/* ---------- Formulário de lançamento ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .2s ease; }
.sheet-panel {
  position: relative; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 1rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom));
  display: grid; gap: .85rem;
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.quick input { font-size: 1.1rem; padding: .75rem .8rem; background: var(--accent-soft); border-color: transparent; }
.quick input:focus { background: var(--surface); }
@media (min-width: 640px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 24px; transform: translateY(16px); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
  .sheet.open .sheet-panel { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0s !important; }
}

/* ---------- Versão 2: planejamento ---------- */


.totals { flex-wrap: wrap; gap: .25rem 1.25rem; }
.totals .due { color: var(--due); }
.neg { color: var(--out); }
.pos { color: var(--in); }
h3 { font-family: var(--font-d); font-size: 1rem; margin: 0; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .8rem; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.sw.in { background: var(--in); } .sw.out { background: var(--out); } .sw.parc { background: var(--parc); }
.sw.open { background: repeating-linear-gradient(135deg, #E0A44A 0 3px, #F4D7A8 3px 6px); }
.panel > header:has(.legend) { flex-wrap: wrap; }

/* Gráfico do ano */
.yearchart { display: grid; grid-template-columns: repeat(12, 1fr); gap: .25rem; height: 220px; }
.ycol { display: grid; grid-template-rows: 1fr auto; gap: .35rem; text-decoration: none; color: var(--muted); border-radius: 10px; padding: .35rem .1rem .25rem; }
.ycol:hover { background: var(--bg); }
.ycol.now { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ybars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; }
.ybar { width: 38%; max-width: 16px; border-radius: 4px 4px 2px 2px; }
.ybar.in { background: var(--in); }
.ybar.stack { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.ybar.stack .out { background: var(--out); border-radius: 0 0 2px 2px; }
.ybar.stack .open { background: repeating-linear-gradient(135deg, #E0A44A 0 3px, #F4D7A8 3px 6px); border-radius: 4px 4px 0 0; }
.ycol.future .ybar.stack .out { background: var(--parc); }
.ylabel { text-align: center; font-size: .75rem; }
.tablewrap { overflow-x: auto; margin: 0 -1.15rem; padding: 0 1.15rem; }
.ytable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; min-width: 560px; }
.ytable th, .ytable td { padding: .55rem .4rem; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.ytable thead th { color: var(--muted); font-weight: 600; font-size: .8rem; border-top: 0; }
.ytable th:first-child { text-align: left; }
.ytable tbody th a { color: var(--ink); text-decoration: none; font-weight: 600; }
.ytable tbody th small { display: block; color: var(--muted); font-weight: 400; }
.ytable tr.now { background: var(--accent-soft); }
.ytable tr.future td { color: var(--muted); }

/* Compromissos futuros */
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.hbars li { display: grid; grid-template-columns: 5.5rem 1fr 6.5rem; align-items: center; gap: .75rem; font-size: .92rem; }
.hbars a { color: var(--ink); text-decoration: none; }
.hbars strong { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar { display: flex; height: 12px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.hbar .parc { background: var(--parc); }
.hbar .open { background: repeating-linear-gradient(135deg, #E0A44A 0 3px, #F4D7A8 3px 6px); }

.plist { list-style: none; margin: 0; padding: 0; }
.plist li { padding: .8rem 0; border-top: 1px solid var(--line); display: grid; gap: .35rem; }
.plist li:first-child { border-top: 0; padding-top: 0; }
.plist li.paused { opacity: .55; }
.plist-top { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
.plist-top a { color: var(--ink); text-decoration: none; }
.plist small { color: var(--muted); }
.progress { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: var(--bar, var(--parc)); }
.progress.debt span { background: var(--in); }
.progress.over span { background: var(--out); }
.inline-block-form { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }

/* Plano de ação */
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
@media (min-width: 900px) { .tips { grid-template-columns: 1fr 1fr; } }
.tip { border-radius: 14px; padding: .9rem 1rem; display: grid; gap: .3rem; align-content: start; border-left: 4px solid; }
.tip p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.tip form { margin-top: .2rem; }
.tip.alerta { background: var(--out-soft); border-color: var(--out); }
.tip.dica { background: var(--due-soft); border-color: var(--due); }
.tip.ok { background: var(--in-soft); border-color: var(--in); }
.tip-tag { font-size: .75rem; font-weight: 600; color: var(--muted); }

.todo { list-style: none; margin: 1rem 0 0; padding: 0; }
.todo form { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.check { width: 24px; height: 24px; border-radius: 7px; border: 1.8px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff; flex-shrink: 0; }
.check svg { width: 16px; height: 16px; stroke-width: 2.6; }
.done .check { background: var(--in); border-color: var(--in); }
.todo-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.todo-main small { color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.done .todo-main > span { text-decoration: line-through; color: var(--muted); }

/* Destaques do painel */
.pins { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.pin { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1rem 1.15rem; display: grid; gap: .45rem; border-top: 4px solid var(--c); }
.pin h2 { font-size: .95rem; }
.pin-value { margin: 0; font-family: var(--font-d); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pin-value small { font-family: var(--font-b); font-size: .85rem; font-weight: 500; color: var(--muted); }
.pin .progress span { background: var(--c); }
.pin .progress.over span { background: var(--out); }
.pin-meta { margin: 0; display: flex; flex-wrap: wrap; gap: .2rem 1rem; color: var(--muted); font-size: .85rem; }

.ahead-grid { display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .ahead-grid { grid-template-columns: 1.4fr 1fr; align-items: end; } }
.ahead-grid p { margin: 0 0 .5rem; }
.minibars { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; height: 130px; }
.minibars a { display: grid; grid-template-rows: auto 1fr auto; gap: .25rem; text-decoration: none; color: var(--muted); text-align: center; }
.mb-val { font-size: .72rem; font-variant-numeric: tabular-nums; }
.mb-bar { display: flex; align-items: flex-end; justify-content: center; }
.mb-bar span { width: 70%; max-width: 34px; background: var(--parc); border-radius: 6px 6px 3px 3px; min-height: 3px; }
.mb-label { font-size: .78rem; }
.ahead-side { display: grid; gap: .75rem; }
.ahead-side p { display: flex; flex-direction: column; margin: 0; }
.ahead-side p strong { font-family: var(--font-d); font-size: 1.4rem; }
.tip-mini { display: grid; gap: .15rem; padding: .75rem .9rem; border-radius: 12px; text-decoration: none; color: var(--ink); border-left: 4px solid; }
.tip-mini span { font-size: .82rem; color: var(--accent); font-weight: 600; }
.tip-mini.alerta { background: var(--out-soft); border-color: var(--out); }
.tip-mini.dica { background: var(--due-soft); border-color: var(--due); }
.tip-mini.ok { background: var(--in-soft); border-color: var(--in); }

.bar-val small { font-weight: 400; }

/* Ajustes das categorias */
.cat-opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; }
.mini { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); }
.mini input { width: 8rem; padding: .4rem .55rem; font-size: .9rem; }
.checkbox { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
@media (min-width: 760px) { .cat-opts { grid-column: 2 / -1; } }

/* Menu Mais */
.menu { list-style: none; margin: 0; padding: .25rem 1.15rem; }
.menu li + li { border-top: 1px solid var(--line); }
.menu a { display: flex; align-items: center; gap: 1rem; padding: .9rem 0; color: var(--ink); text-decoration: none; }
.menu svg { color: var(--accent); flex-shrink: 0; }
.menu span { display: flex; flex-direction: column; }
.menu small { color: var(--muted); }

.wrap > *, .cols > * { min-width: 0; }
.ycol.future .ybar.in { background: repeating-linear-gradient(135deg, #1F8A5E 0 3px, #9ED2BC 3px 6px); }

.checks { display: flex; flex-wrap: wrap; gap: .45rem 1rem; }
.acc-row { flex-wrap: wrap; }
.acc-row > span { flex: 1; }
.acc-row .pay { flex-basis: 100%; }
.pin.benefit { border-top-style: dashed; }

.agenda-day { margin: 0; }
.agenda-day + .agenda-day { margin-top: 1rem; }
.ev { display: flex; align-items: center; gap: .85rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.ev:first-of-type { border-top: 0; }
.ev-time { width: 3.2rem; font-family: var(--font-d); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.ev-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ev-main small { color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.ev.bill .ev-time { color: var(--due); }

/* Importação */
.imp-tools { display: flex; gap: 1rem; margin-bottom: .5rem; }
.imp-list { list-style: none; margin: 0; padding: 0; }
.imp-list li { display: flex; gap: .75rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.imp-list li.off { opacity: .5; }
.imp-check input { width: 20px; height: 20px; margin-top: .2rem; accent-color: var(--accent); }
.imp-main { flex: 1; display: grid; gap: .4rem; min-width: 0; }
.imp-top { display: flex; justify-content: space-between; }
.imp-main input[name^="desc"] { padding: .45rem .6rem; font-size: .95rem; }
.imp-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.imp-bottom select { width: auto; max-width: 100%; padding: .4rem .55rem; font-size: .9rem; }
.imp-note { color: var(--due); font-weight: 500; }
.imp-submit { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); padding-top: .75rem; background: linear-gradient(transparent, var(--surface) 30%); }
@media (min-width: 900px) { .imp-submit { bottom: 0; } }

small.note { display: block; color: var(--due-ink); background: var(--due-soft); border-radius: 6px; padding: .1rem .45rem; margin-top: .2rem; width: fit-content; max-width: 100%; }
.plain li { flex-wrap: wrap; }
.plain li > .pay { flex-basis: 100%; }
.add-acc { margin-top: 1rem; }
.add-acc summary { float: none; display: inline-flex; }

.pw-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .88rem; color: var(--muted); }
.pw-rules li::before { content: '○'; display: inline-block; width: 1.2rem; }
.pw-rules li.ok { color: var(--in); }
.pw-rules li.ok::before { content: '✓'; }

/* ---------- Estrutura com menu lateral ---------- */
.topbar {
  display: flex; align-items: center; gap: .75rem;
  padding: calc(.7rem + env(safe-area-inset-top)) 1rem .7rem;
  max-width: 1120px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--font-d); font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand img { border-radius: 9px; box-shadow: 0 4px 14px -4px var(--accent-glow); }
.top-brand { margin-right: auto; }
.top-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.sidenav { display: none; }
.panel, .pin { box-shadow: var(--card-shadow); }

@media (min-width: 1000px) {
  body.has-nav { padding: 0 0 3rem 248px; }
  .sidenav {
    display: flex; flex-direction: column; gap: 1.25rem;
    position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 30;
    padding: 1.25rem .9rem 1.25rem; background: var(--surface); border-right: 1px solid var(--line);
  }
  [data-theme="dark"] .sidenav { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(14px); }
  .sidenav .brand { padding: 0 .5rem; }
  .sidenav nav { display: grid; gap: .15rem; }
  .sidenav nav a {
    display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem; border-radius: 12px;
    color: var(--muted); text-decoration: none; font-weight: 500;
  }
  .sidenav nav a:hover { background: var(--surface-2); color: var(--ink); }
  .sidenav nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .sidenav nav svg { width: 20px; height: 20px; }
  .side-add { margin-top: auto; }
  .side-add svg { width: 18px; height: 18px; }
  .has-nav .top-brand { visibility: hidden; }
  .bottomnav { display: none; }
  .wrap, .topbar { max-width: 1120px; }
  .wrap { padding: 0 1.5rem; }
  .topbar { padding: 1rem 1.5rem .5rem; }
}
@media (min-width: 1000px) { .cols { grid-template-columns: 1fr 1fr; align-items: start; } }
@media (max-width: 999px) { .cols { grid-template-columns: 1fr; } }

.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--glass); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom));
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .7rem; padding: .3rem 0; }
.bottomnav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.fab {
  justify-self: center; width: 56px; height: 56px; margin-top: -26px;
  border: 0; border-radius: 50%; color: #fff; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--hero-b), var(--hero-c));
  box-shadow: 0 10px 24px -8px var(--accent-glow);
}
[data-theme="dark"] .fab { color: #fff; }
.fab svg { width: 28px; height: 28px; stroke-width: 2.2; }

/* ---------- Botões de tema e conta ---------- */
.theme-btn { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); }
.when-dark { display: none !important; }
[data-theme="dark"] .when-dark { display: inline-flex !important; }
[data-theme="dark"] .when-light { display: none !important; }
.theme-btn span { display: inline-flex; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
  background: var(--c, var(--accent)); color: #fff; font-weight: 700; font-family: var(--font-d); font-size: 1rem;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--c, var(--accent)) 45%, transparent);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.35rem; }
.avatar-xl { width: 88px; height: 88px; font-size: 2.2rem; }

.usermenu { position: relative; }
.usermenu summary {
  list-style: none; display: flex; align-items: center; gap: .55rem; cursor: pointer;
  padding: .25rem .6rem .25rem .3rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary > svg { width: 16px; height: 16px; color: var(--muted); }
.um-name { font-weight: 600; font-size: .92rem; white-space: nowrap; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
.um-name .full { display: none; }
@media (min-width: 640px) { .um-name .full { display: inline; } .um-name .short { display: none; } }
.um-panel {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60; width: min(300px, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: .5rem;
  box-shadow: 0 24px 60px -20px var(--shadow), 0 2px 8px var(--shadow);
}
.um-head { display: flex; align-items: center; gap: .8rem; padding: .7rem .6rem .8rem; }
.um-head div { display: flex; flex-direction: column; min-width: 0; }
.um-head small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.um-section { border-top: 1px solid var(--line); padding: .4rem 0; display: grid; gap: .1rem; }
.um-label { font-size: .78rem; font-weight: 600; color: var(--muted); padding: .35rem .6rem .1rem; }
.swatches { display: flex; gap: .55rem; padding: .35rem .6rem .5rem; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--sw) 40%, white), var(--sw) 60%, color-mix(in srgb, var(--sw) 60%, black));
}
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.um-row {
  display: flex; align-items: center; gap: .7rem; width: 100%; padding: .6rem .6rem; border-radius: 10px;
  color: var(--ink); text-decoration: none; font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left;
}
.um-row:hover { background: var(--surface-2); }
.um-row svg { width: 19px; height: 19px; color: var(--muted); }
.um-row.danger, .um-row.danger svg { color: var(--out); }

/* ---------- Painel colorido ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 1.25rem 1.25rem 1.35rem; border-radius: 24px; color: #fff;
  background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 62%, var(--hero-c) 120%);
  box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--hero-b) 70%, transparent);
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .7; pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, #fff 99%, transparent), radial-gradient(1px 1px at 32% 68%, #fff 99%, transparent),
    radial-gradient(1.4px 1.4px at 58% 18%, #fff 99%, transparent), radial-gradient(1px 1px at 74% 54%, #fff 99%, transparent),
    radial-gradient(1.6px 1.6px at 88% 26%, #fff 99%, transparent), radial-gradient(1px 1px at 46% 86%, #fff 99%, transparent),
    radial-gradient(1.2px 1.2px at 92% 80%, #fff 99%, transparent), radial-gradient(1px 1px at 22% 90%, #fff 99%, transparent);
}
.hero::after {
  content: ''; position: absolute; width: 340px; height: 340px; right: -90px; top: -120px; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--hero-c) 70%, transparent), transparent 70%); opacity: .55;
}
.hero .monthnav { margin: 0 0 1rem -.4rem; color: #fff; }
.hero .icon-btn { color: #fff; }
.hero .icon-btn:hover { background: rgba(255, 255, 255, .14); }
.hero .link-sm { color: #fff; opacity: .85; }
.hero-label { color: rgba(255, 255, 255, .78); }
.hero-value, .hero-value.neg { color: #fff; }
.hero-value.neg::after { content: ' no vermelho'; font-size: .3em; font-family: var(--font-b); font-weight: 600; letter-spacing: 0; vertical-align: middle; background: rgba(255, 107, 133, .3); padding: .25rem .55rem; border-radius: 99px; margin-left: .5rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .6rem; margin-top: 1rem; }
.kpi {
  display: flex; align-items: center; gap: .65rem; padding: .7rem .8rem; border-radius: 16px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(8px);
}
.kpi-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-ic svg { width: 18px; height: 18px; stroke-width: 2.2; }
.kpi.in .kpi-ic { background: #3DD39A; color: #06301F; }
.kpi.out .kpi-ic { background: #FF7B93; color: #3D0712; }
.kpi.due .kpi-ic { background: #FFC86B; color: #3E2604; }
.kpi div { display: flex; flex-direction: column; min-width: 0; }
.kpi small { color: rgba(255, 255, 255, .78); font-size: .78rem; }
.kpi strong { font-family: var(--font-d); font-size: 1.12rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi em { font-style: normal; font-size: .72rem; color: rgba(255, 255, 255, .7); }
.hero .who { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .16); }
.hero .who-legend span, .hero .muted { color: rgba(255, 255, 255, .75); }
.hero .who-bar span { box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset; }

.panel > header h2 { display: flex; align-items: center; gap: .55rem; }
.panel > header h2::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--hero-b), var(--hero-c)); box-shadow: 0 0 10px var(--accent-glow);
}
.pin { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, var(--surface)), var(--surface) 70%); }
.btn-primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--hero-c) 70%, var(--accent))); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--hero-c) 70%, var(--accent))); }
[data-theme="dark"] .btn-primary { color: #0E1027; }
.mb-bar span, .hbar .parc, .ycol.future .ybar.stack .out { background: linear-gradient(180deg, var(--hero-c), var(--hero-b)); }
.hbar .parc { background: linear-gradient(90deg, var(--hero-b), var(--hero-c)); }
.toast { background: var(--in-soft); color: var(--in-ink); }

/* ---------- Perfil ---------- */
.profile-photo { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.profile-photo form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.theme-pick { display: flex; gap: .75rem; flex-wrap: wrap; }
.theme-card {
  display: grid; gap: .4rem; justify-items: center; padding: .6rem; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; font: inherit; font-size: .85rem; color: var(--ink); min-width: 5.5rem;
}
.theme-card.on { border-color: var(--accent); background: var(--accent-soft); }
.theme-card i { width: 52px; height: 32px; border-radius: 9px; display: block; }

@media (min-width: 1000px) { .bottomnav { display: none; } }
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .kpi { padding: .6rem .6rem; gap: .5rem; }
  .kpi-ic { width: 28px; height: 28px; border-radius: 9px; }
  .kpi-ic svg { width: 15px; height: 15px; }
  .kpi strong { font-size: .98rem; }
  .kpi.due { grid-column: 1 / -1; }
}

/* ---------- Sino de alertas ---------- */
.bell-btn { position: relative; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); padding: 0 !important; }
.bell .bell-btn { display: grid; }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  display: grid; place-items: center; font-size: .68rem; font-weight: 700; color: #fff;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg);
}
.badge.hot { background: var(--out); }
[data-theme="dark"] .badge { color: #0E1027; }
.bell-panel { width: min(340px, calc(100vw - 1.5rem)); right: -48px; }
@media (min-width: 640px) { .bell-panel { right: 0; } }
.bell-head { display: flex; flex-direction: column; padding: .6rem .6rem .5rem; }
.bell-head small { color: var(--muted); }
.bell-empty { margin: 0; padding: 1rem .6rem 1.2rem; color: var(--muted); }
.bell-list { list-style: none; margin: 0; padding: .25rem 0; border-top: 1px solid var(--line); max-height: 60vh; overflow-y: auto; }
.bell-item { display: flex; gap: .7rem; align-items: center; padding: .55rem .6rem; border-radius: 12px; color: var(--ink); text-decoration: none; }
.bell-item:hover { background: var(--surface-2); }
.bell-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); }
.bell-ic svg { width: 18px; height: 18px; }
.bell-item.alerta .bell-ic { background: var(--out-soft); color: var(--out); }
.bell-item.dica .bell-ic { background: var(--due-soft); color: var(--due); }
.bell-txt { display: flex; flex-direction: column; min-width: 0; }
.bell-txt strong { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell-txt small { color: var(--muted); }
.bell-item.alerta small { color: var(--out); font-weight: 500; }
.bell-foot { display: flex; justify-content: space-between; padding: .6rem .6rem .35rem; border-top: 1px solid var(--line); }

/* Campo "do que se trata" para Outros */
.other-hint { color: var(--accent) !important; font-weight: 600; }
.need-desc input { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 460px) {
  .top-brand span { display: none; }
  .top-actions { gap: .3rem; }
  .usermenu summary { padding-right: .45rem; gap: .4rem; }
  .um-name { max-width: 6.5rem; }
}
@media (max-width: 639px) {
  .um-panel, .bell-panel { position: fixed; top: calc(64px + env(safe-area-inset-top)); left: .75rem; right: .75rem; width: auto; }
}

/* ---------- Versão 5: contas, dívidas e agenda ---------- */
.bottomnav { grid-template-columns: repeat(5, 1fr); }
.pagehead .btn svg { width: 18px; height: 18px; }
.fab-page {
  position: fixed; right: 1rem; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 25;
  width: 58px; height: 58px; border: 0; border-radius: 50%; color: #fff; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--hero-b), var(--hero-c)); box-shadow: 0 12px 26px -8px var(--accent-glow);
}
.fab-page svg { width: 28px; height: 28px; stroke-width: 2.2; }
@media (min-width: 1000px) { .fab-page { display: none; } }
.filter-note { margin: 0; padding: .6rem .85rem; border-radius: 12px; background: var(--accent-soft); font-size: .9rem; }
.card-hint { margin: -.35rem 0 0; padding: .55rem .75rem; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: .88rem; font-weight: 600; }

/* Formulários dentro de listas (editar cartão, editar conta) */
.plain li > span { min-width: 0; }
.plain form.pay-form, .plain .pay-form { display: grid; gap: .8rem; flex-shrink: 1; width: 100%; }
.plain .pay-form .grid2, .plain .pay-form .grid3 { display: grid; }
@media (min-width: 640px) { .plain .pay-form .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plain .pay-form .actions { display: flex; }

/* Lista de contas a pagar */
.sumbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
.sumbox { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .8rem 1rem; box-shadow: var(--card-shadow); }
.sumbox small { color: var(--muted); display: block; }
.sumbox strong { font-family: var(--font-d); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.sumbox.due strong { color: var(--due); } .sumbox.out strong { color: var(--ink); } .sumbox.late strong { color: var(--out); }
.pitem { display: grid; grid-template-columns: auto 1fr auto; gap: .35rem .85rem; align-items: center; padding: .85rem 0; border-top: 1px solid var(--line); }
.pitems > li:first-child .pitem { border-top: 0; padding-top: .2rem; }
.pitems { list-style: none; margin: 0; padding: 0; }
.pitem .bill-main span:first-child { font-weight: 600; }
.ptag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .02em; padding: .05rem .45rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); margin-right: .35rem; vertical-align: 1px; }
.ptag.card { background: var(--accent-soft); color: var(--accent); }
.pitem-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center; }
.pitem-actions details { width: auto; }
.pitem-actions details[open] { flex-basis: 100%; }
.pitem-actions summary { list-style: none; cursor: pointer; }
.pitem-actions summary::-webkit-details-marker { display: none; }
.pitem-actions details[open] > summary { display: none; }
.pitem.st-paga { opacity: .6; }
.pitem.st-paga .bill-main span:first-child { text-decoration: line-through; }
.pitem.st-atrasada .bill-day { background: var(--out-soft); color: var(--out); }
.pitem.st-hoje .bill-day, .pitem.st-logo .bill-day { background: var(--due-soft); color: var(--due); }
.pitem small.late { color: var(--out); font-weight: 600; }
.pitem small.soon { color: var(--due); font-weight: 600; }
.chips-nav { display: flex; gap: .4rem; flex-wrap: wrap; }
.chips-nav a { padding: .4rem .85rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .9rem; }
.chips-nav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .chips-nav a[aria-current="page"] { color: #0E1027; }
.tabs { display: inline-grid; grid-auto-flow: column; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.tabs a { padding: .5rem 1rem; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px var(--shadow); }
.btn-sm { padding: .45rem .9rem; font-size: .9rem; border-radius: 10px; }
.newbox > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.newbox > summary::-webkit-details-marker { display: none; }
.newbox[open] > summary { margin-bottom: .9rem; }
.newbox[open] > summary .link-sm { display: none; }
.pagehead .actions { margin-left: auto; }
@media (max-width: 640px) { .pagehead .actions { margin-left: 0; width: 100%; } .pagehead .actions .btn { flex: 1; } }
.ev-amt { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); text-decoration: none; white-space: nowrap; }
.ev-amt:hover { color: var(--accent); }
.ev.bill .ev-time { color: var(--accent); }
.ev.late .ev-time, .late-title { color: var(--out) !important; }
.tabs + .actions, .pagehead .tabs { flex-shrink: 0; }
.ytable td.due { color: var(--due); }
