/* ==========================================================================
   BitLa+ Main Stylesheet
   Modern Cyber-Financial Aesthetic with Glassmorphism & High Usability
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
  height: 64px;
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
}

.logo-icon,
.logo-bitcoiners-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.logo-text span {
  color: #FFCC00;
  text-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

.badge-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 245, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 245, 255, 0.25);
  letter-spacing: 0.5px;
}

/* Exchange Selector Tabs */
.exchange-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.exchange-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.exchange-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

.exchange-tab-btn.active {
  background: var(--accent-primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

/* Header Right Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ==========================================================================
   Settings Dropdown & Theme Submenu Component
   ========================================================================== */
.settings-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.settings-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: all 0.2s ease;
}

.settings-btn:hover, .settings-btn.active {
  color: var(--text-main);
  background: var(--bg-surface-hover);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.15);
}

.settings-btn .settings-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-btn .theme-moon-svg {
  display: block;
  width: 18px;
  height: 18px;
}

.settings-btn.active .settings-icon {
  transform: rotate(-15deg) scale(1.08);
}

/* Settings Menu Dropdown */
.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.settings-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.settings-menu-header {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 10px 4px;
}

/* Menu Item: Temas */
.settings-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  user-select: none;
}

.settings-menu-item:hover, .settings-menu-item.active {
  background: var(--bg-surface-hover);
  color: var(--accent-cyan);
}

.settings-item-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-item-label .item-icon {
  font-size: 15px;
}

.submenu-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.settings-menu-item.active .submenu-arrow {
  transform: rotate(90deg);
}

/* Submenu container */
.settings-submenu {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding: 6px 4px 6px 8px;
  border-left: 2px solid var(--border-color);
  background: var(--bg-secondary);
  border-radius: 0 8px 8px 0;
}

.settings-submenu.open {
  display: flex;
}

.settings-submenu-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-subtle);
  padding: 2px 8px 4px;
  text-transform: uppercase;
}

/* Theme Option Button */
.theme-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-main);
  text-align: left;
  transition: all 0.2s ease;
}

.theme-option-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-color);
}

.theme-option-btn.active {
  background: var(--bg-surface-hover);
  border-color: var(--accent-cyan);
}

.theme-opt-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-opt-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-surface);
}

.theme-opt-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.theme-opt-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main) !important;
}

.theme-opt-desc {
  font-size: 10px;
  color: var(--text-muted) !important;
}

.theme-check {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-cyan);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.theme-option-btn.active .theme-check {
  opacity: 1;
}

/* Auth Profile / Button */
.auth-btn {
  background: linear-gradient(135deg, var(--accent-cyan), #00A6FF);
  color: #001220;
  border: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.user-badge-container {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 4px 12px 4px 6px;
  border-radius: 20px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #FFFFFF;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.user-role {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  margin-left: 6px;
  transition: color 0.2s;
}

.btn-logout:hover {
  color: var(--color-bearish);
}

/* ==========================================================================
   Main Application Grid Layout
   ========================================================================== */
.main-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 310px 330px;
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* Sidebar Panels */
.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-title i, .panel-title span.icon {
  font-size: 15px;
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Top Movers Section */
.movers-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.movers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.token-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.token-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-glow);
  transform: translateX(2px);
}

.token-card.active {
  border-color: var(--accent-cyan);
  background: var(--bg-surface-hover);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.1);
}

.radar-exchange-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  max-width: 155px;
}

.radar-exchange-select:hover, .radar-exchange-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.2);
}

.exchange-badge-tag {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-block;
  line-height: 1.3;
}

.tag-binance {
  background: rgba(243, 186, 47, 0.15);
  color: #F3BA2F;
  border: 1px solid rgba(243, 186, 47, 0.35);
}

.tag-bybit {
  background: rgba(255, 145, 0, 0.15);
  color: #FF9100;
  border: 1px solid rgba(255, 145, 0, 0.35);
}

.tag-bitget {
  background: rgba(0, 245, 255, 0.15);
  color: #00F5FF;
  border: 1px solid rgba(0, 245, 255, 0.35);
}

.tag-mexc {
  background: rgba(0, 230, 118, 0.15);
  color: #00E676;
  border: 1px solid rgba(0, 230, 118, 0.35);
}

