/* ==========================================================================
   Rapid Trading X — Painel de Afiliados
   Mesmo design do app: preto, roxo neon, Inter + JetBrains Mono.
   ========================================================================== */

:root {
  --bg: #000000;
  --surface: #0c0c0f;
  --surface-2: #121218;
  --surface-3: #17171f;
  --line: #1f1f27;
  --line-2: #2a2a35;
  --text: #f5f5f7;
  --text-dim: #a1a1aa;
  --muted: #6b7280;

  --purple: #a855f7;
  --purple-deep: #7c3aed;
  --purple-soft: rgba(168, 85, 247, 0.12);
  --purple-line: rgba(168, 85, 247, 0.35);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.12);
  --pink: #ec4899;

  --r-input: 12px;
  --r-card: 16px;
  --r-sheet: 24px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -28px rgba(0, 0, 0, 0.9);
  --shadow-purple: 0 0 0 1px rgba(168, 85, 247, 0.35), 0 12px 32px -12px rgba(168, 85, 247, 0.65);
  --grad-purple: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --sidebar-w: 272px;
  --topbar-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(168, 85, 247, 0.14), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(124, 58, 237, 0.1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

.mono,
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- Boot screen */
.boot {
  display: grid;
  place-items: center;
  min-height: 100dvh;
}

.boot img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(168, 85, 247, 0.45));
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    transform: scale(0.94);
    opacity: 0.8;
  }
}

/* ------------------------------------------------------------------ Layout */
.shell {
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: calc(18px + var(--safe-top)) 14px calc(14px + var(--safe-bottom));
  border-right: 1px solid var(--line);
  background: rgba(8, 8, 11, 0.96);
  backdrop-filter: blur(18px);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.shell.is-menu-open .sidebar {
  transform: translateX(0);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 6px 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar__brand img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.sidebar__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--purple-line);
  border-radius: 999px;
  background: var(--purple-soft);
  color: #d8b4fe;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-dim);
}

.nav {
  flex: 1;
  overflow-y: auto;
  margin: 14px -4px 0;
  padding: 0 4px;
}

.nav__label {
  margin: 8px 10px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 4px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text-dim);
  text-align: left;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.nav__item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.nav__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  font-size: 18px;
  transition: inherit;
}

.nav__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.nav__title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
}

.nav__sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav__item.is-active {
  border-color: var(--purple-line);
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.16), rgba(168, 85, 247, 0.04));
  color: var(--text);
}

.nav__item.is-active .nav__icon {
  border-color: transparent;
  background: var(--grad-purple);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(168, 85, 247, 0.8);
}

.nav__badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.sidebar__foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.me-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.me-card__text {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.me-card__name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-card__code {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad-purple);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.9), 0 0 0 3px rgba(168, 85, 247, 0.5);
}

.avatar--sm {
  width: 34px;
  height: 34px;
  font-size: 12px;
  box-shadow: none;
}

.avatar--ghost {
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-dim);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.shell.is-menu-open .scrim {
  opacity: 1;
  pointer-events: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(18px);
}

.menu-btn {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  gap: 1px;
  border: 0;
  border-radius: 13px;
  background: var(--grad-purple);
  color: #fff;
  box-shadow: 0 8px 22px -10px rgba(168, 85, 247, 0.9);
}

.menu-btn i {
  font-size: 20px;
}

