@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* Core Theme Colors */
  --bg-body: #07090e;
  --bg-sidebar: #090d15;
  --bg-topbar: rgba(9, 13, 21, 0.88);
  --bg-card: #0f1523;
  --bg-card-subtle: #141c2e;
  --bg-card-glass: rgba(15, 21, 35, 0.72);
  --bg-card-highlight: #1a243a;
  --bg-input: #0a0e18;

  /* Gold Luxury Palette */
  --gold-50: #fff9e6;
  --gold-100: #ffecb3;
  --gold-200: #ffd580;
  --gold-300: #f5c542;
  --gold-400: #e5aa22;
  --gold-500: #d49514;
  --gold-600: #b3790a;
  --gold-gradient: linear-gradient(135deg, #ffe082 0%, #d4af37 45%, #a67c1e 100%);
  --gold-gradient-hover: linear-gradient(135deg, #fff0a8 0%, #e5c04b 45%, #b88a22 100%);
  --gold-gradient-dark: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(166, 124, 30, 0.05) 100%);
  --gold-border: rgba(212, 175, 55, 0.25);
  --gold-border-strong: rgba(212, 175, 55, 0.55);
  --gold-glow: 0 0 25px rgba(212, 175, 55, 0.28);
  --gold-glow-sm: 0 0 12px rgba(212, 175, 55, 0.2);
  --gold-glow-lg: 0 0 45px rgba(212, 175, 55, 0.42);

  /* Functional Accents */
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-glow: 0 0 20px rgba(16, 185, 129, 0.3);

  --blue-500: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.12);
  --cyan-500: #06b6d4;
  --cyan-bg: rgba(6, 182, 212, 0.12);

  --amber-500: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);

  --rose-500: #f43f5e;
  --rose-bg: rgba(244, 63, 94, 0.12);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #f5c542;
  --text-gold-light: #fef08a;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);

  /* Fonts */
  --font-brand: 'Poppins', 'Montserrat', sans-serif;
  --font-heading: 'Poppins', 'Montserrat', sans-serif;
  --font-main: 'Poppins', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Grotesk', monospace;

  /* Dimensions */
  --sidebar-width: 272px;
  --topbar-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-glass: 0 12px 40px rgba(0, 0, 0, 0.6);
}

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

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 175, 55, 0.08), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(16, 185, 129, 0.04), transparent 60%);
}

/* Custom Gold Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.28);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
}

/* Base Layout Structure */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.14) 0%, rgba(9, 13, 21, 0.85) 100%);
  border: 1px solid var(--gold-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.22);
  padding: 5px;
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.38);
}

.brand-icon .brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.brand-icon svg {
  width: 26px;
  height: 26px;
  fill: url(#goldGradIcon);
}

.brand-details {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-brand);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2.2px;
  color: #ffffff;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-tagline {
  font-family: var(--font-brand);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  color: #c6b28c;
  text-transform: uppercase;
  margin-top: 3px;
  white-space: nowrap;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 14px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 3px;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--gold-300);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.14) 0%, rgba(212, 175, 55, 0.02) 100%);
  border-left: 3px solid var(--gold-400);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.nav-item.active svg {
  stroke: var(--gold-300);
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--gold-gradient);
  color: #000;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.node-security-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.node-security-badge svg {
  width: 18px;
  height: 18px;
  stroke: var(--emerald-400);
  fill: none;
  flex-shrink: 0;
}

.node-security-text {
  font-size: 11px;
}
.node-security-title {
  font-weight: 700;
  color: var(--emerald-400);
  line-height: 1.2;
}
.node-security-sub {
  color: var(--text-muted);
  font-size: 10px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--rose-500);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.logout-btn:hover {
  background: var(--rose-bg);
  border-color: rgba(244, 63, 94, 0.3);
}

/* MAIN CONTENT WRAPPER */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* TOPBAR */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 990;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.network-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--emerald-400);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 10px var(--emerald-400);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.payout-ticker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.payout-ticker strong {
  font-family: var(--font-mono);
  color: var(--gold-300);
  font-weight: 600;
}

/* TOPBAR RIGHT */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Topbar Wallet Pills */
.topbar-wallets {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallet-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

.wallet-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-medium);
}

.wallet-chip svg {
  width: 15px;
  height: 15px;
  stroke: var(--gold-400);
  fill: none;
}

.wallet-chip-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.wallet-chip-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Notification & User Profile Pill */
.notification-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}
.notification-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}
.notification-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--gold-400);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold-400);
}

.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s ease;
}
.user-profile-chip:hover {
  border-color: var(--gold-border-strong);
  box-shadow: var(--gold-glow-sm);
}

.user-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #000;
}

.user-meta-mini {
  display: flex;
  flex-direction: column;
}

.user-name-mini {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.user-id-mini {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold-300);
}

/* PAGE CONTENT WRAPPER */
.content-wrapper {
  padding: 28px;
  flex: 1;
}

/* PAGE HEADER TITLE BAR */
.page-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title-main {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-main span.gold-highlight {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle-main {
  font-size: 13px;
  color: var(--text-secondary);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* User Identity Bar (Member ID, Sponsor, KYC) */
.user-identity-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(18, 24, 38, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.identity-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.identity-item span.label {
  color: var(--text-muted);
}
.identity-item span.value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}
.identity-divider {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
}

/* Official Channel Action Pills */
.community-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1080px) {
  .topbar-wallets {
    display: none;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .menu-toggle-btn {
    display: block;
  }
  .content-wrapper {
    padding: 18px;
  }
  .user-identity-bar {
    gap: 10px;
  }
  .community-actions {
    margin-left: 0;
    width: 100%;
    margin-top: 6px;
  }
}
