/* ═══════════════════════════════════════════════════════════
   Flux Energy Affiliate Portal — Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --blue:          #2563eb;
  --blue-dark:     #1d4ed8;
  --blue-light:    #eff6ff;
  --orange:        #ea580c;
  --orange-light:  #fff7ed;
  --green:         #16a34a;
  --green-light:   #f0fdf4;
  --purple:        #7c3aed;
  --purple-light:  #f5f3ff;
  --red:           #dc2626;
  --red-light:     #fef2f2;
  --amber:         #d97706;
  --amber-light:   #fffbeb;

  --bg:            #f1f5f9;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text:          #0f172a;
  --muted:         #64748b;
  --subtle:        #94a3b8;

  --sidebar-w:     252px;
  --sidebar-bg:    #0f172a;

  --radius-s:      6px;
  --radius:        10px;
  --radius-l:      14px;
  --radius-xl:     20px;
  --radius-full:   9999px;

  --shadow-s:  0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-m:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-l:  0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 30px rgba(0,0,0,.12), 0 8px 12px rgba(0,0,0,.06);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  color: var(--text);
  line-height: 1.5;
}
a { text-decoration: none; }
button { font-family: inherit; }

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #0a1628 0%, #1a2f5e 45%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Brand */
.login-brand {
  text-align: center;
  color: #fff;
}
.login-brand-logo {
  display: block;
  width: 200px;
  margin: 0 auto .75rem;
  border-radius: var(--radius-s);
}
.login-brand p {
  font-size: .875rem;
  color: rgba(255,255,255,.55);
  margin-top: .2rem;
}

/* Card */
.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.5rem 2rem;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,.06);
}
.login-card-header { margin-bottom: 1.75rem; }
.login-card-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.login-card-header p {
  font-size: .875rem;
  color: var(--muted);
  margin-top: .25rem;
}

/* Form */
.login-form { display: flex; flex-direction: column; gap: 1.1rem; }

.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
}
.form-group input {
  width: 100%;
  padding: .65rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-group input::placeholder { color: var(--subtle); }

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 2.75rem; }
.toggle-password {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: .25rem;
  transition: color .15s;
}
.toggle-password:hover { color: var(--text); }

.error-message {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #fecaca;
  border-radius: var(--radius-s);
  padding: .6rem .875rem;
  font-size: .85rem;
}