.menu-btn span {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar__brand {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.topbar__title {
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__hello {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.07);
  color: var(--text);
  text-align: right;
}

.topbar__balance small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topbar__balance strong {
  color: var(--green);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}

.main {
  min-width: 0;
}

.page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px calc(40px + var(--safe-bottom));
  animation: page-in 0.28s ease;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (min-width: 1024px) {
  .sidebar {
    transform: none;
  }

  .sidebar__close,
  .menu-btn,
  .scrim {
    display: none;
  }

  .main {
    margin-left: var(--sidebar-w);
  }

  .topbar {
    padding: 0 28px;
  }

  .page {
    padding: 26px 28px 48px;
  }
}

/* ------------------------------------------------------------------ Blocks */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-title {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-desc {
  margin: 6px 0 0;
  max-width: 560px;
  color: var(--text-dim);
  font-size: 13px;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: rgba(12, 12, 15, 0.9);
  box-shadow: var(--shadow-card);
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 0;
}

.card__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.card__title i {
  color: var(--purple);
  font-size: 18px;
}

.card__body {
  padding: 16px 18px 18px;
}

.card__sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.stack {
  display: grid;
  gap: 16px;
}

.grid-2 {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-2--wide {
    grid-template-columns: 1.4fr 1fr;
  }
}

/* Hero (saldo) */
.hero {
  overflow: hidden;
  padding: 20px;
  border-color: var(--purple-line);
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(168, 85, 247, 0.28), transparent 70%),
    linear-gradient(180deg, #14111c 0%, #0c0c0f 100%);
}

.hero__glow {
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.2);
  filter: blur(50px);
  pointer-events: none;
}

.hero__row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.hero__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}

.hero__value {
  margin: 4px 0 2px;
  font-family: var(--mono);
  font-size: clamp(30px, 7vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero__hint {
  color: var(--muted);
  font-size: 12px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 760px) {
  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.kpi {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: linear-gradient(180deg, #121218 0%, #0c0c0f 100%);
  box-shadow: var(--shadow-card);
}

.kpi__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 16px;
}

.kpi__icon--green {
  background: var(--green-soft);
  color: var(--green);
}

.kpi__icon--red {
  background: var(--red-soft);
  color: var(--red);
}

.kpi__icon--amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.kpi__icon--blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.kpi__label {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.kpi__value {
  overflow: hidden;
  font-family: var(--mono);
  font-size: clamp(18px, 4.6vw, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi__hint {
  color: var(--muted);
  font-size: 11px;
}

.kpi--accent {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1) 0%, #0c0c0f 100%);
}

.pos {
  color: var(--green);
}

.neg {
  color: var(--red);
}

/* Chips / segmented */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.18s;
}

.chip:hover {
  color: var(--text);
}

.chip.is-active {
  border-color: transparent;
  background: var(--grad-purple);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(168, 85, 247, 0.9);
}

.chip i {
  font-size: 15px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-input);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.12s, filter 0.18s, background 0.18s, border-color 0.18s;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn i {
  font-size: 17px;
}

.btn--primary {
  background: var(--grad-purple);
  color: #fff;
  box-shadow: var(--shadow-purple);
}

.btn--primary:hover {
  filter: brightness(1.08);
}

.btn--green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35), 0 12px 32px -12px rgba(16, 185, 129, 0.65);
}

.btn--ghost {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--purple-line);
}

.btn--sm {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12.5px;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: 44px;
  padding: 0;
}

.btn .spin {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Forms */
.field {
  display: grid;
  gap: 6px;
}

.label {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.input-wrap {
  position: relative;
}

.input-wrap > i {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted);
  font-size: 17px;
  transform: translateY(-50%);
  pointer-events: none;
}

.input,
.select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-input);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.input-wrap > .input {
  padding-left: 42px;
}

.input::placeholder {
  color: #52525b;
}

.input:focus,
.select:focus {
  border-color: var(--purple);
  outline: none;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}

.input--mono {
  font-family: var(--mono);
}

.input-action {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
}

.input-action:hover {
  color: var(--text);
}

.hint {
  color: var(--muted);
  font-size: 11.5px;
}

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-input);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.5;
}

.alert i {
  flex: none;
  margin-top: 1px;
  font-size: 17px;
}

.alert--purple {
  border-color: var(--purple-line);
  background: var(--purple-soft);
  color: #e9d5ff;
}

.alert--purple i {
  color: var(--purple);
}

.alert--red {
  border-color: rgba(239, 68, 68, 0.4);
  background: var(--red-soft);
  color: #fecaca;
}

.alert--red i {
  color: var(--red);
}

.alert--amber {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--amber-soft);
  color: #fde68a;
}

.alert--amber i {
  color: var(--amber);
}

.alert--green {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--green-soft);
  color: #a7f3d0;
}

.alert--green i {
  color: var(--green);
}

/* Copy box (link) */
.copybox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--purple-line);
  border-radius: 14px;
  background: rgba(168, 85, 247, 0.06);
}

.copybox__text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #e9d5ff;
  font-family: var(--mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge--plain::before {
  display: none;
}

.badge--green {
  background: var(--green-soft);
  color: var(--green);
}

.badge--red {
  background: var(--red-soft);
  color: var(--red);
}

.badge--amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge--purple {
  background: var(--purple-soft);
  color: #c084fc;
}

.badge--blue {
  background: var(--blue-soft);
  color: #60a5fa;
}

/* Lists */
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.row-item:first-child {
  border-top: 0;
}

.row-item__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 18px;
}

