/* Fx2Fund Dashboard Styles — Dark Theme */

/* Match main site font size (UIKit base = .875rem / 14px) */
#dashboard-sidebar,
#dashboard-main {
  font-size: .875rem;
  line-height: 1.5;
}

#dashboard-main h3 { font-size: 1.15rem; color: #fff; }
#dashboard-main h4 { font-size: 1rem; color: #fff; }
#dashboard-main strong { font-weight: 600; color: #fff; }
#dashboard-main p { color: #d7dce8; }

/* Sidebar — dark glass */
#dashboard-sidebar {
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  z-index: 100;
  overflow-y: auto;
  background: #0d1424;
  border-right: 1px solid rgba(255,255,255,0.10);
}

#dashboard-sidebar .uk-logo {
  display: block;
  padding: 20px 0;
}

#dashboard-sidebar .uk-nav > li > a {
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  margin: 2px 0;
  font-size: 0.85rem;
  transition: all 0.2s;
}

#dashboard-sidebar .uk-nav > li > a:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255, 255, 255, 0.04);
}

#dashboard-sidebar .uk-nav > li.uk-active > a {
  color: #fff;
  background: rgba(252, 180, 45, 0.10);
}

#dashboard-sidebar .uk-nav > li.uk-active > a i {
  color: #FCB42D;
}

#dashboard-sidebar .uk-nav > li > a i {
  width: 20px;
  margin-right: 10px;
  text-align: center;
}

/* Main content area */
#dashboard-main {
  margin-left: 240px;
  min-height: 100vh;
  background: #0a0f1c;
  color: #d7dce8;
}

/* Top bar */
.dashboard-topbar {
  background: rgba(10,15,28,0.80);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  padding: 8px 30px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.dashboard-topbar h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #fff;
}

/* Nav links injected into topbar by site-header.js */
.sh-dash-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}
.sh-dash-nav .sh-link {
  color: #d7dce8;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}
.sh-dash-nav .sh-link:hover {
  color: #FCB42D;
  text-decoration: none;
}

/* Sidebar user profile — avatar + name below logo */
/* ════════════════════════════════════════════════════════════════════
   Sidebar identity card — stunning at-a-glance summary of the trader's
   contest persona: avatar (with online dot), username (with privacy
   toggle), country, current rank, and R:R rating with star tier.
   The card replaces the old plain avatar + email row.
   ════════════════════════════════════════════════════════════════════ */
.sidebar-user {
  position: relative;
  display: block;
  margin-top: 16px;
  padding: 18px 16px 16px;
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(252,180,45,0.085) 0%, rgba(252,180,45,0.012) 55%, rgba(255,255,255,0.018) 100%);
  border: 1px solid rgba(252,180,45,0.28);
  box-shadow:
    0 14px 36px -16px rgba(0,0,0,0.55),
    0 6px 18px -8px rgba(252,180,45,0.10),
    inset 0 1px 0 rgba(255,255,255,0.04);
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(8px);
  animation: sucIn .55s cubic-bezier(.2,.7,.2,1) forwards;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.sidebar-user:hover {
  transform: translateY(-2px);
  border-color: rgba(252,180,45,0.45);
  box-shadow:
    0 18px 44px -16px rgba(0,0,0,0.60),
    0 10px 28px -8px rgba(252,180,45,0.22),
    inset 0 1px 0 rgba(255,255,255,0.06);
}
@keyframes sucIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Top gold accent stripe — same pattern the runner cards + champion use */
.sidebar-user::before {
  content: '';
  position: absolute;
  top: 0; left: 18%; right: 18%; height: 2px;
  background: linear-gradient(90deg, transparent, #FCB42D, transparent);
  opacity: 0.85;
}

/* Soft gold halo bloom in the top-right — anchors the eye */
.sidebar-user::after {
  content: '';
  position: absolute;
  top: -30%; right: -30%;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(252,180,45,0.16), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Avatar block — circular with golden ring + live pulse dot ── */
.suc-avatar-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  z-index: 1;
}
.suc-avatar, .sidebar-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(252,180,45,0.55);
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 3px rgba(252,180,45,0.10), 0 6px 18px -4px rgba(252,180,45,0.30);
  background: rgba(255,255,255,0.06);
}
.suc-avatar[src=""],
.suc-avatar:not([src]) { opacity: 0; }

/* Online status dot at bottom-right of avatar — gentle pulse */
.suc-live-dot {
  position: absolute;
  right: 0; bottom: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #3BD297;
  border: 2px solid rgba(10,15,28,1);
  box-shadow: 0 0 0 2px rgba(59,210,151,0.20);
  animation: sucPulse 2.6s ease-in-out infinite;
}
@keyframes sucPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(59,210,151,0.20); }
  50%      { box-shadow: 0 0 0 4px rgba(59,210,151,0.42); }
}

