/* =========================================================
   EliteGate — design system dark/premium/fintech
   Camadas de profundidade: body -> section -> card -> input
   ========================================================= */

:root {
  --bg: #0b0a13;
  --bg-radial: radial-gradient(circle at 15% -10%, #2a1050 0%, transparent 40%),
               radial-gradient(circle at 85% 0%, #190a35 0%, transparent 35%);
  --surface: #121120;
  --surface-2: #171528;
  --surface-input: #0e0d1a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f5f3ff;
  --text-dim: #9490ab;
  --text-faint: #6b6780;

  --purple: #8b5cf6;
  --purple-light: #a879ff;
  --purple-dark: #6d28d9;
  --grad-purple: linear-gradient(135deg, #7c3aed, #a855f7);

  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --blue: #60a5fa;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-glow: 0 0 0 1px rgba(139, 92, 246, 0.18), 0 12px 30px rgba(124, 58, 237, 0.18);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg) var(--bg-radial);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--purple-light); text-decoration: none; }
a:hover { text-decoration: underline; }

small { color: var(--text-dim); }

/* ---------- layout containers ---------- */

.wrap { max-width: 1240px; margin: auto; padding: 0 24px 60px; }
.page { max-width: 1240px; margin: auto; padding: 0 24px 60px; }

.container-narrow { max-width: 980px; margin: auto; padding: 0 24px 60px; }

/* ---------- top navigation ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 10, 19, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1240px;
  margin: auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand span { color: var(--purple-light); }

.navlinks {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}

.navlinks a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  position: relative;
}
.navlinks a:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.navlinks a.active { color: var(--text); background: rgba(139, 92, 246, 0.14); }
.navlinks a.active::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--purple-light);
  border-radius: 2px;
}
.navlinks .ic { font-size: 14px; line-height: 1; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- buttons ---------- */

.btn, .ghost, .btn-danger {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: filter .15s ease, transform .05s ease;
}
.btn { background: var(--grad-purple); color: #fff; box-shadow: 0 6px 18px rgba(124, 58, 237, .35); }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }

.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.ghost:hover { background: var(--surface); border-color: var(--border-strong); }

.btn-danger { background: rgba(251, 113, 133, 0.12); color: var(--red); border: 1px solid rgba(251, 113, 133, 0.3); }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 13px; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-title .icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 16px;
  background: rgba(139, 92, 246, 0.14);
  color: var(--purple-light);
  flex-shrink: 0;
}
.card-title h2 { margin: 0; font-size: 16px; }
.card-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); }

/* ---------- hero / landing ---------- */

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 50px;
  align-items: center;
  padding-top: 40px;
}
.hero h1 { font-size: clamp(38px, 6vw, 66px); line-height: 1.02; margin: 14px 0; letter-spacing: -0.02em; }
.hero p { font-size: 18px; color: var(--text-dim); max-width: 560px; line-height: 1.6; }
.hero small { color: var(--purple-light); font-weight: 800; letter-spacing: .16em; font-size: 12px; }
.hero .card.big {
  background: var(--grad-purple);
  border: none;
  display: grid; gap: 10px; padding: 40px;
  box-shadow: var(--shadow-glow);
}
.hero .card.big span { font-size: 12px; font-weight: 800; letter-spacing: .14em; opacity: .85; }
.hero .card.big strong { font-size: 56px; }
.hero .card.big em { font-style: normal; opacity: .8; }

/* ---------- auth pages ---------- */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: min(420px, 100%); }
.auth .brand { display: block; text-align: center; margin-bottom: 4px; font-size: 21px; }
.auth h1 { text-align: center; font-size: 22px; margin: 4px 0 22px; }
.auth p.hint { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 16px; }

form { display: grid; gap: 12px; }
label { font-size: 12.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }

