/* ══════════════════════════════════════════════════════════════════════════ */
/*  PropFirm System — Dashboard CSS v3.0 (Premium Fintech)                   */
/*  Inherits design tokens from terminal.css                                 */
/* ══════════════════════════════════════════════════════════════════════════ */

/* ── Base ─────────────────────────────────────────────────────────────────── */
.fxsim-dash {
  min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font);
}

/* ── NAV ──────────────────────────────────────────────────────────────────── */
.fxdb-nav {
  height: 62px; background: rgba(12,18,32,.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(124,110,245,.15);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 4px 24px rgba(0,0,0,.4);
}
.fxdb-nav-logo {
  font-size: 16px; font-weight: 800; color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow); letter-spacing: -.3px;
  white-space: nowrap;
}
.fxdb-nav-links { display: flex; gap: 2px; align-items: center; flex: 1; padding: 0 24px; }
.fxdb-nav-link {
  color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 6px 13px; border-radius: var(--r-md); transition: all .15s; white-space: nowrap;
  border: 1px solid transparent;
}
.fxdb-nav-link:hover { color: var(--text); background: var(--card2); border-color: var(--border); }
.fxdb-nav-link.active { color: var(--accent); background: var(--accent-dim); border-color: rgba(124,110,245,.2); font-weight: 600; }
.fxdb-nav-logout, .fxdb-nav-logout-btn { color: var(--red-dim) !important }
.fxdb-nav-logout:hover, .fxdb-nav-logout-btn:hover { color: var(--red) !important; background: var(--red-dim) !important; border-color: var(--red) !important; }

/* ── BODY ─────────────────────────────────────────────────────────────────── */
.fxdb-body { max-width: 1260px; margin: 0 auto; padding: 32px 24px; }

/* ── PAGE HEADER ──────────────────────────────────────────────────────────── */
.fxdb-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 32px; flex-wrap: wrap; gap: 14px;
}
.fxdb-title {
  font-size: 26px; font-weight: 800; color: var(--text); margin: 0 0 4px;
  letter-spacing: -.5px; text-align:center;
}
.fxdb-subtitle { font-size: 14px; color: var(--text-dim); margin: 0; }
.fxdb-subtitle strong { color: var(--accent); }
.fxdb-header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── STATUS BANNER ────────────────────────────────────────────────────────── */
.fxdb-status-banner {
  border-radius: var(--r-md); padding: 13px 18px; font-size: 13px;
  font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
  animation: fx-slidein .3s ease;
}
@keyframes fx-slidein { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:none} }
.fxdb-banner-active  { background: var(--accent-dim); border: 1px solid rgba(124,110,245,.3); color: var(--accent3); }
.fxdb-banner-funded  { background: var(--green-dim); border: 1px solid rgba(18,212,152,.3); color: var(--green); }
.fxdb-banner-failed  { background: var(--red-dim); border: 1px solid rgba(240,71,92,.3); color: var(--red); }
.fxdb-banner-passed  { background: var(--green-dim); border: 1px solid rgba(18,212,152,.3); color: var(--green); }

/* ── CARDS ────────────────────────────────────────────────────────────────── */
.fxdb-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px 24px;
  transition: border-color .2s, box-shadow .2s;
}
.fxdb-card:hover { border-color: var(--border2); }
.fxdb-card-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 16px;
}

/* ── CHALLENGE SECTION ────────────────────────────────────────────────────── */
.fxdb-challenge-section {
  display: grid; grid-template-columns: 1fr 340px; gap: 20px; margin-bottom: 24px;
}

/* ── RULE CARDS GRID ──────────────────────────────────────────────────────── */
.fxdb-rules-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 20px;
}
.fxdb-rule-card {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px; transition: border-color .2s;
}
.fxdb-rule-card:hover { border-color: var(--border2); }
.fxdb-rule-title { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; font-weight: 700; }
.fxdb-rule-vals {
  display: flex; align-items: baseline; gap: 5px;
  font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px;
}
.fxdb-rule-badge {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; background: var(--card3); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px;
}
.fxdb-rule-badge.badge-pass { background: var(--green-dim); color: var(--green); }
.fxdb-rule-badge.badge-warn { background: var(--yellow-dim); color: var(--yellow); }
.fxdb-rule-badge.badge-fail { background: var(--red-dim); color: var(--red); }