.row-item__main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.row-item__title {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-item__sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-item__side {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.row-item__amount {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
}

/* Player card */
.players {
  display: grid;
  gap: 12px;
}

@media (min-width: 900px) {
  .players {
    grid-template-columns: 1fr 1fr;
  }
}

.player {
  padding: 14px;
}

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

.player__name {
  font-size: 14px;
  font-weight: 800;
}

.player__email {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.player__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.player__stat {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.player__stat small {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.player__stat strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

/* Chart */
.chart {
  position: relative;
  height: 220px;
  margin-top: 6px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart__grid line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-dasharray: 3 4;
}

.chart__axis text {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.chart__bar {
  fill: url(#barGrad);
  transition: opacity 0.15s;
}

.chart__bar--zero {
  fill: rgba(255, 255, 255, 0.06);
}

.chart__bar.is-hover {
  fill: #c084fc;
}

.chart__tip {
  position: absolute;
  top: 0;
  padding: 7px 10px;
  border: 1px solid var(--purple-line);
  border-radius: 10px;
  background: rgba(12, 12, 15, 0.96);
  font-size: 11px;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
  box-shadow: var(--shadow-card);
}

.chart__tip strong {
  display: block;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.chart__tip span {
  color: var(--muted);
}

/* Funnel */
.funnel {
  display: grid;
  gap: 10px;
}

.funnel__step {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
}

.funnel__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 17px;
}

.funnel__bar {
  position: relative;
  height: 34px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-2);
}

.funnel__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.55), rgba(124, 58, 237, 0.25));
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.funnel__label {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 700;
}

.funnel__value {
  min-width: 58px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.funnel__rate {
  margin: -4px 0 0 48px;
  color: var(--muted);
  font-size: 11px;
}

.funnel__rate b {
  color: #c084fc;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.table td.num,
.table th.num {
  text-align: right;
}

.table tr:last-child td {
  border-bottom: 0;
}

/* Feed */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.live-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: ping 1.6s infinite;
}

.live-dot.is-off {
  color: var(--muted);
}

.live-dot.is-off::before {
  background: var(--muted);
  animation: none;
}

@keyframes ping {
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.feed-new {
  animation: feed-in 0.6s ease;
}

@keyframes feed-in {
  from {
    background: rgba(168, 85, 247, 0.14);
  }
}

/* Info list (key/value) */
.kv {
  display: grid;
  gap: 0;
}

.kv__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.kv__row:first-child {
  border-top: 0;
  padding-top: 0;
}

.kv__key {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 13px;
}

.kv__key i {
  color: var(--muted);
  font-size: 16px;
}

.kv__val {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty / skeleton */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}

.empty i {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 24px;
}

.empty strong {
  color: var(--text);
  font-size: 14px;
}

.empty p {
  margin: 0;
  max-width: 320px;
  font-size: 12.5px;
}

.skel {
  border-radius: 10px;
  background: linear-gradient(90deg, #121218 0%, #1b1b24 50%, #121218 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

/* Toast */
.toasts {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  left: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(18, 18, 24, 0.97);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.9);
  animation: toast-in 0.25s ease;
  pointer-events: auto;
}

.toast i {
  font-size: 18px;
}

.toast--ok i {
  color: var(--green);
}

.toast--error i {
  color: var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: fade 0.2s ease;
}

@media (min-width: 640px) {
  .modal {
    place-items: center;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal__box {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  border: 1px solid var(--purple-line);
  border-radius: var(--r-sheet);
  background: #0e0e13;
  box-shadow: 0 30px 80px -30px rgba(168, 85, 247, 0.45);
  animation: pop 0.25s ease;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.modal__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 15px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 24px;
}

.modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.modal__text {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 13px;
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

/* Login */
.auth {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
}

.auth__main {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-top)) 16px 24px;
}

.auth__card {
  display: grid;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-sheet);
  background: rgba(12, 13, 20, 0.86);
  box-shadow: 0 30px 80px -40px rgba(168, 85, 247, 0.5);
  backdrop-filter: blur(16px);
}

@media (min-width: 900px) {
  .auth__card {
    max-width: 920px;
    grid-template-columns: 1fr 1fr;
  }
}

.auth__side {
  position: relative;
  display: none;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(360px 260px at 90% 0%, rgba(168, 85, 247, 0.3), transparent 70%),
    radial-gradient(320px 220px at 0% 100%, rgba(59, 130, 246, 0.14), transparent 70%);
}

@media (min-width: 900px) {
  .auth__side {
    display: flex;
  }
}

.auth__side h2 {
  margin: 28px 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth__side p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
}

.perks {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.perks li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
}

.perks i {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--purple-line);
  border-radius: 11px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 16px;
}

.auth__form {
  padding: 24px 20px;
}

@media (min-width: 900px) {
  .auth__form {
    padding: 36px 32px;
  }
}

.auth__logo {
  width: 88px;
  height: 88px;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(168, 85, 247, 0.45));
}

.auth__logo--side {
  width: 104px;
  height: 104px;
  margin: 0;
}

@media (min-width: 900px) {
  .auth__form .auth__logo {
    display: none;
  }
}

.auth__title {
  margin: 14px 0 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.auth__sub {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

@media (min-width: 900px) {
  .auth__title,
  .auth__sub {
    text-align: left;
  }

  .auth__title {
    margin-top: 0;
  }
}

.auth__foot {
  padding: 18px 16px calc(18px + var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.auth__foot .badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: rgba(255, 255, 255, 0.06);
}

/* Utility spacing */
.mt-0 {
  margin-top: 0;
}

.mt-8 {
  margin-top: 8px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.row--between {
  justify-content: space-between;
}

.grow {
  flex: 1;
}

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

.text-muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.center {
  text-align: center;
}

/* ---- correções de largura no celular ---- */
.grid-2 > *,
.stack > *,
.card,
.kpi {
  min-width: 0;
}

.page {
  overflow-x: clip;
}

@media (max-width: 1023px) {
  .sidebar__tag {
    display: none;
  }
}