input, select, textarea {
  width: 100%;
  background: var(--surface-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font: inherit;
  outline: none;
  transition: border-color .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus { border-color: var(--purple); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 18px) center, calc(100% - 13px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.error { color: var(--red); font-size: 13.5px; min-height: 1.4em; }
.ok { color: var(--green); font-size: 13.5px; }

/* ---------- dashboard header ---------- */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin: 28px 0 22px;
}
.page-head h1 { font-size: 32px; margin: 6px 0 4px; letter-spacing: -0.01em; }
.page-head .eyebrow { color: var(--purple-light); font-weight: 800; font-size: 12px; letter-spacing: .1em; }
.page-head p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

.period-filter { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.period-filter button {
  border: 0; background: transparent; color: var(--text-dim);
  padding: 7px 14px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 12.5px; cursor: pointer;
}
.period-filter button.active { background: var(--grad-purple); color: #fff; }

/* ---------- balance / hero card ---------- */

.balance-card {
  background: var(--grad-purple);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: var(--shadow-glow);
  margin-bottom: 20px;
}
.balance-card .label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; opacity: .9; }
.balance-card strong { display: block; font-size: 42px; margin: 8px 0 4px; letter-spacing: -0.02em; }
.balance-card .sub { font-size: 13px; opacity: .85; }
.balance-card .actions { display: flex; gap: 10px; }
.balance-card .actions .btn { background: #fff; color: var(--purple-dark); box-shadow: none; }
.balance-card .actions .ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.25); }
.balance-card .badge { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* ---------- metric cards ---------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}
.metric-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.metric-card .ic {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; font-size: 14px;
}
.metric-card .delta { font-size: 12px; font-weight: 800; }
.metric-card .delta.up { color: var(--green); }
.metric-card .delta.down { color: var(--red); }
.metric-card .label { font-size: 11.5px; font-weight: 800; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; }
.metric-card strong { display: block; font-size: 23px; margin-top: 6px; }

.ic-purple { background: rgba(139,92,246,.16); color: var(--purple-light); }
.ic-green  { background: rgba(52,211,153,.14); color: var(--green); }
.ic-amber  { background: rgba(251,191,36,.14); color: var(--amber); }
.ic-red    { background: rgba(251,113,133,.14); color: var(--red); }
.ic-blue   { background: rgba(96,165,250,.14); color: var(--blue); }

/* ---------- content grid: performance + sidebar ---------- */

.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }

.perf-total { text-align: right; }
.perf-total .label { font-size: 11px; font-weight: 800; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; }
.perf-total strong { display: block; font-size: 22px; }

.chart-wrap { margin-top: 18px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 6px; }

.side-card { display: grid; gap: 14px; }

.total-sacado { display: flex; align-items: center; gap: 12px; }
.total-sacado .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(139,92,246,.16); color: var(--purple-light); font-size: 16px; }
.total-sacado .label { font-size: 11px; font-weight: 800; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; }
.total-sacado strong { display: block; font-size: 19px; }
.progress-bar { height: 5px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.progress-bar i { display: block; height: 100%; background: var(--grad-purple); }

.quick-actions { display: grid; gap: 8px; }
.quick-action {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}
.quick-action:hover { background: #1c1a30; border-color: var(--border-strong); text-decoration: none; }
.quick-action .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }

/* ---------- sub-page header (Voltar) ---------- */

.subpage-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0; max-width: 1240px; margin: auto;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 9px 16px; border-radius: 999px; color: var(--text); font-weight: 700; font-size: 13.5px;
}
.back-link:hover { text-decoration: none; border-color: var(--border-strong); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 6px 13px; border-radius: 999px; background: rgba(52,211,153,.12); color: var(--green); border: 1px solid rgba(52,211,153,.25); }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.center-head { text-align: center; padding: 26px 24px 6px; max-width: 720px; margin: auto; }
.center-head .icon-badge {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 16px; background: var(--grad-purple);
  display: grid; place-items: center; font-size: 24px;
  box-shadow: var(--shadow-glow);
}
.center-head h1 { font-size: 26px; margin: 0 0 8px; }
.center-head p { color: var(--text-dim); margin: 0; font-size: 14px; }

.side-top { text-align: left; padding: 22px 24px 6px; max-width: 1240px; margin: auto; }
.side-top h1 { font-size: 28px; margin: 10px 0 4px; }
.side-top p { color: var(--text-dim); margin: 0; font-size: 14px; }

/* ---------- two-column form layout (pix page) ---------- */

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 980px; margin: 26px auto 0; padding: 0 24px; }

.mini-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.mini-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.mini-card .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.mini-card small { display: block; font-size: 11px; }
.mini-card b { font-size: 13px; }

