/* ============================================
   APEXFUNDS — Dashboard Stylesheet
   Mobile-First, Fully Responsive
   ============================================ */

/* ── Dashboard Layout ── */
.dash-wrap {
  display: flex;
  min-height: 100vh;
  background: var(--navy-950);
  overflow-x: hidden;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--navy-900);
  border-right: 1px solid var(--white-08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  width: 240px;
  height: 100vh;
  z-index: 200;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.open {
  transform: translateX(0);
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--white-08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.sidebar-close {
  background: none;
  border: none;
  color: var(--white-50);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.sidebar-close:hover { color: var(--white); background: var(--white-08); }

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--white-08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-600), var(--navy-700));
  border: 2px solid rgba(212,160,23,0.3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold-400);
  flex-shrink: 0;
}
.sidebar-user-name { font-weight: 600; font-size: 0.88rem; margin-bottom: 2px; }
.sidebar-user-plan {
  font-size: 0.68rem;
  color: var(--gold-400);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white-20);
  padding: 10px 10px 4px;
  margin-top: 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--white-50);
  transition: var(--transition);
  position: relative;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.sidebar-link:hover { background: var(--white-04); color: var(--white-80); }
.sidebar-link.active {
  background: rgba(212,160,23,0.08);
  color: var(--gold-400);
  border-color: rgba(212,160,23,0.15);
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--gold-400);
  border-radius: 0 2px 2px 0;
}
.sidebar-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 600;
  background: rgba(212,160,23,0.15);
  color: var(--gold-400);
  border: 1px solid rgba(212,160,23,0.2);
  white-space: nowrap;
}
.sidebar-badge.green {
  background: rgba(34,197,94,0.1);
  color: var(--success);
  border-color: rgba(34,197,94,0.2);
}
.sidebar-bottom {
  padding: 12px 10px;
  border-top: 1px solid var(--white-08);
  flex-shrink: 0;
}

/* ── Sidebar Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 199;
}
.sidebar-overlay.open { display: block; }

/* ── Main Content ── */
.dash-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Top Bar ── */
.dash-topbar {
  height: 62px;
  background: rgba(5, 14, 36, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--white-08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  box-sizing: border-box;
}
.dash-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dash-topbar-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-topbar-sub { font-size: 0.72rem; color: var(--white-50); white-space: nowrap; }
.dash-topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.topbar-menu-btn {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  flex-shrink: 0;
}
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--white-04);
  border: 1px solid var(--white-08);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--white-50);
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}
.topbar-btn:hover { border-color: rgba(212,160,23,0.3); color: var(--gold-400); }
.topbar-notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-400);
  border: 1px solid var(--navy-900);
}

/* ── Page Content ── */
.dash-content {
  flex: 1;
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ── Welcome Banner ── */
.dash-welcome {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  border: 1px solid rgba(212,160,23,0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
}
.dash-welcome::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
}
.dash-welcome-orb {
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,160,23,0.06) 0%, transparent 70%);
  right: -50px; top: -50px;
  filter: blur(30px);
  pointer-events: none;
}
.dash-welcome h2 { font-size: 1.4rem; margin-bottom: 4px; }
.dash-welcome p { color: var(--white-50); font-size: 0.85rem; }
.dash-welcome-right { flex-shrink: 0; }

/* ── Stat Cards ── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.dash-stat-card {
  background: var(--white-04);
  border: 1px solid var(--white-08);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.dash-stat-card:hover { border-color: rgba(212,160,23,0.2); transform: translateY(-2px); }
.dash-stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
}
.dash-stat-card.gold::after { background: linear-gradient(90deg, transparent, var(--gold-400), transparent); }
.dash-stat-card.green::after { background: linear-gradient(90deg, transparent, var(--success), transparent); }
.dash-stat-card.blue::after { background: linear-gradient(90deg, transparent, #60a5fa, transparent); }
.dash-stat-card.purple::after { background: linear-gradient(90deg, transparent, #a78bfa, transparent); }
.dash-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dash-stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.dash-stat-icon.gold { background: rgba(212,160,23,0.12); }
.dash-stat-icon.green { background: rgba(34,197,94,0.12); }
.dash-stat-icon.blue { background: rgba(96,165,250,0.12); }
.dash-stat-icon.purple { background: rgba(167,139,250,0.12); }
.dash-stat-change {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 100px;
  white-space: nowrap;
}
.dash-stat-change.up { background: rgba(34,197,94,0.1); color: var(--success); }
.dash-stat-change.neutral { background: rgba(255,255,255,0.06); color: var(--white-50); }
.dash-stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-stat-label { font-size: 0.72rem; color: var(--white-50); }

/* ── Panel ── */
.dash-panel {
  background: var(--white-04);
  border: 1px solid var(--white-08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}
.dash-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--white-08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-panel-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}
.dash-panel-body { padding: 16px 20px; }
.dash-panel-action {
  font-size: 0.78rem;
  color: var(--gold-400);
  cursor: pointer;
  white-space: nowrap;
}

/* ── Chart ── */
.dash-chart-area {
  height: 160px;
  position: relative;
  margin-top: 8px;
  width: 100%;
}