.tag-bitunix {
  background: rgba(168, 85, 247, 0.15);
  color: #A855F7;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.tag-spot {
  background: rgba(0, 229, 255, 0.15);
  color: #00E5FF;
  border: 1px solid rgba(0, 229, 255, 0.35);
}

/* Radar Market Navigation Tabs */
.radar-market-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
}

.radar-tab-btn {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.radar-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.radar-tab-btn.active {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.45);
  color: #00E5FF;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.radar-tab-icon {
  font-size: 11px;
}

.token-market-type.spot {
  color: #00E5FF;
  font-weight: 600;
}

.sig-market-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-hover);
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.sig-market-tag.tag-spot {
  background: rgba(0, 229, 255, 0.15);
  color: #00E5FF;
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.spot-radar-info-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin-bottom: 8px;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #00E5FF;
}

.token-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.token-symbol {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.token-market-type {
  font-size: 10px;
  color: var(--text-muted);
}

.token-price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.token-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.pct-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.pct-bullish {
  background: var(--color-bullish-bg);
  color: var(--color-bullish);
  border: 1px solid rgba(0, 230, 118, 0.25);
}

.pct-bearish {
  background: var(--color-bearish-bg);
  color: var(--color-bearish);
  border: 1px solid rgba(255, 59, 48, 0.25);
}

/* ==========================================================================
   Central Chart Workspace
   ========================================================================== */
.chart-workspace {
  background: #11132e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

.chart-header {
  padding: 10px 18px;
  background: #11132e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.chart-symbol-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.current-symbol {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.current-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.chart-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.chart-badge.highlight {
  background: rgba(0, 245, 255, 0.1);
  color: var(--accent-cyan);
  border-color: rgba(0, 245, 255, 0.3);
}

/* Floating In-Chart Candle Countdown Timer */
.chart-floating-countdown {
  position: absolute;
  z-index: 20;
  transform: translateY(-50%);
  background: rgba(10, 16, 26, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 245, 255, 0.4);
  border-radius: 8px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.65), 0 0 12px rgba(0, 245, 255, 0.2);
  pointer-events: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  opacity: 0;
  transition: top 0.12s ease-out, opacity 0.2s ease;
  user-select: none;
}

[data-theme="white"] .chart-floating-countdown {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 10px rgba(2, 132, 199, 0.2);
  color: #0F172A;
}

[data-theme="dark"] .chart-floating-countdown {
  background: rgba(14, 16, 22, 0.9);
  border-color: rgba(0, 245, 255, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 245, 255, 0.18);
}

[data-theme="blue"] .chart-floating-countdown {
  background: rgba(8, 14, 26, 0.92);
  border-color: rgba(0, 245, 255, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75), 0 0 14px rgba(0, 245, 255, 0.25);
}

.chart-floating-countdown .countdown-icon {
  font-size: 11px;
  line-height: 1;
}

.chart-floating-countdown .countdown-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
}

.chart-floating-countdown strong {
  color: var(--accent-cyan);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.countdown-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  display: inline-block;
  animation: countdown-pulse-glow 1.5s infinite;
  flex-shrink: 0;
}

@keyframes countdown-pulse-glow {
  0% { transform: scale(0.9); opacity: 0.5; box-shadow: 0 0 0 0 rgba(0, 245, 255, 0.7); }
  70% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 0 5px rgba(0, 245, 255, 0); }
  100% { transform: scale(0.9); opacity: 0.5; box-shadow: 0 0 0 0 rgba(0, 245, 255, 0); }
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

#legend-delta-vp {
  transition: opacity 0.2s ease, transform 0.15s ease;
  user-select: none;
}

#legend-delta-vp:hover {
  transform: translateY(-1px);
}

.legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-ema15 { background: #1565c0; }
.dot-ema30 { background: #ffffff; }

.chart-container-box {
  flex: 1;
  width: 100%;
  position: relative;
  background: #11132e;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-price-pane {
  flex: 7;
  position: relative;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: #11132e;
}

#trading-chart {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Hide TradingView Attribution Logos from All Chart Panes */
#tv-attr-logo,
a[id^="tv-attr-logo"],
a[href*="tradingview.com"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.chart-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

/* PineScript Momentum HUD Table (Semi-transparent background, without green border) */
.chart-momentum-hud {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  background: rgba(17, 19, 46, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  user-select: none;
  min-width: 160px;
}

[data-theme="white"] .chart-momentum-hud {
  background: rgba(240, 243, 250, 0.7);
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.hud-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.hud-meter {
  font-size: 12px;
  font-weight: 800;
  font-family: monospace;
  letter-spacing: 0.8px;
}

.hud-status {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
  opacity: 0.95;
}

/* Lower Sub-pane: RSI Jules Indicator (Integrated seamlessly without division line) */
.rsi-sub-pane {
  height: 210px;
  min-height: 190px;
  width: 100%;
  position: relative;
  border-top: none; /* No divider line */
  background: #11132e;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.rsi-header {
  height: 18px;
  padding: 2px 14px;
  background: transparent; /* No dividing bar */
  border-bottom: none;     /* No bottom border */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 5;
  pointer-events: none;
}

.rsi-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rsi-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.rsi-val-badge {
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

#rsi-chart {
  flex: 1;
  width: 100%;
  position: relative;
  min-height: 0;
}

.rsi-overlay-canvas {
  position: absolute;
  top: 18px;
  left: 0;
  width: 100%;
  height: calc(100% - 18px);
  pointer-events: none;
  z-index: 4;
}

.chart-loader {
  display: none !important;
}

/* Subtle in-header live synchronization indicator */
.chart-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.chart-sync-indicator.syncing {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00E676;
  box-shadow: 0 0 6px #00E676;
}

.chart-sync-indicator.syncing .sync-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
  animation: pulse-sync 0.8s infinite alternate;
}

@keyframes pulse-sync {
  from { opacity: 0.3; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

/* ==========================================================================
   Right Panel: Signal Radar & Education
   ========================================================================== */
.signal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signal-header-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trend-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.trend-bullish {
  background: var(--color-bullish-bg);
  color: var(--color-bullish);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.trend-bearish {
  background: var(--color-bearish-bg);
  color: var(--color-bearish);
  border: 1px solid rgba(255, 59, 48, 0.3);
}

.trend-neutral {
  background: rgba(132, 147, 172, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.ema-values-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.ema-val-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ema-val-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.ema-val-number {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ema-val-number.fast { color: var(--ema-fast-color); }
.ema-val-number.slow { color: var(--ema-slow-color); }

/* Educational Trading Lab Card */
.edu-card {
  background: linear-gradient(145deg, var(--bg-surface), var(--bg-secondary));
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edu-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.edu-desc {
  font-size: 11.5px;
  color: #c4c8db;
  line-height: 1.55;
  white-space: pre-line;
  word-break: break-word;
}

.edu-desc strong {
  font-weight: 700;
  color: #ffffff;
}

.edu-desc .highlight-rec {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Signal History Feed */
.signals-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signal-history-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left-width: 3px;
}

.signal-history-item.LONG,
.signal-history-item.BUY {
  border-left-color: #00E676;
}

.signal-history-item.SHORT,
.signal-history-item.SELL {
  border-left-color: #FF1744;
}

.sig-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sig-type-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.sig-type-tag.LONG,
.sig-type-tag.BUY {
  background: rgba(0, 230, 118, 0.15);
  color: #00E676;
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.sig-type-tag.SHORT,
.sig-type-tag.SELL {
  background: rgba(255, 23, 68, 0.15);
  color: #FF1744;
  border: 1px solid rgba(255, 23, 68, 0.3);
}

.sig-time {
  font-size: 11px;
  color: var(--text-subtle);
}

.sig-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  font-family: monospace;
}

.sig-reason {
  font-size: 11px;
  color: #c4c8db;
  line-height: 1.55;
  white-space: pre-line;
  word-break: break-word;
  margin-top: 4px;
}

.sig-reason strong,
.toast-body strong {
  font-weight: 700;
  color: #ffffff;
}

.sig-reason .highlight-rec,
.toast-body .highlight-rec {
  color: var(--accent-cyan);
  font-weight: 700;
}

.sig-exchange-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-hover);
  color: var(--text-muted);
  text-transform: uppercase;
}

.sig-action-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  cursor: pointer;
  align-self: flex-start;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: opacity 0.2s;
}

.sig-action-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* AI Agent Sentinel UI Components */
.agent-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
  font-size: 11px;
}

.agent-status-info {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-weight: 500;
}

.agent-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00E676;
  box-shadow: 0 0 8px #00E676;
  animation: pulse-dot 1.5s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.agent-scan-mini-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.agent-scan-mini-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

.agent-feed-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.agent-tab-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.agent-tab-btn.active {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--accent-cyan);
  font-weight: 700;
}

.token-sig-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  display: inline-block;
  letter-spacing: 0.3px;
}

.token-sig-badge.BUY {
  background: #00E676;
  color: #000;
  animation: pulse-badge 1.8s infinite;
}

.token-sig-badge.SELL {
  background: #FF1744;
  color: #fff;
  animation: pulse-badge 1.8s infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

/* Toast Notifications Container */
.agent-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
  max-width: 360px;
}

.agent-toast {
  pointer-events: auto;
  background: rgba(18, 20, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: toast-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-left-width: 4px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.agent-toast:hover {
  transform: translateY(-2px);
}

.agent-toast.BUY {
  border-left-color: #00E676;
}

.agent-toast.SELL {
  border-left-color: #FF1744;
}

.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toast-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.toast-body {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  white-space: pre-line;
  word-break: break-word;
}

.toast-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-subtle);
  margin-top: 2px;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   Modals (Authentication & Alerts)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transform: translateY(16px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.modal-tab-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: var(--bg-secondary);
}

.modal-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 245, 255, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #00A6FF);
  color: #001220;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  opacity: 0.95;
  box-shadow: var(--shadow-glow);
}

.auth-error {
  background: var(--color-bearish-bg);
  border: 1px solid rgba(255, 59, 48, 0.3);
  color: var(--color-bearish);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  display: none;
}

.btn-plans {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(0, 245, 255, 0.08);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-plans:hover {
  background: var(--accent-cyan);
  color: #001220;
  box-shadow: 0 4px 14px rgba(0, 245, 255, 0.35);
  transform: translateY(-1px);
}

[data-theme="white"] .btn-plans:hover {
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

/* ==========================================================================
   VIP Platform Access Guard (Restricted to BITLA ULTRA & ADMIN)
   ========================================================================== */
.ultra-guard-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - 64px);
  padding: 24px 16px;
  box-sizing: border-box;
  background: radial-gradient(circle at 50% 30%, rgba(0, 245, 255, 0.05) 0%, rgba(8, 11, 17, 0.98) 70%);
  position: relative;
  z-index: 90;
}

[data-theme="white"] .ultra-guard-overlay {
  background: radial-gradient(circle at 50% 30%, rgba(0, 102, 255, 0.04) 0%, rgba(248, 250, 252, 0.98) 70%);
}

.ultra-guard-card {
  max-width: 480px;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 245, 255, 0.08);
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  animation: guardCardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes guardCardAppear {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ultra-guard-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #00F5FF, #8A2BE2, #00E676);
}

.ultra-guard-icon-wrap {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: rgba(0, 245, 255, 0.08);
  border: 1px solid rgba(0, 245, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.15);
}

.ultra-guard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(138, 43, 226, 0.15);
  border: 1px solid rgba(138, 43, 226, 0.35);
  color: #C084FC;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.ultra-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #A855F7;
  box-shadow: 0 0 8px #A855F7;
}

.ultra-guard-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

.ultra-guard-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 20px;
}

.guard-form-intro {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
}

.guard-login-form .form-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  transition: all 0.2s ease;
}

.guard-login-form .form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.2);
}

.guard-forbidden-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
}

.guard-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.guard-user-pill .pill-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00F5FF, #8A2BE2);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.guard-user-pill .pill-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 13px;
  display: block;
}

.guard-user-pill .pill-role {
  font-size: 11px;
  font-weight: 600;
  color: #FFB300;
}

.guard-forbidden-alert {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.25);
  margin: 14px 0;
  color: #FF6961;
  font-size: 12px;
  line-height: 1.5;
}

.guard-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 768px) {
  .ultra-guard-card {
    padding: 24px 18px;
  }
  .ultra-guard-title {
    font-size: 18px;
  }
  .guard-actions-row {
    flex-direction: column;
  }
}

.mobile-nav-dock.guard-locked {
  display: none !important;
}

