/* App escuro de bolso: cabeçalho com meses, cartão verde do saldo, contas a vencer e barra de abas com o + no centro. */
:root {
  --bg: #050706;
  --bg-glow: #0b2410;
  --surface: #121513;
  --surface-2: #181c19;
  --line: #262b27;
  --ink: #f2f5f1;
  --muted: #9aa49c;
  --dim: #6c756e;
  --green: #6ee38a;
  --green-deep: #2f7d43;
  --card-a: #0f2c16;
  --card-b: #06120a;
  --card-line: #24502e;
  --tile: #173a1f;
  --tile-line: #2a5a34;
  --yellow: #f3c24f;
  --blue: #4f9cf0;
  --orange: #f08a3c;
  --pink: #d9539a;
  --red: #f0735f;
  --font: "Outfit", "Avenir Next", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  background: radial-gradient(120% 70% at 50% 18%, var(--bg-glow) 0%, var(--bg) 62%) fixed, var(--bg);
  color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.4; min-height: 100%;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(env(safe-area-inset-bottom, 0px) + 112px);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 520px; margin: 0 auto; display: grid; gap: 18px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.money { font-variant-numeric: tabular-nums; }

/* cabeçalho */
.header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; background: var(--bg); margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding: 18px max(16px, env(safe-area-inset-left, 0px)) 0; border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.hrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; max-width: 520px; margin: 0 auto; }
.kicker { font-size: 15px; color: var(--ink); font-weight: 300; }
h1 { margin: 2px 0 0; font-size: 30px; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.bell { position: relative; width: 52px; height: 52px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.bell svg { width: 22px; height: 22px; }
.badge { position: absolute; top: -9px; right: -9px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: var(--yellow); color: #1a1405; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.months { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: 520px; margin: 14px auto 0; padding-bottom: 10px; scroll-snap-type: x proximity; }
.months::-webkit-scrollbar { display: none; }
.months button { flex: none; border: 0; background: none; color: var(--muted); font-size: 17px; padding: 6px 12px; border-radius: 10px; scroll-snap-align: center; }
.months button[aria-current="true"] { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.months button.yr { color: var(--green); font-size: 14px; font-weight: 500; }

/* cartão do saldo */
.balance { margin-top: 18px; border-radius: 24px; padding: 22px 20px 20px; border: 1px solid var(--card-line); background: linear-gradient(160deg, var(--card-a) 0%, var(--card-b) 100%); display: grid; gap: 14px; }
.bhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.eyebrow { color: var(--green); font-size: 14px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.link { color: var(--green); background: none; border: 0; padding: 0; font-size: 15px; font-weight: 500; }
.big { font-size: clamp(44px, 13vw, 60px); font-weight: 700; letter-spacing: -.035em; line-height: 1; margin: 4px 0 2px; }
.big.neg { color: var(--red); }
.sentence { font-size: 17px; font-weight: 300; line-height: 1.55; margin: 0; color: var(--ink); }
.sentence b { font-weight: 600; }
.sentence .warn { color: var(--yellow); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.tile { background: var(--tile); border: 1px solid var(--tile-line); border-radius: 14px; padding: 14px 14px 13px; display: grid; gap: 6px; min-width: 0; text-align: left; }
.tile .k { color: var(--muted); font-size: 15px; font-weight: 300; display: flex; align-items: center; gap: 8px; }
.tile .k i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.tile .v { font-size: clamp(16px, 4.6vw, 20px); font-weight: 600; overflow-wrap: anywhere; }

/* painéis */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px 18px 6px; }
.phead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.phead h2 { margin: 0; font-size: 21px; font-weight: 600; }
.phead .money { color: var(--muted); font-size: 15px; }
.item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.dia { width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-content: center; text-align: center; line-height: 1; }
.dia small { font-size: 11px; color: var(--muted); letter-spacing: .06em; font-weight: 500; }
.dia b { font-size: 21px; font-weight: 600; margin-top: 3px; }
.dia.late { border-color: var(--red); }
.dia.late b { color: var(--red); }
.info { min-width: 0; display: grid; gap: 2px; background: none; border: 0; padding: 0; text-align: left; }
.info .n { font-size: 18px; font-weight: 500; overflow-wrap: anywhere; }
.info .m { font-size: 15px; color: var(--muted); font-weight: 300; overflow-wrap: anywhere; }
.info .m .late { color: var(--red); font-weight: 400; }
.paguei { border: 1px solid var(--green-deep); background: transparent; color: var(--green); border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: 16px; }
.paguei.done { border-color: var(--line); color: var(--muted); font-weight: 400; }
.amt { font-size: 17px; font-weight: 500; text-align: right; white-space: nowrap; }
.amt.in { color: var(--green); }
.amt.sv { color: var(--yellow); }
.empty { color: var(--muted); font-weight: 300; padding: 16px 0 14px; margin: 0; }
.cats { display: grid; gap: 14px; padding: 16px 0 16px; }
.cat { display: grid; gap: 7px; }
.cat .row1 { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; }
.cat .row1 span:last-child { color: var(--muted); }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.chart { padding: 12px 0 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 14px; color: var(--muted); padding: 2px 0 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.goal { display: grid; gap: 10px; padding: 16px 0 18px; }
.goal .big2 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.goalform { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.plain { width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 12px; font-size: 16px; }
.btn { border: 1px solid var(--green-deep); background: transparent; color: var(--green); border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.btn.solid { background: var(--green-deep); color: #fff; border-color: var(--green-deep); }
.muted { color: var(--muted); font-weight: 300; margin: 0; }
.status { text-align: center; color: var(--muted); font-size: 14px; }

/* abas */
.tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: rgba(8, 10, 9, .96); border-top: 1px solid var(--line); padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 8px) max(16px, env(safe-area-inset-left, 0px)); }
.tabs { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; }
.tab { border: 0; background: none; color: var(--muted); display: grid; justify-items: center; gap: 3px; font-size: 13px; padding: 4px 0; }
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--green); font-weight: 600; }
.tab[aria-current="page"] span { color: var(--ink); }
.plus { justify-self: center; width: 66px; height: 66px; margin-top: -30px; border-radius: 50%; border: 2px solid var(--green); background: radial-gradient(circle at 50% 35%, #3d9a55, var(--green-deep)); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 22px rgba(47, 125, 67, .45); }
.plus svg { width: 30px; height: 30px; }
.plus[disabled] { opacity: .45; cursor: not-allowed; }

/* folha de lançamento */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 18px) max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; }
.sheet h3 { margin: 0; font-size: 22px; font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 10px 4px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--tile); color: var(--green); }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; color: var(--muted); }
.field input { width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 12px; font-size: 16px; }
#f-valor { font-size: 32px; font-weight: 600; padding: 10px 12px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 7px 12px; font-size: 15px; color: var(--muted); }
.chips button[aria-pressed="true"] { background: var(--tile); border-color: var(--tile-line); color: var(--green); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--green-deep); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .grow { flex: 1; }
.danger { border: 1px solid var(--red); color: var(--red); background: transparent; border-radius: 12px; padding: 12px 16px; }
.err { color: var(--red); font-size: 15px; margin: 0; }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .18s ease-out; } @keyframes up { from { transform: translateY(24px); opacity: .6; } } }

/* ===== Acréscimos da versão com login ===== */
.login { min-height: 100vh; display: grid; place-items: center; padding: 32px 0; }
.login-box { width: 100%; max-width: 420px; display: grid; gap: 18px; }
.logo { width: 64px; height: 64px; border-radius: 18px; background: radial-gradient(circle at 50% 35%, #3d9a55, var(--green-deep)); border: 2px solid var(--green); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 22px rgba(47, 125, 67, .45); }
.logo svg { width: 32px; height: 32px; }
.login h1 { font-size: 34px; margin: 0; }
.login .sub { font-size: 17px; color: var(--muted); font-weight: 300; margin: -8px 0 0; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px 18px; display: grid; gap: 14px; }
.seg.seg2 { grid-template-columns: repeat(2, 1fr); }
.ok { color: var(--green); font-size: 15px; margin: 0; }
.aviso { background: #2a2208; border: 1px solid #5a4712; color: var(--yellow); border-radius: 14px; padding: 10px 14px; font-size: 14px; margin-top: 14px; }
.lista-mais { display: grid; gap: 10px; padding: 16px 0 18px; }
.lista-mais .btn, .lista-mais .danger { width: 100%; text-align: center; }
.arquivo { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