/* ── Investment Card ── */
.investment-card {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}
.investment-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
}
.investment-card:last-child { margin-bottom: 0; }
.inv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.inv-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(212,160,23,0.1);
  border: 1px solid rgba(212,160,23,0.25);
  color: var(--gold-400);
}
.inv-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--success);
  font-family: var(--font-mono);
}
.inv-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
.inv-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.inv-amount-item { text-align: center; }
.inv-amount-label {
  font-size: 0.65rem;
  color: var(--white-50);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.inv-amount-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
}
.inv-amount-value.gold { color: var(--gold-400); }
.inv-amount-value.green { color: var(--success); }

/* ── Progress ── */
.inv-progress-wrap { margin-bottom: 10px; }
.inv-progress-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.inv-progress-label { font-size: 0.72rem; color: var(--white-50); }
.inv-progress-pct { font-size: 0.72rem; color: var(--gold-400); font-family: var(--font-mono); }
.inv-progress-bar {
  height: 5px;
  background: var(--white-08);
  border-radius: 3px;
  overflow: hidden;
}
.inv-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400));
  transition: width 1.2s ease;
}
.inv-countdown {
  text-align: center;
  font-size: 0.78rem;
  color: var(--white-50);
  margin-top: 6px;
}
.inv-countdown strong { color: var(--gold-400); font-family: var(--font-mono); }

/* ── Table — scrollable wrapper ── */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}
.dash-table th {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white-30);
  border-bottom: 1px solid var(--white-08);
  white-space: nowrap;
  background: var(--navy-900);
}
.dash-table td {
  padding: 13px 14px;
  font-size: 0.83rem;
  border-bottom: 1px solid var(--white-04);
  color: var(--white-80);
  vertical-align: middle;
  white-space: nowrap;
}
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--white-04); }

.tx-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 500;
}
.tx-type.deposit { background: rgba(96,165,250,0.1); color: #60a5fa; border: 1px solid rgba(96,165,250,0.2); }
.tx-type.profit { background: rgba(34,197,94,0.1); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.tx-type.withdrawal { background: rgba(212,160,23,0.1); color: var(--gold-400); border: 1px solid rgba(212,160,23,0.2); }
.tx-status { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; }
.tx-status.completed { color: var(--success); }
.tx-status.pending { color: var(--gold-400); }
.tx-hash { font-family: var(--font-mono); font-size: 0.7rem; color: var(--white-30); }

/* ── Quick Nav Buttons (Mobile Bottom) ── */
.dash-quick-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(5,14,36,0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--white-08);
  display: flex;
  z-index: 100;
  padding: 8px 0 12px;
}
.dash-quick-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--white-50);
  font-family: var(--font-body);
}
.dash-quick-nav-btn.active { color: var(--gold-400); }
.dash-quick-nav-btn:hover { color: var(--gold-400); }
.dash-quick-nav-icon { font-size: 1.2rem; line-height: 1; }
.dash-quick-nav-label { font-size: 0.6rem; letter-spacing: 0.04em; white-space: nowrap; }

/* ── Bottom nav spacing ── */
.dash-content { padding-bottom: 80px; }

/* ── Network Selector ── */
.network-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.network-btn {
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--white-08);
  background: var(--white-04);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  font-family: var(--font-body);
  width: 100%;
}
.network-btn:hover, .network-btn.selected {
  border-color: rgba(212,160,23,0.4);
  background: rgba(212,160,23,0.06);
}
.network-btn-name { font-size: 0.82rem; font-weight: 600; color: var(--white); margin-bottom: 2px; }
.network-btn-sub { font-size: 0.65rem; color: var(--white-50); font-family: var(--font-mono); }

/* ── Wallet Address ── */
.wallet-box {
  background: var(--navy-900);
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}
.wallet-label {
  font-size: 0.7rem;
  color: var(--gold-400);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.wallet-address-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.wallet-address {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--white-80);
  word-break: break-all;
  flex: 1;
  line-height: 1.6;
}
.wallet-copy {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--gold-glow);
  border: 1px solid rgba(212,160,23,0.2);
  color: var(--gold-400);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-body);
}
.wallet-copy:hover { background: rgba(212,160,23,0.2); }

/* ── Quick Stats ── */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--white-08);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.quick-stat { background: var(--navy-900); padding: 14px 10px; text-align: center; }
.quick-stat-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-400);
  margin-bottom: 2px;
}
.quick-stat-label { font-size: 0.65rem; color: var(--white-50); letter-spacing: 0.04em; }

/* ── Available Balance Block ── */
.balance-block {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.balance-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
}

/* ── Referral Box ── */
.referral-box {
  background: linear-gradient(135deg, rgba(212,160,23,0.06), rgba(212,160,23,0.02));
  border: 1px solid rgba(212,160,23,0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
}
.referral-code {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold-400);
  letter-spacing: 0.15em;
  margin: 14px 0;
  padding: 14px;
  background: var(--white-04);
  border: 1px dashed rgba(212,160,23,0.3);
  border-radius: var(--radius-sm);
  word-break: break-all;
}
.referral-desc { font-size: 0.82rem; color: var(--white-50); margin-bottom: 16px; line-height: 1.6; }

/* ── Section Header ── */
.dash-section-header { margin-bottom: 20px; }
.dash-section-header h2 { font-size: 1.6rem; margin-bottom: 6px; }
.dash-section-header p { color: var(--white-50); font-size: 0.88rem; }