/* ── PROGRESS BARS ────────────────────────────────────────────────────────── */
.fxdb-progress-bar {
  height: 5px; background: var(--card3); border-radius: 3px; overflow: hidden;
}
.fxdb-progress-fill {
  height: 100%; border-radius: 3px; transition: width .6s cubic-bezier(.4,0,.2,1);
  background: var(--accent);
}
.fxdb-progress-fill.green  { background: linear-gradient(90deg, var(--green), #0faa78); }
.fxdb-progress-fill.red    { background: linear-gradient(90deg, var(--red), #c0392b); }
.fxdb-progress-fill.yellow { background: linear-gradient(90deg, var(--yellow), #e6ac00); }
.fxdb-rule-foot { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── ACCOUNT SUMMARY ──────────────────────────────────────────────────────── */
.fxdb-account-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.fxdb-acc-tile {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 13px 15px; transition: all .15s;
}
.fxdb-acc-tile:hover { border-color: var(--border2); }
.fxdb-acc-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-bottom: 5px; }
.fxdb-acc-val { font-size: 17px; font-weight: 700; color: var(--text); font-family: var(--mono); }
.fxdb-acc-tile.tile-equity .fxdb-acc-val { color: var(--accent3); }

/* ── STAT LIST ────────────────────────────────────────────────────────────── */
.fxdb-stat-list { display: flex; flex-direction: column; gap: 0; }
.fxdb-stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; gap: 12px;
}
.fxdb-stat-row:last-child { border-bottom: none; }
.fxdb-stat-row span { color: var(--text-muted); }
.fxdb-stat-row strong, .fxdb-stat-row b { color: var(--text); font-weight: 600; }

/* ── ACTIONS ──────────────────────────────────────────────────────────────── */
.fxdb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.fxdb-btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff; font-size: 13px; font-weight: 700; border: none; border-radius: var(--r-md);
  padding: 9px 18px; cursor: pointer; text-decoration: none; transition: all .18s;
  font-family: var(--font); box-shadow: 0 2px 12px var(--accent-glow); letter-spacing: .1px;
}
.fxdb-btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.fxdb-btn-sm { padding: 7px 13px !important; font-size: 12px !important; }
.fxdb-btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card2); border: 1px solid var(--border2);
  color: var(--text-dim); font-size: 13px; font-weight: 600; border-radius: var(--r-md);
  padding: 9px 16px; cursor: pointer; text-decoration: none; transition: all .15s; font-family: var(--font);
}
.fxdb-btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── TWO-ROW LAYOUT ───────────────────────────────────────────────────────── */
.fxdb-bottom-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px;
}

/* ── TABLE ────────────────────────────────────────────────────────────────── */
.fxdb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fxdb-table th {
  text-align: left; padding: 10px 14px; font-size: 10px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border); background: var(--card2);
}
.fxdb-table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.fxdb-table th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.fxdb-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: middle; }
.fxdb-table tr:last-child td { border-bottom: none; }
.fxdb-table tr:hover td { background: rgba(124,110,245,.04); color: var(--text); }
.fxdb-table .pnl-pos { color: var(--green) !important; font-weight: 600; }
.fxdb-table .pnl-neg { color: var(--red)   !important; font-weight: 600; }

/* ── EQUITY CHART ─────────────────────────────────────────────────────────── */
/* max-height removed: Chart.js (maintainAspectRatio:false) sizes the canvas  */
/* from the parent container height (220px). A CSS max-height lower than that */
/* clips the x-axis labels without affecting the Chart.js pixel buffer.       */

/* ── EMPTY STATE ──────────────────────────────────────────────────────────── */
.fxdb-empty {
  text-align: center; padding: 60px 24px; color: var(--text-muted);
}
.fxdb-empty-icon { font-size: 48px; margin-bottom: 16px; filter: grayscale(.4); }
.fxdb-empty h3 { color: var(--text-dim); font-size: 18px; margin-bottom: 10px; font-weight: 700; }
.fxdb-empty p { font-size: 14px; margin-bottom: 22px; line-height: 1.6; }

/* ── ANNOUNCEMENT BANNER ──────────────────────────────────────────────────── */
#fxdb-announcement { position: sticky; top: 62px; z-index: 90; }

/* ── MODAL ────────────────────────────────────────────────────────────────── */
.fxdb-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  z-index: 9500; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fx-fadein .2s ease;
  backdrop-filter: blur(6px);
}
.fxdb-modal-box {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 16px; padding: 28px 30px; max-width: 500px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
  animation: fx-fadein .2s ease;
}
.fxdb-modal-box h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--text); }