.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 980px; margin: 18px auto 0; padding: 0 24px 10px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.feature-card .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.feature-card b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.feature-card span { font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }

.qr-box {
  display: grid; place-items: center; text-align: center; gap: 10px;
  min-height: 260px; padding: 20px;
}
.qr-box img { max-width: 200px; width: 100%; background: #fff; padding: 10px; border-radius: 12px; }
.qr-box .placeholder-ic {
  width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2);
  display: grid; place-items: center; font-size: 22px; color: var(--text-faint);
}
.qr-box .title { font-weight: 700; font-size: 15px; }
.qr-box .hint { font-size: 13px; color: var(--text-dim); max-width: 260px; }
.copy-field { display: flex; gap: 8px; width: 100%; }
.copy-field textarea { resize: none; height: 70px; font-size: 12px; }

/* ---------- balance banner (transfer / affiliate pages) ---------- */

.banner-card {
  background: var(--grad-purple);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  max-width: 980px; margin: 22px auto 0;
  box-shadow: var(--shadow-glow);
}
.banner-card .row-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.banner-card .label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; opacity: .9; }
.banner-card strong { font-size: 34px; }
.banner-card .pill { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 8px; max-width: 980px; margin: 18px auto 0; padding: 0 24px; }
.tab {
  flex: 1; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.tab.active { background: var(--grad-purple); color: #fff; border-color: transparent; }
.tab.disabled { opacity: .45; cursor: not-allowed; }

.form-card { max-width: 980px; margin: 18px auto 0; padding: 0 24px; }

.notice-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(139,92,246,.08); border: 1px solid rgba(139,92,246,.2);
  border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 18px;
}
.notice-row .ic { color: var(--purple-light); font-size: 15px; flex-shrink: 0; }
.notice-row b { display: block; font-size: 13.5px; color: var(--purple-light); }
.notice-row span { font-size: 12.5px; color: var(--text-dim); }

.fav-keys-toggle {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px; color: var(--amber); font-weight: 700; font-size: 13px; cursor: pointer; margin-bottom: 14px;
}
.disabled-tab-note { text-align: center; color: var(--text-dim); font-size: 13.5px; padding: 40px 20px; }

/* ---------- extrato ---------- */

.extrato-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.extrato-toolbar .search-wrap { flex: 1; min-width: 220px; }
.search-wrap { position: relative; }
.search-wrap input { padding-left: 38px; }
.search-wrap .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 13px; }
.extrato-toolbar select { width: auto; min-width: 150px; }

