:root {
  --brand: #ff2e4d;
  --brand-2: #ff7a1a;
  --brand-ink: #e5133a;
  --fire: linear-gradient(135deg, #ff2e4d 0%, #ff5a2a 55%, #ff9a1a 100%);
  --zap: #d4ff3a;
  --violet: #7c3aed;

  --ink: #0d0d12;
  --ink-2: #3b3b45;
  --muted: #74737d;
  --line: #e7e4dd;
  --bg: #f3f1ec;
  --card: #ffffff;
  --sunken: #f7f5f1;
  --hero: #0d0d12;

  --ok: #00a862;
  --ok-soft: #dcf8ea;
  --warn: #c27800;
  --warn-soft: #fff1d1;
  --bad: #e5133a;
  --bad-soft: #ffe2e7;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 0 rgba(13, 13, 18, .04), 0 10px 30px -12px rgba(13, 13, 18, .14);
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15.5px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}
a { color: var(--brand-ink); text-decoration: none; font-weight: 600; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5rem; letter-spacing: -.02em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }
.container { max-width: 760px; margin: 0 auto; padding: 8px 16px 16px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 12px 0 16px; }
.page-head h1 { margin: 0; }
.eyebrow { font: 600 .72rem/1 var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; }

/* topo */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: var(--ink); display: flex; align-items: center; gap: 8px; font: 700 1.25rem/1 var(--display); letter-spacing: -.03em; }
.brand .dot { color: var(--brand); }
.brand .tag { font: 700 .66rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--bg); padding: 4px 7px; border-radius: 99px; }
.nav { display: none; gap: 2px; background: var(--card); padding: 4px; border-radius: 99px; box-shadow: var(--shadow); }
.nav a { color: var(--ink-2); padding: 7px 14px; border-radius: 99px; font-size: .9rem; font-weight: 600; }
.nav a:hover { color: var(--ink); }
.nav a.active { background: var(--ink); color: var(--bg); }

/* barra inferior flutuante (celular) */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 10;
  display: flex; gap: 2px; padding: 6px;
  background: color-mix(in srgb, var(--ink) 94%, transparent); color: var(--bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 24px; box-shadow: 0 14px 40px -10px rgba(0, 0, 0, .45);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; color: inherit; opacity: .55; font-size: .66rem; font-weight: 600; border-radius: 18px; }