/* ── NOTIFICATION BELL ────────────────────────────────────────────────────── */
.fxdb-notif-wrap  { position: relative; display: inline-flex; align-items: center; z-index: 201; }
.fxdb-notif-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 17px; padding: 6px 8px; border-radius: var(--r-md); position: relative;
  transition: all .15s; line-height: 1;
}
.fxdb-notif-btn:hover { color: var(--text); background: var(--card2); }
.fxdb-notif-badge {
  position: absolute; top: 0; right: 0;
  background: var(--red); color: #fff; font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 3px;
  line-height: 16px; text-align: center;
}
.fxdb-notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  z-index: 2000; overflow: hidden; animation: fx-fadein .15s ease;
}
.fxdb-notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--text-dim);
}
.fxdb-notif-markread { background:none; border:none; color:var(--accent); cursor:pointer; font-size:11px; font-weight:600; padding:2px 6px; }
#fxdb-notif-list  { max-height: 360px; overflow-y: auto; }
.fxdb-notif-empty { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.fxdb-notif-item  {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); transition: background .12s; cursor: pointer;
}
.fxdb-notif-item:last-child { border-bottom: none; }
.fxdb-notif-item:hover { background: var(--card2); }
.fxdb-notif-unread { border-left: 3px solid var(--accent); }
.fxdb-notif-read   { opacity: .6; }
.fxdb-notif-icon  { font-size: 16px; flex-shrink: 0; padding-top: 2px; }
.fxdb-notif-body  { flex: 1; min-width: 0; }
.fxdb-notif-title { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.fxdb-notif-msg   { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.fxdb-notif-time  { font-size: 10px; color: var(--text-muted); margin-top: 4px; opacity: .6; }

/* ── DARK/LIGHT TOGGLE ────────────────────────────────────────────────────── */
.fxdb-theme-btn {
  background: none; border: 1px solid var(--border2); color: var(--text-muted);
  cursor: pointer; font-size: 14px; padding: 5px 9px; border-radius: var(--r-md);
  transition: all .15s; margin-right: 4px;
}
.fxdb-theme-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ── LIGHT MODE ───────────────────────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg:        #f5f7fb; --bg2: #edf0f6;
  --card:      #ffffff; --card2: #f0f3f9; --card3: #e8ecf5;
  --border:    #d4dbe8; --border2: #c5ceda;
  --text:      #1a2235; --text-dim: #4a5e7a; --text-muted: #8597b0;
  --overlay:   rgba(245,247,251,0.96);
}
:root[data-theme="light"] .fxdb-nav { background: rgba(255,255,255,.95); border-bottom-color: #d4dbe8; }
:root[data-theme="light"] .fxdb-table th { background: #f0f3f9; }
/* Mobile drawer theme — override shadow colour in light mode */
:root[data-theme="light"] { --shadow-color: rgba(30,40,80,.15); }

/* ── ONBOARDING MODAL ─────────────────────────────────────────────────────── */
.fxdb-onboarding-box {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 20px; padding: 36px 38px; max-width: 460px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.fxdb-onboarding-emoji { font-size: 52px; margin-bottom: 14px; }
.fxdb-onboarding-box h2 { font-size: 21px; font-weight: 800; margin-bottom: 10px; color: var(--text); }
.fxdb-onboarding-box p  { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.fxdb-onboarding-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.fxdb-onboarding-steps strong { color: var(--text); }

/* ── ADVANCED ANALYTICS ───────────────────────────────────────────────────── */
.fxst-charts-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px;
}

/* ── Chart card height constraints ───────────────────────────────────────── */
/* Chart.js responsive:true + maintainAspectRatio:false requires the PARENT   */
/* to have a defined height; without it the canvas collapses to 0 then        */
/* ResizeObserver loops → page becomes infinitely tall.                       */
.fxdb-chart-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.fxdb-chart-card > div[style*="flex:1"] {
  /* Ensure the chart wrapper fills the card */
  height: 220px;
}
#fxst-advanced .fxdb-card-title { font-size: 12px; color: var(--text-muted); }

/* ── SECURITY CARD ────────────────────────────────────────────────────────── */
.fxdb-card .fxdb-stat-list .fxdb-stat-row { padding: 12px 0; }

/* ── PROFILE ──────────────────────────────────────────────────────────────── */
.fxsim-profile-header { display: flex; align-items: center; gap: 20px; }
.fxsim-profile-avatar {
  width: 66px; height: 66px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.fxsim-profile-info h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.fxsim-profile-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--text-muted); }
.fxsim-profile-badge { padding: 3px 11px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.fxsim-badge-funded  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(18,212,152,.2); }
.fxsim-badge-passed  { background: var(--accent-dim); color: var(--accent3); border: 1px solid rgba(124,110,245,.2); }
.fxsim-badge-active  { background: var(--accent-dim); color: var(--accent3); border: 1px solid rgba(124,110,245,.2); }
.fxsim-badge-new     { background: var(--card3); color: var(--text-muted); border: 1px solid var(--border); }
.fxsim-profile-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.fxsim-pstat { background: var(--card2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 13px 14px; transition: all .15s; }
.fxsim-pstat:hover { border-color: var(--border2); transform: translateY(-1px); }
.fxsim-pstat span { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 700; margin-bottom: 5px; }
.fxsim-pstat strong { font-size: 19px; font-weight: 700; }

/* ── MT5 BOX ──────────────────────────────────────────────────────────────── */
.fxdb-mt5-box { border: 1px solid rgba(18,212,152,.2); background: linear-gradient(135deg, rgba(18,212,152,.04) 0%, var(--card) 60%); }
.fxdb-mt5-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.fxdb-mt5-field { background: var(--card2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 13px 15px; }
.fxdb-mt5-label { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 7px; font-weight: 700; }
.fxdb-mt5-value-row { display: flex; align-items: center; gap: 6px; }
.fxdb-mt5-value-row code { flex:1; font-size:13px; font-family:var(--mono); color:var(--text); background:none; padding:0; word-break:break-all; transition:background .2s; border-radius:3px; }
.mt5-masked { letter-spacing: 2px; }
.fxdb-mt5-copy { background:none; border:1px solid var(--border2); color:var(--text-muted); cursor:pointer; padding:3px 7px; border-radius:4px; font-size:13px; flex-shrink:0; transition:all .15s; }
.fxdb-mt5-copy:hover { color:var(--accent); border-color:var(--accent); }
.fxdb-mt5-instructions { background:var(--card2); border:1px solid var(--border); border-radius:var(--r-md); padding:14px 16px; font-size:13px; color:var(--text-muted); }
.fxdb-mt5-instructions strong { display:block; color:var(--text-dim); margin-bottom:8px; font-size:13px; }
.fxdb-mt5-instructions ol { margin:0; padding-left:18px; line-height:1.9; }
.fxdb-mt5-instructions a { color:var(--accent); }

/* ── PAYOUT SECTION ───────────────────────────────────────────────────────── */
.fxsim-payout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── CHALLENGES PAGE ──────────────────────────────────────────────────────── */
.fxch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.fxch-plan {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 26px; transition: all .2s; cursor: pointer;
  position: relative; overflow: hidden;
}
.fxch-plan::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0; transition: opacity .2s;
}
.fxch-plan:hover { border-color: rgba(124,110,245,.4); transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,.4); }
.fxch-plan:hover::before { opacity: 1; }
.fxch-plan-popular::before { opacity: 1 !important; }
.fxch-plan-popular { border-color: rgba(124,110,245,.35) !important; }
.fxch-plan-name { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.fxch-plan-size { font-size: 26px; font-weight: 800; color: var(--accent); font-family: var(--mono); margin-bottom: 16px; letter-spacing: -1px; }
.fxch-plan-features { list-style: none; padding: 0; margin: 0 0 20px; }
.fxch-plan-features li { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; }
.fxch-plan-features li:last-child { border-bottom: none; }
.fxch-plan-features li span { color: var(--text); font-weight: 600; }
.fxch-plan-price { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 16px; font-family: var(--mono); }
.fxch-plan-split { font-size: 13px; color: var(--green); font-weight: 600; margin-bottom: 18px; }
.fxch-badge-popular {
  position: absolute; top: 16px; right: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 10px; font-weight: 800; padding: 3px 10px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .8px;
}

/* ── ACTIVE CHALLENGE CARD ────────────────────────────────────────────────── */
.fxch-active-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px; margin-bottom: 24px;
  transition: all .2s;
}
.fxch-active-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.fxch-active-name { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.fxch-status-badge {
  padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
}
.fxch-badge-active  { background: var(--accent-dim); color: var(--accent3); border: 1px solid rgba(124,110,245,.2); }
.fxch-badge-funded  { background: var(--green-dim);  color: var(--green);   border: 1px solid rgba(18,212,152,.2); }
.fxch-badge-failed  { background: var(--red-dim);    color: var(--red);     border: 1px solid rgba(240,71,92,.2); }
.fxch-badge-passed  { background: var(--green-dim);  color: var(--green);   border: 1px solid rgba(18,212,152,.2); }

/* ── LEADERBOARD ──────────────────────────────────────────────────────────── */
.fxlb-rank-1 td:first-child { color: var(--yellow) !important; font-weight: 800; }
.fxlb-rank-2 td:first-child { color: var(--text-dim) !important; font-weight: 700; }
.fxlb-rank-3 td:first-child { color: #cd7f32 !important; font-weight: 700; }

/* ── PAYOUT MODAL ─────────────────────────────────────────────────────────── */
#fxpayout-overlay .fxdb-modal-box { background: var(--card); }

/* ── LOADING SKELETON ─────────────────────────────────────────────────────── */
.fxdb-skeleton {
  background: linear-gradient(90deg, var(--card2) 25%, var(--card3) 50%, var(--card2) 75%);
  background-size: 800px 100%; animation: fx-shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .fxdb-challenge-section { grid-template-columns: 1fr; }
  .fxdb-rules-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 900px) {
  .fxdb-bottom-row { grid-template-columns: 1fr; }
  .fxst-charts-row { grid-template-columns: 1fr; }
  .fxdb-rules-grid { grid-template-columns: 1fr 1fr; }
  .fxsim-payout-row { grid-template-columns: 1fr; }
}
/* Hamburger hidden on desktop — only shown via the 768px breakpoint above */
.fxdb-nav-hamburger { display: none; }

/* Body scroll lock when mobile nav drawer is open (iOS scroll bleed prevention) */
body.fxdb-nav-open { overflow: hidden; }

@media (max-width: 768px) {
  .fxdb-body { padding: 20px 16px; }
  .fxdb-rules-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fxdb-title { font-size: 20px; }
  
  .fxch-grid { grid-template-columns: 1fr; }
  .fxsim-profile-header { flex-direction: column; text-align: center; }
  .fxsim-profile-meta { justify-content: center; }
  .fxsim-profile-stats { grid-template-columns: repeat(2,1fr); }
  .fxdb-mt5-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .fxdb-rules-grid { grid-template-columns: 1fr; }
  .fxdb-account-summary { grid-template-columns: 1fr 1fr; }
  .fxdb-notif-item { padding: 10px 12px; gap: 8px; }
}
@media (max-width: 400px) {
  /* Single column for tight viewports (375px iPhone) */
  .fxdb-account-summary { grid-template-columns: 1fr; }
}

/* ── TABLE SCROLL WRAPPER ─────────────────────────────────────────────── */
/* Applied in templates around every .fxdb-table so wide tables scroll    */
/* horizontally on mobile instead of breaking the page layout.            */
.fxdb-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* momentum scroll on iOS */
  /* Negative margin + matching padding lets the scrollbar sit flush       */
  /* with the card edge rather than eating into card padding.              */
  margin: 0 -4px;
  padding: 0 4px;
}

/* ── MOBILE NAV — replace overflow-x:auto scroll with hamburger drawer ──── */
/* overflow-x:auto on nav-links clips position:absolute notification panel.   */
/* The fix: hamburger toggles a vertical dropdown; notification panel escapes */
/* via overflow:visible on .fxdb-notif-wrap so z-index:2000 takes effect.     */
@media (max-width: 768px) {
  .fxdb-nav { padding: 0 16px; }

  /* Hamburger button — show on mobile */
  .fxdb-nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    /* Sits between logo and logout — needs z-index above the dropdown */
    position: relative;
    z-index: 210;
    /* Pull hamburger immediately right of the logo */
    /*order: -1;  */        /* logo is first, hamburger second in DOM but visually grouped */
    /*margin-left: auto;*/
  }
  
  .fxdb-nav-hamburger{
  margin-left:auto;
}

.fxdb-nav-logout,
.fxdb-nav-logout-btn{
  margin-left:12px;
}
  
  .fxdb-nav-hamburger:hover { color: var(--text); background: var(--card2); }
  /* Logo keeps default order:0 — hamburger order:-1 pulls it left of logo in flex. */
  /* Use order on logo to restore correct visual sequence: logo LEFT, hamburger next. */
  /*.fxdb-nav-logo { order: -2; }*/
  /* Logout button: push to far right with auto left-margin */
    /*.fxdb-nav-logout, .fxdb-nav-logout-btn { margin-left: auto; }*/

  /* Nav links become a full-width dropdown drawer */
  .fxdb-nav-links {
    display: none;
    /* Override overflow-x:auto — that clips the notification dropdown panel */
    overflow: visible !important;
    /* Drawer positioning */
    position: absolute;
    top: 62px;   /* nav height */
    left: 0;
    right: 0;
    z-index: 205;
    /* Stack vertically */
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 12px 12px;
    background: var(--card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px var(--shadow-color, rgba(0,0,0,.45));
  }
  .fxdb-nav-links.open { display: flex; }

  /* Nav links full-width in drawer */
  .fxdb-nav-link {
    padding: 9px 14px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Notification wrap — keep relative but allow overflow so panel isn't clipped */
  .fxdb-notif-wrap { overflow: visible; width: 100%; }

  /* Notification bell row inside drawer — full-width */
  .fxdb-notif-btn { width: 100%; justify-content: flex-start; gap: 8px; padding: 9px 14px; border-radius: var(--r-md); }

  /* Notification panel — full-width below bell, not offset to right */
  .fxdb-notif-panel {
    position: absolute;
    /* Align to left edge of viewport with small margin */
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    top: calc(100% + 4px);
    z-index: 9000;
    margin: 0 4px;
  }

  /* Theme toggle — full-width in drawer */
  .fxdb-theme-btn { width: 100%; justify-content: flex-start; padding: 9px 14px; }
}

/* ── MOBILE NAV OVERLAY — close menu when clicking outside ──────────────── */
.fxdb-nav-overlay {
  display: none;
  position: fixed;
  inset: 62px 0 0 0;
  /* z-index must be BELOW nav (200) so the hamburger button stays tappable,
     but ABOVE normal page content (z-index 0–90) to block background interaction. */
  z-index: 150;
  background: rgba(0,0,0,.4);
}
.fxdb-nav-overlay.open { display: block; }

/* ── MODAL MOBILE ────────────────────────────────────────────────────────── */
/* position:fixed inset:0 is correct, but on mobile the box needs max-height  */
/* and scroll so tall modals don't overflow the viewport.                      */
@media (max-width: 600px) {
  .fxdb-modal-overlay {
    align-items: flex-end;   /* Sheet slides up from bottom on mobile */
    padding: 0;
  }
  .fxdb-modal-box {
    max-width: 100%;
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 24px 20px;
  }
}


/* ── ONBOARD BANNER ───────────────────────────────────────────────────────── */
.fxdb-onboard-banner {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--accent-dim), rgba(18,212,152,.06));
  border: 1px solid rgba(124,110,245,.2); border-radius: var(--r-lg);
  padding: 28px 28px; margin-bottom: 20px;
}
.fxdb-onboard-icon { font-size: 42px; flex-shrink: 0; }
.fxdb-onboard-banner > div { flex: 1; min-width: 200px; }
.fxdb-onboard-banner h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.fxdb-onboard-banner p  { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* ── CERTIFICATE ──────────────────────────────────────────────────────────── */
.fxsim-cert-wrap {
  min-height: 100vh; background: var(--bg); display: flex;
  align-items: center; justify-content: center; padding: 40px 20px;
}
.fxsim-cert-box {
  background: var(--card); border: 1px solid rgba(124,110,245,.25);
  border-radius: 20px; padding: 52px 60px; max-width: 680px; width: 100%;
  text-align: center; box-shadow: var(--shadow-lg), 0 0 60px rgba(124,110,245,.08);
  position: relative; overflow: hidden;
}
.fxsim-cert-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--green));
}

/* ── PAYOUT SECTION ───────────────────────────────────────────────────────── */
#fxpayout-overlay { backdrop-filter: blur(6px); }

/* ══════════════════════════════════════════════════════════════════════════ */
/*  UI OVERHAUL — dashboard, cards, charts, animations, interactive          */
/* ══════════════════════════════════════════════════════════════════════════ */

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }

