/* ================================================================
   The Arena - styles.css v4
   The Black Vault Funding | Midnight Black + Gold
================================================================ */

/* ── Reset & Root ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #000000;
  --bg2:          #080c10;
  --bg-card:      #0d1015;
  --gold:         #f1d890;
  --gold-dark:    #d4b84a;
  --gold-glow:    rgba(241,216,144,0.18);
  --gold-border:  rgba(241,216,144,0.22);
  --green:        #00c864;
  --green-dim:    rgba(0,200,100,0.55);
  --red:          #e03e3e;
  --red-dim:      rgba(224,62,62,0.55);
  --text:         #eceef5;
  --text-muted:   rgba(236,238,245,0.50);
  --text-sub:     rgba(236,238,245,0.30);
  --sidebar-w:    172px;
  --topbar-h:     54px;
  --radius:       10px;
  --radius-sm:    6px;
  --card-bg:      #0d1015;
  --card-border:  rgba(241,216,144,0.22);
  --card-shadow:  0 0 0 1px rgba(241,216,144,0.18), 0 0 20px rgba(241,216,144,0.07), 0 4px 24px rgba(0,0,0,0.65);
}

html { height: 100%; font-size: 14px; }

body {
  height: 100%;
  background: #000000;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* subtle gold radial on bg */
