/* =====================================================
   FORYOU MLM - Modern App Theme
   Signature: 3D tilting membership/wallet card
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --emerald-950: #071410;
  --emerald-900: #0B3D2E;
  --emerald-700: #0E7A4C;
  --emerald-500: #16A365;
  --emerald-400: #22C55E;
  --gold-500: #D4A72C;
  --gold-300: #E8C766;

  --bg-page: #F4F8F6;
  --bg-card: #ffffff;
  --text-dark: #0A1F16;
  --text-muted: #4B6459;
  --text-on-dark: #FFFFFF;
  --text-on-dark-muted: #B9D9C7;

  --border-soft: #E3ECE7;
  --danger: #E1493F;
  --warning: #D98A17;
  --info: #2F6FED;

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

  --shadow-soft: 0 8px 30px rgba(11, 61, 46, 0.08);
  --shadow-card: 0 4px 18px rgba(11, 61, 46, 0.06);

  --sidebar-width: 260px;
  --bottom-nav-height: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: 'Sora', sans-serif; letter-spacing: -0.01em; color: var(--text-dark); font-weight: 700; }
.mono { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }
a { text-decoration: none; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Auth pages: ambient gradient + blobs ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 20% 20%, #0E7A4C 0%, #071812 55%, #050f0c 100%);
  padding: 24px;
}

.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.45; animation: drift 16s ease-in-out infinite; }
.blob-1 { width: 380px; height: 380px; background: var(--gold-500); top: -120px; left: -100px; }
.blob-2 { width: 320px; height: 320px; background: var(--emerald-400); bottom: -100px; right: -80px; animation-delay: 4s; }
.blob-3 { width: 220px; height: 220px; background: #1fa8e0; top: 40%; right: 10%; animation-delay: 8s; opacity: 0.25; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -25px) scale(1.08); }
}

.auth-box {
  position: relative; z-index: 2;
  width: 400px; max-width: 92vw;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 40px 34px; text-align: center;
  color: var(--text-on-dark);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-box .logo-mark {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 21px;
  color: var(--emerald-950);
  box-shadow: 0 8px 20px rgba(212, 167, 44, 0.35);
}

.auth-box h1 { font-size: 25.5px; font-weight: 700; margin-bottom: 2px; color: #fff; }
.auth-box p.subtitle { color: var(--text-on-dark-muted); margin-bottom: 26px; font-size: 15px; }

.form-group { text-align: left; margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text-on-dark-muted); }

.form-group input {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius-sm);
  font-size: 15.5px; color: #fff;
  transition: border-color 0.2s, background 0.2s;
}
.form-group input::placeholder { color: rgba(255,255,255,0.35); }
.form-group input:focus { outline: none; border-color: var(--gold-500); background: rgba(255,255,255,0.12); }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-700));
  color: #fff; border: none; padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 16.5px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 8px 22px rgba(14, 122, 76, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.auth-links { margin-top: 18px; font-size: 14.5px; color: var(--text-on-dark-muted); }
.auth-links a { color: var(--gold-300); font-weight: 500; }

/* ---------- Show/Hide password toggle ---------- */
.password-field { position: relative; }
.password-field input { padding-right: 44px !important; }
.toggle-password-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-on-dark-muted); border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.toggle-password-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.toggle-password-btn svg { width: 18px; height: 18px; }
.toggle-password-btn .eye-hide { display: none; }

/* Light-background forms (My Account, Add Member, etc.) need a darker icon */
.field .toggle-password-btn { color: var(--text-muted); }
.field .toggle-password-btn:hover { color: var(--text-dark); background: #F0F5F2; }

.alert-error {
  background: rgba(225, 73, 63, 0.15); border: 1px solid rgba(225, 73, 63, 0.35);
  color: #ff9a92; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14.5px; margin-bottom: 16px; text-align: left;
}
.alert-success {
  background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.35);
  color: #7de3a4; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14.5px; margin-bottom: 16px; text-align: left;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width); flex-shrink: 0;
  background: linear-gradient(180deg, var(--emerald-950) 0%, #0a2c21 100%);
  color: var(--text-on-dark);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 4px;
}

.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 19px;
  padding: 6px 10px 22px; color: #fff;
}
.sidebar .brand .logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 16.5px; font-weight: 800; color: var(--emerald-950);
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text-on-dark-muted); font-size: 15px; font-weight: 500;
  position: relative;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; transform: translateX(2px); }