/* ── Page entrance animation ─────────────────────────────────────────────── */
.fxdb-body { animation: fx-fadein .4s ease both; }
.fxdb-card { animation: fx-fadein .4s ease both; }
.fxdb-card:nth-child(2) { animation-delay: .05s; }
.fxdb-card:nth-child(3) { animation-delay: .10s; }
.fxdb-card:nth-child(4) { animation-delay: .15s; }

/* ── Card hover lift ─────────────────────────────────────────────────────── */
.fxdb-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.fxdb-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(124,110,245,.12);
}

/* ── Rule cards (profit target, drawdown) ────────────────────────────────── */
.fxdb-rule-card {
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}
.fxdb-rule-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  opacity: 0;
  transition: opacity .2s;
}
.fxdb-rule-card:hover::after { opacity: 1; }

/* ── Status banners ──────────────────────────────────────────────────────── */
.fxdb-status-banner {
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fx-slidedown .3s ease;
}
.fxdb-banner-funded {
  background: linear-gradient(135deg, rgba(18,212,152,.1), rgba(18,212,152,.05));
  border: 1px solid rgba(18,212,152,.3);
  color: var(--green);
}
.fxdb-banner-failed {
  background: var(--red-dim);
  border: 1px solid rgba(240,71,92,.3);
  color: var(--red);
}
.fxdb-banner-passed {
  background: linear-gradient(135deg, rgba(124,110,245,.1), rgba(124,110,245,.05));
  border: 1px solid rgba(124,110,245,.3);
  color: var(--accent);
}