body::before {
  content: "";
  position: fixed;
  top: -300px; left: 50%;
  transform: translateX(-50%);
  width: 1000px; height: 700px;
  background: radial-gradient(ellipse at center, rgba(241,216,144,0.025) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Blur Gate ─────────────────────────────────────────────────── */
.blur-gate {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.blur-gate.hidden { display: none; }

.blur-gate-modal {
  background: #0d1015;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: clamp(24px, 4vw, 40px);
  width: min(520px, 94vw);
  box-shadow: var(--card-shadow);
}

.gate-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}

.gate-brand-mark {
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
}

.gate-brand-name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
}

.gate-brand-tag {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.gate-title {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.gate-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.gate-form { display: flex; flex-direction: column; gap: 14px; }
.gate-field { display: flex; flex-direction: column; gap: 5px; }

.gate-field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.gate-field input[type="text"],
.gate-field input[type="email"] {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.gate-field input:focus { border-color: rgba(241,216,144,0.4); }

.gate-label-block {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.gate-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.gate-radio {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.gate-radio:hover { border-color: var(--card-border); background: rgba(255,255,255,0.05); }
.gate-radio input[type="radio"] { display: none; }

.gate-radio-mark {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color 0.15s, background 0.15s;
}

.gate-radio input:checked ~ .gate-radio-mark {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 6px rgba(241,216,144,0.5);
}

.gate-radio strong { display: block; font-size: 12px; font-weight: 600; color: var(--text); }
.gate-radio em { display: block; font-size: 10px; font-style: normal; color: var(--text-muted); margin-top: 1px; }

.gate-error { font-size: 12px; color: var(--red); min-height: 16px; }

.gate-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 0 20px rgba(241,216,144,0.2);
}

.gate-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.gate-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.gate-legal { font-size: 10px; color: var(--text-sub); text-align: center; margin-top: 12px; }
.optional { color: var(--text-sub); }
.required { color: var(--red); }

/* ── App Shell ─────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.blur-active { filter: blur(10px); pointer-events: none; user-select: none; }

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #080c10;
  border-right: 1px solid rgba(241,216,144,0.10);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sidebar-logo {
  padding: 16px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo-main {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}

.sidebar-logo-sub {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav li { margin: 1px 0; }

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-decoration: none;
}

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

.nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(241,216,144,0.05);
}

.nav-item--gold { color: var(--gold) !important; }

.nav-icon { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-account {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 10px 14px 12px;
}

.sidebar-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.sidebar-account-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-sub); }
.sidebar-account-number { font-size: 10px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sidebar-logout { margin-top: 8px; font-size: 11px; }

/* ── Main Area ─────────────────────────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #080c10;
  border-bottom: 1px solid rgba(241,216,144,0.10);
  gap: 12px;
}

.topbar-title { min-width: 0; }

.topbar-heading {
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.topbar-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.status-pill--live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,200,100,0.10);
  border: 1px solid rgba(0,200,100,0.25);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--green);
  white-space: nowrap;
}

.status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,200,100,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(0,200,100,0); }
}

.last-updated { font-size: 10px; color: var(--text-sub); white-space: nowrap; }

/* ── Content Area ─────────────────────────────────────────────── */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: clamp(14px, 2vw, 20px);
  scrollbar-width: thin;
  scrollbar-color: rgba(241,216,144,0.20) transparent;
}

.content-area::-webkit-scrollbar { width: 4px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: rgba(241,216,144,0.20); border-radius: 2px; }

/* ── Views ─────────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.view-title {
  font-size: clamp(14px, 2.5vw, 17px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* ── Universal Card Base ──────────────────────────────────────── */
.card, .stat-card, .detail-card, .progress-card, .hold-time-card, .chart-card-inner {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.card { overflow: hidden; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Stat Cards ────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.5vw, 12px);
  margin-bottom: clamp(8px, 1.5vw, 12px);
}

.stats-grid-2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.5vw, 12px);
  margin-bottom: clamp(8px, 1.5vw, 12px);
}

.stat-card {
  padding: clamp(14px, 2vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
  border-radius: var(--radius);
}

.stat-card:hover {
  border-color: rgba(241,216,144,0.38);
  box-shadow: 0 0 0 1px rgba(241,216,144,0.32), 0 0 32px rgba(241,216,144,0.12), 0 4px 24px rgba(0,0,0,0.65);
}

.stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.stat-value {
  font-size: clamp(20px, 2.8vw, 28px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-value--sub {
  font-size: clamp(11px, 1.5vw, 13px);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── P&L card sub-layout ──────────────────────────────────────── */
.pnl-main {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pnl-meta {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-top: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
}

.pnl-meta-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  gap: 2px;
}

.pnl-meta-divider {
  width: 1px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.pnl-meta-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-sub);
  white-space: nowrap;
  text-align: center;
}

.pnl-meta-val {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Gauge containers ─────────────────────────────────────────── */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gauge-svg { width: 100%; max-width: 160px; }
.donut-svg  { width: 100%; max-width: 130px; }

/* ── Chart Card ────────────────────────────────────────────────── */
.chart-card {
  margin-bottom: clamp(8px, 1.5vw, 12px);
}

.chart-card-inner {
  padding: 12px 16px 10px;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chart-card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.balance-chart-container { width: 100%; overflow: hidden; }

.chart-label { font-size: 9px; fill: var(--text-sub); font-variant-numeric: tabular-nums; }

.no-data { text-align: center; padding: 20px; color: var(--text-muted); font-size: 12px; }

/* ── Progress Section ──────────────────────────────────────────── */
.progress-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.5vw, 12px);
  margin-bottom: clamp(8px, 1.5vw, 12px);
}

.progress-card {
  padding: 14px 16px;
  border-radius: var(--radius);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.progress-title { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.progress-label { font-size: 11px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.progress-track {
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.progress-bar--green {
  background: linear-gradient(90deg, var(--green), rgba(0,200,100,0.7));
  box-shadow: 0 0 8px rgba(0,200,100,0.4);
}

.progress-bar--red {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  box-shadow: 0 0 8px rgba(241,216,144,0.3);
}

.progress-pct { font-size: 10px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ── Detail Grid (Performance) ─────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1.2vw, 10px);
  margin-bottom: clamp(8px, 1.5vw, 12px);
}

.detail-card {
  padding: clamp(12px, 1.5vw, 16px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.detail-card:hover { border-color: rgba(241,216,144,0.35); }

.detail-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.10em; color: var(--text-sub); }

.detail-value {
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

/* ── Hold Time Chart Card ──────────────────────────────────────── */
.hold-time-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: clamp(8px, 1.5vw, 12px);
}

.hold-time-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.hold-chart-wrap { width: 100%; }

/* Grouped bar chart rows */
.hbc-row {
  display: grid;
  grid-template-columns: 58px 1fr 46px;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.hbc-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.hbc-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hbc-bar-track {
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.hbc-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  min-width: 0;
}

.hbc-bar-fill--win  { background: linear-gradient(90deg, #00c864, rgba(0,200,100,0.7)); }
.hbc-bar-fill--loss { background: linear-gradient(90deg, #e03e3e, rgba(224,62,62,0.7)); }

.hbc-counts {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-sub);
  text-align: left;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.hbc-count-win  { color: var(--green); font-weight: 700; }
.hbc-count-loss { color: var(--red);   font-weight: 700; }

.hbc-legend {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  padding-left: 66px;
}

.hbc-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.hbc-legend-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.hbc-legend-dot--win  { background: var(--green); }
.hbc-legend-dot--loss { background: var(--red); }

/* ── Calendar ──────────────────────────────────────────────────── */
.cal-nav { display: flex; align-items: center; gap: 8px; }

.cal-month-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  min-width: 130px;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) minmax(60px, 80px);
  gap: 4px;
  margin-top: 8px;
}

.cal-header {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-sub);
  text-align: center;
  padding: 4px 0 8px;
}

/* Calendar day tile */
.cal-day {
  background: #0d1015;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  min-height: clamp(72px, 8.5vw, 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 4px 5px;
  gap: 2px;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.cal-day--empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none !important;
}

.cal-day--win {
  background: rgba(0,40,20,0.70);
  border-color: rgba(0,200,100,0.28);
}

.cal-day--loss {
  background: rgba(40,8,8,0.70);
  border-color: rgba(224,62,62,0.28);
}

.cal-day:not(.cal-day--empty):hover {
  border-color: rgba(241,216,144,0.35);
  box-shadow: 0 0 0 1px rgba(241,216,144,0.18);
}

/* date number — top center, bold */
.cal-day-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  text-align: center;
  width: 100%;
}

.cal-day--win .cal-day-num  { color: rgba(0,200,100,0.6); }
.cal-day--loss .cal-day-num { color: rgba(224,62,62,0.6); }

/* "Profit" / "Loss" label */
.cal-day-result {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
  margin-top: 2px;
}

.cal-day--win  .cal-day-result { color: var(--green); }
.cal-day--loss .cal-day-result { color: var(--red); }

/* dollar P&L — center, large */
.cal-day-pnl {
  font-size: clamp(10px, 1.3vw, 13px);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
  margin-top: 2px;
}

/* trade count — bottom center */
.cal-day-trades {
  font-size: 8px;
  color: var(--text-sub);
  text-align: center;
  line-height: 1;
  margin-top: auto;
  padding-top: 2px;
}

.val-pos { color: var(--green) !important; }
.val-neg { color: var(--red)   !important; }

/* Weekly totals column */
.cal-week {
  background: #0d1015;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-sm);
  min-height: clamp(72px, 8.5vw, 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  gap: 3px;
  text-align: center;
}

.cal-week--pos { border-color: rgba(0,200,100,0.18); background: rgba(0,30,15,0.60); }
.cal-week--neg { border-color: rgba(224,62,62,0.18); background: rgba(35,6,6,0.60); }
.cal-week--empty { background: transparent; border-color: transparent; }

.cal-week-label {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.cal-week-pnl {
  font-size: clamp(9px, 1.1vw, 12px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cal-week-trades {
  font-size: 8px;
  color: var(--text-sub);
}

/* ── Tables ─────────────────────────────────────────────────────── */
.table-card { margin-bottom: 12px; }
.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.data-table thead tr { border-bottom: 1px solid rgba(255,255,255,0.07); }

.data-table th {
  padding: 10px 12px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-sub);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 9px 12px;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.035);
  white-space: nowrap;
}

.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.symbol { font-weight: 600; color: var(--gold); }

/* ── Collapsible Trade History ─────────────────────────────────── */
.trade-history-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin-bottom: clamp(8px, 1.5vw, 12px);
  overflow: hidden;
}

.trade-history-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: color 0.15s, background 0.15s;
}

.trade-history-toggle:hover { background: rgba(255,255,255,0.03); color: var(--text); }

.trade-history-toggle-label { display: flex; align-items: center; gap: 8px; }

.trade-history-arrow {
  font-size: 11px;
  transition: transform 0.25s ease;
  color: var(--text-sub);
}

.trade-history-panel.open .trade-history-arrow { transform: rotate(180deg); }

.trade-history-body {
  display: none;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.trade-history-panel.open .trade-history-body { display: block; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--long    { background: rgba(0,200,100,0.14);   color: var(--green); border: 1px solid rgba(0,200,100,0.2); }
.badge--short   { background: rgba(224,62,62,0.14);   color: var(--red);   border: 1px solid rgba(224,62,62,0.2); }
.badge--active  { background: rgba(0,200,100,0.12);   color: var(--green); border: 1px solid rgba(0,200,100,0.18); }
.badge--passed  { background: rgba(241,216,144,0.12); color: var(--gold);  border: 1px solid rgba(241,216,144,0.2); }
.badge--dormant { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.1); }

/* ── Account Tabs ──────────────────────────────────────────────── */
.account-tabs {
  display: flex;
  gap: 1px;
  padding: 10px 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}

.acct-tab {
  padding: 7px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.acct-tab:hover { color: var(--text); }
.acct-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s, transform 0.12s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--gold {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #000;
  box-shadow: 0 0 16px rgba(241,216,144,0.18);
}

.btn--ghost {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  color: var(--text-muted);
}

.btn--danger {
  background: rgba(224,62,62,0.14);
  border-color: rgba(224,62,62,0.2);
  color: var(--red);
}

.btn--sm { padding: 5px 10px; font-size: 11px; }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 20px; right: 20px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  z-index: 9000;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast--info    { background: rgba(30,40,60,0.96); border: 1px solid rgba(100,140,255,0.3); color: #a0b4ff; }
.toast--success { background: rgba(0,40,20,0.96);  border: 1px solid rgba(0,200,100,0.3);   color: var(--green); }
.toast--error   { background: rgba(50,8,8,0.96);   border: 1px solid rgba(224,62,62,0.3);   color: var(--red); }

/* ── Challenge Card ────────────────────────────────────────────── */
.challenge-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px;
  margin-bottom: 10px;
}

/* ── Section divider label ─────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 10px;
  margin-top: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid, .stats-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    height: 52px;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid rgba(241,216,144,0.10);
    z-index: 100;
  }

  .sidebar-logo { display: none; }
  .sidebar-account { display: none; }

  .sidebar-nav {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
  }

  .sidebar-nav ul {
    display: flex;
    flex-direction: row;
    height: 52px;
  }

  .sidebar-nav li { margin: 0; flex: 1; }

  .nav-item {
    height: 52px;
    flex-direction: column;
    justify-content: center;
    padding: 4px 2px;
    font-size: 9px;
    border-left: none;
    border-top: 2px solid transparent;
    border-radius: 0;
    gap: 3px;
    text-align: center;
  }

  .nav-item.active { border-left-color: transparent; border-top-color: var(--gold); }
  .nav-icon { width: 16px; height: 16px; opacity: 0.9; }

  .main-area { padding-bottom: 52px; }
  .app-shell { flex-direction: column; }

  .stats-grid, .stats-grid-2 { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .progress-section { grid-template-columns: 1fr; }

  .cal-grid { grid-template-columns: repeat(7, 1fr) 52px; gap: 2px; }
  .cal-day { min-height: 54px; padding: 4px 2px; }
  .cal-day-result { display: none; }
  .cal-week { min-height: 54px; }
  .hbc-row { grid-template-columns: 44px 1fr 40px; }
}

@media (max-width: 480px) {
  .stats-grid, .stats-grid-2 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .topbar-controls .last-updated { display: none; }
}