.sidebar nav a.active { background: rgba(212, 167, 44, 0.12); color: var(--gold-300); }
.sidebar nav a.active::before {
  content: ''; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 20px; border-radius: 4px;
  background: var(--gold-500); box-shadow: 0 0 12px var(--gold-500);
}

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

.topbar {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 14px 28px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 10;
}

.user-chip { font-size: 15px; color: var(--text-muted); font-weight: 500; }
.user-chip strong { color: var(--text-dark); }
.logout-btn {
  color: var(--danger); font-size: 14.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(225,73,63,0.25);
  transition: background 0.15s ease;
}
.logout-btn:hover { background: rgba(225,73,63,0.08); }

.content-area { padding: 24px 28px 100px; max-width: 1100px; width: 100%; margin: 0 auto; }

/* ---------- Signature: 3D tilt wallet/membership card ---------- */
.tilt-stage { perspective: 1200px; margin-bottom: 26px; }

.wallet-card {
  position: relative; border-radius: 24px;
  padding: 26px 26px 22px; min-height: 190px; color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(212,167,44,0.35), transparent 55%),
    linear-gradient(135deg, var(--emerald-900) 0%, var(--emerald-700) 55%, var(--emerald-950) 100%);
  box-shadow: 0 20px 45px rgba(11, 61, 46, 0.35);
  overflow: hidden; transform-style: preserve-3d;
  transition: transform 0.12s ease-out; will-change: transform;
  animation: cardIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) rotateX(8deg); }
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

.wallet-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.22) 50%, transparent 60%);
  background-size: 250% 250%;
  animation: sheen 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen {
  0% { background-position: 200% 0%; }
  55%, 100% { background-position: -50% 0%; }
}

.wallet-card .card-top { display: flex; justify-content: space-between; align-items: flex-start; transform: translateZ(30px); }
.wallet-card .card-label { font-size: 13.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-on-dark-muted); }
.wallet-card .chip {
  width: 38px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}

.wallet-card .balance {
  font-family: 'IBM Plex Mono', monospace; font-size: 35px; font-weight: 600;
  margin-top: 18px; transform: translateZ(40px); font-variant-numeric: tabular-nums;
}

.wallet-card .card-bottom { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 22px; transform: translateZ(25px); }
.wallet-card .member-id { font-family: 'IBM Plex Mono', monospace; font-size: 14.5px; letter-spacing: 0.08em; color: var(--text-on-dark-muted); }
.wallet-card .member-name { font-size: 14px; color: var(--text-on-dark-muted); margin-top: 2px; }
.wallet-card .brand-mark { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 16.5px; letter-spacing: 0.02em; color: var(--gold-300); }

/* ---------- Stat chips ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 26px;
}

.summary-card {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-md); padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  opacity: 0; animation: fadeUp 0.5s ease forwards;
}
.summary-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }

.card-grid .summary-card:nth-child(1) { animation-delay: 0.05s; }
.card-grid .summary-card:nth-child(2) { animation-delay: 0.1s; }
.card-grid .summary-card:nth-child(3) { animation-delay: 0.15s; }
.card-grid .summary-card:nth-child(4) { animation-delay: 0.2s; }
.card-grid .summary-card:nth-child(5) { animation-delay: 0.25s; }
.card-grid .summary-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.summary-card .label { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }
.summary-card .value { font-family: 'IBM Plex Mono', monospace; font-size: 23.5px; font-weight: 600; color: var(--emerald-900); }

.section-title { font-size: 16.5px; font-weight: 700; margin: 30px 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-500); }

.hint-text { color: var(--text-muted); font-size: 14.5px; line-height: 1.6; }

/* ---------- Bottom nav (mobile app feel) ---------- */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-soft);
  z-index: 20; justify-content: space-around; align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  padding: 6px 12px; border-radius: 12px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.bottom-nav a svg { width: 20px; height: 20px; }
.bottom-nav a.active { color: var(--emerald-700); transform: translateY(-2px); }
.bottom-nav a.active svg { filter: drop-shadow(0 2px 6px rgba(14,122,76,0.4)); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .content-area { padding: 18px 16px calc(var(--bottom-nav-height) + 24px); }
  .topbar { padding: 14px 18px; }
  .wallet-card .balance { font-size: 29px; }
}