/* ── Progress bars ───────────────────────────────────────────────────────── */
.fxdb-progress-bar {
  background: var(--border);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
}
.fxdb-progress-fill {
  height: 100%;
  border-radius: 100px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.fxdb-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%;
  height: 100%;
  background: rgba(255,255,255,.3);
  animation: fx-shimmer 2s infinite;
}
@keyframes fx-shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}
.fxdb-progress-fill.green { background: linear-gradient(90deg, var(--green), #1bf5ad); }
.fxdb-progress-fill.red   { background: linear-gradient(90deg, var(--red), #f87185); }
.fxdb-progress-fill.accent{ background: linear-gradient(90deg, var(--accent), var(--teal)); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.fxdb-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: .1px;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.fxdb-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
  filter: brightness(1.1);
  color: #fff;
}
.fxdb-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
  white-space: nowrap;
}
.fxdb-btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.fxdb-btn-sm { padding: 6px 13px; font-size: 12px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.fxdb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fxdb-table th {
  background: var(--card2);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
.fxdb-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  transition: background .12s;
}
.fxdb-table tr:hover td { background: rgba(124,110,245,.03); }
.fxdb-table tr:last-child td { border-bottom: none; }

/* ── Stat lists (inside cards) ───────────────────────────────────────────── */
.fxdb-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.fxdb-stat-row:last-child { border-bottom: none; }
.fxdb-stat-row span { color: var(--text-muted); }
.fxdb-stat-row strong { color: var(--text); font-weight: 600; }

/* ── Account stat tiles ──────────────────────────────────────────────────── */
.fxdb-acc-tile {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: all .18s;
}
.fxdb-acc-tile:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.fxdb-acc-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 5px;
}
.fxdb-acc-val {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.fxdb-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
}
.fxdb-empty-icon { font-size: 48px; margin-bottom: 14px; }
.fxdb-empty h3 { font-size: 17px; font-weight: 700; color: var(--text-dim); margin-bottom: 8px; }

/* ── Loading skeleton ────────────────────────────────────────────────────── */
.fxdb-skeleton {
  background: linear-gradient(90deg, var(--card2) 25%, var(--card3) 50%, var(--card2) 75%);
  background-size: 200% 100%;
  animation: fx-skeleton 1.5s ease-in-out infinite;
  border-radius: var(--r-md);
}
@keyframes fx-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Challenges plan cards ───────────────────────────────────────────────── */
.fxch-plan-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  position: relative;
  transition: all .25s ease;
  animation: fx-fadein .4s ease both;
}
.fxch-plan-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(124,110,245,.2);
}
.fxch-plan-card.featured {
  border-color: var(--accent);
  background: linear-gradient(160deg, rgba(124,110,245,.08) 0%, var(--card) 50%);
  box-shadow: 0 0 0 1px rgba(124,110,245,.3), var(--shadow-glow);
}
.fxch-plan-tag {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.fxch-plan-name { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.fxch-plan-size {
  font-size: 32px;
  font-weight: 900;
  color: var(--text);
  font-family: var(--mono);
  margin: 8px 0;
  letter-spacing: -1px;
}
.fxch-plan-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 16px;
}
.fxch-plan-rules {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.fxch-plan-rules li {
  font-size: 12px;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
}
.fxch-plan-rules li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}
.fxch-plan-split { color: var(--green) !important; font-weight: 700; }
.fxch-plan-btn { width: 100%; text-align: center; }

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.fxdb-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(6,10,18,.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fx-fadein .2s ease;
}
.fxdb-modal-box {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: fx-fadein .25s ease;
  position: relative;
}
.fxdb-modal-box h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

/* ── Certificate page ────────────────────────────────────────────────────── */
.fxcert-wrap {
  background: linear-gradient(145deg, var(--card) 0%, var(--card2) 100%);
  border: 2px solid var(--accent);
  border-radius: 20px;
  padding: 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(124,110,245,.15), var(--shadow-lg);
}
.fxcert-wrap::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(124,110,245,.12), transparent 70%);
  border-radius: 50%;
}
.fxcert-wrap::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(18,212,152,.08), transparent 70%);
  border-radius: 50%;
}
.fxcert-logo { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
.fxcert-subtitle { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 3px; }
.fxcert-name { font-size: 36px; font-weight: 900; color: var(--text); letter-spacing: -.5px; margin: 12px 0; }
.fxcert-plan { font-size: 20px; font-weight: 800; color: var(--accent); margin: 8px 0; }
.fxcert-funded-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  padding: 10px 28px;
  border-radius: 50px;
  margin: 16px 0;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.fxcert-text { font-size: 14px; color: var(--text-dim); margin: 6px 0; }
.fxcert-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border2); }
.fxcert-seal { font-size: 32px; color: var(--accent); margin-bottom: 8px; }

