:root {
  --accent: #2352C9;
  --accent-hover: #1a3fa0;
  --navy: #111827;
  --sidebar-w: 240px;
  --surface: #fff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #1f2937;
  --muted: #64748b;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--surface-2); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1.25rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.sidebar-logo-box {
  background: #fff;
  border-radius: 12px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
}
.sidebar-logo-box img { height: 44px; display: block; }
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-right: 3px solid transparent;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-item.active { color: #fff; background: rgba(35,82,201,0.2); border-right-color: var(--accent); }
.nav-icon { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-user { color: #94a3b8; font-size: .8rem; line-height: 1.6; }
.sidebar-user strong { display: block; color: #fff; font-size: .875rem; }
.sidebar-user a { color: #64748b; text-decoration: none; }
.sidebar-user a:hover { color: #94a3b8; }

/* ========== MAIN CONTENT ========== */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 1.1rem; font-weight: 600; }
.content { padding: 2rem; flex: 1; }

/* ========== STAT CARDS ========== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.stat-label { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5rem; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: .25rem; }
.stat-sub { font-size: .78rem; color: var(--muted); }

/* ========== GENERAL CARD ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

/* ========== TABLES ========== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.table-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.table-header h2 { font-size: 1rem; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: .875rem 1rem; border-bottom: 1px solid var(--border); font-size: .875rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfd; }
.mono { font-family: 'Menlo', 'Monaco', 'Courier New', monospace; font-size: .8rem; }

/* ========== BADGES ========== */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-admin { background: #e0e9ff; color: #1a3fa0; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
  line-height: 1;
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: .3rem .7rem; font-size: .78rem; border-radius: 6px; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 1.25rem; }
label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .4rem;
}
input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=url],
select,
textarea {
  width: 100%;
  padding: .6rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35,82,201,.12);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

/* ========== ALERTS ========== */
.alert {
  padding: .875rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .875rem;
  line-height: 1.5;
}
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-error, .alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ========== AUTH PAGES ========== */
.auth-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo img { height: 56px; }
.auth-title { font-size: 1.25rem; font-weight: 700; margin-bottom: .4rem; text-align: center; }
.auth-sub { text-align: center; color: var(--muted); font-size: .875rem; margin-bottom: 1.75rem; }

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.page-btn {
  padding: .4rem .8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .82rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  transition: all .15s;
}
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:hover:not(.active) { background: var(--surface-2); }

/* ========== SECRET KEY BOX ========== */
.secret-box {
  background: #111827;
  color: #60a5fa;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: .85rem;
  padding: .875rem 1rem;
  border-radius: 8px;
  word-break: break-all;
  position: relative;
  line-height: 1.6;
}
.copy-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: .25rem .6rem;
  font-size: .75rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background .15s;
}
.copy-btn:hover { background: var(--accent-hover); }

/* ========== UTILITY CLASSES ========== */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.text-muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.w-100 { width: 100%; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .topbar { padding: 1rem; }
}

/* ========== DETAILS / SUMMARY ========== */
details > summary::-webkit-details-marker { display: none; }
details > summary { outline: none; }

/* ========== KYC ONBOARDING WIZARD ========== */
.onboarding-wrap {
  max-width: 680px;
  margin: 0 auto;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: .25rem;
}
.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: .375rem;
}
.stepper-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  background: var(--surface);
  color: var(--muted);
  transition: all .2s;
}
.stepper-step.active .stepper-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.stepper-step.done .stepper-circle {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.stepper-label {
  font-size: .72rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  font-weight: 500;
}
.stepper-step.active .stepper-label { color: var(--accent); font-weight: 600; }
.stepper-step.done .stepper-label { color: var(--success); }
.stepper-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-bottom: 1.4rem;
  min-width: 20px;
  transition: background .2s;
}
.stepper-line.done { background: var(--success); }

/* Onboarding card */
.onboarding-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.onboarding-card-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.onboarding-card-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: .375rem;
  color: var(--text);
}
.onboarding-card-header p {
  color: var(--muted);
  font-size: .9rem;
}

/* Radio cards (account type) */
.radio-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .625rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: .875rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  transition: all .15s;
  color: var(--text);
  user-select: none;
}
.radio-card input { display: none; }
.radio-card:hover { border-color: var(--accent); background: #f0f4ff; }
.radio-card.selected { border-color: var(--accent); background: #eef2ff; color: var(--accent); }
.radio-icon { font-size: 1.4rem; }

/* Payout cards */
.payout-card {
  display: flex;
  align-items: center;
  gap: .625rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: .75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: .875rem;
  transition: all .15s;
  color: var(--text);
  user-select: none;
}
.payout-card input { display: none; }
.payout-card:hover { border-color: var(--accent); background: #f0f4ff; }
.payout-card.selected { border-color: var(--accent); background: #eef2ff; color: var(--accent); }
.payout-fields { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* Alert info */
.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: .875rem 1rem;
  color: #1e40af;
  font-size: .875rem;
}
