:root {
  --bg: #070708;
  --bg-elev: #121214;
  --bg-card: #1a1a1e;
  --bg-card-2: #222228;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --line: rgba(255,255,255,.08);
  --accent: #e11d48;
  --accent-2: #fb7185;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0,0,0,.45);
  --nav-h: 72px;
  --font: "Outfit", system-ui, sans-serif;
}

html[data-theme="light"] {
  --bg: #f4f4f5;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-card-2: #fafafa;
  --text: #18181b;
  --muted: #71717a;
  --line: rgba(0,0,0,.08);
  --shadow: 0 12px 30px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(225,29,72,.18), transparent 60%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }

#app { min-height: 100dvh; }

.shell {
  width: min(480px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 20px 16px calc(var(--nav-h) + 24px);
  position: relative;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.topbar h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.topbar p { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--accent); }

.beta {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  margin-bottom: 18px;
  color: var(--muted);
  font-size: .85rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-beta { background: rgba(251,191,36,.15); color: var(--warn); }
.badge-count { background: rgba(225,29,72,.18); color: var(--accent-2); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 10px;
}
.section-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.section-head .sub { color: var(--muted); font-size: .85rem; margin-top: 4px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card.interactive { transition: transform .15s ease, border-color .15s ease; }
.card.interactive:active { transform: scale(.98); }
.card.interactive:hover { border-color: rgba(225,29,72,.45); }

.casa-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 118px;
}
.casa-card .row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.casa-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-card-2);
  object-fit: cover;
  flex-shrink: 0;
}
.casa-logo.fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--accent-2);
  background: linear-gradient(135deg, rgba(225,29,72,.35), rgba(0,0,0,.2));
}
.casa-card .name { font-weight: 700; font-size: .98rem; }
.casa-card .status {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.casa-card .status.ok { color: var(--ok); }
.casa-card .status.nova { color: var(--muted); }
.casa-mini {
  margin-top: 2px;
  font-size: .72rem;
  line-height: 1.35;
  text-align: left;
  width: 100%;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 4px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}
.stat .v { font-size: 1.2rem; font-weight: 800; }
.stat .l { font-size: .72rem; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }

.kpi {
  display: grid;
  gap: 8px;
}
.kpi-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.kpi-row .l { color: var(--muted); font-size: .9rem; }
.kpi-row .v { font-weight: 700; }

.level-btn {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.level-btn strong { font-size: 1rem; }
.level-btn span { color: var(--muted); font-size: .85rem; }
.level-btn .tag {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(225,29,72,.15); color: var(--accent-2); font-weight: 800; font-size: .8rem;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 0 6px env(safe-area-inset-bottom);
  z-index: 40;
}
.bottom-nav a, .bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  padding: 8px 4px;
}
.bottom-nav .ico { font-size: 1.15rem; line-height: 1; }
.bottom-nav .active { color: var(--accent-2); }
.bottom-nav .saque {
  color: #fff;
  gap: 2px;
  margin-top: -10px;
  font-size: .68rem;
  font-weight: 700;
}
.bottom-nav .saque .saque-ico {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #be123c);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(225,29,72,.45);
  font-size: 1.25rem;
  line-height: 1;
}
.bottom-nav .saque.active { color: var(--accent-2); }
.bottom-nav .saque.active .saque-ico { outline: 2px solid rgba(255,255,255,.35); }

/* Login */
.login-wrap {
  width: min(420px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow);
  position: relative;
}
.brand-mark {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #9f1239);
  box-shadow: 0 0 40px rgba(225,29,72,.45);
  font-size: 1.6rem;
}
.brand-title {
  text-align: center;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: .02em;
  margin: 0 0 4px;
}
.brand-title span { color: var(--accent-2); }
.brand-sub {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  margin: 0 0 22px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.field .control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
}
.field .control:focus-within { border-color: var(--accent); }
.field input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 14px 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: .02em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #be123c);
  color: #fff;
  box-shadow: 0 10px 28px rgba(225,29,72,.35);
}
.btn-primary:disabled { opacity: .55; cursor: wait; }
.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--line);
}
.btn-sm { width: auto; padding: 8px 12px; font-size: .85rem; border-radius: 999px; }

.secure-note {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
}

.onboard h1 {
  font-size: 1.55rem;
  font-weight: 800;
  text-align: center;
  margin: 8px 0 10px;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.onboard .lead {
  text-align: center;
  color: var(--muted);
  margin: 0 0 18px;
  font-size: .95rem;
}
.feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.feature .n {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(225,29,72,.18); color: var(--accent-2);
  display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex-shrink: 0;
}
.feature strong { display: block; }
.feature span { color: var(--muted); font-size: .85rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px);
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: .88rem;
  z-index: 60;
  max-width: min(420px, 92vw);
  box-shadow: var(--shadow);
}
.toast.err { border-color: rgba(248,113,113,.4); }

.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 50; display: grid; place-items: end center;
}
.modal {
  width: min(480px, 100%);
  background: var(--bg-elev);
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--line);
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 85dvh;
  overflow: auto;
}
.modal h3 { margin: 0 0 12px; font-size: 1.15rem; }
.modal .actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-x {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--line);
  color: var(--text); font-size: 1.2rem; line-height: 1;
}
.modal-pix { position: relative; }
.pix-kicker {
  color: var(--accent-2);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pix-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
}
.pix-step { display: flex; align-items: center; gap: 6px; }
.pix-step span {
  width: 22px; height: 22px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--bg-card); border: 1px solid var(--line);
  font-size: .75rem; font-weight: 800;
}
.pix-step.on { color: var(--text); }
.pix-step.on span { background: var(--accent); border-color: var(--accent); color: #fff; }
.pix-line { flex: 1; height: 1px; background: var(--line); }
.pix-bal {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: .9rem;
}
.pix-bal strong { color: var(--accent-2); }
.modal-pix select {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: inherit;
}
.btn-max {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: .75rem;
  letter-spacing: .04em;
}

.period {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
}
.period button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
}
.period button.on {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-size: .92rem;
}
.copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.copy-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .8rem;
}
.list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .9rem;
}
.list-item:last-child { border-bottom: 0; }
.muted { color: var(--muted); }
.err-text { color: var(--danger); font-size: .85rem; margin-top: 8px; }
.loading { text-align: center; color: var(--muted); padding: 40px 12px; }

.page-static h2 { margin: 0 0 8px; }
.page-static ol, .page-static ul { color: var(--muted); line-height: 1.55; padding-left: 1.2rem; }
.page-static li { margin-bottom: 8px; }