/* ── Profile page ────────────────────────────────────────────────────────── */
.fxsim-profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.fxsim-pstat {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  transition: all .18s;
}
.fxsim-pstat:hover { border-color: var(--accent); transform: translateY(-1px); }
.fxsim-pstat span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; display: block; margin-bottom: 5px; }
.fxsim-pstat strong { font-size: 20px; font-weight: 800; font-family: var(--mono); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .fxdb-card { padding: 16px; }
  .fxcert-wrap { padding: 28px 18px; }
  .fxcert-name { font-size: 24px; }
  .fxsim-profile-header { flex-direction: column; text-align: center; }
  .fxsim-profile-stats  { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
  .fxdb-btn-primary, .fxdb-btn-ghost { padding: 8px 14px; font-size: 12px; }
  .fxsim-pstat strong { font-size: 17px; }
}

/* ══════════════════════════════════════════════════════════════════════════ */
/*  PHASE C — Full page interactivity: dashboard, challenges, rules, cert    */
/* ══════════════════════════════════════════════════════════════════════════ */

/* ── Dashboard metric cards ─────────────────────────────────────────────── */
.fxdb-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.fxdb-metric-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  animation: fx-fadein .4s ease both;
}
.fxdb-metric-card:nth-child(2) { animation-delay: .07s; }
.fxdb-metric-card:nth-child(3) { animation-delay: .14s; }
.fxdb-metric-card:nth-child(4) { animation-delay: .21s; }
.fxdb-metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(124,110,245,.15);
}
.fxdb-metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  opacity: 0;
  transition: opacity .2s;
}
.fxdb-metric-card:hover::before { opacity: 1; }
.fxdb-metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
}
.fxdb-metric-value {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--mono);
  color: var(--text);
  line-height: 1;
}
.fxdb-metric-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.fxdb-metric-icon {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  background: var(--accent-dim);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* ── Dashboard loading state ─────────────────────────────────────────────── */
.fxdb-metric-card.loading .fxdb-metric-value {
  background: linear-gradient(90deg, var(--card2) 25%, var(--card3) 50%, var(--card2) 75%);
  background-size: 200% 100%;
  animation: fx-skeleton 1.5s ease-in-out infinite;
  border-radius: 6px;
  color: transparent;
  min-height: 32px;
}

/* ── Dashboard header ────────────────────────────────────────────────────── */
.fxdb-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.fxdb-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.5px;
  margin: 0;
  line-height: 1.2;
   text-align:center;
}
.fxdb-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 4px 0 0;
}
.fxdb-subtitle strong { color: var(--accent); font-weight: 600; }
.fxdb-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ── Challenge section cards ─────────────────────────────────────────────── */
.fxdb-section { margin-bottom: 24px; }
.fxdb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.fxdb-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dim);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fxdb-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Challenge plan cards ─────────────────────────────────────────────────── */
.fxch-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
@keyframes card-float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.fxch-plan-card.featured {
  animation: card-float 4s ease-in-out infinite;
}
.fxch-plan-card.featured:hover {
  animation: none;
  transform: translateY(-6px);
}

