/* ==========================================================================
   NewTech LLC — MLM Web App  ·  Core (tokens, base, layout)
   ========================================================================== */

:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg: #f5f7ff;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --surface-3: #eef1fb;
  --border: #e7eaf8;
  --border-strong: #d6dbf0;
  --text: #171c35;
  --text-2: #4a5478;
  --text-3: #8c96bc;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-2: #7c3aed;
  --primary-soft: #eef2ff;
  --primary-soft-border: #dbe4ff;
  --on-primary: #ffffff;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --success-soft-border: #d1fae5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --warning-soft-border: #fde68a;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --danger-soft-border: #fecaca;
  --info: #0ea5e9;
  --info-soft: #f0f9ff;
  --info-soft-border: #bae6fd;
  --muted: #64748b;

  --hero-gradient: linear-gradient(120deg, #2563eb 0%, #7c3aed 50%, #ef4444 100%);
  --hero-glow: 0 18px 44px -16px rgba(124, 58, 237, .50);

  --shadow-sm: 0 1px 2px rgba(60, 70, 150, .06);
  --shadow: 0 2px 6px rgba(60, 70, 150, .06), 0 14px 34px -14px rgba(70, 80, 180, .20);
  --shadow-lg: 0 28px 64px -24px rgba(70, 80, 180, .30);
  --ring: 0 0 0 3px rgba(15, 23, 42, .10);

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;

  --sidebar-w: 264px;
  --topbar-h: 64px;
  --mobile-nav-h: 64px;

  --accent-1: #2563eb; --accent-1-soft: #eef2ff;
  --accent-2: #ef4444; --accent-2-soft: #fef2f2;
  --accent-3: #f59e0b; --accent-3-soft: #fffbeb;
  --accent-4: #10b981; --accent-4-soft: #ecfdf5;
  --accent-5: #ec4899; --accent-5-soft: #fdf0f7;
}

html { color-scheme: light; scroll-behavior: smooth; }

.ntc-app {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 700px at -6% -6%, rgba(224, 231, 255, .85), transparent 60%),
    radial-gradient(900px 640px at 106% -4%, rgba(253, 235, 248, .8), transparent 60%),
    radial-gradient(1100px 800px at 55% 118%, rgba(232, 250, 244, .85), transparent 60%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ntc-app input, .ntc-app select, .ntc-app textarea, .ntc-app button { font-family: inherit; }

.ntc-app *, .ntc-app *::before, .ntc-app *::after { box-sizing: border-box; }
.ntc-app img { max-width: 100%; }

/* Icons never show a focus/border box when clicked. */
.ntc-app * { -webkit-tap-highlight-color: transparent; }
.ntc-app button:focus, .ntc-app a:focus, .ntc-app .icon-btn:focus, .ntc-app .btn:focus, .ntc-app .avatar:focus, .ntc-app [tabindex]:focus { outline: none !important; box-shadow: none !important; }

/* ---------- Icons ---------- */
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; fill: none !important; stroke: currentColor !important; display: inline-block !important; visibility: visible !important; }
.icon path, .icon circle, .icon rect, .icon line { stroke: currentColor !important; fill: none !important; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

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

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 60;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary);
  background: transparent; border-radius: 0; box-shadow: none;
}
.brand-mark .icon { width: 26px; height: 26px; }
.brand-mark-lg { font-size: 24px; }
.brand-mark-lg .icon { width: 34px; height: 34px; }
.brand-logo { height: 38px; width: auto; }
.brand-name { font-weight: 700; font-size: 17px; }