.tabbar a.active { opacity: 1; background: var(--brand); color: #fff; }

@media (min-width: 720px) {
  .nav { display: flex; }
  .tabbar { display: none !important; }
  body { padding-bottom: 32px; }
}

/* cartões */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack > * + * { margin-top: 10px; }

/* dinheiro */
.money { font-family: var(--display); font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money .cur { font-size: .5em; font-weight: 600; margin-right: .2em; opacity: .7; vertical-align: .45em; }
.money .cents { font-size: .55em; opacity: .7; }

/* hero do saldo */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--hero); color: #fff; border-radius: 28px; padding: 22px; margin-bottom: 14px;
}
.hero::before {
  content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; right: -120px; top: -160px;
  background: var(--fire); filter: blur(60px); opacity: .85; border-radius: 50%;
}
.hero::after {
  content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; left: -90px; bottom: -150px;
  background: var(--violet); filter: blur(70px); opacity: .55; border-radius: 50%;
}
.hero .eyebrow { color: rgba(255, 255, 255, .65); }
.hero .big { font-size: clamp(2.4rem, 11vw, 3.2rem); line-height: 1; margin: 4px 0 20px; }
.hero-foot { display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px; padding: 12px; }
.hero-foot .txt { min-width: 0; font-size: .88rem; color: rgba(255, 255, 255, .78); }
.hero-foot .txt strong { color: #fff; display: block; font: 700 1.05rem/1.2 var(--display); text-transform: capitalize; }
.ring { width: 58px; height: 58px; flex: none; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, .14); }
.ring .bar { stroke: var(--zap); stroke-linecap: round; transition: stroke-dasharray .8s cubic-bezier(.2, .8, .2, 1); }
.ring-wrap { position: relative; flex: none; }
.ring-wrap .pct { position: absolute; inset: 0; display: grid; place-items: center; font: 700 .82rem/1 var(--display); color: #fff; }

/* status do participante */
.status-card { position: relative; overflow: hidden; }
.status-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.status-top .big { font-size: 2.4rem; line-height: 1; margin: 6px 0 4px; }
.status-top .big.bad { color: var(--bad); }
.status-msg { font: 700 1.5rem/1.15 var(--display); letter-spacing: -.02em; margin: 6px 0 4px; }
.status-card.ok { background: var(--ok); color: #04130b; }
.status-card.ok .muted, .status-card.ok .eyebrow { color: rgba(4, 19, 11, .65); }
.status-card.ok .pill { background: rgba(0, 0, 0, .12); color: inherit; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* pílulas de status */
.pill { display: inline-flex; align-items: center; gap: 5px; font: 700 .7rem/1 var(--body); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.neutral { background: var(--sunken); color: var(--muted); }
.pill.ink { background: var(--ink); color: var(--bg); }

/* linha do tempo de meses */
.strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
@media (min-width: 520px) { .strip { grid-template-columns: repeat(12, 1fr); } }
.cell { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.cell .sq { width: 100%; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font: 700 .85rem/1 var(--display); }
.cell .lb { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.sq.paid { background: var(--ok); color: #fff; }
.sq.partial { background: var(--warn); color: #fff; }
.sq.open { background: var(--bad); color: #fff; }
.sq.pending { background: var(--sunken); color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* listas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.list li + li { border-top: 1px solid var(--line); }
.list .main { min-width: 0; flex: 1; }
.list .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.list .end { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.list li.day-head { border: 0; padding: 18px 0 4px; font: 700 .72rem/1 var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.list li.day-head + li { border-top: 0; }
.list li.day-head:first-child { padding-top: 2px; }
.amount { font: 700 1rem/1.1 var(--display); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.amount.in { color: var(--ok); }
.amount.out { color: var(--ink); }
.clickable { cursor: pointer; }
.list li.clickable { border-radius: 14px; transition: background .15s; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.list li.clickable:hover { background: var(--sunken); }
.list li.clickable + li.clickable { border-top-color: transparent; box-shadow: 0 -1px 0 var(--line); }

/* ícones e avatares */
.tx-ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.tx-ico.in { background: var(--ok-soft); color: var(--ok); }
.tx-ico.out { background: var(--bad-soft); color: var(--bad); }
.tx-ico.manual { background: var(--warn-soft); color: var(--warn); }
.avatar { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; font: 700 .82rem/1 var(--display); letter-spacing: .02em; }
.avatar.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 1.2rem; }
.avatar.dim { opacity: .4; filter: grayscale(1); }

/* enquetes */
.poll-opt { position: relative; overflow: hidden; border-radius: 14px; background: var(--sunken); padding: 12px 14px; margin-top: 8px; }
.poll-opt .fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--brand) 16%, transparent); border-radius: 14px; }
.poll-opt.lead .fill { background: var(--fire); opacity: .9; }
.poll-opt.lead { color: #fff; }
.poll-opt.lead .muted { color: rgba(255, 255, 255, .8); }
.poll-opt > *:not(.fill) { position: relative; }
.poll-opt .row strong { font: 700 1.05rem/1 var(--display); }
.poll-voters { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip { font: 600 .72rem/1 var(--mono); padding: 5px 7px; border-radius: 8px; background: var(--card); color: var(--ink-2); }
.poll-opt.lead .chip { background: rgba(255, 255, 255, .22); color: #fff; }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
details summary { cursor: pointer; list-style: none; font-weight: 600; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; color: var(--brand-ink); }
details[open] summary::before { content: "– "; }

/* Pix */
.pix { background: var(--sunken); border-radius: 18px; padding: 14px; }
.pix-key { font-family: var(--mono); font-size: .92rem; font-weight: 600; overflow-wrap: anywhere; }
.trigram-tag { font: 700 .9em/1 var(--mono); background: var(--ink); color: var(--bg); padding: 3px 7px; border-radius: 7px; letter-spacing: .04em; }

/* formulários */
form .field { margin-bottom: 14px; }
label { display: block; font-size: .78rem; font-weight: 700; margin-bottom: 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
input, select, textarea {
  width: 100%; font: inherit; font-weight: 500; color: var(--ink); background: var(--sunken);
  border: 2px solid transparent; border-radius: 14px; padding: 12px 14px; transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: var(--card); }
input.upper { text-transform: uppercase; letter-spacing: .14em; font-family: var(--mono); font-weight: 700; }
.check { display: flex; align-items: center; gap: 10px; font-size: .92rem; font-weight: 550; text-transform: none; letter-spacing: 0; color: var(--ink); padding: 6px 0; margin: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.section-title { font: 700 .72rem/1 var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--brand-ink); margin: 6px 0 12px; }
.section-title:not(:first-child) { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 .95rem/1 var(--body); border-radius: 14px; padding: 13px 18px;
  border: 0; cursor: pointer; white-space: nowrap;
  background: var(--brand); color: #fff; transition: transform .1s, filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.block { width: 100%; padding: 15px 18px; }
.btn.fire { background: var(--fire); }
.btn.ink { background: var(--ink); color: var(--bg); }
.btn.ghost { background: var(--sunken); color: var(--ink); }
.btn.small { padding: 8px 12px; font-size: .82rem; border-radius: 11px; }
.btn.link { background: none; color: var(--brand-ink); padding: 0; font-weight: 700; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.error { background: var(--bad-soft); color: var(--bad); border-radius: 14px; padding: 12px 14px; font-size: .88rem; font-weight: 600; margin-bottom: 14px; }
.success { background: var(--ok-soft); color: var(--ok); border-radius: 14px; padding: 12px 14px; font-size: .9rem; font-weight: 600; margin-bottom: 14px; }

/* login */
.auth { max-width: 420px; margin: 4vh auto 0; }
.auth-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--fire); color: #fff; border-radius: 28px; padding: 28px 22px 64px; margin-bottom: -44px; }
.auth-hero::after { content: ""; position: absolute; z-index: -1; right: -60px; bottom: -80px; width: 220px; height: 220px; border-radius: 50%; background: var(--violet); filter: blur(50px); opacity: .7; }
.auth-hero .word { font: 700 3rem/1 var(--display); letter-spacing: -.05em; margin: 0; }
.auth-hero .word span { color: var(--zap); }
.auth-hero p { margin: 10px 0 0; font-weight: 550; opacity: .92; max-width: 26ch; }
.auth-hero .tag { display: inline-block; font: 700 .66rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; background: rgba(0, 0, 0, .25); padding: 6px 9px; border-radius: 99px; margin-bottom: 16px; }
.auth .card { position: relative; margin: 0 10px 14px; box-shadow: 0 20px 50px -20px rgba(13, 13, 18, .35); }

/* perfil */
.profile { display: flex; align-items: center; gap: 14px; }
.profile .name { font: 700 1.35rem/1.1 var(--display); letter-spacing: -.02em; }

/* abas do admin */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 6px -16px 16px; padding: 0 16px 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; padding: 9px 14px; border-radius: 99px; background: var(--card); color: var(--ink-2); font-size: .88rem; font-weight: 650; box-shadow: var(--shadow); }
.tabs a.active { background: var(--ink); color: var(--bg); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; flex: 1; min-width: 140px; }
.monthbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.monthbar input { flex: 1; text-align: center; font-family: var(--display); font-weight: 700; background: var(--card); box-shadow: var(--shadow); }
.monthbar .btn { width: 46px; height: 46px; padding: 0; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg { display: flex; background: var(--card); box-shadow: var(--shadow); border-radius: 16px; padding: 4px; gap: 2px; margin-bottom: 14px; }
.seg button { flex: 1; font: 650 .85rem/1 var(--body); border: 0; background: none; color: var(--muted); padding: 10px 6px; border-radius: 12px; cursor: pointer; }
.seg button.active { background: var(--ink); color: var(--bg); }
.seg button .n { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat.wide { grid-column: 1 / -1; background: var(--hero); color: #fff; position: relative; overflow: hidden; isolation: isolate; }
.stat.wide::before { content: ""; position: absolute; z-index: -1; width: 240px; height: 240px; right: -80px; top: -140px; background: var(--fire); filter: blur(50px); opacity: .8; border-radius: 50%; }
.stat.wide .k { color: rgba(255, 255, 255, .65); }
.stat .k { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.stat .v { font-size: 1.5rem; margin-top: 6px; line-height: 1; }
.stat .v.bad { color: var(--bad); }
.stat .v.ok { color: var(--ok); }
.bar { height: 10px; background: rgba(255, 255, 255, .14); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.bar > span { display: block; height: 100%; background: var(--zap); border-radius: 99px; }

/* Pix pendente */
.pend-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pend-top .big { font-size: 1.9rem; line-height: 1; margin-top: 6px; }
.quote { background: var(--sunken); border-radius: 14px; padding: 10px 12px; margin: 12px 0; font-size: .88rem; }
.quote .from { font-weight: 700; }

/* diálogo (bottom sheet no celular) */
dialog {
  border: 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); background: var(--card); color: var(--ink);
  width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 50px rgba(0, 0, 0, .3);
}
dialog[open] { animation: sheet .28s cubic-bezier(.2, .8, .2, 1); }
dialog::backdrop { background: rgba(10, 10, 14, .55); backdrop-filter: blur(3px); }
dialog h2 { font-size: 1.4rem; }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 560px) {
  dialog { width: min(480px, calc(100vw - 32px)); margin: auto; border-radius: 28px; padding: 24px; }
}
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(100px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 16px; z-index: 30; max-width: calc(100vw - 32px);
  font-size: .9rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: pop .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes pop { from { transform: translate(-50%, 10px); opacity: 0; } }
@media (min-width: 720px) { .toast { bottom: 24px; } }

.empty { text-align: center; color: var(--muted); padding: 26px 8px; }
.empty .em { display: block; font-size: 2rem; margin-bottom: 6px; }
.empty strong { display: block; color: var(--ink); font: 700 1.1rem/1.2 var(--display); margin-bottom: 4px; }

/* carregando */
.skel { padding-top: 12px; }
.skel div { background: linear-gradient(90deg, var(--card) 0%, var(--sunken) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: var(--radius); margin-bottom: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

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