/* ── Identity row: gold-gradient username + privacy eye toggle ── */
.suc-identity {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
  min-width: 0;
}
.suc-username, .sidebar-user-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #FCB42D 0%, #ffd36b 55%, #FCB42D 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 145px;
  animation: sucShimmer 7s ease-in-out infinite;
}
@keyframes sucShimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.suc-eye {
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.10);
  color: #8c95a8;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  padding: 0;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
  flex-shrink: 0;
}
.suc-eye:hover {
  color: #FCB42D;
  border-color: rgba(252,180,45,0.45);
  background: rgba(252,180,45,0.10);
}

/* ── Country chip ── */
.suc-country {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #8c95a8;
  font-weight: 600;
  margin-bottom: 12px;
}
.suc-flag {
  width: 16px; height: 12px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

/* ── Stat grid: Rank | R:R + stars ── */
.suc-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 10px 6px 8px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.suc-stat {
  text-align: center;
  padding: 0 8px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.suc-stat:last-child { border-right: none; }
.suc-stat-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #8c95a8;
  margin-bottom: 3px;
}
.suc-stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.suc-stat-value.gold {
  background: linear-gradient(135deg, #FCB42D, #ffd36b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.suc-stat-value.muted { color: #5b6477; }
.suc-stat-stars {
  display: flex;
  justify-content: center;
  gap: 1.5px;
  margin-top: 3px;
  line-height: 1;
  color: #FCB42D;
  font-size: 8.5px;
}
.suc-stat-stars .suc-star-empty { color: rgba(255,255,255,0.12); }

/* ── Privacy state: username hidden ── */
.sidebar-user.is-username-hidden .suc-username {
  letter-spacing: 0.18em;
  background: linear-gradient(135deg, rgba(255,255,255,0.42), rgba(255,255,255,0.18));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: none;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .sidebar-user { animation: none; opacity: 1; transform: none; }
  .sidebar-user:hover { transform: none; }
  .suc-live-dot { animation: none; }
  .suc-username { animation: none; }
}

/* ── Legacy classes kept for backward compat ── */
.sidebar-user-info { display: none; }
.sidebar-user-email { display: none; }

/* Dashboard cards */
.dash-card {
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.dash-card:hover {
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 4px 18px rgba(0,0,0,0.30);
}

.dash-card .card-label {
  font-size: 0.72rem;
  color: #8c95a8;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 600;
  margin-bottom: 4px;
}

.dash-card .card-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.dash-card .card-value.positive { color: #3BD297; }
.dash-card .card-value.negative { color: #e74c3c; }

/* ─── Contextual percentage chip (universal) ───────────────────────
   Single compact pill: "▲ 4.18% /day" or "▼ 0.14% of eq".
   Merged phrase stays on one line — never wraps. */
.metric-pct-wrap {
  display: flex; align-items: center; flex-wrap: wrap;
  margin-top: 5px; line-height: 1;
}
.metric-pct {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px;
  font-size: 0.62rem; font-weight: 700;
  border-radius: 9px; letter-spacing: 0.15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.metric-pct.pos {
  background: rgba(59,210,151,0.14); color: #3BD297;
  box-shadow: 0 0 0 1px rgba(59,210,151,0.18) inset;
}
.metric-pct.neg {
  background: rgba(231,76,60,0.14); color: #e74c3c;
  box-shadow: 0 0 0 1px rgba(231,76,60,0.18) inset;
}
.metric-pct.neu {
  background: rgba(148,163,184,0.14); color: #94a3b8;
  box-shadow: 0 0 0 1px rgba(148,163,184,0.18) inset;
}
.metric-pct.warn {
  background: rgba(252,180,45,0.16); color: #FCB42D;
  box-shadow: 0 0 0 1px rgba(252,180,45,0.22) inset;
}
.metric-pct.info {
  background: rgba(52,152,219,0.14); color: #3498db;
  box-shadow: 0 0 0 1px rgba(52,152,219,0.18) inset;
}
.metric-pct-base { display: none; }

/* ─── Period filter bar (client Performance page) ──────────────────
   Mirrors the Live/Demo segmented control — same glass container,
   same 10px/22px pill padding, same glowing dot indicator, same
   gold gradient + deep glow on the active pill, same transitions.
   A pulsing range-chip on the right advertises the active window
   in absolute dates. */
.period-bar {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 22px; flex-wrap: wrap;
}
.period-bar-label {
  font-size: 0.72rem; font-weight: 700;
  color: rgba(255,255,255,0.42);
  text-transform: uppercase; letter-spacing: 1.1px;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.period-bar-label i {
  color: #FCB42D; font-size: 0.88rem;
  filter: drop-shadow(0 0 6px rgba(252,180,45,0.45));
}
.period-tabs {
  display: inline-flex;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 5px;
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}
.period-tab {
  position: relative;
  padding: 10px 20px;
  font-size: 0.8rem; font-weight: 600;
  color: rgba(255,255,255,0.55);
  background: transparent; border: none;
  border-radius: 10px;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.2s ease, background 0.25s ease,
              box-shadow 0.25s ease, transform 0.15s ease;
  letter-spacing: 0.3px; white-space: nowrap;
}
.period-tab:hover { color: rgba(255,255,255,0.95); }
.period-tab:active { transform: translateY(1px); }
.period-tab .period-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #FCB42D; color: #FCB42D;
  box-shadow: 0 0 6px currentColor;
  transition: box-shadow 0.25s ease, background 0.25s ease;
  flex-shrink: 0;
}
.period-tab.active {
  color: #0a0e17; font-weight: 700;
  background: linear-gradient(135deg, #FCB42D 0%, #f39c12 100%);
  box-shadow: 0 6px 18px rgba(252,180,45,0.28),
              0 1px 2px rgba(252,180,45,0.4);
}
.period-tab.active .period-dot {
  background: #0a0e17; color: #0a0e17; box-shadow: none;
}
.period-range {
  font-size: 0.76rem; color: rgba(255,255,255,0.55);
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 11px;
  margin-left: auto;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
  font-weight: 600; letter-spacing: 0.3px;
}
.period-range .period-range-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #FCB42D;
  box-shadow: 0 0 8px #FCB42D, 0 0 16px rgba(252,180,45,0.3);
  animation: periodRangeDotPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes periodRangeDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.25); }
}
.period-tab .period-tab-short { display: none; }

@media (max-width: 900px) {
  .period-tab { padding: 9px 16px; font-size: 0.76rem; gap: 7px; }
}
@media (max-width: 640px) {
  .period-bar { gap: 10px; }
  .period-bar-label { display: none; }
  .period-range {
    margin-left: 0; width: 100%;
    justify-content: center; font-size: 0.72rem;
  }
  .period-tabs { padding: 4px; border-radius: 12px; }
  .period-tab {
    padding: 8px 12px; font-size: 0.72rem; gap: 6px;
    border-radius: 9px;
  }
  .period-tab .period-dot { width: 6px; height: 6px; }
  .period-tab .period-tab-full  { display: none; }
  .period-tab .period-tab-short { display: inline; }
}

.dash-card .card-value + .metric-pct-wrap { margin-top: 7px; }
.dash-card .metric-pct { padding: 2px 8px; font-size: 0.66rem; border-radius: 10px; }
.bucket-hero-card .metric-pct-wrap { margin-top: 9px; }
.bucket-hero-card .metric-pct {
  padding: 3px 9px; font-size: 0.68rem;
  backdrop-filter: blur(6px);
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.active { background: rgba(59,210,151,0.15); color: #3BD297; }
.status-badge.paused { background: rgba(243,156,18,0.15); color: #f39c12; }
.status-badge.stopped { background: rgba(231,76,60,0.15); color: #e74c3c; }
.status-badge.connected { background: rgba(59,210,151,0.15); color: #3BD297; }
.status-badge.disconnected { background: rgba(231,76,60,0.15); color: #e74c3c; }

/* Tables */
.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table th {
  background: rgba(255,255,255,0.03);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.70rem;
  color: #8c95a8;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.dash-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.82rem;
  color: #d7dce8;
}

.dash-table tr:hover td {
  background: rgba(252,180,45,0.04);
}

.profit-positive { color: #3BD297; font-weight: 600; }
.profit-negative { color: #e74c3c; font-weight: 600; }

/* Loading spinner */
.dash-loading {
  text-align: center;
  padding: 60px;
  color: rgba(255,255,255,0.35);
}

.dash-loading .spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: #3BD297;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.dash-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,0.3);
}

.dash-empty i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

/* UIKit overrides for dark theme */
.uk-card-default {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  color: #fff !important;
}

.uk-input, .uk-select, .uk-textarea {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}

.uk-input:focus, .uk-select:focus, .uk-textarea:focus {
  border-color: rgba(252,180,45,0.45) !important;
  box-shadow: 0 0 0 4px rgba(252,180,45,0.10) !important;
}

.uk-form-label { color: #8c95a8 !important; font-weight: 600; }
.uk-alert-success { background: rgba(59,210,151,0.12) !important; color: #3BD297 !important; border: 1px solid rgba(59,210,151,0.25) !important; }
.uk-alert-danger { background: rgba(255,90,110,0.12) !important; color: #ff5a6e !important; border: 1px solid rgba(255,90,110,0.25) !important; }
.uk-text-muted { color: #8c95a8 !important; }
.uk-text-small { color: #8c95a8 !important; }
.uk-button-default { background: rgba(255,255,255,0.06) !important; color: #d7dce8 !important; border-color: rgba(255,255,255,0.10) !important; }
.uk-button-primary { background: linear-gradient(135deg, #FCB42D, #ffd36b) !important; color: #0a0f1c !important; font-weight: 700; box-shadow: 0 8px 24px rgba(252,180,45,0.30); }
.uk-button-danger { background: rgba(255,90,110,0.18) !important; color: #ff5a6e !important; }
hr { border-color: rgba(255,255,255,0.10) !important; }

/* Account link form */
.link-form .step { display: none; }
.link-form .step.active { display: block; }

.link-form .step-indicator {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.link-form .step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.link-form .step-dot.active { background: #FCB42D; color: #0a0e17; }
.link-form .step-dot.done { background: #3BD297; color: #fff; }

/* Responsive: mobile */
@media (max-width: 960px) {
  #dashboard-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
    z-index: 200;
  }

  #dashboard-sidebar.show {
    transform: translateX(0);
  }

  /* Dark overlay behind sidebar */
  #sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 199;
    backdrop-filter: blur(2px);
  }
  #sidebar-overlay.show { display: block; }

  /* Close button inside sidebar */
  .sidebar-close-btn {
    display: flex !important;
  }

  #dashboard-main {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: inline-block !important;
  }
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  padding: 5px;
}

.sidebar-close-btn {
  display: none;
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5); font-size: 0.9rem;
  align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; z-index: 10;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }


/* Notification toast */
.dash-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  z-index: 9999;
  animation: slideIn 0.3s ease;
}

.dash-toast.success { background: #3BD297; }
.dash-toast.error { background: #e74c3c; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Dash table wrapper scrollable */
.dash-table-wrap { overflow-x: auto; }

/* ── Export PDF button (used by dashboard.html + dashboard-account-detail.html) ── */
.export-pdf-btn {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 7px 14px;
	background: linear-gradient(135deg, rgba(252,180,45,0.12), rgba(243,156,18,0.08));
	border: 1px solid rgba(252,180,45,0.3);
	border-radius: 8px;
	color: #FCB42D;
	font-size: 0.78rem; font-weight: 700;
	font-family: inherit; letter-spacing: 0.2px;
	cursor: pointer;
	transition: all 0.18s ease;
}
.export-pdf-btn:hover { background: linear-gradient(135deg, rgba(252,180,45,0.2), rgba(243,156,18,0.14)); border-color: rgba(252,180,45,0.5); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(252,180,45,0.18); }
.export-pdf-btn:disabled { opacity: 0.55; cursor: wait; transform: none; box-shadow: none; }
.export-pdf-btn i { font-size: 0.82rem; }
@media (max-width: 600px) {
	.export-pdf-btn .pdf-btn-label { display: none; }
	.export-pdf-btn { padding: 7px 10px; }
}

/* ── PDF-capture mode ───────────────────────────────────────
   Applied to <html> by pdf-export.js while html2canvas is
   snapshotting the page. Hides UI chrome (sidebar, toggles,
   the export button itself, chatbot widget) and forces a
   desktop-width layout so mobile users still get a desktop-
   quality PDF regardless of their viewport. */
html.pdf-capturing,
html.pdf-capturing body {
	background: #0a0e17 !important;
	overflow-x: visible !important;
	min-width: 1280px !important;
	width: 1280px !important;
	padding-top: 0 !important;
}
html.pdf-capturing #site-header,
html.pdf-capturing #dashboard-sidebar,
html.pdf-capturing #sidebar-overlay,
html.pdf-capturing .mobile-menu-btn,
html.pdf-capturing #export-pdf-btn,
html.pdf-capturing #chatbot-widget,
html.pdf-capturing #chatbot-launcher {
	display: none !important;
}
html.pdf-capturing .dashboard-topbar {
	position: relative !important;
	top: 0 !important;
}
html.pdf-capturing #dashboard-main {
	margin-left: 0 !important;
	width: 1280px !important;
	min-width: 1280px !important;
}
/* Disable transitions/animations during capture to prevent
   flicker at the moment we snapshot. */
html.pdf-capturing * {
	transition: none !important;
	animation: none !important;
}

/* ── Top-Up Buttons — next to every token balance display ──── */

/* Sidebar: gold-themed top-up icon next to balance badge */
.sidebar-topup-mini {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	background: rgba(252,180,45,0.12);
	border: 1px solid rgba(252,180,45,0.30);
	color: #FCB42D;
	font-size: 0.6rem;
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
}
.sidebar-topup-mini:hover {
	background: rgba(252,180,45,0.22);
	border-color: rgba(252,180,45,0.50);
	box-shadow: 0 0 12px rgba(252,180,45,0.20);
	transform: translateY(-1px);
}
.sidebar-topup-mini i { font-size: inherit; line-height: 1; }

/* Topbar: compact pill button next to token widget */
.topbar-topup-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 16px;
	background: linear-gradient(135deg, #3BD297, #2ecc71);
	color: #0a0f1c;
	border-radius: 100px;
	font-size: 0.78rem;
	font-weight: 700;
	text-decoration: none;
	transition: all 0.2s ease;
	box-shadow: 0 2px 12px rgba(59,210,151,0.20);
	font-family: inherit;
	white-space: nowrap;
}
.topbar-topup-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 20px rgba(59,210,151,0.45);
	color: #0a0f1c;
	text-decoration: none;
}
.topbar-topup-btn i { font-size: 0.7rem; }
@media (max-width: 640px) {
	.topbar-topup-btn .topup-label { display: none; }
	.topbar-topup-btn { padding: 6px 10px; }
}

/* Hero card: prominent top-up next to large balance */
.wallet-hero-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	position: relative;
}
.hero-topup-btn {
	position: relative;
	padding: 14px 32px;
	background: linear-gradient(135deg, #3BD297, #2ecc71);
	color: #0a0f1c;
	border: none;
	border-radius: 14px;
	font-weight: 800;
	font-size: 0.92rem;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	font-family: inherit;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
	box-shadow: 0 4px 18px rgba(59,210,151,0.25);
}
.hero-topup-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 30px rgba(59,210,151,0.50);
	color: #0a0f1c;
	text-decoration: none;
}
.hero-topup-btn i { font-size: 1rem; }
@media (max-width: 640px) {
	.hero-topup-btn { padding: 12px 24px; font-size: 0.85rem; width: 100%; justify-content: center; }
}

/* Site-header compensation — push dashboard layout below the fixed 40px header */
body.has-site-header {
  padding-top: 40px !important;
}
body.has-site-header #dashboard-sidebar {
  top: 40px !important;
  height: calc(100vh - 40px) !important;
  min-height: auto !important;
}
body.has-site-header #dashboard-main {
  min-height: calc(100vh - 40px) !important;
}
body.has-site-header .dashboard-topbar {
  top: 40px !important;
}
@media (max-width: 960px) {
  body.has-site-header #dashboard-sidebar {
    top: 40px !important;
    height: calc(100vh - 40px) !important;
  }
}

/* ══ Mobile dashboard shell (js/dash-shell.js) ═══════════════════════════
   Page title in the top bar, bottom tab bar, and phone layout fixes shared
   by every dashboard page. #dashboard-main prefixes out-rank each page's own
   inline <style> blocks without !important. */
.dash-page-title { display: none; }
.dash-tabbar { display: none; }

@media (max-width: 760px) {
  .dash-page-title {
    display: block; margin: 0 0 0 10px; font-size: 1.02rem; font-weight: 800; color: #fff;
    letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw;
  }
  .dashboard-topbar { position: sticky; top: 0; z-index: 30; padding: 10px 14px !important; padding-top: max(10px, env(safe-area-inset-top)) !important;
    background: rgba(10, 14, 23, 0.92) !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .topbar-topup-btn .topup-label, .export-pdf-btn { display: none !important; }

  body.has-dash-tabbar #dashboard-main { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  #dashboard-main > .uk-padding { padding: 14px !important; }

  .dash-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 14, 23, 0.95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }
  .dash-tabbar a, .dash-tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: rgba(232, 236, 245, 0.42); font-size: 0.68rem; font-weight: 600; text-decoration: none; background: none; border: 0; font-family: inherit;
  }
  .dash-tabbar i { font-size: 1.05rem; }
  .dash-tabbar a.is-on { color: #FCB42D; }
  .dash-tabbar a.is-on::before {
    content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px; background: #FCB42D;
  }
  .dash-tab-trade i {
    width: 36px; height: 36px; margin-top: -12px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, #FCB42D, #ffd36b); color: #0a0f1c; font-size: 0.95rem;
    box-shadow: 0 6px 18px -4px rgba(252, 180, 45, 0.6);
  }
  .dash-tabbar a.dash-tab-trade { color: #d7dce8; }

  /* chat bubble + preview sit above the tab bar */
  body.has-dash-tabbar #pfx-b { bottom: calc(76px + env(safe-area-inset-bottom)); right: 14px; width: 50px; height: 50px; }
  body.has-dash-tabbar #pfx-pv { bottom: calc(136px + env(safe-area-inset-bottom)); }
  body.has-dash-tabbar #pfx-p { bottom: calc(72px + env(safe-area-inset-bottom)); max-height: calc(100vh - 90px - env(safe-area-inset-bottom)); }

  /* ── stat tiles: two per row instead of one ── */
  #dashboard-main .wallet-stats, #dashboard-main .aff-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #dashboard-main .wallet-stat, #dashboard-main .aff-stat { padding: 14px; }

  /* ── wallet hero: button stays inside the card ── */
  #dashboard-main .wallet-hero-row { flex-direction: column; align-items: stretch; gap: 14px; }
  #dashboard-main .hero-topup-btn { width: 100%; justify-content: center; margin: 0; box-sizing: border-box; }

  /* ── empty wallet: the lockout card already carries the Add Funds CTA ── */
  #dashboard-content:has(.lockout-card) .hero-topup-btn { display: none; }

  /* ── affiliate "How it works": stacked rows, icon beside text ── */
  #dashboard-main .aff-how { grid-template-columns: 1fr !important; gap: 4px !important; }
  #dashboard-main .aff-how > div { display: grid; grid-template-columns: 42px 1fr; column-gap: 12px; text-align: left !important; padding: 10px 0 !important; align-items: center; }
  #dashboard-main .aff-how > div > div:first-child { grid-row: span 2; margin: 0 !important; }

  /* ── any results table becomes a stack of cards ── */
  #dashboard-main .dash-table thead { display: none; }
  #dashboard-main .dash-table, #dashboard-main .dash-table tbody { display: block; width: 100%; }
  #dashboard-main .dash-table tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  #dashboard-main .dash-table td { display: block; padding: 0 !important; border: 0 !important; }
  #dashboard-main .dash-table td:first-child { flex-basis: 100%; }
  #dashboard-main .dash-table td:last-child { margin-left: auto; }
  #dashboard-main .dash-table-wrap { overflow: visible; }
}

/* ══ Dashboard home (js/dash-home.js) ═══════════════════════════════════ */
.dh { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; }
.dh .up { color: #3BD297; }
.dh .down { color: #ff5a6e; }
.dh-gold { color: #FCB42D; }
.dh-dim { color: #8c95a8; }
.dh-small { font-size: 0.74rem; }
.dh-hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 20px 22px 18px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(252, 180, 45, 0.14), transparent 55%), linear-gradient(160deg, #161c2e, #0f1424);
  border: 1px solid rgba(252, 180, 45, 0.18); box-shadow: 0 20px 50px -28px rgba(0, 0, 0, 0.8);
}
.dh-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.dh-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  color: #d7dce8; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
}
.dh-chip i { width: 7px; height: 7px; border-radius: 50%; background: #8c95a8; }
.dh-chip.is-live { color: #3BD297; background: rgba(59, 210, 151, 0.1); border-color: rgba(59, 210, 151, 0.25); }
.dh-chip.is-live i { background: #3BD297; box-shadow: 0 0 0 3px rgba(59, 210, 151, 0.2); }
.dh-ends { font-size: 0.74rem; color: #8c95a8; font-variant-numeric: tabular-nums; }
.dh-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: #8c95a8; }
.dh-equity { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 16px; }
.dh-equity > span:first-child { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #fff; }
.dh-ret { font-size: 0.9rem; font-weight: 700; padding: 3px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); font-variant-numeric: tabular-nums; }
.dh-hero h2 { margin: 4px 0 8px; color: #fff; font-size: 1.5rem; }
.dh-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dh-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dh-kpis > div { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.035); }
.dh-kpis span { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #8c95a8; }
.dh-kpis b { font-size: 1.02rem; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; }
.dh-kpis b.up { color: #3BD297; } .dh-kpis b.down { color: #ff5a6e; } .dh-kpis b.dh-gold { color: #FCB42D; }
.dh-kpis small { font-size: 0.7rem; color: #8c95a8; font-weight: 600; }
.dh-rankline { margin-top: 12px; font-size: 0.8rem; color: #b5bccb; }
.dh-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.dh-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px; padding: 14px 16px; border-radius: 13px;
  font-weight: 800; font-size: 0.92rem; text-decoration: none !important; color: #d7dce8 !important;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.09); transition: transform 0.1s, filter 0.15s;
}
.dh-btn:active { transform: scale(0.98); }
.dh-btn-gold { color: #0a0f1c !important; background: linear-gradient(135deg, #FCB42D, #ffd36b); border: 0; box-shadow: 0 12px 28px -12px rgba(252, 180, 45, 0.7); }
.dh-btn:hover { filter: brightness(1.06); }
.dh-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.dh-card { border-radius: 16px; padding: 16px 18px; background: #121828; border: 1px solid rgba(255, 255, 255, 0.06); min-width: 0; }
.dh-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.dh-card h3 { margin: 0; font-size: 0.98rem; color: #fff; display: flex; align-items: center; gap: 8px; }
.dh-card header a { font-size: 0.78rem; font-weight: 700; color: #FCB42D; text-decoration: none; white-space: nowrap; }
.dh-count { font-size: 0.7rem; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: #b5bccb; }
.dh-chart { height: 200px; }
.dh-list { list-style: none; margin: 0; padding: 0; }
.dh-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.dh-row:first-child { border-top: 0; }
.dh-row b { color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dh-row b.up { color: #3BD297; } .dh-row b.down { color: #ff5a6e; }
.dh-none { padding: 18px 0; text-align: center; color: #8c95a8; font-size: 0.84rem; }
.dh-tag { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 4px; }
.dh-tag-buy { color: #3BD297; background: rgba(59, 210, 151, 0.12); }
.dh-tag-sell { color: #ff5a6e; background: rgba(255, 90, 110, 0.12); }
.dh-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.dh-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: #121828; border: 1px solid rgba(255, 255, 255, 0.06); }
.dh-stat span { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #8c95a8; }
.dh-stat b { font-size: 1.15rem; color: #fff; font-variant-numeric: tabular-nums; }
.dh-stat b.up { color: #3BD297; } .dh-stat b.down { color: #ff5a6e; }
.dh-last { display: flex; justify-content: space-between; align-items: center; }
.dh-last > div { display: flex; flex-direction: column; gap: 2px; }

@media (max-width: 900px) {
  .dh-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .dh-hero { padding: 16px 16px 14px; border-radius: 16px; }
  .dh-equity > span:first-child { font-size: 1.85rem; }
  .dh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dh-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dh-kpis > div { padding: 9px 11px; }
  .dh-actions { grid-template-columns: 1fr; gap: 8px; }
  .dh-card { padding: 14px; }
  .dh-chart { height: 170px; }
}

/* ══ Performance page (js/dash-performance.js) ══════════════════════════ */
.dp-switch { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.dp-chip {
  padding: 7px 14px; border-radius: 999px; font: inherit; font-size: 0.8rem; font-weight: 700; white-space: nowrap; cursor: pointer;
  color: #b5bccb; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
}
.dp-chip.is-on { color: #FCB42D; background: rgba(252, 180, 45, 0.12); border-color: rgba(252, 180, 45, 0.35); }
.dp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dh-stat em { font-style: normal; }
.dh-stats .dh-stat { padding: 12px 14px; }
#dp-daily { position: relative; }
@media (max-width: 760px) {
  .dp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dp-kpis .dh-stat b { font-size: 1.05rem; }
}