.sidebar-close { display: none !important; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-item .icon { opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.active .icon { opacity: 1; }

.sidebar-footer { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.sidebar-user-meta { min-width: 0; }
.sidebar-user-meta strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-meta span { font-size: 12px; color: var(--text-3); letter-spacing: 1px; }

.sidebar-backdrop { display: none; }

/* ---------- Main area ---------- */
.app-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
}
.menu-toggle { display: none !important; }
.page-title h1 { font-size: 17px; font-weight: 700; margin: 0; }

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

/* ---------- Announcement ticker ---------- */
.ntc-ticker {
  position: sticky; top: var(--topbar-h); z-index: 49;
  display: flex; align-items: center;
  height: 40px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  padding: 0 26px;
}
.ntc-ticker-label {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  margin-right: 18px; padding: 3px 10px;
  border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .12em;
}
.ntc-ticker-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; animation: ntc-pulse 1.2s ease-in-out infinite;
}
@keyframes ntc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.7); }
}
.ntc-ticker-viewport { flex: 1; min-width: 0; overflow: hidden; }
.ntc-ticker-track {
  display: inline-flex; align-items: center;
  gap: 42px; white-space: nowrap;
  will-change: transform;
  animation: ntc-ticker-scroll 30s linear infinite;
}
.ntc-ticker:hover .ntc-ticker-track { animation-play-state: paused; }
@keyframes ntc-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ntc-ticker-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
}
.ntc-ticker-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.ntc-ticker-normal .ntc-ticker-dot { background: var(--primary); }
.ntc-ticker-important .ntc-ticker-dot { background: #f59e0b; }
.ntc-ticker-important { color: #d97706; font-weight: 600; }
.ntc-ticker-urgent .ntc-ticker-dot { background: var(--danger); }
.ntc-ticker-urgent { color: var(--danger); font-weight: 600; }
@media (max-width: 600px) {
  .ntc-ticker { height: 38px; padding: 0 14px; }
  .ntc-ticker-label { margin-right: 10px; padding: 2px 8px; font-size: 10px; }
  .ntc-ticker-item { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ntc-ticker-track { animation: none !important; }
}

.main-content { flex: 1; padding: 26px 28px 40px; width: 100%; max-width: 1280px; margin: 0 auto; }

/* ---------- Topbar user menu ---------- */
.user-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent !important; border: none !important; cursor: pointer;
  padding: 0; border-radius: 50%;
  color: var(--text) !important;
  transition: opacity .15s ease;
}
.user-menu-btn:hover { background: transparent !important; opacity: .8; }
.user-menu-btn .avatar { cursor: pointer; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--border); }
.user-menu-btn .avatar:hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }

.icon-btn {
  border: none !important; background: transparent !important;
  color: var(--text-2) !important; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px;
  transition: color .15s ease;
  position: relative;
}
.icon-btn .icon { width: 21px; height: 21px; }
.icon-btn:hover { background: transparent !important; color: var(--text) !important; }
.icon-btn:active { transform: scale(.92); }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: none; border-radius: 9px;
  background: var(--surface-2); color: var(--primary); cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.btn-icon .icon { width: 16px; height: 16px; }
.btn-icon:hover { background: var(--primary-soft); color: var(--primary); }
.btn-icon:active { transform: scale(.92); }
.breakdown-table { min-width: 0 !important; }
.breakdown-table td { vertical-align: middle; }

.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

/* ---------- Mobile nav ---------- */
.mobile-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  height: var(--mobile-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, .06);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--text-3); text-decoration: none;
}
.mobile-nav-item .icon { width: 22px; height: 22px; }
.mobile-nav-item.active { color: var(--primary); }

/* ---------- Views ---------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.view-head p { margin: 4px 0 0; color: var(--text-2); }

/* ---------- Stat grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- Generic grid ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }

/* ---------- Auth ---------- */
.ntc-app-auth {
  background:
    radial-gradient(1000px 700px at 88% -10%, rgba(236, 72, 153, .12), transparent 60%),
    radial-gradient(900px 640px at -8% 20%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(1000px 700px at 50% 130%, rgba(16, 185, 129, .12), transparent 60%),
    var(--bg);
}
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; gap: 26px; }
.auth-brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.auth-brand .brand-mark { margin-bottom: 4px; }
.auth-company { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.auth-tagline { margin: 0; color: var(--text-2); font-size: 14px; }
.auth-logo { height: 56px; width: auto; }
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}
.auth-tabs { display: flex; background: var(--surface-3); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; border: none !important; background: transparent !important; padding: 10px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--text-2) !important; cursor: pointer; transition: all .15s ease; font-family: inherit; }
.auth-tab.active { background: var(--surface) !important; color: var(--primary) !important; box-shadow: var(--shadow-sm); }
.auth-pane { display: none; }
.auth-pane.active { display: block; animation: ntcFadeIn .25s ease; }
@keyframes ntcFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.auth-head { margin-bottom: 20px; }
.auth-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.auth-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 18px; }
.auth-foot { text-align: center; margin-top: 20px; }
.center { text-align: center; }
.sponsor-alert { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }

/* ==========================================================================
   Chart
   ========================================================================== */
.chart-wrap { position: relative; height: 300px; }
.line-chart { width: 100%; height: 100%; display: block; }
.chart-tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--text); color: var(--surface);
  font-size: 12px; padding: 8px 12px; border-radius: 10px;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -110%);
  white-space: nowrap;
}
.chart-tooltip b { display: block; font-size: 13px; margin-bottom: 2px; }
.chart-tooltip span { display: block; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0 4px; font-size: 13px; color: var(--text-2); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.dot-income { background: var(--accent-1); }
.dot-withdraw { background: var(--accent-4); }
.dot-net { background: var(--accent-3); }
.legend-item { display: inline-flex; align-items: center; }

/* ---------- Network summary ---------- */
.network-summary { display: flex; flex-direction: column; gap: 2px; }
.net-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 2px; border-bottom: 1px solid var(--border); }
.net-row:last-child { border-bottom: none; }
.net-row strong { font-size: 17px; }
.net-total strong { font-size: 20px; color: var(--primary); }
.net-level { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.level-dot { width: 10px; height: 10px; border-radius: 4px; display: inline-block; }
.level-1 { background: var(--accent-1); }
.level-2 { background: var(--accent-2); }
.level-3 { background: var(--accent-4); }

/* ==========================================================================
   Wallet hero
   ========================================================================== */
.wallet-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background:
    radial-gradient(600px 300px at 88% -20%, rgba(255, 235, 246, .4), transparent 65%),
    radial-gradient(500px 300px at -5% 130%, rgba(255, 255, 255, .22), transparent 60%),
    var(--hero-gradient);
  border-radius: var(--radius-lg);
  padding: 30px 32px; color: #fff; margin-bottom: 24px;
  box-shadow: var(--hero-glow);
}
.wallet-label { font-size: 14px; opacity: .9; display: block; letter-spacing: .02em; }
.wallet-amount { font-size: 40px; font-weight: 800; letter-spacing: -.03em; display: block; line-height: 1.1; text-shadow: 0 2px 18px rgba(0, 0, 0, .12); }
.wallet-note { font-size: 13px; opacity: .9; }
.wallet-actions .btn { background: #fff; color: #4f46e5; box-shadow: 0 8px 22px -6px rgba(31, 27, 90, .35); }
.wallet-actions .btn:hover { background: #fff; color: #4338ca; transform: translateY(-1px); }

/* ==========================================================================
   Referrals
   ========================================================================== */
.referral-link-row { display: flex; gap: 12px; align-items: center; }
.referral-link {
  flex: 1; padding: 14px 16px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--surface-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 14px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.referral-code-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 14px; }

/* ==========================================================================
   Profile
   ========================================================================== */
.profile-hero { display: flex; align-items: center; gap: 22px; padding: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.profile-avatar-wrap { position: relative; cursor: pointer; border-radius: 50%; }
.profile-hero .avatar-xl { width: 76px; height: 76px; border-radius: 50%; }
.profile-hero .avatar-empty { background: var(--surface-3); color: var(--primary); }
.profile-hero .avatar-empty .icon { width: 22px; height: 22px; }
.profile-hero .avatar-empty.has-img .icon { display: none; }
.avatar-hover-cam { position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,.4); color: #fff; opacity: 0; transition: opacity .15s ease; pointer-events: none; }
.avatar-hover-cam .icon { width: 22px; height: 22px; }
.profile-avatar-wrap:hover .avatar-hover-cam, .profile-avatar-wrap:focus-visible .avatar-hover-cam { opacity: 1; }
.profile-hero-info { flex: 1; min-width: 220px; }
.profile-hero-info h3 { margin: 0 0 2px; font-size: 20px; font-weight: 800; }
.profile-meta { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.profile-facts { display: flex; flex-direction: column; gap: 10px; }
.profile-fact { display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 14px; }
.profile-fact span { color: var(--text-2); }

/* ---------- Withdraw form ---------- */
.withdraw-balance {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px;
}
.withdraw-balance span { color: var(--text-2); }
.withdraw-balance strong { font-size: 22px; }

/* ==========================================================================
   Pricing
   ========================================================================== */
.current-package { display: flex; align-items: center; gap: 16px; padding: 20px 24px; margin-bottom: 22px; }
.current-package-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.current-package-icon .icon { width: 26px; height: 26px; }
.current-package-info { flex: 1; }
.current-package-info h3 { margin: 0; font-size: 18px; }
.current-package-info p { margin: 2px 0 0; color: var(--text-2); }
.current-package-status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 340px)); gap: 18px; margin-bottom: 22px; justify-content: center; }
.pricing-card { padding: 24px; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.pricing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pricing-current { border: 2px solid var(--primary); }
.pricing-head h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }

.pricing-type { display:inline-block; font-size:12px; font-weight:600; padding:3px 10px; border-radius:999px; margin-bottom:10px; text-transform:capitalize; }
.pricing-type-package { background:#eef2ff; color:#4338ca; }
.pricing-type-subscription { background:#fef3c7; color:#92400e; }
.pricing-type-membership { background:#ecfdf5; color:#047857; }

.ntc-paydone { position:fixed; left:50%; top:18px; transform:translateX(-50%); z-index:99999; background:#dcfce7; color:#166534; border:1px solid #86efac; padding:12px 18px; border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.15); font-weight:600; max-width:90vw; text-align:center; }

/* Self-hosted gateway deposit view */
.deposit-card { max-width:560px; margin:0 auto; }
.deposit-loading { padding:30px; text-align:center; color:#64748b; }
.deposit-head { margin-bottom:14px; }
.deposit-row { display:flex; justify-content:space-between; gap:16px; padding:10px 0; border-bottom:1px solid #eef2f7; }
.deposit-row:last-of-type { border-bottom:none; }
.deposit-label { color:#64748b; font-size:13px; }
.deposit-value { font-weight:600; text-align:right; }
.deposit-mono { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12px; word-break:break-all; }
.deposit-address-wrap { margin:16px 0; }
.deposit-address { background:#0f172a; color:#e2e8f0; padding:14px 16px; border-radius:10px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:13px; word-break:break-all; margin-bottom:8px; }
.deposit-note { color:#64748b; font-size:13px; margin-top:14px; }
.status-badge { display:inline-block; font-size:12px; font-weight:700; padding:3px 10px; border-radius:999px; }
.status-success { background:#dcfce7; color:#166534; }
.status-warning { background:#fef3c7; color:#92400e; }
.status-info { background:#dbeafe; color:#1e40af; }
.status-muted { background:#e2e8f0; color:#475569; }
.pricing-price { display: flex; align-items: baseline; gap: 4px; }
.price-currency { font-size: 20px; font-weight: 700; color: var(--text-2); }
.price-amount { font-size: 36px; font-weight: 800; letter-spacing: -.03em; }
.pricing-features { list-style: none; margin: 18px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pricing-features li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.pricing-features .icon { width: 17px; height: 17px; color: var(--success); }

/* ==========================================================================
   Theme picker (settings)
   ========================================================================== */
.theme-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-option {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; font-family: inherit; font-weight: 600; font-size: 14px; color: var(--text);
  transition: all .15s ease;
}
.theme-option:hover { border-color: var(--primary); }
.theme-option.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.theme-option-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; }

.settings-list { display: flex; flex-direction: column; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 2px; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row span { color: var(--text-2); }
.settings-label { display: flex; flex-direction: column; gap: 2px; }
.settings-label strong { font-weight: 600; color: var(--text); }
.settings-label small { color: var(--text-2); font-size: 12.5px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; margin-left: 18px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .18s ease, border-color .18s ease; cursor: pointer; }
.slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s ease; }
.switch input:checked + .slider { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ==========================================================================
   Genealogy tree (binary layout)
   ========================================================================== */
.tree-card-wrap { overflow: hidden; position: relative; }
.tree-scroller {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tree-scroller::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Animated side arrows to hint the tree scrolls horizontally. */
.ntc-app .tree-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 28px; height: 28px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-2);
  font-size: 30px; font-weight: 700; line-height: 1;
  font-family: inherit;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 0 3px;
  text-shadow: 0 1px 2px rgba(255,255,255,.8), 0 2px 6px rgba(15,23,42,.25);
  transition: color .15s ease;
}
.ntc-app .tree-nav-arrow:hover { color: var(--primary); background: transparent !important; }
.ntc-app .tree-nav-arrow:focus { background: transparent !important; box-shadow: none !important; }
.tree-nav-left { left: 10px; animation: ntcNudge 1.6s ease-in-out infinite; }
.tree-nav-right { right: 10px; animation: ntcNudgeR 1.6s ease-in-out infinite; }
.tree-nav-arrow.is-visible { display: inline-flex; }
.tree-nav-arrow.is-hidden { display: none; }

@keyframes ntcNudge {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(-50%) translateX(-4px); }
}
@keyframes ntcNudgeR {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(-50%) translateX(4px); }
}

.tree-root {
  padding: 14px 8px 18px;
  min-width: max-content;
  position: relative;
}
.tree-root::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  background:
    radial-gradient(1200px 300px at 50% -40px, var(--primary-soft, rgba(99,102,241,.14)), transparent 70%),
    radial-gradient(900px 260px at 85% 110%, var(--secondary-soft, rgba(168,85,247,.10)), transparent 70%);
  pointer-events: none;
}
.tree-level { position: relative; }
.tree-level, .tree-children { list-style: none; margin: 0; padding: 0; }

/* Level-by-level pyramid: each generation is a centered flex row. */
.tree-level { display: flex; justify-content: center; }
.tree-children {
  display: none;
  justify-content: center;
  align-items: flex-start;
  margin-top: 14px;
  position: relative;
  padding-top: 4px;
}
.tree-node.expanded > .tree-children,
.tree-node .tree-children.open { display: flex; }

.tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 0 7px;
}

/* ---- Connector lines ---------------------------------------------------
   1) vertical drop from the parent card into the children row,
   2) horizontal "elbow" from each child centre to its neighbours,
   3) tiny vertical from the elbow down to the child card. */
.tree-node > .tree-children::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  width: 0;
  height: 12px;
  border-left: 1.5px solid var(--border-strong);
}
.tree-node > .tree-children::after {
  content: '';
  position: absolute;
  top: -17px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--border-strong);
}
.tree-children .tree-node::before,
.tree-children .tree-node::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 50%;
  height: 4px;
  border-top: 1.5px solid var(--border-strong);
}
.tree-children .tree-node::before { left: 0; border-right: 1.5px solid var(--border-strong); }
.tree-children .tree-node::after  { right: 0; }

/* ---- Member card ---- */
.tree-card {
  background: transparent; border: none; border-radius: 50%;
  padding: 3px; cursor: pointer; position: relative; z-index: 1;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
}
.tree-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15,23,42,.12);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tree-card:hover::before { transform: scale(1.1); box-shadow: 0 4px 12px rgba(15,23,42,.16); }

.tree-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background-color: var(--primary-soft, rgba(99,102,241,.12));
  background-size: cover; background-position: center;
  color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 10px; flex: none;
  border: 2px solid var(--border);
  position: relative; z-index: 1;
  transition: border-color .15s ease;
}
.tree-card:hover .tree-avatar { border-color: var(--primary); }
.tree-node[data-status="active"] .tree-avatar { border-color: var(--success, #16a34a); }
.tree-node[data-status="pending"] .tree-avatar { border-color: var(--warning, #d97706); }

/* Gentle per-level gradient rings for readability. */
.tree-node[data-level="0"] .tree-avatar { background-image: linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff; border-color:#6366f1; }
.tree-node[data-level="1"] .tree-avatar { background-image: linear-gradient(135deg,#0ea5e9,#6366f1); color:#fff; border-color:#0ea5e9; }
.tree-node[data-level="2"] .tree-avatar { background-image: linear-gradient(135deg,#10b981,#0ea5e9); color:#fff; border-color:#10b981; }
.tree-node[data-level="3"] .tree-avatar { background-image: linear-gradient(135deg,#f59e0b,#ec4899); color:#fff; border-color:#f59e0b; }

/* Expandable "has children" indicator: a small + badge. */
.tree-avatar.has-kids { cursor: pointer; }
.tree-node[data-has-children="1"] .tree-card::after {
  content: '+';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--primary, #6366f1);
  color: #fff;
  font-size: 9px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--surface);
  z-index: 2;
}
.tree-node.expanded[data-has-children="1"] .tree-card::after { content: '−'; }

.tree-node.filtered { display: none; }

/* Hover tooltip popover */
.tree-tooltip {
  position: fixed;
  z-index: 9999;
  width: 248px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15,23,42,.20);
  font-size: 12px;
  overflow: hidden;
}
.tree-tooltip[data-flip="1"]::before {
  content: '';
  position: absolute;
  top: -7px; left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--border-strong);
}
.tree-tooltip[data-flip="0"]::after {
  content: '';
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--border-strong);
}
.tree-tip-loading { color: var(--text-2); font-size: 11px; padding: 16px; text-align: center; }

.tree-tip-top {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, var(--primary-soft), rgba(124,58,237,.08));
  border-bottom: 1px solid var(--border);
}
.tree-tip-avatar {
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  background-color: var(--primary-soft);
  background-size: cover; background-position: center;
  color: var(--primary); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,.14);
}
.tree-tip-id { flex: 1; min-width: 0; }
.tree-tip-id strong { display: block; font-size: 13.5px; line-height: 1.25; }
.tree-tip-id span { display: block; font-size: 10.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-tip-top .badge { flex: none; }

.tree-tip-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; padding: 12px 14px;
}
.tree-tip-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}
.tree-tip-stat span { display: block; font-size: 10px; color: var(--text-3); margin-bottom: 2px; }
.tree-tip-stat strong { display: block; font-size: 13px; color: var(--text); }

.tree-tip-body {
  display: flex; flex-direction: column; gap: 7px;
  padding: 12px 14px;
}
.tree-tip-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tree-tip-row span { color: var(--text-2); font-size: 11px; }
.tree-tip-row strong { font-size: 11.5px; text-align: right; white-space: nowrap; }
.tree-tip-code {
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10.5px; background: var(--primary-soft); color: var(--primary);
  padding: 2px 6px; border-radius: 6px; border: 1px solid var(--primary-soft-border);
}
.tree-tip-foot {
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 10.5px; color: var(--text-3);
}

/* Member detail modal */
.tree-modal { padding: 0; }
.tree-modal-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--primary-soft), rgba(124,58,237,.10));
  border-bottom: 1px solid var(--border);
}
.tree-modal-hero .avatar-xl { border: 3px solid #fff; box-shadow: 0 4px 16px rgba(15,23,42,.18); }
.tree-modal-id { flex: 1; min-width: 0; }
.tree-modal-id h3 { margin: 0 0 3px; font-size: 19px; }
.tree-modal-user { font-size: 12.5px; color: var(--text-2); display: block; }
.tree-modal-stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; padding: 18px 24px 4px;
}
.tree-modal-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}
.tree-modal-tile-icon { color: var(--primary); margin-bottom: 5px; display: inline-flex; }
.tree-modal-tile-icon .icon { width: 18px; height: 18px; }
.tree-modal-tile-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: inline-block; }
.tree-modal-tile strong { display: block; font-size: 16px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-modal-tile span { font-size: 10.5px; color: var(--text-3); display: block; }
.tree-modal-tile .badge { margin-top: 4px; }
.tree-modal-list { padding: 14px 24px 6px; }
.tree-modal-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--border); }
.tree-modal-row:last-child { border-bottom: none; }
.tree-modal-row span { color: var(--text-2); font-size: 13px; }
.tree-modal-row strong { font-size: 13px; text-align: right; }

/* ==========================================================================
   Notifications page
   ========================================================================== */
.notif-card { padding: 4px; }
.notif-list-full { max-height: none; }
.notif-item { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.notif-item:last-child { border-bottom: none; }
.notif-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface-3); color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.notif-unread { background: var(--primary-soft); }
.notif-unread .notif-icon { background: var(--primary); color: #fff; }
.notif-body { flex: 1; min-width: 0; }
.notif-body strong { font-size: 14px; }
.notif-body p { margin: 2px 0 4px; color: var(--text-2); font-size: 13.5px; }
.notif-time { font-size: 12px; color: var(--text-3); }
.notif-mark { width: 30px; height: 30px; }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes ntcPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ==========================================================================
   Tasks & Gifts (walkthrough + rank ladder)
   ========================================================================== */
.rank-chip {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 6px 14px; border-radius: 999px;
	background: linear-gradient(135deg, var(--primary-soft), var(--accent-3, var(--primary-soft)));
	border: 1px solid var(--primary-soft);
	color: var(--primary-strong, var(--text-1)); font-size: 13px; font-weight: 600;
}
.rank-chip .icon { width: 15px; height: 15px; }
.rank-card .card-head { margin-bottom: 14px; }
.rank-ladder { display: flex; flex-direction: column; gap: 0; }
.rank-step {
	display: flex; align-items: center; gap: 14px;
	padding: 12px 14px; border-radius: 12px;
	position: relative;
}
.rank-step + .rank-step::before {
	content: ''; position: absolute; left: 29px; top: -14px;
	width: 2px; height: 14px; background: var(--border-strong, var(--border));
}
.rank-step-dot {
	width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
	display: flex; align-items: center; justify-content: center;
	background: var(--bg-2, #eee); color: var(--text-3);
	font-size: 13px; font-weight: 700;
	border: 1px solid var(--border);
}
.rank-step.reached .rank-step-dot { background: var(--success, #16a34a); color: #fff; border-color: transparent; }
.rank-step.current { background: var(--primary-soft); border: 1px solid var(--primary-soft); }
.rank-step.current .rank-step-dot { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 0 0 4px var(--primary-soft); }
.rank-step-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rank-step-meta strong { font-size: 14px; }
.rank-step-meta span { font-size: 12.5px; color: var(--text-2); }

.view-subhead { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.view-subhead h3 { font-size: 17px; margin: 0; }

.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.task-card { display: flex; flex-direction: column; gap: 12px; }
.task-card-head { display: flex; align-items: flex-start; gap: 12px; }
.task-icon {
	width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
	display: flex; align-items: center; justify-content: center;
	background: var(--primary-soft); color: var(--primary); font-size: 20px;
}
.task-title-wrap { flex: 1; min-width: 0; }
.task-title-wrap h3 { margin: 0 0 3px; font-size: 15.5px; }
.task-type { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.task-card .badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.task-card .badge .icon { width: 13px; height: 13px; }
.task-subtitle { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.task-rewards { display: flex; flex-wrap: wrap; gap: 8px; }
.reward-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.reward-gift { background: var(--accent-3, var(--primary-soft)); color: #7a4d00; }
.reward-gift .icon, .reward-rank .icon { width: 14px; height: 14px; }
.reward-rank { background: var(--primary-soft); color: var(--primary-strong, var(--text-1)); }

.task-progress { display: flex; align-items: center; gap: 10px; }
.task-progress .progress { flex: 1; height: 9px; border-radius: 999px; overflow: hidden; background: var(--bg-2, #eee); }
.task-progress .progress-fill {
	height: 100%; border-radius: inherit;
	background: linear-gradient(90deg, var(--primary), var(--accent-3, var(--primary)));
	transition: width .6s ease;
}
.task-percent { font-size: 12.5px; font-weight: 700; color: var(--text-2); min-width: 34px; text-align: right; }

.task-conditions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.task-conditions li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.task-conditions .cond-dot { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 11px; background: var(--bg-2, #eee); color: var(--text-3); }
.task-conditions li.met .cond-dot { background: var(--success, #16a34a); color: #fff; }
.task-conditions .cond-label { flex: 1; min-width: 0; }
.task-conditions .cond-count { font-weight: 700; color: var(--text-1); }
.task-conditions-extra { display: flex; flex-wrap: wrap; gap: 12px; }

.task-done-note {
	display: flex; align-items: center; gap: 8px;
	padding: 10px 12px; border-radius: 10px;
	background: var(--success-soft, #ecfdf3); color: var(--success, #16a34a);
	font-size: 13px; font-weight: 600;
}
.task-done-note .icon { width: 18px; height: 18px; }

.task-card { animation: ntcTaskIn .5s ease both; }
.task-card:nth-child(2) { animation-delay: .1s; }
.task-card:nth-child(3) { animation-delay: .2s; }
.task-complete { border-color: var(--success-soft, #a7f3d0); }
@keyframes ntcTaskIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Dashboard hero + highlights + task preview
   ========================================================================== */
.dash-hero {
	padding: 26px 26px 22px; border-radius: 16px; margin-bottom: 18px;
	background:
		radial-gradient(1200px 300px at 100% -10%, var(--accent-3, var(--primary-soft)) 0, transparent 60%),
		radial-gradient(800px 260px at -10% 120%, var(--primary-soft) 0, transparent 55%),
		var(--card-bg, var(--surface, #fff));
	border: 1px solid var(--border);
}
.dash-hero-main { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.dash-hero-main h2 { margin: 0; font-size: 26px; line-height: 1.2; }
.dash-hero-main p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.dash-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.dash-hero-actions .btn { display: inline-flex; align-items: center; gap: 7px; }
.dash-hero-actions .btn .icon { width: 15px; height: 15px; }

.tasks-preview { display: flex; flex-direction: column; }
.tasks-preview .task-preview-item { display: flex; flex-direction: column; gap: 12px; }
.task-preview-top { display: flex; align-items: flex-start; gap: 12px; }
.task-preview-top > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.task-preview-top strong { font-size: 14.5px; }
.task-preview-top span { font-size: 12.5px; color: var(--text-2); }
.task-preview-rewards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.task-conditions-compact li { font-size: 12.5px; }

/* ==========================================================================
   Network: referral hub + collapsible genealogy tree
   ========================================================================== */
.tree-toggle-card summary {
	display: flex; align-items: center; gap: 14px; cursor: pointer;
	padding: 16px 18px; border-radius: 12px; list-style: none;
}
.tree-toggle-card summary::-webkit-details-marker { display: none; }
.tree-toggle-title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.tree-toggle-title .icon { width: 22px; height: 22px; color: var(--primary); }
.tree-toggle-title span { display: flex; flex-direction: column; gap: 2px; }
.tree-toggle-title small { font-size: 12.5px; color: var(--text-2); }
.tree-toggle-hint { font-size: 13px; color: var(--text-2); font-weight: 600; }
.tree-toggle-card > summary > .icon-chevron-down { transition: transform .2s ease; width: 16px; height: 16px; }
.tree-toggle-card[open] > summary > .icon-chevron-down { transform: rotate(180deg); }
.tree-toggle-body { border-top: 1px solid var(--border); padding: 16px 18px 18px; }
.tree-filter-wrap { margin-bottom: 16px; }
