/* ==========================================================================
   Trademind.win Dynamic Terminal Components (Charts, Corridors, L2 Book,
   5-Pillar Bars, Heatmap, Sparklines & Auth Modal)
   ========================================================================== */

/* Active Position Cards & Price Corridors */
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}
.pos-card {
  background: var(--bn-bg-elevated, #121722);
  border: 1px solid var(--bn-border, #1e2634);
  border-radius: 10px;
  padding: 13px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.pos-card:hover,
.pos-card.active-inspect {
  border-color: var(--bn-yellow, #fcd535);
  box-shadow: 0 0 0 1px rgba(252, 213, 53, 0.25);
}
.pos-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}
.pos-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}
.pos-metric-lbl {
  color: var(--bn-text-secondary, #848e9c);
  font-size: 10.5px;
  margin-bottom: 2px;
  text-transform: uppercase;
}
.pos-metric-val {
  font-weight: 700;
  color: var(--bn-text-primary, #eaecef);
}

.corridor-wrap {
  background: #0c1017;
  border: 1px solid var(--bn-border, #1e2634);
  border-radius: 8px;
  padding: 9px 11px;
}
.corridor-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 4px;
}
.corridor-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #1b222d;
}
.corridor-marker {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 14px;
  background: #eaecef;
  border-radius: 2px;
}
.corridor-dot {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bn-yellow, #fcd535);
  border: 2px solid #0b0e11;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(252, 213, 53, 0.85);
}

/* 5-Pillar Confluence & Microstructure Factor Bars */
.factor-row {
  margin-bottom: 10px;
}
.factor-hdr {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}
.factor-track {
  height: 7px;
  background: #1a2230;
  border-radius: 999px;
  overflow: hidden;
}
.factor-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* L2 Order Book Depth Ladder */
.depth-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: 3px 8px;
  font-size: 11.5px;
  margin-bottom: 2px;
  border-radius: 4px;
  overflow: hidden;
}
.depth-bg-bid {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(14, 203, 129, 0.16);
  z-index: 0;
}
.depth-bg-ask {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(246, 70, 93, 0.16);
  z-index: 0;
}
.depth-row span {
  position: relative;
  z-index: 1;
}

/* Market Conviction Heatmap */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}
.heat-tile {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--bn-border, #1e2634);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.heat-tile:hover {
  transform: translateY(-2px);
  border-color: var(--bn-yellow, #fcd535);
}
.heat-long {
  background: linear-gradient(145deg, rgba(14, 203, 129, 0.18), rgba(17, 22, 29, 0.92));
  border-color: rgba(14, 203, 129, 0.38);
}
.heat-short {
  background: linear-gradient(145deg, rgba(246, 70, 93, 0.18), rgba(17, 22, 29, 0.92));
  border-color: rgba(246, 70, 93, 0.38);
}
.heat-neutral {
  background: var(--bn-bg-elevated, #121722);
}

/* Live Telemetry Activity Log */
.log-box {
  max-height: 310px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-item {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #0d1219;
  border-left: 3px solid var(--bn-border, #1e2634);
}

/* Login / Registration (Sign Up) Modal */
.tm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.82);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.tm-modal-backdrop.open {
  display: flex;
}
.tm-auth-box {
  width: 100%;
  max-width: 440px;
  background: #11161d;
  border: 1px solid #2b3139;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}
.tm-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #0b0e11;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.tm-auth-tab {
  padding: 8px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  color: #848e9c;
  transition: all 0.15s ease;
}
.tm-auth-tab.active {
  background: var(--bn-yellow, #fcd535);
  color: #0b0e11;
}

/* Sleek Institutional Sidebar Trader Card */
.sb-user-card {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(17, 22, 29, 0.85);
  border: 1px solid rgba(252, 213, 53, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s ease;
}

.sb-user-card:hover {
  border-color: rgba(252, 213, 53, 0.45);
  background: rgba(24, 32, 42, 0.85);
}

.sb-user-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
  text-decoration: none;
  cursor: pointer;
}

.sb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fcd535, #f0b90b);
  color: #0b0e11;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(252, 213, 53, 0.25);
}

.sb-avatar.guest {
  background: #2b3139;
  color: #eaecef;
}

.sb-user-details {
  min-width: 0;
  flex: 1;
}

.sb-user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sb-user-name {
  font-weight: 700;
  font-size: 12.5px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.sb-mode-tag {
  font-size: 9px !important;
  padding: 1px 5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.4px !important;
}

.sb-user-email {
  font-size: 10.5px;
  color: var(--bn-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sb-logout-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--bn-text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.sb-logout-btn:hover {
  color: var(--bn-red);
  background: rgba(246, 70, 93, 0.14);
  border-color: rgba(246, 70, 93, 0.35);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0ecb81;
  box-shadow: 0 0 8px #0ecb81;
  display: inline-block;
  animation: tmPulse 1.6s infinite;
}
@keyframes tmPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}



/* ---- Config sub-tabs, skeleton placeholders, chart tooltip, ledger controls ---- */
.cfg-tabs { display:flex; gap:6px; overflow-x:auto; margin-bottom:14px; padding-bottom:2px; -webkit-overflow-scrolling:touch; }
.cfg-tab { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:8px; font-size:12.5px; font-weight:700; white-space:nowrap; text-decoration:none; color:var(--bn-text-secondary); background:var(--bn-bg-elevated); border:1px solid var(--bn-border); }
.cfg-tab:hover { color:var(--bn-text-primary); }
.cfg-tab.active { color:#0b0e11; background:var(--bn-yellow); border-color:var(--bn-yellow); }
.skeleton-text { color:transparent !important; background:linear-gradient(90deg, var(--bn-bg-elevated) 25%, rgba(255,255,255,0.08) 37%, var(--bn-bg-elevated) 63%); background-size:400% 100%; animation:tm-shimmer 1.3s ease infinite; border-radius:6px; min-width:90px; display:inline-block; }
@keyframes tm-shimmer { 0% { background-position:100% 50%; } 100% { background-position:0 50%; } }
.tm-chart-tip { position:absolute; z-index:5; pointer-events:none; padding:7px 9px; border-radius:6px; font-size:11px; line-height:1.5; background:rgba(11,14,17,0.95); border:1px solid var(--bn-border); color:var(--bn-text-primary); white-space:nowrap; display:none; }
.trade-row-win td:first-child { box-shadow: inset 3px 0 0 var(--bn-green); }
.trade-row-loss td:first-child { box-shadow: inset 3px 0 0 var(--bn-red); }
.stag-timer { margin-top:8px; font-size:11px; color:var(--bn-text-secondary); }
.stag-timer .bar { height:4px; border-radius:3px; background:var(--bn-bg-elevated); overflow:hidden; margin-top:3px; }
.stag-timer .bar > span { display:block; height:100%; background:var(--bn-yellow); }
@media (prefers-reduced-motion: reduce) { .skeleton-text { animation:none; } }

/* ==========================================================================
   INSTITUTIONAL ACCOUNT & USER PROFILE STYLES
   ========================================================================== */
.acc-hero {
  background: linear-gradient(135deg, rgba(24, 30, 39, 0.95) 0%, rgba(14, 18, 24, 0.98) 100%);
  border: 1px solid var(--bn-border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}
.acc-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--bn-yellow), #f3ba2f, #0ecb81);
}
.acc-hero-main {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.acc-hero-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.acc-hero-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fcd535, #f0b90b);
  color: #0b0e11;
  font-size: 24px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(240, 185, 11, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.acc-hero-meta {
  flex: 1 1 240px;
  min-width: 0;
}
.acc-hero-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.acc-hero-display-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--bn-text-primary);
  letter-spacing: -0.2px;
}
.acc-hero-handle-pill {
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  color: var(--bn-text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  user-select: none;
}
.acc-hero-handle-pill:hover {
  border-color: var(--bn-yellow);
  color: var(--bn-yellow);
  background: rgba(240, 185, 11, 0.08);
}
.acc-hero-email {
  font-size: 12.5px;
  color: var(--bn-text-secondary);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.acc-hero-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.acc-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

/* Nav Sub-Pills for quick section jump */
.acc-subnav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.acc-subnav-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--bn-text-secondary);
  background: var(--bn-bg-elevated);
  border: 1px solid var(--bn-border);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.acc-subnav-btn:hover {
  color: var(--bn-text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}
.acc-subnav-btn.active {
  color: #0b0e11;
  background: var(--bn-yellow);
  border-color: var(--bn-yellow);
}

/* KPI Micro Tiles for Balances */
.acc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .acc-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .acc-kpi-grid {
    grid-template-columns: 1fr;
  }
}
.acc-kpi-tile {
  background: var(--bn-bg-elevated);
  border: 1px solid var(--bn-border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}
.acc-kpi-tile-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--bn-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.acc-kpi-tile-val {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  margin-top: 6px;
  color: var(--bn-text-primary);
}
.acc-kpi-tile-sub {
  font-size: 11px;
  color: var(--bn-text-secondary);
  font-family: var(--font-mono, monospace);
  margin-top: 4px;
}

/* Password Input Toggle */
.acc-input-wrap {
  position: relative;
  width: 100%;
}
.acc-input-wrap .bn-input {
  padding-right: 38px;
}
.acc-pass-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--bn-text-secondary);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.acc-pass-toggle:hover {
  color: var(--bn-text-primary);
}

/* Preset Chips for Reset Amount */
.acc-preset-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.acc-preset-btn {
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--bn-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.acc-preset-btn:hover {
  color: var(--bn-yellow);
  border-color: var(--bn-yellow);
  background: rgba(240, 185, 11, 0.08);
}
.acc-preset-btn.active {
  color: #0b0e11;
  background: var(--bn-yellow);
  border-color: var(--bn-yellow);
}

/* Session List Items */
.acc-session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acc-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--bn-bg-elevated);
  border: 1px solid var(--bn-border);
  border-radius: 8px;
  gap: 12px;
  flex-wrap: wrap;
}
.acc-session-item.current {
  border-color: rgba(14, 203, 129, 0.35);
  background: rgba(14, 203, 129, 0.04);
}
.acc-session-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 200px;
  min-width: 0;
}
.acc-session-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bn-text-secondary);
  flex-shrink: 0;
}
.acc-session-details {
  flex: 1;
  min-width: 0;
}
.acc-session-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--bn-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.acc-session-sub {
  font-size: 11px;
  color: var(--bn-text-secondary);
  font-family: var(--font-mono, monospace);
  margin-top: 2px;
}