/* ── Challenge rules interactive ────────────────────────────────────────── */
.fxsim-rules-section h2 {
  position: relative;
}
.fxsim-rules-section h2 .fxi {
  color: var(--accent);
}
/* Staggered step animation */
.fxsim-rules-step:nth-child(1) { animation-delay: .05s; }
.fxsim-rules-step:nth-child(2) { animation-delay: .10s; }
.fxsim-rules-step:nth-child(3) { animation-delay: .15s; }

/* ── Certificate page ────────────────────────────────────────────────────── */
@keyframes cert-glow {
  0%,100% { box-shadow: 0 0 40px rgba(124,110,245,.15), var(--shadow-lg); }
  50%      { box-shadow: 0 0 80px rgba(124,110,245,.30), var(--shadow-lg); }
}
.fxcert-wrap {
  animation: fx-fadein .5s ease, cert-glow 4s ease-in-out infinite;
}
.fxcert-divider {
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  border-radius: 3px;
  margin: 16px auto;
}

/* ── Recent trades table ─────────────────────────────────────────────────── */
.fxdb-loading {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.fxdb-loading::before {
  content: '';
  width: 18px; height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: fx-spin 1s linear infinite;
  flex-shrink: 0;
}

/* ── Profile stats grid animation ───────────────────────────────────────── */
.fxsim-profile-stats > div:nth-child(1) { animation-delay: .05s; }
.fxsim-profile-stats > div:nth-child(2) { animation-delay: .10s; }
.fxsim-profile-stats > div:nth-child(3) { animation-delay: .15s; }
.fxsim-profile-stats > div:nth-child(4) { animation-delay: .20s; }
.fxsim-profile-stats > div:nth-child(5) { animation-delay: .25s; }
.fxsim-profile-stats > div:nth-child(6) { animation-delay: .30s; }
.fxsim-profile-stats > div { animation: fx-fadein .4s ease both; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .fxdb-metrics-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .fxdb-metric-value { font-size: 20px; }
  .fxdb-page-header { flex-direction: column; gap: 12px; }
  .fxdb-header-actions { width: 100%; }
  .fxch-plans-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .fxdb-metrics-row { grid-template-columns: 1fr 1fr; }
  .fxdb-metric-card { padding: 14px 12px; }
  .fxdb-metric-value { font-size: 18px; }
}

/* ══════════════════════════════════════════════════════════════════════════ */
/*  CHALLENGES PAGE — How It Works cards + plan grid                         */
/* ══════════════════════════════════════════════════════════════════════════ */

.fxch-hiw-section {
  margin-bottom: 40px;
}
.fxch-section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -.3px;
}
.fxch-hiw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.fxch-hiw-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  position: relative;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  animation: fx-fadein .4s ease both;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fxch-hiw-card:nth-child(1) { animation-delay: .05s; }
.fxch-hiw-card:nth-child(2) { animation-delay: .10s; }
.fxch-hiw-card:nth-child(3) { animation-delay: .15s; }
.fxch-hiw-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(124,110,245,.2);
}
.fxch-hiw-featured {
  border-color: var(--accent);
  background: linear-gradient(145deg, rgba(124,110,245,.08), var(--card) 60%);
  box-shadow: 0 0 0 1px rgba(124,110,245,.2), var(--shadow-glow);
}
.fxch-hiw-num {
  position: absolute;
  top: 16px; right: 16px;
  width: 28px; height: 28px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fxch-hiw-featured .fxch-hiw-num {
  background: var(--accent);
  color: #fff;
}
.fxch-hiw-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
.fxch-hiw-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.fxch-hiw-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

/* Plan card enhancements */
.fxch-plan-split { color: var(--green) !important; font-weight: 600 !important; }
.fxch-plan-split strong { color: var(--green) !important; }

@media (max-width: 900px) {
  .fxch-hiw-grid { grid-template-columns: 1fr; gap: 12px; }
  .fxch-hiw-card { padding: 20px 18px; }
}

/* ══════════════════════════════════════════════════════════════════════════ */
/*  PROFILE PAGE — professional layout                                        */
/* ══════════════════════════════════════════════════════════════════════════ */

.fxsim-profile-wrap { max-width: 900px; }

/* Header card */
.fxsim-profile-header-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
}
.fxsim-profile-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fxsim-profile-top h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.fxsim-profile-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}
.fxsim-profile-meta-row .fxi { opacity: .6; flex-shrink: 0; }

/* Stats grid */
.fxsim-profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