.tx-table { margin-top: 18px; }
.tx-head, .tx-row {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 1.3fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 4px;
}
.tx-head { font-size: 11px; font-weight: 800; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.tx-row { border-bottom: 1px solid var(--border); }
.tx-row:last-child { border-bottom: none; }

.tx-type { display: flex; align-items: center; gap: 10px; }
.tx-type .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.tx-type .meta { display: grid; gap: 2px; }
.tx-type .kind { font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.tx-type .kind.in { color: var(--green); }
.tx-type .kind.out { color: var(--red); }

.tx-name { font-weight: 700; font-size: 13.5px; }
.tx-name small { display: block; color: var(--text-dim); font-weight: 400; font-size: 12px; margin-top: 2px; }

.tx-id { font-size: 12px; color: var(--text-dim); font-family: ui-monospace, Menlo, monospace; }

.tx-amount { font-weight: 800; font-size: 14px; text-align: right; }
.tx-amount.in { color: var(--green); }
.tx-amount.out { color: var(--red); }
.tx-amount .date { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

.status-tag { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; justify-self: end; }
.status-tag.completed { background: rgba(52,211,153,.14); color: var(--green); }
.status-tag.pending { background: rgba(251,191,36,.14); color: var(--amber); }
.status-tag.failed { background: rgba(251,113,133,.14); color: var(--red); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-dim); }

/* ---------- affiliate page ---------- */

.plan-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-toggle button {
  padding: 13px; border-radius: var(--radius-sm);
  background: var(--surface-input); border: 1px solid var(--border);
  color: var(--text-dim); font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.plan-toggle button.active { background: rgba(139,92,246,.16); border-color: var(--purple); color: var(--text); }

.min-hint { font-size: 11.5px; color: var(--text-faint); margin-top: -6px; }
.min-hint b { color: var(--text-dim); }

.profit-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.profit-box .label { font-size: 12px; color: var(--text-dim); }
.profit-box b { color: var(--green); font-size: 15px; }
.profit-note { background: rgba(139,92,246,.08); border: 1px solid rgba(139,92,246,.2); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12.5px; color: var(--text-dim); }

.links-table .tx-head, .links-table .tx-row { grid-template-columns: 1.6fr 1fr 1fr 1fr auto; }

/* ---------- generic table rows (legacy compat) ---------- */

.row { display: grid; grid-template-columns: 1.5fr 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: center; }
.row:last-child { border-bottom: 0; }

.pix { text-align: center; margin-top: 18px; }
.pix img { max-width: 220px; background: #fff; padding: 10px; border-radius: 10px; display: block; margin: 0 auto 12px; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .content-grid { grid-template-columns: 1fr; }
  .split-2 { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 40px 0; }
  .navlinks { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .balance-card { flex-direction: column; align-items: flex-start; }
  .balance-card .actions { width: 100%; }
  .balance-card .actions .btn, .balance-card .actions .ghost { flex: 1; }
  .tx-head { display: none; }
  .tx-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 0; }
  .tx-amount { text-align: left; }
  .status-tag { justify-self: start; }
  .mini-cards, .plan-toggle { grid-template-columns: 1fr; }
}


/* ---------- alternância de tema: claro elegante, sem branco estourado ---------- */
:root[data-theme="light"] {
  --bg: #efedf7;
  --bg-radial: radial-gradient(circle at 15% -10%, #e4dcff 0%, transparent 42%),
               radial-gradient(circle at 85% 0%, #f7e9ff 0%, transparent 38%);
  --surface: #faf9fe;
  --surface-2: #f1eef9;
  --surface-input: #f7f5fc;
  --border: rgba(58, 43, 94,  0.12);
  --border-strong: rgba(58, 43, 94, 0.22);
  --text: #28223b;
  --text-dim: #6e6682;
  --text-faint: #8f87a2;
  --purple: #7650d9;
  --purple-light: #6941c6;
  --purple-dark: #5832b2;
  --grad-purple: linear-gradient(135deg, #7650d9, #9b70ed);
  --shadow-card: 0 8px 24px rgba(54, 37, 91, 0.08);
  --shadow-glow: 0 0 0 1px rgba(118, 80, 217, 0.12), 0 12px 30px rgba(118, 80, 217, 0.12);
}
:root[data-theme="light"] html,
:root[data-theme="light"] body {
  background-color: var(--bg);
  color: var(--text);
}
:root[data-theme="light"] .topbar {
  background: rgba(239, 237, 247, 0.9);
}
:root[data-theme="light"] .hero .card.big,
:root[data-theme="light"] .balance-card,
:root[data-theme="light"] .banner-card {
  color: #fff;
}
:root[data-theme="light"] .balance-card .actions .btn {
  background: #fff;
  color: #5832b2;
}
:root[data-theme="light"] .ghost,
:root[data-theme="light"] .icon-btn,
:root[data-theme="light"] .tab,
:root[data-theme="light"] .mini-card,
:root[data-theme="light"] .profit-box {
  color: var(--text);
}
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  color: var(--text);
}
:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder {
  color: #9991ac;
}
:root[data-theme="light"] .auth .card {
  box-shadow: 0 16px 48px rgba(54, 37, 91, 0.12);
}
.theme-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .18);
  font: 700 13px/1 var(--font);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.theme-toggle:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.22); }
.theme-toggle .theme-icon { font-size: 17px; }
@media (max-width: 760px) {
  .theme-toggle { right: 14px; bottom: 14px; min-height: 44px; padding: 0 14px; }
}


/* MZPay: navegação móvel acessível sem ocultar as seções */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: 700 13px/1 var(--font);
  cursor: pointer;
}
@media (max-width: 760px) {
  .topbar-inner {
    position: relative;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
  }
  .mobile-nav-toggle { display: inline-flex; margin-left: auto; }
  .topbar-actions { margin-left: 0; }
  .navlinks {
    display: none;
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .navlinks.mobile-open { display: flex; }
  .navlinks a {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    white-space: normal;
  }
  .navlinks a.active::after { display: none; }
  .topbar-actions .ghost { padding: 10px 12px; }
  .page, .wrap, .container-narrow { padding-left: 16px; padding-right: 16px; }
  .page-head h1 { font-size: 26px; }
  .card { padding: 18px; }
}


/* Editor de taxas individual: campos juntos em um painel responsivo */
.fee-modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; background: rgba(3, 2, 10, .78); backdrop-filter: blur(7px); }
.fee-modal { width: min(560px, 100%); max-height: min(90vh, 760px); overflow-y: auto; padding: 26px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.fee-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.fee-modal-head h2 { margin: 5px 0; font-size: 24px; }
.fee-modal-head p { margin: 0; color: var(--text-dim); font-size: 13px; overflow-wrap: anywhere; }
.fee-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fee-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@media (max-width: 560px) { .fee-modal { padding: 20px; } .fee-modal-grid { grid-template-columns: 1fr; } .fee-modal-actions { flex-direction: column-reverse; } .fee-modal-actions button { width: 100%; } }

/* MZPay: fundo escuro uniforme em toda a viewport. */
html, body { min-height:100%; background-color:#0b0a13 !important; background-image:radial-gradient(circle at 15% -10%, #21113b 0%, transparent 40%), radial-gradient(circle at 85% 0%, #150b28 0%, transparent 35%) !important; color:#f5f3ff !important; color-scheme:dark; }
body, main, #app, .page, .wrap, .container-narrow, .subpage-top, .side-top { background-color:transparent !important; color:#f5f3ff; }
input, select, textarea { color-scheme:dark; }
[data-theme="light"] { color-scheme:dark !important; }
.user-admin-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.fee-minimum-note { color:var(--amber); background:rgba(251,191,36,.08); border:1px solid rgba(251,191,36,.2); border-radius:10px; padding:10px 12px; font-size:12px; }
@media(max-width:700px){ .user-admin-actions{justify-content:flex-start;} }


/* ---- Utilitarios (substituem estilos inline; a CSP nao permite style="") ---- */
.u-hidden { display: none; }
.u-mb-10 { margin-bottom: 10px; }
.u-mb-18 { margin-bottom: 18px; }
.u-mt-18 { margin-top: 18px; }
.u-mt-12 { margin-top: 12px; }
.u-header-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.u-side-top { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.u-flex-gap14 { display: flex; gap: 14px; align-items: center; }
.u-flex-gap12 { display: flex; gap: 12px; align-items: center; }
.u-icon-48 { width: 48px; height: 48px; border-radius: 14px; }
.u-h1-24 { font-size: 24px; margin: 0; }
.u-split-reset { margin: 0 0 20px; padding: 0; max-width: none; }
.u-hint-13 { font-size: 13px; color: var(--text-dim); margin-top: -6px; }
.u-metrics-5 { grid-template-columns: repeat(5, 1fr); }
.u-form-end { align-items: end; }
.u-row-center { align-items: center; gap: 12px; flex-wrap: wrap; }
.u-title-between { justify-content: space-between; width: 100%; }
.u-tx-row-5 { grid-template-columns: 1.6fr 1fr 1fr 1fr auto; }
.u-brand-flex { display: flex; align-items: center; gap: 6px; }
.pill-violet { background: rgba(139, 92, 246, .12); color: #a879ff; border-color: rgba(139, 92, 246, .25); }
@media (max-width: 760px) {
  .u-metrics-5 { grid-template-columns: repeat(2, 1fr); }
  .u-tx-row-5 { grid-template-columns: 1fr; }
}

/* ---- Acessibilidade ---- */
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface-2); color: var(--text); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid #a879ff; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Modal (confirmacao de saque, codigo 2FA) ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface, #14141c); border: 1px solid var(--border, #2a2a38); border-radius: 16px; padding: 22px; width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 10px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0; }
.modal dt { color: var(--text-dim); }
.modal dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ---- Telas novas (seguranca, 2FA, conciliacao) ---- */
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border, #2a2a38); vertical-align: top; }
.table-wrap th { color: var(--text-dim); font-weight: 600; }
.code-box { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; word-break: break-all; user-select: all; }
.codes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.qr-img { display: block; margin: 12px auto; background: #fff; padding: 8px; border-radius: 12px; }
.tabs-inline { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs-inline button[aria-selected="true"] { background: var(--accent, #7c3aed); color: #fff; }
.warn { color: #f5b942; }
.auth-wide .card { max-width: 520px; }

/* ---- Modal de PIX pago: identidade MZPay e layout responsivo ---- */
body.pix-modal-open { overflow: hidden; }
.pix-paid-backdrop[hidden] { display: none !important; }
.pix-paid-backdrop { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; overflow-y: auto; background: rgba(5, 4, 13, .82); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.pix-paid-modal { position: relative; width: min(100%, 460px); max-height: min(90dvh, 760px); overflow-y: auto; padding: 34px 30px 28px; text-align: center; color: var(--text); background: linear-gradient(155deg, var(--surface-2), var(--surface)); border: 1px solid rgba(52, 211, 153, .24); border-radius: 24px; box-shadow: 0 28px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(139, 92, 246, .10); animation: pixPaidEnter .22s ease-out; }
.pix-paid-close { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-input); color: var(--text-dim); font-size: 26px; line-height: 1; cursor: pointer; }
.pix-paid-check { display: grid; place-items: center; width: 76px; height: 76px; margin: 4px auto 18px; border-radius: 50%; color: var(--green); background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .28); box-shadow: 0 0 34px rgba(52, 211, 153, .10); }
.pix-paid-check svg { width: 43px; height: 43px; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.pix-paid-eyebrow { margin: 0 0 7px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.pix-paid-modal h2 { margin: 0; font-size: clamp(21px, 5vw, 27px); line-height: 1.2; letter-spacing: -.025em; }
.pix-paid-modal > p:not(.pix-paid-eyebrow) { max-width: 340px; margin: 12px auto 22px; color: var(--text-dim); font-size: 14px; }
.pix-paid-amount-label { color: var(--text-dim); font-size: 12px; }
.pix-paid-amount { margin-top: 3px; color: var(--text); font-size: clamp(29px, 8vw, 38px); font-weight: 800; letter-spacing: -.04em; overflow-wrap: anywhere; }
.pix-paid-reference { margin-top: 12px; color: var(--text-faint); font-size: 11px; overflow-wrap: anywhere; }
.pix-paid-reference span { color: var(--text-dim); }
.pix-paid-actions { display: grid; gap: 10px; margin-top: 25px; }
.pix-paid-actions .btn, .pix-paid-actions .ghost { display: flex; justify-content: center; align-items: center; min-height: 46px; margin: 0; text-align: center; }
.pix-paid-actions .ghost { width: 100%; }
.pix-status-hint { margin-top: 12px; color: var(--purple-light) !important; }
@keyframes pixPaidEnter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 560px) {
  .pix-paid-backdrop { align-items: end; padding: 10px; }
  .pix-paid-modal { width: 100%; max-height: 92dvh; padding: 30px 20px 20px; border-radius: 22px; }
  .pix-paid-check { width: 66px; height: 66px; margin-bottom: 15px; }
  .pix-paid-check svg { width: 38px; height: 38px; }
  .pix-paid-actions { margin-top: 21px; }
}
@media (prefers-reduced-motion: reduce) { .pix-paid-modal { animation: none; } }


/* ---- Taxas ao vivo (dashboard) ---- */
.fee-card .fee-big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; transition: color .3s, transform .3s; }
.fee-card .fee-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 14px; }
.fee-card .fee-updated { opacity: .7; }
.fee-card .fee-line { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }
.fee-big.fee-changed { color: #f5b942; transform: scale(1.04); }
.sim-box label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.sim-box input { width: 100%; }
.sim-result { min-height: 20px; margin-top: 8px; font-size: 13px; font-weight: 600; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #34d399; background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .25); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; display: inline-block; animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } .fee-big { transition: none; } }

/* ---- Admin: dois grupos de taxa (deposito / saque) ---- */
.fee-group { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.fee-group legend { padding: 0 8px; font-weight: 700; font-size: 13px; }
.fee-group .field-row { margin: 0; }
.fee-group-dep legend { color: #a879ff; }
.fee-group-wd legend { color: #34d399; }