/* =====================================================
   Admin UI Kit - Phase 3 (forms, tables, badges, buttons)
   ===================================================== */

.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 { margin: 0; font-size: 22.5px; }
.page-header p { margin: 4px 0 0; color: var(--text-muted); font-size: 14.5px; }

.page-alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 15px; margin-bottom: 20px;
  animation: fadeUp 0.4s ease both;
}
.page-alert-success { background: #E9F7EF; color: var(--emerald-700); border: 1px solid #BFE6D0; }
.page-alert-error { background: #FDECEC; color: var(--danger); border: 1px solid #F5C6C2; }

.panel {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  padding: 22px 24px; margin-bottom: 24px;
}
.panel h3 { margin: 0 0 16px; font-size: 16.5px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.field { text-align: left; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field .hint { display: block; font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 400; }

.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  font-size: 15px; font-family: 'Inter', sans-serif; color: var(--text-dark);
  background: #fbfdfc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(22, 163, 101, 0.12);
}

.radio-group { display: flex; gap: 16px; margin-top: 4px; }
.radio-group label { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: var(--text-dark); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; border: none;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-emerald { background: linear-gradient(135deg, var(--emerald-500), var(--emerald-700)); color: #fff; box-shadow: 0 6px 16px rgba(14,122,76,0.25); }
.btn-emerald:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-outline { background: transparent; border: 1px solid var(--border-soft); color: var(--text-dark); }
.btn-outline:hover { background: #F4F8F6; }
.btn-danger-outline { background: transparent; border: 1px solid #F5C6C2; color: var(--danger); }
.btn-danger-outline:hover { background: #FDECEC; }
.btn-gold { background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: var(--emerald-950); }
.btn-gold:hover { transform: translateY(-1px); filter: brightness(1.05); }

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

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border-soft); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--bg-card); }
table.data-table th {
  text-align: left; padding: 13px 16px; background: #F4F8F6;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 700; white-space: nowrap;
}
table.data-table td { padding: 13px 16px; border-top: 1px solid var(--border-soft); vertical-align: middle; white-space: nowrap; }
table.data-table tbody tr { transition: background 0.15s ease; }
table.data-table tbody tr:hover { background: #FAFCFB; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.badge-active { background: #E9F7EF; color: var(--emerald-700); }
.badge-active::before { background: var(--emerald-500); }
.badge-inactive, .badge-blocked { background: #FDECEC; color: var(--danger); }
.badge-inactive::before, .badge-blocked::before { background: var(--danger); }
.badge-pending { background: #FEF3E0; color: var(--warning); }
.badge-pending::before { background: var(--warning); }
.badge-paid, .badge-completed { background: #E9F7EF; color: var(--emerald-700); }
.badge-paid::before, .badge-completed::before { background: var(--emerald-500); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 15px; }

.search-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-bar input { flex: 1; min-width: 180px; padding: 11px 15px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); font-size: 15px; }

.user-found-card {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, #0B3D2E, #0E7A4C); color: #fff;
  border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 18px;
  animation: fadeUp 0.4s ease both;
}
.user-found-card .name { font-weight: 700; font-size: 16.5px; }
.user-found-card .meta { font-size: 14px; color: var(--text-on-dark-muted); margin-top: 2px; }

/* ---------- Table toolbar (search + export) - Phase 9 ---------- */
.table-toolbar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap;
}
.table-toolbar .table-search-input {
  flex: 1; min-width: 180px; padding: 9px 14px;
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  font-size: 15px; background: #fbfdfc;
}
.table-toolbar .table-search-input:focus {
  outline: none; border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(22, 163, 101, 0.12);
}
.btn-export {
  background: #F4F8F6; border: 1px solid var(--border-soft); color: var(--text-dark);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-export:hover { background: #ECF3EF; }
.btn-export svg { width: 14px; height: 14px; }

/* ---------- Mobile topbar overflow fix - Phase 9 ---------- */
@media (max-width: 480px) {
  .topbar { gap: 10px; }
  .user-chip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .logout-btn { flex-shrink: 0; }
}

/* =====================================================
   Dashboard 2.0 — gradient tiles, dark chart cards, referral box
   ===================================================== */

.tile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 22px;
}

.stat-tile {
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  color: #fff;
  min-height: 132px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 14px 30px rgba(11, 61, 46, 0.18);
  opacity: 0; animation: fadeUp 0.5s ease forwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-tile:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(11, 61, 46, 0.24); }
.tile-grid .stat-tile:nth-child(1) { animation-delay: 0.05s; }
.tile-grid .stat-tile:nth-child(2) { animation-delay: 0.12s; }
.tile-grid .stat-tile:nth-child(3) { animation-delay: 0.19s; }
.tile-grid .stat-tile:nth-child(4) { animation-delay: 0.26s; }

.stat-tile::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 90% -10%, rgba(255,255,255,0.28), transparent 55%);
  pointer-events: none;
}

.stat-tile-emerald { background: linear-gradient(135deg, var(--emerald-500), var(--emerald-900)); }
.stat-tile-gold { background: linear-gradient(135deg, var(--gold-300), #C98A1C); color: var(--emerald-950); }
.stat-tile-teal { background: linear-gradient(135deg, #17B6A6, #0B6E82); }
.stat-tile-violet { background: linear-gradient(135deg, #7C6CF0, #4A3AA8); }

.stat-tile .tile-label { font-size: 14px; opacity: 0.85; font-weight: 600; letter-spacing: 0.02em; }
.stat-tile .tile-value {
  font-family: 'IBM Plex Mono', monospace; font-size: 29px; font-weight: 600;
  margin-top: 10px; font-variant-numeric: tabular-nums;
}
.stat-tile .tile-sub { font-size: 13px; opacity: 0.75; margin-top: 6px; }
.stat-tile .tile-icon {
  position: absolute; top: 18px; right: 20px;
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
}
.stat-tile .tile-icon svg { width: 17px; height: 17px; }

/* ---------- Referral box ---------- */
.referral-box {
  background: linear-gradient(120deg, var(--emerald-950), var(--emerald-900) 60%, #0a2c21);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  box-shadow: 0 14px 30px rgba(11, 61, 46, 0.2);
  animation: fadeUp 0.5s ease both;
}
.referral-box .referral-text { flex: 1; min-width: 200px; color: #fff; }
.referral-box .referral-text .title { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.referral-box .referral-text .desc { font-size: 13.5px; color: var(--text-on-dark-muted); }
.referral-box .referral-input-group {
  display: flex; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius-sm); overflow: hidden; flex: 1.4; min-width: 240px;
}
.referral-box .referral-input-group input {
  flex: 1; background: transparent; border: none; color: #fff;
  padding: 10px 14px; font-size: 14px; font-family: 'IBM Plex Mono', monospace;
}
.referral-box .referral-input-group input:focus { outline: none; }
.copy-btn {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  color: var(--emerald-950); border: none; padding: 0 18px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover { filter: brightness(1.08); }
.copy-btn:active { transform: scale(0.96); }
.copy-btn.copied { background: linear-gradient(135deg, var(--emerald-400), var(--emerald-700)); color: #fff; }

/* ---------- Dark chart cards ---------- */
.chart-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px; margin-bottom: 8px;
}
.chart-grid.chart-grid-wide { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 900px) { .chart-grid.chart-grid-wide { grid-template-columns: 1fr; } }

.chart-card {
  background: linear-gradient(160deg, var(--emerald-950) 0%, #0d3327 100%);
  border-radius: var(--radius-lg);
  padding: 20px 20px 12px;
  color: #fff;
  box-shadow: 0 14px 30px rgba(11, 61, 46, 0.18);
  opacity: 0; animation: fadeUp 0.55s ease forwards;
  animation-delay: 0.1s;
}
.chart-card .chart-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.chart-card .chart-card-title { font-size: 15px; font-weight: 700; }
.chart-card .chart-card-meta { font-size: 12.5px; color: var(--text-on-dark-muted); }
.chart-card .chart-canvas-wrap { position: relative; height: 220px; }
.chart-card .chart-canvas-wrap.short { height: 190px; }

.legend-dots { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.legend-dots .legend-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-on-dark-muted); }
.legend-dots .legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.donut-with-legend { display: flex; align-items: center; gap: 18px; }
.donut-with-legend .chart-canvas-wrap { flex: 1; }