/* Bottom 2-col */
.fxsim-profile-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Profile form fields */
.fxsim-profile-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fxsim-pf-field { display: flex; flex-direction: column; gap: 5px; }
.fxsim-pf-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.fxsim-pf-field input,
.fxsim-pf-field select {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none;
}
.fxsim-pf-field input:focus,
.fxsim-pf-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Security rows */
.fxsim-profile-security { display: flex; flex-direction: column; gap: 2px; }
.fxsim-sec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.fxsim-sec-row:last-child { border-bottom: none; }
.fxsim-sec-info { display: flex; flex-direction: column; gap: 3px; }
.fxsim-sec-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
.fxsim-sec-desc { font-size: 12px; color: var(--text-muted); }
.fxsim-sec-action { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.fxsim-sec-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.fxsim-sec-status.on {
  background: rgba(16,216,160,.12);
  color: var(--green);
}
.fxsim-sec-status.off {
  background: rgba(255,83,112,.1);
  color: var(--red);
}

/* Badges */
.fxsim-profile-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.fxsim-badge-funded { background: rgba(16,216,160,.15); color: var(--green); }
.fxsim-badge-passed { background: rgba(124,110,245,.12); color: var(--accent); }
.fxsim-badge-active { background: rgba(124,110,245,.08); color: var(--accent); }
.fxsim-badge-new    { background: rgba(139,164,192,.1);  color: var(--text-muted); }

@media (max-width: 768px) {
  .fxsim-profile-header-card  { flex-direction: column; text-align: center; }
  .fxsim-profile-top          { justify-content: center; }
  .fxsim-profile-meta-row     { justify-content: center; }
  .fxsim-profile-bottom-grid  { grid-template-columns: 1fr; }
  .fxsim-profile-stats-grid   { grid-template-columns: repeat(2, 1fr); }
}

/* Certificate empty state */
.fxcert-empty-icon {
  width: 100px; height: 100px;
  background: linear-gradient(135deg, var(--accent-dim), rgba(18,212,152,.08));
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--accent);
  box-shadow: 0 0 48px var(--accent-glow);
  animation: fx-pulse 2s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/*  PHASE 9 — Rules + Statistics UI Polish                                   */
/* ══════════════════════════════════════════════════════════════════════════ */

/* ── Statistics KPI cards ─────────────────────────────────────────────────── */
/* fxst-kpis is populated by JS via innerHTML; these rules style the cards.   */
.fxst-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.fxst-kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
  animation: fx-fadein .35s ease both;
}
.fxst-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity .2s;
}
.fxst-kpi-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.fxst-kpi-card:hover::before { opacity: 1; }

/* KPI label + value — the card innerHTML is:
   <span>Label</span><strong style="color:...">Value</strong> */
.fxst-kpi-card > span {
  font-size: 10px !important;
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.fxst-kpi-card > strong {
  font-size: 22px !important;
  font-weight: 800 !important;
  font-family: var(--mono);
  letter-spacing: -.5px;
  line-height: 1;
}

/* nth-child animation stagger */
.fxst-kpi-card:nth-child(2) { animation-delay: .04s; }
.fxst-kpi-card:nth-child(3) { animation-delay: .08s; }
.fxst-kpi-card:nth-child(4) { animation-delay: .12s; }
.fxst-kpi-card:nth-child(5) { animation-delay: .16s; }
.fxst-kpi-card:nth-child(6) { animation-delay: .20s; }
.fxst-kpi-card:nth-child(7) { animation-delay: .24s; }
.fxst-kpi-card:nth-child(8) { animation-delay: .28s; }

/* Lower row: by-symbol + metrics */
.fxst-lower-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

/* ── Statistics page header refinement ────────────────────────────────────── */
#fxsim-statistics .fxdb-title {
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Rules page header — premium prop-firm look ───────────────────────────── */
/* Adds a subtle animated gradient badge above the h1                          */
.fxsim-rules-header {
  position: relative;
  padding: 20px 0 0;
}
.fxsim-rules-header::before {
  content: '🏆 FUNDED TRADER PROGRAM';
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(124,110,245,.25);
  border-radius: 20px;
  padding: 5px 16px;
  margin: 0 auto 18px;
  width: fit-content;
  text-transform: uppercase;
}

/* ── Rules CTA buttons — premium hierarchy ────────────────────────────────── */
.fxsim-rules-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 48px 0 28px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* Primary CTA — larger + glowing */
.fxsim-rules-cta .fxsim-btn-primary {
  padding: 15px 38px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: .3px;
  box-shadow: 0 4px 24px var(--accent-glow) !important;
  border-radius: var(--r-lg) !important;
  /* Override the global width:100% on .fxsim-btn-primary — inside a flex
     CTA row the button must size to its content, not stretch full-width. */
  width: auto !important;
  display: inline-flex !important;
  margin-top: 0 !important;
}
.fxsim-rules-cta .fxsim-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow) !important;
}

/* Secondary CTA — distinct from primary, clearly secondary */
.fxsim-rules-cta .fxsim-btn-ghost {
  padding: 14px 28px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  margin-left: 0 !important;   /* override inline margin-left:12px from template */
  border-radius: var(--r-lg) !important;
  opacity: .85;
  border: 1px solid var(--border2) !important;
  background: transparent !important;
  color: var(--text-dim) !important;
  transition: all .2s !important;
}
.fxsim-rules-cta .fxsim-btn-ghost:hover {
  opacity: 1;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-dim) !important;
}

/* ── Rules step cards — accent top-border on hover ────────────────────────── */
.fxsim-rules-step { position: relative; overflow: hidden; }
.fxsim-rules-step::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.fxsim-rules-step:hover::after { transform: scaleX(1); }

/* ── Rules general rule cards — icon accent ───────────────────────────────── */
.fxsim-rules-rule-icon {
  background: var(--accent-dim);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px !important;
  flex-shrink: 0;
  margin-top: 0 !important;
}

/* ── Responsive adjustments for Phase 9 ──────────────────────────────────── */
@media (max-width: 900px) {
  .fxst-lower-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .fxst-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .fxst-kpi-card { padding: 14px 16px; }
  .fxst-kpi-card > strong { font-size: 18px !important; }
}