.btn-primary {
  width: 100%;
  padding: .72rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: .35rem;
  transition: background .15s, box-shadow .15s, transform .1s;
  box-shadow: 0 1px 2px rgba(37,99,235,.25);
}
.btn-primary:hover  { background: var(--blue-dark); box-shadow: 0 4px 14px rgba(37,99,235,.3); }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { opacity: .7; cursor: not-allowed; }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.demo-hint {
  margin-top: 1.25rem;
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: .5rem .875rem;
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════ */
.dashboard-page { display: flex; min-height: 100vh; background: var(--bg); }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand-logo {
  width: 130px;
  display: block;
  border-radius: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: .875rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .875rem;
  border-radius: var(--radius-s);
  color: #94a3b8;
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(37,99,235,.22); color: #93c5fd; }
.nav-item--disabled { opacity: .38; pointer-events: none; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: .875rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem .375rem .875rem;
}
.sidebar-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-name {
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
.sidebar-user-email {
  font-size: .72rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .575rem .875rem;
  background: rgba(220,38,38,.1);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,.18);
  border-radius: var(--radius-s);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar-logout:hover { background: rgba(220,38,38,.2); color: #f87171; }

/* ── Main content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2.25rem 2.5rem 3rem;
  min-width: 0;
}

.main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}
.page-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.03em;
}
.page-subtitle {
  font-size: .875rem;
  color: var(--muted);
  margin-top: .2rem;
}
.header-date {
  font-size: .8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .475rem .875rem;
  box-shadow: var(--shadow-s);
  white-space: nowrap;
}

/* ── Stats grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-l);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.375rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-m); transform: translateY(-1px); }

.stat-icon {
  width: 50px; height: 50px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-blue   { background: var(--blue-light);   color: var(--blue); }
.icon-green  { background: var(--green-light);  color: var(--green); }
.icon-orange { background: var(--orange-light); color: var(--orange); }
.icon-purple { background: var(--purple-light); color: var(--purple); }

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--text);
}
.stat-label {
  font-size: .775rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: .3rem;
  letter-spacing: .01em;
}
.stat-sub {
  font-size: .68rem;
  color: var(--subtle);
  margin-top: .15rem;
}

/* Skeleton shimmer */
.skeleton .stat-value,
.skeleton .stat-label {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-s);
  color: transparent;
  user-select: none;
}
.skeleton .stat-value { width: 70px; height: 1.7rem; }
.skeleton .stat-label { width: 110px; height: .8rem; margin-top: .45rem; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Table card ────────────────────────────────────────────── */
.table-card {
  background: var(--surface);
  border-radius: var(--radius-l);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.375rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.table-card-header h2 {
  font-size: .95rem;
  font-weight: 700;
}
.table-card-header p {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .2rem;
}

.table-controls { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

.search-box {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .475rem .875rem;
  transition: border-color .15s;
}
.search-box:focus-within { border-color: var(--blue); }
.search-box svg { color: var(--muted); flex-shrink: 0; }
.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: .84rem;
  color: var(--text);
  width: 170px;
}
.search-box input::placeholder { color: var(--subtle); }

.filter-select {
  padding: .475rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: .84rem;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.filter-select:focus { border-color: var(--blue); }

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

.customer-table {
  width: 100%;
  border-collapse: collapse;
}
.customer-table thead tr { border-bottom: 1px solid var(--border); }
.customer-table th {
  padding: .8rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.customer-table th:first-child { padding-left: 1.75rem; }
.customer-table th:last-child  { padding-right: 1.75rem; }

.customer-table td {
  padding: .9rem 1rem;
  font-size: .875rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.customer-table td:first-child { padding-left: 1.75rem; }
.customer-table td:last-child  { padding-right: 1.75rem; }
.customer-table tbody tr { transition: background .1s; }
.customer-table tbody tr:hover { background: #f8fafc; }
.customer-table tbody tr:last-child td { border-bottom: none; }

.table-placeholder { padding: 2.5rem !important; }
.placeholder-row {
  height: 1rem;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-s);
}

/* ── Customer cell ─────────────────────────────────────────── */
.cust-cell { display: flex; align-items: center; gap: .75rem; }
.cust-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
  font-size: .68rem;
  font-weight: 800;
  flex-shrink: 0;
}
.cust-name  { font-weight: 600; }
.cust-meta  { display: flex; align-items: center; gap: .4rem; margin-top: .1rem; }
.cust-email { font-size: .78rem; color: var(--muted); }
.cust-meta .badge { font-size: .64rem; padding: .15rem .45rem; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .275rem .65rem;
  border-radius: var(--radius-full);
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-elec   { background: #dbeafe; color: #1d4ed8; }
.badge-gas    { background: #fff7ed; color: #c2410c; }
.badge-both   { background: #f5f3ff; color: #6d28d9; }
.badge-active   { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #f1f5f9; color: #64748b; }

/* Source badges */
.badge-direct { background: #eff6ff; color: #2563eb; }
.badge-karma  { background: #fffbeb; color: #b45309; font-weight: 700; }

/* Service year badges */
.badge-y1      { background: #dcfce7; color: #15803d; }
.badge-y2      { background: #dbeafe; color: #1d4ed8; }
.badge-y3      { background: #fff7ed; color: #c2410c; }
.badge-expired { background: #f1f5f9; color: #94a3b8; }

/* ── Residual cell ──────────────────────────────────────────── */
.residual {
  font-weight: 700;
  color: var(--text);
  font-size: .9rem;
}
.residual--none { color: var(--subtle); font-weight: 400; }
.residual-period {
  font-size: .72rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: .1rem;
}

/* ── Activation cell ────────────────────────────────────────── */
.act-paid     { color: var(--green);  font-weight: 600; font-size: .875rem; }
.act-pending  { color: var(--amber);  font-weight: 600; font-size: .875rem; }
.act-forfeited{ color: var(--red);    font-weight: 500; font-size: .82rem;  }
.act-bonus    { color: var(--amber);  font-weight: 600; font-size: .875rem; }
.act-na       { color: var(--subtle); font-size: .875rem; }

.date-cell { color: var(--muted); font-size: .84rem; white-space: nowrap; }

/* ── Empty state ────────────────────────────────────────────── */
.table-empty {
  padding: 3.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .875rem;
  color: var(--muted);
}
.table-empty svg { opacity: .28; }
.table-empty p   { font-size: .875rem; }

/* ── Table footer ───────────────────────────────────────────── */
.table-footer {
  padding: .875rem 1.75rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.table-footer-divider { color: var(--border); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .main-content { padding: 1.5rem 1.25rem 2.5rem; }
  .table-card-header { flex-direction: column; }
  .table-controls { width: 100%; }
  .search-box input { width: 100%; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; max-width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .main-header { flex-direction: column; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 1.75rem 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════
   COMMISSIONS PAGE
   ═══════════════════════════════════════════════════════════ */

/* ── Section card (extends table-card) ─────────────────────── */
.section-card {
  background: var(--surface);
  border-radius: var(--radius-l);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.375rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.section-header h2 { font-size: .95rem; font-weight: 700; }
.section-header p  { font-size: .8rem; color: var(--muted); margin-top: .2rem; }

/* ── Generic commission table ───────────────────────────────── */
.comm-table { width: 100%; border-collapse: collapse; }
.comm-table thead tr { border-bottom: 1px solid var(--border); }
.comm-table th {
  padding: .8rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.comm-table th:first-child { padding-left: 1.75rem; }
.comm-table th:last-child  { padding-right: 1.75rem; }
.comm-table td {
  padding: .875rem 1rem;
  font-size: .875rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.comm-table td:first-child { padding-left: 1.75rem; }
.comm-table td:last-child  { padding-right: 1.75rem; }
.comm-table tbody tr { transition: background .1s; }
.comm-table tbody tr:hover { background: #f8fafc; }
.comm-table tbody tr:last-child td { border-bottom: none; }

/* Right-aligned numeric cells */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num-bold { font-weight: 700; }
.running-total { color: var(--green); font-weight: 700; }

/* Status badges for monthly table */
.badge-current { background: #dbeafe; color: #1d4ed8; }
.badge-paid    { background: #dcfce7; color: #15803d; }

/* ── Rate reference strip ───────────────────────────────────── */
.rate-reference {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .875rem 1.75rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}
.rate-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  align-self: center;
  margin-right: .25rem;
}
.rate-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}
.rate-pill strong { color: var(--text); }

/* ── Portfolio projection tiles ─────────────────────────────── */
.projection-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--border);
  gap: 1px;
  border-bottom: 1px solid var(--border);
}
.proj-tile {
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.proj-tile-value {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.03em;
}
.proj-tile-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: .3rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.proj-tile--y1    .proj-tile-value { color: var(--green); }
.proj-tile--y2    .proj-tile-value { color: var(--blue); }
.proj-tile--y3    .proj-tile-value { color: var(--orange); }
.proj-tile--total .proj-tile-value { color: var(--purple); }

/* ── Activation split layout ────────────────────────────────── */
.activation-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.activation-pane {
  padding: 1.25rem 1.75rem 1.5rem;
}
.activation-pane + .activation-pane {
  border-left: 1px solid var(--border);
}
.activation-pane h3 {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1rem;
}

/* Pending activation item */
.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1.5px solid #fde68a;
  border-radius: var(--radius);
  background: #fffbeb;
  margin-bottom: .6rem;
}
.pending-item-info  { display: flex; align-items: center; gap: .65rem; }
.pending-item-name  { font-weight: 600; font-size: .875rem; }
.pending-item-meta  { font-size: .76rem; color: var(--muted); margin-top: .1rem; }
.pending-item-right { text-align: right; flex-shrink: 0; }
.pending-item-amount { font-weight: 800; font-size: 1rem; color: var(--amber); }
.pending-days { font-size: .74rem; color: var(--amber); margin-top: .1rem; font-weight: 500; }

/* Paid history table (compact, no outer borders) */
.paid-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.paid-table td { padding: .6rem .5rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.paid-table tr:last-child td { border-bottom: none; }
.paid-table td:first-child { padding-left: 0; }

/* ── KARMA group header rows ────────────────────────────────── */
.karma-group-row > td {
  background: #f8fafc;
  padding: .6rem 1rem .6rem 1.75rem;
  border-bottom: 1px solid var(--border);
}
.karma-referrer-name  { font-size: .82rem; font-weight: 700; color: var(--text); }
.karma-referrer-email { font-size: .74rem; color: var(--muted); margin-top: .1rem; }

/* Bonus / credit status */
.bonus-paid       { color: var(--green);  font-weight: 600; font-size: .84rem; }
.bonus-pending    { color: var(--amber);  font-weight: 600; font-size: .84rem; }
.bonus-ineligible { color: var(--subtle); font-size: .82rem; }

/* ── Sub-section empty states ───────────────────────────────── */
.sub-empty {
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .84rem;
}

/* ── Commissions responsive ─────────────────────────────────── */
@media (max-width: 1100px) {
  .projection-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .activation-split { grid-template-columns: 1fr; }
  .activation-pane + .activation-pane { border-left: none; border-top: 1px solid var(--border); }
  .projection-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE NAVIGATION
   ═══════════════════════════════════════════════════════════ */

/* ── Mobile top bar ─────────────────────────────────────────── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  z-index: 200;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.hamburger-btn {
  position: absolute;
  left: .75rem;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: .4rem .5rem;
  border-radius: var(--radius-s);
  display: flex;
  align-items: center;
  transition: background .15s;
}
.hamburger-btn:hover { background: rgba(255,255,255,.1); }

.mobile-topbar-logo {
  height: 28px;
  border-radius: 3px;
  display: block;
}

/* ── Overlay backdrop ───────────────────────────────────────── */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,.55);
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-overlay.open { display: block; }

/* ── Slide-in drawer ────────────────────────────────────────── */
.mobile-nav-drawer {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(310px, 85vw);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.mobile-nav-overlay.open .mobile-nav-drawer {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.mobile-nav-header-logo {
  height: 30px;
  border-radius: 3px;
  display: block;
}
.mobile-nav-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: var(--radius-s);
  line-height: 1;
  transition: color .15s, background .15s;
}
.mobile-nav-close:hover { color: #fff; background: rgba(255,255,255,.1); }

.mobile-nav-list {
  flex: 1;
  overflow-y: auto;
  padding: .625rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.mobile-nav-section-label {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #475569;
  padding: .75rem .875rem .3rem;
}
.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 .875rem;
  min-height: 56px;
  border-radius: var(--radius-s);
  color: #94a3b8;
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
  box-sizing: border-box;
}
.mobile-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.mobile-nav-item.active { background: rgba(37,99,235,.22); color: #93c5fd; }

/* ── Drawer footer ──────────────────────────────────────────── */
.mobile-nav-footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: .875rem;
  flex-shrink: 0;
}
.mobile-nav-user {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .375rem .375rem .75rem;
}
.mobile-nav-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.mobile-nav-user-name  { font-size: .82rem; font-weight: 600; color: #fff; line-height: 1.2; }
.mobile-nav-user-email {
  font-size: .72rem; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px;
}
.mobile-nav-logout-btn {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .625rem .875rem;
  background: rgba(220,38,38,.1);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,.18);
  border-radius: var(--radius-s);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.mobile-nav-logout-btn:hover { background: rgba(220,38,38,.2); color: #f87171; }

/* ── Show on mobile ─────────────────────────────────────────── */
@media (max-width: 767px) {
  .mobile-topbar { display: flex; }
  .main-content  { padding-top: calc(56px + 1.5rem); }
}
