/**
 * Dashboard Styles
 * Extended styles for the user dashboard
 */

/* Subtle Premium Refresh Button Styling */
.btn-refresh-premium {
  background: rgba(31, 221, 254, 0.1);
  color: var(--color-text);
  border: 1px solid rgba(31, 221, 254, 0.3);
  font-size: var(--font-size-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wide);
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.85;
}

.btn-refresh-premium:hover:not(:disabled) {
  background: rgba(31, 221, 254, 0.15);
  border-color: rgba(31, 221, 254, 0.4);
  opacity: 1;
  transform: translateY(-1px);
}

.btn-refresh-premium:active:not(:disabled) {
  transform: translateY(0);
  background: rgba(31, 221, 254, 0.12);
}

.btn-refresh-premium:disabled,
.btn-refresh-premium.loading {
  opacity: 0.6;
  cursor: wait;
  background: rgba(31, 221, 254, 0.08);
  border-color: rgba(31, 221, 254, 0.2);
}

/* Light mode support - see comprehensive fixes at end of file */

/* ===== Responsive Visibility ===== */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: block !important;
  }
  
  .mobile-only.btn,
  .mobile-only button {
    display: flex !important;
  }
}

/* ===== DX Balance Card Specific ===== */

/* Refresh Button - Icon Style (moved from inline styles) */
#refreshAllDataBtn {
  width: 28px;
  height: 28px;
  border-radius: 6px; /* Custom size between --radius-sm (4px) and --radius-md (8px) */
  border: none;
  background: rgba(31, 221, 254, 0.15); /* Primary color with opacity */
  color: var(--color-primary); /* Using design token instead of #1fddfe */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-4xl); /* 36px - Large emoji size */
  transition: var(--transition-base); /* Using design token instead of 0.2s ease */
  box-shadow: var(--shadow-sm); /* Using design token */
  flex-shrink: 0;
  margin-left: auto;
  padding: 0; /* Ensure no padding for icon button */
}

#refreshAllDataBtn:hover {
  background: rgba(31, 221, 254, 0.25) !important;
  transform: scale(1.05);
}

#refreshAllDataBtn:active {
  transform: scale(0.95);
}

html.light #refreshAllDataBtn {
  background: rgba(31, 221, 254, 0.1) !important;
  color: var(--color-primary-dark) !important; /* #0ea5e9 */
}

html.light #refreshAllDataBtn:hover {
  background: rgba(31, 221, 254, 0.2) !important;
}

/* ===== Stat Filter Styles ===== */
/* Stat filter container - flexbox layout for filter buttons */
.stat-filters-container {
  display: flex;
  align-items: center;
  gap: var(--space-2); /* 8px gap using design token */
}

/* Stat filter group - removes default margin */
.stat-filter {
  margin: 0;
}

/* ===== Sidebar/Live Streams Styles ===== */
/* Sidebar header with title and actions */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5); /* 20px - using design token */
}

.sidebar-title {
  margin: 0;
}

.sidebar-actions {
  display: flex;
  gap: var(--space-2); /* 8px - using design token */
  align-items: center;
}

/* Sidebar action buttons (Clear, View All) */
.sidebar-action-btn {
  font-size: var(--font-size-sm); /* 14px - using closest token (13px → 14px) */
  padding: var(--space-1) var(--space-2); /* 4px 8px - using design tokens */
  color: var(--color-text-tertiary);
}

/* Sidebar content container */
.sidebar-content {
  min-height: 100px;
}

/* Empty state for live streams */
.no-live-streams {
  text-align: center;
  padding: var(--space-10) var(--space-5); /* 40px 20px - using design tokens */
  color: var(--color-text-tertiary);
}

.no-live-streams p {
  margin: 0 0 var(--space-4) 0; /* 0 0 16px 0 - using design token */
}

/* ===== Wallet Modal Styles ===== */
/* Wallet modal header layout */
.wallet-modal-header-layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}

.wallet-modal-header-content {
  flex: 1;
}

/* ===== Sidebar Navigation Button Styles ===== */
/* Sidebar nav buttons (Help, Theme) - remove default button styles */
.sidebar-nav-button {
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
}

/* ===== Wallet Prompt Styles ===== */
#walletPrompt {
  padding: 0 var(--space-5); /* 0 20px - using design token */
}

/* Hide wallet prompt when it has the hidden class */
#walletPrompt.hidden {
  display: none !important;
}

/* ===== Staking Section Styles ===== */
/* Staking requirement hint text */
.staking-requirement-hint {
  font-size: var(--font-size-xs); /* 0.75rem - using design token */
  color: var(--color-text-secondary);
  margin-top: var(--space-2); /* 8px - using design token */
}

/* Progress fill width is dynamic (controlled by JS) - keep inline for that */

/* ===== Utility Classes ===== */
/* Hidden utility class - for elements controlled by JavaScript */
/* Note: No !important so JavaScript can override with style.display */
.hidden {
  display: none;
}

/* ===== Footer Styles ===== */
.footer-content {
  padding: 0 var(--space-5); /* 0 20px - using design token */
  width: 100%;
  max-width: 100%;
}

/* ===== Loading Overlay ===== */
/* Loading overlay is controlled by JS - display: none is acceptable */

/* ===== Image Styles ===== */
/* Discord logo in dropdown */
.wallet-dropdown-item-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

/* ===== Trading Bot Modal Styles ===== */
/* Disabled activation step */
.activation-step-disabled {
  opacity: 0.5;
}

/* ===== Dashboard Layout ===== */
.dashboard-main {
  flex: 1;
  padding: var(--spacing-xl) 0;
  min-height: calc(100vh - 200px);
}

.dashboard-header {
  text-align: left;
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
  width: 100%;
}

.dashboard-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  width: 100%;
  max-width: none;
  padding: 0 var(--space-5);
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

.dashboard-content .container {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding: 0;
}

.dashboard-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  width: 100%;
  position: relative;
}

/* Three-column layout for Staking, Trading Bot, and Subscriptions */
.dashboard-row-three-columns {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

@media (max-width: 1200px) {
  .dashboard-row-three-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-row-three-columns {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    /* Reduced gap on mobile for better spacing */
    margin-top: var(--spacing-md);
  }
}

/* iPhone 14 Landscape (844px × 390px) - Match iPad Pro Portrait Layout (1024×1366) */
/* Apply tablet PORTRAIT layout styles (NOT landscape) to iPhone landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {

  /* Match tablet PORTRAIT layout for dashboard-row-three-columns */
  /* In portrait: Trading Bot + Streams side by side (columns 1-2), Staking spans 2 columns below */
  .dashboard-row-three-columns {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
  }

  /* Trading Bot - first column, first row */
  .dashboard-row-three-columns>.trading-bot-card {
    grid-column: 1;
    grid-row: 1;
  }

  /* Live Streams - second column, first row */
  .dashboard-row-three-columns>.sidebar-box {
    grid-column: 2;
    grid-row: 1;
  }

  /* Staking - spans columns 1-2, second row (matches iPad Pro portrait 1024×1366 layout) */
  .dashboard-row-three-columns>.staking-card {
    grid-column: 1 / span 2;
    grid-row: 2;
  }

  /* Apply tablet portrait styles to stat cards, staking, etc. */
  /* 2x2 grid layout for stat cards - better for iPad portrait and iPhone landscape */
  .dashboard-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto repeat(2, auto) auto !important;
    gap: var(--spacing-md) !important;
  }

  /* Welcome message spans all columns */
  .welcome-message-wrapper {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  /* Stat cards in 2x2 grid - force override */
  .dashboard-stats-row>.dashboard-card.stat-card-small {
    grid-row: auto !important;
  }

  /* DX Trade Balance - top left */
  .dashboard-stats-row>.dashboard-card:nth-child(2) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  /* Total PnL - top right */
  .dashboard-stats-row>.dashboard-card:nth-child(4) {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  /* Active Positions - bottom left */
  .dashboard-stats-row>.dashboard-card:nth-child(5) {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }

  /* Trading Volume - bottom right */
  .dashboard-stats-row>.dashboard-card:nth-child(6) {
    grid-column: 2 !important;
    grid-row: 3 !important;
  }

  /* DX Growth Chart - spans both columns below 2x2 grid */
  .dashboard-stats-row>.dashboard-card-graph {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    width: 100% !important;
  }

  /* Ensure stat cards are properly sized for 2x2 grid */
  .stat-card-small {
    min-width: 0;
    width: 100%;
    aspect-ratio: 1.2 / 1 !important;
    /* Slightly taller for 2x2 grid */
    padding: var(--spacing-md) var(--spacing-lg) !important;
    min-height: 130px !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
  }

  /* Optimize stat card header for 2x2 layout */
  .stat-card-small .stat-header-compact {
    margin-bottom: var(--spacing-sm) !important;
  }

  /* Optimize stat card icons */
  .stat-card-small .stat-icon-compact {
    width: 32px !important;
    height: 32px !important;
    font-size: var(--font-size-lg) !important; /* 1.125rem - using closest token (1.2rem → 1.125rem) */
  }

  /* Optimize stat card action buttons (refresh, dropdown) */
  .stat-card-small .stat-header-actions {
    gap: var(--spacing-xs) !important;
  }

  .stat-card-small .stat-action-emoji,
  .stat-card-small .stat-filter-select {
    min-width: 36px !important;
    min-height: 36px !important;
    font-size: var(--font-size-sm) !important; /* 0.875rem - using closest token (0.9rem → 0.875rem) */
    padding: var(--spacing-xs) var(--spacing-sm) !important;
  }

  /* Ensure growth chart displays properly */
  .dashboard-card-graph {
    width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .staking-card {
    grid-column: span 2;
  }

  .pool-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--spacing-md);
  }

  .staking-info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  /* Tablet portrait text sizing - optimized for 2x2 grid */
  .stat-card-small .stat-title-compact {
    font-size: clamp(0.85rem, 1.8vw, 1rem) !important;
    font-weight: 500 !important;
    margin-bottom: var(--spacing-xs) !important;
  }

  .stat-card-small .stat-value-compact {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem) !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    margin: var(--spacing-xs) 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    max-height: 2.4em !important;
  }

  .stat-card-small .stat-label-compact {
    font-size: clamp(0.75rem, 1.4vw, 0.9rem) !important;
    margin-top: var(--spacing-xs) !important;
    opacity: 0.8 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .stat-card-small {
    padding: var(--spacing-lg) !important;
  }

  /* Staking amount display - portrait sizing */
  .staking-amount-display {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  .staking-amount-value {
    font-size: clamp(2.5rem, 5vw, 3rem);
  }

  /* Countdown timer - portrait layout (vertical, not horizontal) */
  .countdown-display {
    gap: var(--spacing-md);
    flex-direction: row;
    /* Keep horizontal but with portrait spacing */
  }

  .countdown-item {
    min-width: 70px;
    padding: var(--spacing-md);
  }

  .countdown-value {
    font-size: clamp(1.5rem, 3vw, 1.75rem);
  }

  /* Live streams - portrait sizing */
  .sidebar-box {
    padding: var(--spacing-lg) !important;
  }

  #related .rel {
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
  }

  #related .rel .thumb {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
  }

  #related .rel .t .tt {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.5;
  }

  #related .rel .t .m {
    font-size: clamp(0.8rem, 1.4vw, 1rem);
  }

  .sidebar-title {
    font-size: clamp(1.2rem, 2.2vw, 1.5rem) !important;
    margin-bottom: var(--spacing-lg) !important;
  }
}

/* Mobile Landscape (smaller phones, < 768px width) - Keep side by side layout */
@media (max-width: 767px) and (orientation: landscape) {

  /* Make dashboard-row-three-columns match dashboard-row width */
  .dashboard-row-three-columns {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: var(--spacing-md);
    align-items: stretch;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  /* Trading Bot - left half */
  .dashboard-row-three-columns>.trading-bot-card {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* Live Streams - right half */
  .dashboard-row-three-columns>.sidebar-box {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* Ensure both cards have equal heights and fill space */
  .dashboard-row-three-columns>.trading-bot-card,
  .dashboard-row-three-columns>.sidebar-box {
    align-self: stretch;
    height: 100%;
  }

  /* Make card bodies flex to fill available space */
  .dashboard-row-three-columns>.trading-bot-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  /* Ensure sidebar-box content fills space */
  .dashboard-row-three-columns>.sidebar-box #related {
    flex: 1;
    min-height: 0;
  }

  /* Staking - full width below */
  .dashboard-row-three-columns>.staking-card {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
}

/* Stats Row + VAL Holdings (tall rectangle on right) Layout */
.dashboard-row-stats-with-val {
  display: grid;
  grid-template-columns: 4fr 1fr;
  gap: var(--spacing-lg);
  width: 100%;
  align-items: start;
  justify-items: start;
  margin-bottom: var(--spacing-md);
  overflow: visible;
  /* Allow welcome message to be visible above cards */
  box-sizing: border-box;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

/* Responsive: Stack VAL Holdings below on smaller screens */
@media (max-width: 1200px) {
  .dashboard-row-stats-with-val {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    /* Reduced gap on tablet */
  }

  .dashboard-val-holdings-tall {
    order: 2;
  }
}

/* Mobile optimizations for VAL holdings section */
@media (max-width: 768px) {
  .dashboard-row-stats-with-val {
    gap: var(--spacing-sm);
    /* Reduced gap on mobile */
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    /* Ensure proper alignment */
  }

  .dashboard-val-holdings-tall {
    gap: var(--spacing-sm);
    /* Reduced gap between VAL card and swap card on mobile */
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    /* Ensure proper alignment */
  }

  /* Ensure VAL card and swap card have equal margins */
  .stat-card-val-tall,
  .swap-card {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }
  
  /* Swap card spacing when placed under VAL balance */
  .swap-card-compact {
    margin-top: var(--spacing-md); /* Using design token */
  }
}

.dashboard-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: var(--spacing-md);
  width: 100%;
  align-items: start;
  justify-items: stretch;
  text-align: left;
}

/* Welcome message in first row, spans all columns - align with cards */
.welcome-message-wrapper {
  grid-row: 1;
  grid-column: 1 / -1;
  margin: 0 0 var(--space-3) 0; /* 12px bottom margin using design token */
  padding: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0 !important;
  min-width: 0;
  /* Flexbox properties moved from inline styles */
  display: flex;
  align-items: center;
  gap: var(--space-3); /* 12px gap using design token */
  flex-wrap: nowrap;
}

/* Ensure welcome message title has no extra padding/margin */
.welcome-message-wrapper .dashboard-title {
  padding: 0 !important;
  margin: 0 !important;
}

/* Fixed sizing for welcome message - not responsive */
.welcome-message-wrapper .dashboard-title {
  font-size: var(--font-size-lg); /* 1.125rem (18px) - close to 1.1rem, using design token */
  font-weight: var(--font-weight-semibold); /* 600 - using design token */
  line-height: 1.2;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap;
  flex-shrink: 0;
}

/* All stat cards in second row */
.dashboard-stats-row>.dashboard-card.stat-card-small {
  grid-row: 2;
}

/* Graph card in third row, spanning all 4 columns */
.dashboard-stats-row>.dashboard-card-graph {
  grid-row: 3;
  grid-column: 1 / 5;
}

/* Responsive grid adjustments for stat cards */
@media (max-width: 1400px) {
  .dashboard-stats-row {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
  }
}

/* iPad Pro Portrait (1024px width) - 4x1 layout with optimized fonts */
@media (min-width: 1024px) and (max-width: 1200px) and (orientation: portrait) {
  .dashboard-stats-row {
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: auto 1fr auto !important;
    gap: var(--spacing-md) !important;
  }

  /* All stat cards in second row */
  .dashboard-stats-row>.dashboard-card.stat-card-small {
    grid-row: 2 !important;
  }

  /* DX Trade Balance - first column */
  .dashboard-stats-row>.dashboard-card:nth-child(2) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  /* Total PnL - second column */
  .dashboard-stats-row>.dashboard-card:nth-child(4) {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  /* Active Positions - third column */
  .dashboard-stats-row>.dashboard-card:nth-child(5) {
    grid-column: 3 !important;
    grid-row: 2 !important;
  }

  /* Trading Volume - fourth column */
  .dashboard-stats-row>.dashboard-card:nth-child(6) {
    grid-column: 4 !important;
    grid-row: 2 !important;
  }

  /* DX Growth Chart - spans all 4 columns */
  .dashboard-stats-row>.dashboard-card-graph {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
  }

  /* Optimized font sizes for 4x1 layout - fit within 168x120 */
  .stat-card-small {
    padding: 2px var(--spacing-md) 4px var(--spacing-md) !important;
    aspect-ratio: 2.2 / 1 !important;
    min-height: 120px !important;
    max-height: 120px !important;
    height: 120px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }

  /* Ensure consistent header height for label alignment - align to very top */
  .stat-card-small .stat-header-compact {
    min-height: 18px !important;
    height: 18px !important;
    max-height: 18px !important;
    margin-bottom: 2px !important;
    margin-top: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-shrink: 0 !important;
  }

  .stat-card-small .stat-header-actions,
  .stat-card-small .stat-filter-dropdown {
    min-height: 18px !important;
    height: 18px !important;
    max-height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .stat-card-small .stat-action-emoji,
  .stat-card-small .stat-filter-select {
    margin: 0 !important;
    padding: 0 !important;
    font-size: var(--font-size-sm) !important; /* 0.875rem - using closest token (0.8rem → 0.875rem) */
    line-height: 1 !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
  }

  .stat-card-small .stat-filter-dropdown .custom-dropdown,
  .stat-card-small .stat-filter-dropdown select {
    height: 18px !important;
    line-height: 18px !important;
    display: flex !important;
    align-items: center !important;
  }

  .stat-card-small .stat-title-compact {
    font-size: clamp(0.65rem, 0.95vw, 0.75rem) !important;
    margin-bottom: 2px !important;
    margin-top: 0 !important;
    line-height: 1.1 !important;
    flex-shrink: 0 !important;
  }

  .stat-card-small .stat-value-compact {
    font-size: clamp(0.85rem, 1.7vw, 1.05rem) !important;
    line-height: 1.1 !important;
    font-weight: 600 !important;
    margin: 2px 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    max-height: 1.6em !important;
    flex: 1 1 auto !important;
  }

  .stat-card-small .stat-label-compact {
    font-size: clamp(0.6rem, 0.85vw, 0.7rem) !important;
    margin-top: 2px !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    opacity: 0.8 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    text-align: left !important;
    display: block !important;
    line-height: 1.1 !important;
    flex-shrink: 0 !important;
  }
}

@media (max-width: 1200px) {

  /* Exclude iPad Pro portrait and iPhone 14 landscape (768px-1024px) - they have their own layouts */
  .dashboard-stats-row {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto repeat(3, auto);
    gap: var(--spacing-md);
  }

  /* Keep welcome message fixed size */
  .welcome-message-wrapper {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  /* Cards in 2x2 grid on tablet */
  .dashboard-stats-row>.dashboard-card.stat-card-small {
    grid-row: 2;
  }

  /* DX Trade Balance */
  .dashboard-stats-row>.dashboard-card:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  /* Graph underneath DX Trade Balance - spans both columns on tablet */
  .dashboard-stats-row>.dashboard-card-graph {
    grid-column: 1 / 3;
    grid-row: 4;
  }

  /* Total PnL */
  .dashboard-stats-row>.dashboard-card:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
  }

  /* Active Positions */
  .dashboard-stats-row>.dashboard-card:nth-child(5) {
    grid-column: 1;
    grid-row: 3;
  }

  /* Trading Volume */
  .dashboard-stats-row>.dashboard-card:nth-child(6) {
    grid-column: 2;
    grid-row: 3;
  }
}

/* Ensure iPhone 14 landscape and iPad Pro portrait override 1200px breakpoint */
/* This applies to both landscape (iPhone 14) and portrait (iPad Pro) */
/* 2x2 grid layout for better balance */
@media (min-width: 768px) and (max-width: 1024px) {
  .dashboard-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto repeat(2, auto) auto !important;
  }

  .dashboard-stats-row>.dashboard-card:nth-child(2) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .dashboard-stats-row>.dashboard-card:nth-child(4) {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  .dashboard-stats-row>.dashboard-card:nth-child(5) {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }

  .dashboard-stats-row>.dashboard-card:nth-child(6) {
    grid-column: 2 !important;
    grid-row: 3 !important;
  }

  .dashboard-stats-row>.dashboard-card-graph {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
  }
}

@media (max-width: 768px) {
  .dashboard-stats-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto repeat(5, auto);
    gap: var(--spacing-sm);
    /* Reduced gap on mobile for better spacing */
  }

  /* Keep welcome message fixed size on mobile */
  .welcome-message-wrapper {
    grid-column: 1;
    grid-row: 1;
  }

  .welcome-message-wrapper .dashboard-title {
    font-size: var(--font-size-2xl) !important; /* 1.5rem = 24px */
    font-weight: 600 !important;
  }

  /* Stack all cards vertically on mobile - each in its own row */
  .dashboard-stats-row>.dashboard-card {
    grid-column: 1 !important;
  }

  /* DX Trade Balance */
  .dashboard-stats-row>.dashboard-card:nth-child(2) {
    grid-row: 2 !important;
  }

  /* Graph underneath DX Trade Balance */
  .dashboard-stats-row>.dashboard-card-graph {
    grid-row: 3 !important;
  }

  /* Total PnL */
  .dashboard-stats-row>.dashboard-card:nth-child(4) {
    grid-row: 4 !important;
  }

  /* Active Positions */
  .dashboard-stats-row>.dashboard-card:nth-child(5) {
    grid-row: 5 !important;
  }

  /* Trading Volume */
  .dashboard-stats-row>.dashboard-card:nth-child(6) {
    grid-row: 6 !important;
  }
}

.dashboard-val-holdings-tall {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  gap: var(--spacing-md);
  width: 100%;
  box-sizing: border-box;
}

/* VAL Holdings as tall rectangle - Premium Design */
.stat-card-val-tall {
  flex: 0 0 auto;
  /* Don't grow or shrink, use natural height */
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Changed from space-between to flex-start */
  padding: var(--spacing-xl) var(--spacing-lg) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  position: relative;

  /* Premium glassmorphism effect */
  background: linear-gradient(135deg,
      rgba(16, 185, 129, 0.08) 0%,
      rgba(5, 150, 105, 0.05) 50%,
      rgba(16, 185, 129, 0.08) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  /* Premium border with gradient */
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;

  /* Multi-layer shadows for depth */
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 4px 16px rgba(16, 185, 129, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);

  /* Smooth transitions */
  transition: all var(--transition-slower);
}

/* Premium hover effect */
.stat-card-val-tall:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.16),
    0 6px 20px rgba(16, 185, 129, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Premium background pattern with VAL logo */
.stat-card-val-tall::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/assets/images/val-logo-trans.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 60% auto;
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  filter: blur(1px);
}

/* Animated gradient overlay for premium feel */
.stat-card-val-tall::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%,
      rgba(16, 185, 129, 0.15) 0%,
      transparent 50%);
  z-index: 0;
  pointer-events: none;
  animation: premiumShimmer 8s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes premiumShimmer {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.4;
  }

  50% {
    transform: translate(10%, 10%) scale(1.1);
    opacity: 0.6;
  }
}

/* Enhanced hover effects */
.stat-card-val-tall:hover::before {
  opacity: 0.12;
  transform: scale(1.05);
}

.stat-card-val-tall:hover::after {
  opacity: 0.8;
}

/* Ensure content is above background */
.stat-card-val-tall>* {
  position: relative;
  z-index: 1;
}

/* VAL holdings content wrapper - Premium spacing */
.val-holdings-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: 20px;
  /* Reduced from 40px for better spacing */
  padding: var(--space-4) 0;
  position: relative;
  z-index: 2;
  /* Fixed dimensions - content scales to fit */
  min-height: 120px;
  max-height: 120px;
  overflow: hidden;
}

/* Premium title styling */
.stat-card-val-tall .stat-title-val-centered {
  text-align: center !important;
  width: 100% !important;
  left: auto !important;
  right: auto !important;
  position: relative !important;
  margin: 0 auto var(--spacing-lg) auto !important;
  padding: 0 !important;
  top: auto !important;
  max-width: 100% !important;
  font-size: clamp(0.85rem, 1.5vw, 1rem) !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.85;
  z-index: 2;
}

/* Gradient green for VAL balance (matching welcome message theme) */
.val-balance-gradient {
  background: linear-gradient(135deg, var(--color-success), var(--color-success-dark), var(--color-success-dark)) !important; /* #10b981, #16a34a, #059669 */
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Ensure VAL Holdings text stays inside */
.stat-card-val-tall .stat-title-compact,
.stat-card-val-tall .stat-value-compact,
.stat-card-val-tall .stat-label-compact {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  box-sizing: border-box;
  word-wrap: break-word;
}

/* Premium USD value styling */
.stat-card-val-tall .val-holdings-content .stat-label-compact {
  font-size: clamp(1rem, 2vw, 1.4rem) !important;
  font-weight: var(--font-weight-semibold);
  margin: 0;
  padding: var(--space-2) 0 0 0;
  line-height: 1.3;
  opacity: 0.85;
  color: var(--color-text-secondary);
  letter-spacing: 0.3px;
  position: relative;
  z-index: 2;
}

/* Rewards Earned Container */
/* Rewards section container - pushes to bottom of flex card */
.rewards-section-container {
  margin-top: auto;
  padding-top: var(--spacing-md); /* Already using design token */
}

.rewards-earned-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.rewards-earned-label {
  font-size: var(--font-size-xs); /* 0.75rem = 12px */
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

html.light .rewards-earned-label {
  color: rgba(0, 0, 0, 0.7);
}

/* Period Selector Buttons */
.rewards-period-selector {
  display: flex;
  gap: 6px;
  width: 100%;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: 8px;
  padding: 4px;
}

.period-btn {
  flex: 1;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: var(--font-size-xs); /* 0.75rem - using closest token (0.7rem → 0.75rem) */
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.period-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.period-btn.active {
  background: rgba(16, 185, 129, 0.2);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

html.light .period-btn {
  color: rgba(0, 0, 0, 0.6);
}

html.light .period-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  color: rgba(0, 0, 0, 0.8);
}

html.light .period-btn.active {
  background: rgba(16, 185, 129, 0.25);
  color: rgba(0, 0, 0, 0.9);
}

/* Rewards Value Display */
.rewards-value-display {
  font-size: var(--font-size-sm); /* 0.875rem - using closest token (0.9rem → 0.875rem) */
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--letter-spacing-wide);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(52, 211, 153, 0.15));
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 185, 129, 0.15);
  text-align: center;
  margin-top: 4px;
}

html.light .rewards-value-display {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.1));
  border-color: rgba(16, 185, 129, 0.2);
}

/* Premium rewards breakdown styling */
.rewards-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  margin-top: 8px;
  padding: var(--space-4);
  background: rgba(16, 185, 129, 0.05);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(16, 185, 129, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-card-val-tall:hover .rewards-breakdown {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.15);
  transform: translateY(-1px);
}

.reward-period {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(16, 185, 129, 0.08);
  transition: all var(--transition-base);
}

.reward-period:last-child {
  border-bottom: none;
}

.reward-period:hover {
  padding-left: 4px;
  border-bottom-color: rgba(16, 185, 129, 0.15);
}

.reward-period-label {
  font-size: var(--font-size-xs); /* 0.75rem - using closest token (0.7rem → 0.75rem) */
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.reward-period-value {
  font-size: var(--font-size-sm); /* 0.875rem - using closest token (0.85rem → 0.875rem) */
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--letter-spacing-wide);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(52, 211, 153, 0.15));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Light mode styling for rewards - darker gray for better contrast */
html.light .reward-period-label {
  color: var(--color-text-secondary) !important; /* #334155 - slate 700, using text-secondary token */
  /* Slate 700 - Better contrast than rgba */
}

html.light .reward-period-value {
  color: var(--color-text);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.1));
  border-color: rgba(16, 185, 129, 0.2);
}

/* Light mode premium card adjustments */
html.light .stat-card-val-tall {
  background: linear-gradient(135deg,
      rgba(16, 185, 129, 0.06) 0%,
      rgba(5, 150, 105, 0.04) 50%,
      rgba(16, 185, 129, 0.06) 100%);
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 4px 16px rgba(16, 185, 129, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html.light .stat-card-val-tall:hover {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 6px 20px rgba(16, 185, 129, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(16, 185, 129, 0.35);
}

html.light .rewards-breakdown {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.15);
}

html.light .stat-card-val-tall:hover .rewards-breakdown {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
}

/* Rewards Earned title styling */
.rewards-earned-title {
  color: rgba(255, 255, 255, 0.8);
  /* Readable for dark mode */
}

html.light .rewards-earned-title {
  color: var(--color-text) !important; /* #0f172a - slate 900, using text token for light mode */
  /* Slate 900 - High contrast */
}

/* Stake tier label styling */
.stake-tier-label {
  color: rgba(255, 255, 255, 0.65);
  /* Readable gray for dark mode */
  font-size: var(--font-size-xs); /* 0.75rem - using closest token (0.65rem → 0.75rem) - custom size for tier label */
  margin-top: var(--space-2); /* 8px - using design token */
}

html.light .stake-tier-label {
  color: var(--color-text-secondary) !important; /* #334155 - slate 700, using text-secondary token */
  /* Slate 700 - Better contrast */
}

/* VAL price label styling */
.val-price-label {
  color: rgba(255, 255, 255, 0.7);
  /* Readable gray for dark mode */
}

html.light .val-price-label {
  color: var(--color-text-secondary) !important; /* #334155 - slate 700, using text-secondary token */
  /* Slate 700 - Better contrast */
}

/* Desktop: Reduce VAL card size while keeping premium design */
@media (min-width: 1201px) {
  .stat-card-val-tall {
    min-height: 233px !important;
    /* Another 10% smaller (from 259px) */
    padding: calc(var(--spacing-md) * 0.73) calc(var(--spacing-md) * 0.73) !important;
    /* Another 10% smaller padding */
    border-radius: 12px;
    /* Slightly smaller radius */
  }

  .val-holdings-content {
    margin-top: 18px !important;
    /* Another 10% smaller (from 20px) */
    padding: 9px 0 !important;
    /* Another 10% smaller (from 10px) */
    gap: 4px !important;
    /* Keep at 4px */
  }

  .stat-card-val-tall .stat-title-val-centered {
    font-size: clamp(0.55rem, 0.87vw, 0.66rem) !important;
    /* Another 10% smaller */
    margin-bottom: calc(var(--spacing-md) * 0.73) !important;
    /* Another 10% smaller margin */
  }

  .val-balance-gradient {
    font-size: clamp(1.1rem, 2.19vw, 1.83rem) !important;
    /* Another 10% smaller */
  }

  .stat-card-val-tall .val-holdings-content .stat-label-compact {
    font-size: clamp(0.62rem, 1.1vw, 0.8rem) !important;
    /* Another 10% smaller */
    padding: var(--space-1) 0 0 0 !important;
    /* Keep at 4px */
  }

  .rewards-breakdown {
    padding: var(--space-3) !important;
    /* Another 10% smaller (from 10px) */
    gap: 5px !important;
    /* Another 10% smaller (from 6px) */
    margin-bottom: 5px !important;
    /* Another 10% smaller (from 6px) */
  }

  .reward-period {
    padding: var(--space-1) 0 !important;
    /* Another 10% smaller (from 4px) */
  }

  .reward-period-label {
    font-size: 0.48rem !important; /* 7.68px - too small for design token, keeping as is for mobile fine-tuning */
    /* Another 10% smaller (from 0.53rem) */
  }

  .reward-period-value {
    font-size: 0.55rem !important; /* 8.8px - too small for design token, keeping as is for mobile fine-tuning */
    /* Another 10% smaller (from 0.61rem) */
    padding: var(--space-1) var(--space-1) !important;
    /* Keep same */
  }

  .stat-card-val-tall::before {
    background-size: 37% auto !important;
    /* Another 10% smaller (from 41%) */
  }
}

/* Responsive background sizing */
@media (max-width: 1200px) {
  .stat-card-val-tall {
    background-size: 60%;
  }
}

@media (max-width: 768px) {
  .stat-card-val-tall {
    background-size: 50%;
  }

  .reward-period {
    font-size: var(--font-size-xs); /* 0.75rem - using closest token (0.7rem → 0.75rem) */
  }
}

.dashboard-row-graph {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  width: 100%;
  margin-bottom: var(--spacing-xl);
  position: relative;
}

/* Premium chart container styling */
.card-body {
  position: relative;
  padding: var(--space-5);
  overflow: hidden;
}

.card-body canvas {
  max-width: 100%;
  height: auto;
}

/* Chart hover effects */
/* Growth chart container - moved from inline styles */
.growth-chart-container {
  height: 482px;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
}

#walletGrowthChart {
  cursor: crosshair;
  transition: opacity 0.2s ease;
}

#walletGrowthChart:hover {
  opacity: 0.95;
}

/* Light mode chart adjustments */
html.light .card-body canvas {
  filter: brightness(0.98);
}

.dashboard-row-graph .dashboard-card-graph {
  grid-column: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Compact stat cards row - 4 small stats (1fr each) + VAL Holdings (2fr) = 6fr total */
/* Small cards are half the size of VAL Holdings (1fr vs 2fr) */
.dashboard-row-stats {
  grid-template-columns: 1fr 1fr 1fr 1fr 2fr;
  gap: var(--spacing-md);
  width: 100%;
  align-items: start;
}

/* Small stat cards - optimized rectangular shape */
.stat-card-small,
.stat-card-square.stat-card-small,
.dashboard-card.stat-card-small,
.dashboard-card.stat-card-compact.stat-card-square.stat-card-small {
  aspect-ratio: 2.2 / 1 !important;
  padding: var(--spacing-md) !important;
  min-height: 120px !important;
  max-height: none !important;
  height: auto !important;
  width: 100% !important;
  max-width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  overflow: hidden !important;
  gap: 0;
  box-sizing: border-box !important;
  margin: 0 !important;
  text-align: left !important;
  border-radius: 12px !important;
  background: var(--card-bg, rgba(255, 255, 255, 0.02)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: all var(--transition-base) !important;
}

.stat-card-small:hover {
  border-color: rgba(255, 255, 255, 0.12) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Override any square aspect ratio from stat-card-square */
.dashboard-card.stat-card-compact.stat-card-square.stat-card-small {
  aspect-ratio: 2.5 / 1 !important;
}

.stat-card-small .stat-header-compact {
  width: 100%;
  height: auto;
  min-height: 28px;
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 10;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* Ensure header actions always takes up space for consistent layout */
.stat-card-small .stat-header-actions {
  min-width: 60px;
  /* Reserve space even when empty */
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.stat-card-small .stat-header-compact .stat-header-actions,
.stat-card-small .stat-header-compact .stat-filter-dropdown {
  pointer-events: auto;
  z-index: 10;
  position: relative;
}

/* Ensure mobile filter buttons are clickable */
.stat-card-small .stat-header-compact .stat-filter-buttons {
  pointer-events: auto !important;
  z-index: 100;
}

/* Ensure dropdown select is properly styled in stat cards */
.stat-card-small .stat-filter-select {
  /* Override any conflicting styles */
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 10 !important;
}

/* Show title elements in stat cards - must be visible */
.stat-card-small .stat-title-compact,
.stat-card-small .stat-title-centered,
.stat-card-small h3.stat-title-compact,
.stat-card-small h3.stat-title-centered {
  font-size: clamp(0.7rem, 1.2vw, 0.9rem) !important;
  font-weight: 700 !important;
  line-height: 1.2;
  visibility: visible !important;
  opacity: 1 !important;
  color: inherit !important;
  display: block !important;
  position: relative !important;
  left: auto !important;
  height: auto !important;
  margin: 0 0 var(--spacing-xs) 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.stat-card-small .stat-icon-compact {
  font-size: var(--font-size-xl) !important; /* 20px = 1.25rem */
}

/* Remove duplicate - title size already set above */

.stat-card-small .stat-value-compact {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem) !important;
  margin: 8px 0 4px 0 !important;
  padding: 0 !important;
  text-align: left !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  line-height: 1.2 !important;
  min-height: 1.2em !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: var(--color-text) !important; /* #ffffff - using text token */
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums !important;
  font-weight: 700 !important;
}

/* DX Balance card - increase margin between value and label by 10% */
.stat-card-small #orderlyBalance {
  margin-bottom: calc(4px * 1.1) !important;
}

.stat-card-small #orderlyBalanceLabel {
  margin-top: calc(var(--spacing-xs) * 1.1) !important;
}

/* Ensure consistent font size for stat-value-compact regardless of positive/negative classes */
.stat-card-small .stat-value-compact.positive,
.stat-card-small .stat-value-compact.negative {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem) !important;
  font-weight: 700 !important;
  /* Only change color, not size */
}

/* Positive/negative colors for dark mode */
.stat-card-small .stat-value-compact.positive {
  color: var(--color-success, #10b981) !important;
}

.stat-card-small .stat-value-compact.negative {
  color: var(--color-danger, #ef4444) !important;
}

/* Light mode: default text color (only for non-positive/negative values) */
html.light .stat-card-small .stat-value-compact:not(.positive):not(.negative) {
  color: var(--color-text) !important;
}

/* Light mode: positive/negative colors (must override the default light mode color) */
html.light .stat-card-small .stat-value-compact.positive {
  color: var(--color-success-dark, #059669) !important;
  /* Use darker green variant for better contrast on light backgrounds (5.2:1) */
}

html.light .stat-card-small .stat-value-compact.negative {
  color: var(--color-danger-dark, #dc2626) !important;
  /* Use darker red variant for better contrast on light backgrounds */
}

/* ===== Trading Bot Card - Premium UI Enhancements ===== */

/* Trading Bot Card Container */
.trading-bot-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.trading-bot-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--color-primary, #1fddfe) 50%, 
    transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.trading-bot-card:hover::before {
  opacity: 0.6;
}

/* Card Description Enhancement */
.trading-bot-card .card-description {
  font-size: var(--font-size-sm); /* 0.875rem = 14px */
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
  opacity: 0.9;
}

/* Trading Bot Stats Grid - Enhanced */
.trading-bot-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stat Item - Premium Styling */
.trading-bot-stats .stat-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  background: rgba(31, 221, 254, 0.03);
  border: 1px solid rgba(31, 221, 254, 0.1);
  border-radius: var(--radius-md, 8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.trading-bot-stats .stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(31, 221, 254, 0.05) 0%, 
    transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.trading-bot-stats .stat-item:hover {
  background: rgba(31, 221, 254, 0.06);
  border-color: rgba(31, 221, 254, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(31, 221, 254, 0.1);
}

.trading-bot-stats .stat-item:hover::before {
  opacity: 1;
}

/* Stat Labels - Enhanced Typography */
.trading-bot-stats .stat-item-label {
  font-size: var(--font-size-xs); /* 0.75rem = 12px */
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

/* Stat Values - Premium Typography */
.trading-bot-stats .stat-item-value {
  font-size: var(--font-size-xl); /* 1.25rem - using closest token (1.375rem → 1.25rem) */
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

/* Number Animation on Update */
.trading-bot-stats .stat-item-value.updating {
  animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Trading Bot Stats P&L Color Coding - Enhanced */
.trading-bot-stats .stat-item-value.positive {
  color: var(--color-success, #22c55e) !important;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.trading-bot-stats .stat-item-value.negative {
  color: var(--color-danger, #ef4444) !important;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

html.light .trading-bot-stats .stat-item-value.positive {
  color: var(--color-success-dark, #059669) !important;
  text-shadow: none;
}

html.light .trading-bot-stats .stat-item-value.negative {
  color: var(--color-danger-dark, #dc2626) !important;
  text-shadow: none;
}

/* Status Section - Premium Design */
.trading-bot-status {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  background: linear-gradient(135deg, 
    rgba(31, 221, 254, 0.08) 0%, 
    rgba(31, 221, 254, 0.03) 100%);
  border: 1px solid rgba(31, 221, 254, 0.15);
  border-radius: var(--radius-md, 8px);
  font-size: var(--font-size-sm); /* 0.875rem = 14px */
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.trading-bot-status::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(31, 221, 254, 0.1) 50%, 
    transparent 100%);
  animation: shimmer 3s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.trading-bot-status > div {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  z-index: 1;
}

/* Status Indicator - Enhanced with Pulse Animation */
#botStatusIndicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  flex-shrink: 0;
  position: relative;
  transition: all 0.3s ease;
}

#botStatusIndicator.active {
  background: var(--color-success, #22c55e);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: statusPulse 2s infinite;
}

#botStatusIndicator.paused {
  background: var(--color-warning, #f59e0b);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: statusPulse 2s infinite;
}

#botStatusIndicator.stopped {
  background: var(--color-danger, #ef4444);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: statusPulse 2s infinite;
}

#botStatusIndicator.offline {
  background: var(--color-text-tertiary, #6b7280);
  box-shadow: none;
  animation: none;
  opacity: 0.5;
}

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

#botStatusText {
  font-weight: 500;
  color: var(--color-text);
  flex: 1;
}

#botLastActivity {
  margin-left: auto;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs); /* 0.75rem = 12px */
  font-weight: 400;
}

/* Trading Bot Actions - Premium Buttons */
.trading-bot-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-4);
  width: 100%;
}

/* Hide actions when empty state is shown */
.trading-bot-card:has(.empty-state:not(.hidden)) .trading-bot-actions {
  display: none;
}

.trading-bot-actions .btn {
  flex: 1;
  min-width: 120px;
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  font-size: var(--font-size-sm); /* 0.875rem = 14px */
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 36px;
}

.trading-bot-actions .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.trading-bot-actions .btn:active::before {
  width: 300px;
  height: 300px;
}

/* Primary Button - View Dashboard */
.trading-bot-actions .btn-primary {
  background: linear-gradient(135deg, 
    var(--color-primary, #1fddfe) 0%, 
    var(--color-primary-dark, #0ea5e9) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(31, 221, 254, 0.3);
  border-radius: 6px !important;
  min-height: 36px !important;
}

.trading-bot-actions .btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 221, 254, 0.4);
  background: linear-gradient(135deg, 
    var(--color-primary-light, #67e8f9) 0%, 
    var(--color-primary, #1fddfe) 100%);
}

.trading-bot-actions .btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(31, 221, 254, 0.3);
}

.trading-bot-actions .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Ghost Button - Pause/Resume - Enhanced Rectangular */
.trading-bot-actions .btn-ghost {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
  color: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 6px !important;
  min-height: 44px !important;
}

.trading-bot-actions .btn-ghost::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.1) 50%, 
    transparent 100%);
  transition: left 0.5s ease;
}

.trading-bot-actions .btn-ghost:hover:not(:disabled)::after {
  left: 100%;
}

.trading-bot-actions .btn-ghost:hover:not(:disabled) {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.12) 0%, 
    rgba(255, 255, 255, 0.08) 100%);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 1);
}

.trading-bot-actions .btn-ghost:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Button Icon Styling */
.trading-bot-actions .btn-ghost .btn-icon {
  font-size: var(--font-size-lg); /* 1.125rem - using closest token (1.1rem → 1.125rem) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.trading-bot-actions .btn-ghost:hover:not(:disabled) .btn-icon {
  transform: scale(1.1);
}

.trading-bot-actions .btn-ghost:active:not(:disabled) .btn-icon {
  transform: scale(0.95);
}

/* Button Text Styling */
.trading-bot-actions .btn-ghost .btn-text {
  font-weight: 600;
  transition: all 0.2s ease;
}

/* Paused State - Enhanced Warning Style */
.trading-bot-actions .btn-ghost.paused {
  background: linear-gradient(135deg, 
    rgba(245, 158, 11, 0.15) 0%, 
    rgba(245, 158, 11, 0.1) 100%);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--color-warning-light); /* #fbbf24 */
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.trading-bot-actions .btn-ghost.paused::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(245, 158, 11, 0.1) 0%, 
    transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.trading-bot-actions .btn-ghost.paused:hover:not(:disabled) {
  background: linear-gradient(135deg, 
    rgba(245, 158, 11, 0.2) 0%, 
    rgba(245, 158, 11, 0.15) 100%);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.3),
              0 0 0 1px rgba(245, 158, 11, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: var(--color-warning-light); /* #fcd34d */
}

.trading-bot-actions .btn-ghost.paused:hover:not(:disabled)::before {
  opacity: 1;
}

/* Active/Resume State - Success Style */
.trading-bot-actions .btn-ghost:not(.paused) {
  /* Active state - subtle success hint */
}

.trading-bot-actions .btn-ghost:not(.paused):hover:not(:disabled) {
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(34, 197, 94, 0.1);
}

/* Loading/Processing State */
.trading-bot-actions .btn-ghost.processing {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

.trading-bot-actions .btn-ghost.processing .btn-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.95);
  }
}

/* Loading State */
.trading-bot-stats.loading .stat-item-value {
  background: linear-gradient(90deg, 
    var(--color-text-tertiary) 25%, 
    var(--color-text-secondary) 50%, 
    var(--color-text-tertiary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  color: transparent;
  border-radius: 4px;
  min-width: 60px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Empty State Enhancement */
.trading-bot-card .empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  min-height: 320px;
  justify-content: center;
}

.trading-bot-card .empty-icon {
  font-size: 4rem;
  opacity: 0.5;
  animation: float 3s ease-in-out infinite;
  margin-bottom: var(--space-2);
  filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.2));
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.trading-bot-card .empty-state p {
  color: var(--color-text-secondary);
  margin: 0;
  font-size: var(--font-size-sm); /* 0.875rem = 14px */
  line-height: 1.6;
  max-width: 400px;
}

.trading-bot-card .empty-state p:first-of-type {
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.trading-bot-card .empty-state p:last-of-type {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .trading-bot-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
  
  .trading-bot-stats .stat-item {
    padding: var(--space-2);
  }
  
  .trading-bot-stats .stat-item-value {
    font-size: var(--font-size-lg); /* 1.125rem = 18px */
  }
  
  .trading-bot-actions {
    flex-direction: column;
  }
  
  .trading-bot-actions .btn {
    width: 100%;
  }
}

/* Light Mode Optimizations */
html.light .trading-bot-stats .stat-item {
  background: rgba(31, 221, 254, 0.05);
  border-color: rgba(31, 221, 254, 0.15);
}

html.light .trading-bot-stats .stat-item:hover {
  background: rgba(31, 221, 254, 0.08);
  border-color: rgba(31, 221, 254, 0.25);
}

html.light .trading-bot-status {
  background: linear-gradient(135deg, 
    rgba(31, 221, 254, 0.1) 0%, 
    rgba(31, 221, 254, 0.05) 100%);
  border-color: rgba(31, 221, 254, 0.2);
}

html.light .trading-bot-actions .btn-ghost {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

html.light .trading-bot-actions .btn-ghost:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
}

/* ===== Trading Bot Dashboard Modal - Dark Theme (Default) ===== */

/* Modal Overlay - Always Dark */
#tradingBotModal.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(8px);
  z-index: 10000;
  overflow-y: auto;
  transition: background 0.3s ease;
}

/* Modal Content - Always Dark */
#tradingBotModal .modal-content {
  max-width: 1200px;
  width: 95%;
  margin: 2rem auto;
  background: var(--color-surface) !important; /* #0f172a */
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.3s ease;
}

/* Modal Header - Always Dark */
#tradingBotModal .modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface) !important; /* #0f172a */
  border-radius: 12px 12px 0 0;
}

#tradingBotModal .modal-header h2 {
  margin: 0;
  color: rgba(255, 255, 255, 0.95) !important;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-xl); /* 1.25rem = 20px */
  font-weight: 600;
}

/* Modal Close Button - Always Dark */
#tradingBotModal .modal-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: var(--font-size-2xl); /* 1.5rem = 24px */
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1;
}

#tradingBotModal .modal-close:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

/* Modal Body - Always Dark */
#tradingBotModal .modal-body {
  padding: 1.5rem;
  background: var(--color-surface) !important; /* #0f172a */
  color: rgba(255, 255, 255, 0.95) !important;
}

/* Bot Tabs - Always Dark */
#tradingBotModal .bot-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  flex-wrap: wrap;
}

#tradingBotModal .bot-tab-btn {
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.6) !important;
  cursor: pointer;
  font-size: var(--font-size-sm); /* 0.875rem = 14px */
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  top: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Mobile Optimizations for Bot Tabs */
@media (max-width: 768px) {
  #tradingBotModal .bot-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    gap: 4px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    /* Add subtle gradient fade on edges to indicate scrollability */
    mask-image: linear-gradient(
      to right,
      transparent 0%,
      black 10%,
      black 90%,
      transparent 100%
    );
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      black 10%,
      black 90%,
      transparent 100%
    );
  }

  /* Hide scrollbar for Chrome, Safari and Opera */
  #tradingBotModal .bot-tabs::-webkit-scrollbar {
    display: none;
  }

  #tradingBotModal .bot-tab-btn {
    padding: 0.875rem 1.25rem;
    font-size: var(--font-size-base); /* 1rem - using closest token (0.9375rem → 1rem) */
    min-height: 44px; /* Touch-friendly minimum height */
    min-width: auto;
    flex-shrink: 0;
    /* Better touch target */
    -webkit-tap-highlight-color: rgba(31, 221, 254, 0.2);
    tap-highlight-color: rgba(31, 221, 254, 0.2);
  }

  #tradingBotModal .bot-tab-btn:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.05) !important;
  }

  /* Ensure active tab is more visible on mobile */
  #tradingBotModal .bot-tab-btn.active {
    border-bottom-width: 3px;
    font-weight: 700;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  #tradingBotModal .bot-tabs {
    gap: 2px;
    padding-bottom: 0.25rem;
  }

  #tradingBotModal .bot-tab-btn {
    padding: 0.75rem 1rem;
    font-size: var(--font-size-sm); /* 0.875rem = 14px */
  }
}

#tradingBotModal .bot-tab-btn:hover {
  color: rgba(255, 255, 255, 0.95) !important;
}

#tradingBotModal .bot-tab-btn.active {
  border-bottom-color: var(--color-primary) !important; /* #1fddfe */
  color: var(--color-primary) !important; /* #1fddfe */
  font-weight: 600;
}

/* Bot Tab Content - Always Dark */
#tradingBotModal .bot-tab-content {
  display: none;
  color: rgba(255, 255, 255, 0.95) !important;
  background: var(--color-surface) !important; /* #0f172a */
}

#tradingBotModal .bot-tab-content.active {
  display: block;
}

/* Loading State - Always Dark */
#tradingBotModal .loading {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: var(--font-size-sm); /* 0.875rem = 14px */
}

/* Tables and Content in Modal - Always Dark */
#tradingBotModal table {
  width: 100%;
  border-collapse: collapse;
  color: rgba(255, 255, 255, 0.95) !important;
}

#tradingBotModal th,
#tradingBotModal td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

#tradingBotModal th {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

/* Buttons in Modal - Always Dark */
#tradingBotModal .btn {
  transition: all 0.2s ease;
}

#tradingBotModal .btn-primary {
  background: linear-gradient(135deg, #1fddfe 0%, #0ea5e9 100%);
  color: white;
}

#tradingBotModal .btn-ghost {
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Cards and Boxes in Modal - Always Dark */
#tradingBotModal .card,
#tradingBotModal .box {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.95) !important;
}

/* Input Fields in Modal - Always Dark */
#tradingBotModal input,
#tradingBotModal select,
#tradingBotModal textarea {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

#tradingBotModal input:focus,
#tradingBotModal select:focus,
#tradingBotModal textarea:focus {
  border-color: var(--color-primary) !important; /* #1fddfe */
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 221, 254, 0.1) !important;
}

/* ===== Dynamically Generated Content in Modal - Always Dark ===== */

/* Force dark theme for all dynamically generated content */
#tradingBotModal .bot-tab-content * {
  color: rgba(255, 255, 255, 0.95) !important;
}

#tradingBotModal .bot-tab-content [style*="background: var(--surface)"] {
  background: rgba(255, 255, 255, 0.05) !important;
}

#tradingBotModal .bot-tab-content [style*="border: 1px solid var(--line)"] {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

#tradingBotModal .bot-tab-content [style*="color: var(--text)"] {
  color: rgba(255, 255, 255, 0.95) !important;
}

#tradingBotModal .bot-tab-content [style*="color: var(--text-dim)"] {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Metric cards in overview */
#tradingBotModal .bot-tab-content > div > div > div[style*="background: var(--surface)"] {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Signal cards in pending/history tabs */
#tradingBotModal .bot-tab-content [style*="background: var(--surface)"] {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Buttons in modal content */
#tradingBotModal .bot-tab-content button {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

#tradingBotModal .bot-tab-content button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

#tradingBotModal .bot-tab-content .btn-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: var(--color-danger) !important; /* #ef4444 */
}

#tradingBotModal .bot-tab-content .btn-danger:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

/* Empty state messages */
#tradingBotModal .bot-tab-content [style*="text-align: center"][style*="color: var(--text-dim)"] {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* ===== P&L Color Coding - Force Green/Red ===== */

/* Positive P&L - Green */
#tradingBotModal [style*="color: var(--color-success)"],
#tradingBotModal [style*="color: var(--color-success)"] *,
#tradingBotModal [style*="color: #22c55e"],
#tradingBotModal [style*="color: #22c55e"] * {
  color: var(--color-success) !important; /* #22c55e - using success color token */
}

/* Negative P&L - Red */
#tradingBotModal [style*="color: var(--color-danger)"],
#tradingBotModal [style*="color: var(--color-danger)"] *,
#tradingBotModal [style*="color: #ef4444"],
#tradingBotModal [style*="color: #ef4444"] * {
  color: var(--color-danger) !important; /* #ef4444 */
}

/* Force P&L colors in overview tab - target all P&L value divs */
#tradingBotModal #botTabOverview div[style*="font-size: 1.5rem"][style*="font-weight: 600"] {
  /* These are the P&L value divs - colors should come from inline styles */
}

/* Ensure no other styles override P&L colors */
#tradingBotModal #botTabOverview * {
  /* Don't override if inline style has color */
}

/* P&L values in execution history */
#tradingBotModal .bot-tab-content [style*="P&L"] + div,
#tradingBotModal .bot-tab-content div[style*="P&L"] {
  /* Target P&L display elements */
}

/* ===== Trading Bot Modal - Light Mode Overrides ===== */
html.light #tradingBotModal.modal-overlay {
  background: rgba(0, 0, 0, 0.5) !important;
}

html.light #tradingBotModal .modal-content {
  background: var(--color-background) !important; /* #ffffff - light mode background */
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

html.light #tradingBotModal .modal-header {
  background: var(--color-background) !important; /* #ffffff - light mode background */
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

html.light #tradingBotModal .modal-header h2 {
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light #tradingBotModal .modal-close {
  color: rgba(0, 0, 0, 0.6) !important;
}

html.light #tradingBotModal .modal-close:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: rgba(0, 0, 0, 0.9) !important;
}

html.light #tradingBotModal .modal-body {
  background: var(--color-background) !important; /* #ffffff - light mode background */
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light #tradingBotModal .bot-tabs {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

html.light #tradingBotModal .bot-tab-btn {
  color: rgba(0, 0, 0, 0.6) !important;
}

html.light #tradingBotModal .bot-tab-btn:hover {
  color: rgba(0, 0, 0, 0.9) !important;
}

html.light #tradingBotModal .bot-tab-btn.active {
  color: var(--color-primary) !important; /* #1fddfe */
  border-bottom-color: var(--color-primary) !important; /* #1fddfe */
}

html.light #tradingBotModal .bot-tab-content {
  background: var(--color-background) !important; /* #ffffff - light mode background */
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light #tradingBotModal .loading {
  color: rgba(0, 0, 0, 0.6) !important;
}

html.light #tradingBotModal table {
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light #tradingBotModal th,
html.light #tradingBotModal td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light #tradingBotModal th {
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
  background: rgba(0, 0, 0, 0.03) !important;
}

html.light #tradingBotModal .btn-ghost {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

html.light #tradingBotModal .btn-ghost:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
}

html.light #tradingBotModal .card,
html.light #tradingBotModal .box {
  background: var(--color-surface) !important; /* #f8f9fa - light mode surface */
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light #tradingBotModal input,
html.light #tradingBotModal select,
html.light #tradingBotModal textarea {
  background: var(--color-background) !important; /* #ffffff - light mode background */
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light #tradingBotModal input:focus,
html.light #tradingBotModal select:focus,
html.light #tradingBotModal textarea:focus {
  border-color: var(--color-primary) !important; /* #1fddfe */
  box-shadow: 0 0 0 3px rgba(31, 221, 254, 0.1) !important;
}

/* Dynamically generated content - Light Mode */
html.light #tradingBotModal .bot-tab-content *:not(.pnl-value):not([style*="color: #22c55e"]):not([style*="color: #ef4444"]):not([style*="#22c55e"]):not([style*="#ef4444"]) {
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

/* P&L values in Execution History and Performance - Force green/red colors (must override black text rule) */
html.light #tradingBotModal #botTabHistory .pnl-value[style*="color: #22c55e"],
html.light #tradingBotModal #botTabHistory .pnl-value[style*="#22c55e"],
html.light #tradingBotModal #botTabHistory [style*="color: #22c55e"],
html.light #tradingBotModal #botTabHistory [style*="#22c55e"],
html.light #tradingBotModal #botTabPerformance .pnl-value[style*="color: #22c55e"],
html.light #tradingBotModal #botTabPerformance .pnl-value[style*="#22c55e"],
html.light #tradingBotModal #botTabPerformance [style*="color: #22c55e"],
html.light #tradingBotModal #botTabPerformance [style*="#22c55e"] {
  color: var(--color-success) !important; /* #22c55e - using success color token */
}

html.light #tradingBotModal #botTabHistory .pnl-value[style*="color: #ef4444"],
html.light #tradingBotModal #botTabHistory .pnl-value[style*="#ef4444"],
html.light #tradingBotModal #botTabHistory [style*="color: #ef4444"],
html.light #tradingBotModal #botTabHistory [style*="#ef4444"],
html.light #tradingBotModal #botTabPerformance .pnl-value[style*="color: #ef4444"],
html.light #tradingBotModal #botTabPerformance .pnl-value[style*="#ef4444"],
html.light #tradingBotModal #botTabPerformance [style*="color: #ef4444"],
html.light #tradingBotModal #botTabPerformance [style*="#ef4444"] {
  color: var(--color-danger) !important; /* #ef4444 */
}

html.light #tradingBotModal .bot-tab-content [style*="background: var(--surface)"] {
  background: var(--color-surface) !important; /* #f8f9fa - light mode surface */
}

html.light #tradingBotModal .bot-tab-content [style*="border: 1px solid var(--line)"] {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

html.light #tradingBotModal .bot-tab-content [style*="color: var(--text)"] {
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light #tradingBotModal .bot-tab-content [style*="color: var(--text-dim)"] {
  color: rgba(0, 0, 0, 0.6) !important;
}

html.light #tradingBotModal .bot-tab-content > div > div > div[style*="background: var(--surface)"] {
  background: var(--color-surface) !important; /* #f8f9fa - light mode surface */
  border-color: rgba(0, 0, 0, 0.1) !important;
}

html.light #tradingBotModal .bot-tab-content [style*="background: var(--surface)"] {
  background: var(--color-surface) !important; /* #f8f9fa - light mode surface */
  border-color: rgba(0, 0, 0, 0.1) !important;
}

html.light #tradingBotModal .bot-tab-content button {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light #tradingBotModal .bot-tab-content button:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
}

html.light #tradingBotModal .bot-tab-content .btn-danger {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: var(--color-danger) !important; /* #ef4444 */
}

html.light #tradingBotModal .bot-tab-content .btn-danger:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

html.light #tradingBotModal .bot-tab-content [style*="text-align: center"][style*="color: var(--text-dim)"] {
  color: rgba(0, 0, 0, 0.6) !important;
}

/* Ensure P&L in overview cards shows correct colors - very specific targeting */
#tradingBotModal #botTabOverview > div > div > div > div[style*="font-size: 1.5rem"][style*="color: #22c55e"] {
  color: var(--color-success) !important; /* #22c55e - using success color token */
}

#tradingBotModal #botTabOverview > div > div > div > div[style*="font-size: 1.5rem"][style*="color: #ef4444"] {
  color: var(--color-danger) !important; /* #ef4444 */
}

/* Also target by checking if inline style contains the color */
#tradingBotModal #botTabOverview div[style*="#22c55e"] {
  color: var(--color-success) !important; /* #22c55e - using success color token */
}

#tradingBotModal #botTabOverview div[style*="#ef4444"] {
  color: var(--color-danger) !important; /* #ef4444 */
}

/* ===== Isolated P&L Components - Execution History & Performance ===== */

/* P&L value class - isolated styling for execution history and performance tabs */
#tradingBotModal .pnl-value {
  /* Base styling - colors come from inline styles */
  font-weight: 600;
}

/* Ensure P&L values in execution history are properly colored */
#tradingBotModal #botTabHistory .pnl-value {
  color: inherit !important; /* Inherit from inline style */
}

/* Ensure P&L values in performance tab are properly colored */
#tradingBotModal #botTabPerformance .pnl-value {
  color: inherit !important; /* Inherit from inline style */
}

/* Dark theme - Force green for positive P&L values in Execution History and Performance */
#tradingBotModal #botTabHistory .pnl-value[style*="color: #22c55e"],
#tradingBotModal #botTabHistory .pnl-value[style*="#22c55e"],
#tradingBotModal #botTabHistory [style*="color: #22c55e"],
#tradingBotModal #botTabHistory [style*="#22c55e"],
#tradingBotModal #botTabPerformance .pnl-value[style*="color: #22c55e"],
#tradingBotModal #botTabPerformance .pnl-value[style*="#22c55e"],
#tradingBotModal #botTabPerformance [style*="color: #22c55e"],
#tradingBotModal #botTabPerformance [style*="#22c55e"] {
  color: var(--color-success) !important; /* #22c55e - using success color token */
}

/* Dark theme - Force red for negative P&L values in Execution History and Performance */
#tradingBotModal #botTabHistory .pnl-value[style*="color: #ef4444"],
#tradingBotModal #botTabHistory .pnl-value[style*="#ef4444"],
#tradingBotModal #botTabHistory [style*="color: #ef4444"],
#tradingBotModal #botTabHistory [style*="#ef4444"],
#tradingBotModal #botTabPerformance .pnl-value[style*="color: #ef4444"],
#tradingBotModal #botTabPerformance .pnl-value[style*="#ef4444"],
#tradingBotModal #botTabPerformance [style*="color: #ef4444"],
#tradingBotModal #botTabPerformance [style*="#ef4444"] {
  color: var(--color-danger) !important; /* #ef4444 */
}

/* Light mode - preserve P&L colors (higher specificity to override black text rule) */
html.light #tradingBotModal .bot-tab-content .pnl-value[style*="color: #22c55e"],
html.light #tradingBotModal .bot-tab-content .pnl-value[style*="#22c55e"],
html.light #tradingBotModal #botTabHistory .pnl-value[style*="color: #22c55e"],
html.light #tradingBotModal #botTabHistory .pnl-value[style*="#22c55e"],
html.light #tradingBotModal #botTabPerformance .pnl-value[style*="color: #22c55e"],
html.light #tradingBotModal #botTabPerformance .pnl-value[style*="#22c55e"],
html.light #tradingBotModal #botTabOverview .pnl-value[style*="color: #22c55e"],
html.light #tradingBotModal #botTabOverview .pnl-value[style*="#22c55e"],
html.light #tradingBotModal .bot-tab-content [style*="color: #22c55e"]:not([style*="color: #1a1a1a"]) {
  color: var(--color-success) !important; /* #22c55e - using success color token */
}

html.light #tradingBotModal .bot-tab-content .pnl-value[style*="color: #ef4444"],
html.light #tradingBotModal .bot-tab-content .pnl-value[style*="#ef4444"],
html.light #tradingBotModal #botTabHistory .pnl-value[style*="color: #ef4444"],
html.light #tradingBotModal #botTabHistory .pnl-value[style*="#ef4444"],
html.light #tradingBotModal #botTabPerformance .pnl-value[style*="color: #ef4444"],
html.light #tradingBotModal #botTabPerformance .pnl-value[style*="#ef4444"],
html.light #tradingBotModal #botTabOverview .pnl-value[style*="color: #ef4444"],
html.light #tradingBotModal #botTabOverview .pnl-value[style*="#ef4444"],
html.light #tradingBotModal .bot-tab-content [style*="color: #ef4444"]:not([style*="color: #1a1a1a"]) {
  color: var(--color-danger) !important; /* #ef4444 */
}

/* Also target by checking if the value contains positive/negative indicators */
#tradingBotModal .bot-tab-content div[style*="Total P&L"] + div,
#tradingBotModal .bot-tab-content div[style*="Daily P&L"] + div {
  /* These will be overridden by more specific rules above */
}

/* Labels now act as titles - make them more prominent */
.stat-card-small .stat-label-compact {
  font-size: clamp(0.75rem, 1.3vw, 0.85rem) !important;
  margin: var(--spacing-xs) 0 0 0 !important;
  padding: 0 !important;
  text-align: left !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  line-height: 1.4;
  opacity: 0.85 !important;
  visibility: visible !important;
  height: auto !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  word-wrap: normal !important;
  color: rgba(255, 255, 255, 0.85) !important;
  position: relative !important;
  z-index: 2 !important;
  flex: 0 0 auto !important;
  box-sizing: border-box;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

html.light .stat-card-small .stat-label-compact {
  color: rgba(0, 0, 0, 0.8) !important;
}

/* Hide stat-change-compact if empty or remove it */
.stat-card-small .stat-change-compact:empty {
  display: none !important;
}

/* Header with actions for balance box */
.stat-header-with-actions {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  width: 100% !important;
  margin-bottom: var(--spacing-xs) !important;
}

.stat-header-with-actions .stat-icon-compact {
  font-size: var(--font-size-lg) !important; /* 18px = 1.125rem */
  opacity: 0.8;
}

.stat-header-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

/* Ensure minimum touch target for accessibility */
.stat-action-emoji {
  min-width: 44px;
  min-height: 44px;
  padding: 10px !important;
  background: none !important;
  border: none !important;
  font-size: var(--font-size-base) !important; /* 16px = 1rem */
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.stat-action-emoji:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

html.light .stat-action-emoji:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Refresh emoji is back in the balance card header (top right) */

/* Filter dropdown */
/*
 * DROPDOWN DESIGN STANDARD:
 * All dropdowns now use the .custom-dropdown component (see components/dropdown.css)
 * This is the official standard for all select elements across DXfi.
 *
 * Usage: <div class="custom-dropdown custom-dropdown--sm"><select>...</select></div>
 * See DROPDOWN_DESIGN_STANDARD.md for complete documentation.
 *
 * Legacy .stat-filter-dropdown and .stat-filter-select styles are maintained for backward compatibility.
 */

/* ===== SANITY TEST BOX - Built from scratch ===== */
.test-stat-card {
  aspect-ratio: 2.5 / 1;
  padding: 12px;
  min-height: 100px;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: visible;
  background: linear-gradient(180deg,
      rgba(var(--panel-top), var(--panel-top-opacity)) 0%,
      rgba(var(--panel-bot), var(--panel-bot-opacity)) 100%);
  border: 1px solid rgba(var(--line), var(--line-opacity));
  border-radius: var(--oui-rounded-xl);
  backdrop-filter: blur(12px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, .2),
    0 0 0 1px rgba(255, 255, 255, .05);
  transition: all var(--transition-slow);
}

.test-stat-header {
  width: 100%;
  height: 24px;
  margin-bottom: 0;
  position: relative;
  z-index: 10;
  pointer-events: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.test-stat-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  pointer-events: auto;
}

.test-action-btn {
  background: none;
  border: none;
  font-size: var(--font-size-base); /* 16px = 1rem */
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.test-action-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

.test-stat-title {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  margin: 0;
  padding: 0;
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
  font-weight: 700;
  line-height: 24px;
  height: 24px;
  text-align: left;
  color: inherit;
  visibility: visible;
  opacity: 1;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 80px);
}

.test-stat-value {
  font-size: clamp(0.9rem, 2vw, 1.5rem);
  margin: 42px 0 0.5rem 0;
  text-align: left;
  display: flex;
  align-items: center;
  width: calc(100% - 24px);
  padding-left: 12px;
  padding-right: 12px;
  line-height: 1.1;
  flex: 0 0 auto;
  min-height: auto;
  max-height: 2.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  visibility: visible;
  opacity: 1;
  color: inherit;
  position: relative;
  z-index: 1;
}

.test-stat-label {
  font-size: clamp(0.65rem, 1.1vw, 0.75rem);
  margin-bottom: 0;
  margin-top: 0.5rem;
  padding-top: 0;
  text-align: left;
  display: block;
  width: calc(100% - 24px);
  padding-left: 12px;
  padding-right: 12px;
  padding-bottom: 0;
  line-height: 1.3;
  opacity: 0.8;
  visibility: visible;
  height: auto;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-wrap: normal;
  color: inherit;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}

.dashboard-card-graph {
  grid-column: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
}

.dashboard-card-sidebar {
  grid-column: 2;
}

@media (max-width: 1024px) {
  .dashboard-card-sidebar {
    grid-column: 1;
  }
}

@media (max-width: 768px) {
  .dashboard-card-sidebar {
    grid-column: 1;
  }
}

.dashboard-card {
  background: linear-gradient(180deg,
      rgba(30, 58, 138, 0.8) 0%,
      rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid rgba(var(--line), var(--line-opacity));
  border-radius: var(--oui-rounded-xl);
  padding: var(--spacing-lg);
  backdrop-filter: blur(12px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, .2),
    0 0 0 1px rgba(255, 255, 255, .05);
  transition: all var(--transition-slow);
  overflow: hidden;
  position: relative;
}

/* White background for light mode dashboard cards */
html.light .dashboard-card {
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 255, 255, 0.98) 100%) !important;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, .08),
    0 0 0 1px rgba(0, 0, 0, .05);
}

.dashboard-card:hover {
  border-color: rgba(var(--oui-color-primary), 0.3);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, .3),
    0 0 0 1px rgba(var(--oui-color-primary), 0.2),
    0 0 20px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}

/* ===== Incinerator card (match other dashboard cards: grid, labels, values) ===== */
.incinerator-card.dashboard-card {
  display: flex;
  flex-direction: column;
}

.incinerator-card .card-body {
  flex: 1;
  min-height: 0;
}

.incinerator-loading,
.incinerator-error {
  padding: var(--spacing-lg);
  text-align: center;
  color: rgba(var(--oui-color-base-foreground), 0.7);
  font-size: var(--font-size-sm);
}

.incinerator-content.hidden {
  display: none !important;
}

.incinerator-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md) var(--spacing-lg);
}

.incinerator-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: var(--space-3, var(--spacing-md));
  background: rgba(31, 221, 254, 0.03);
  border: 1px solid rgba(31, 221, 254, 0.1);
  border-radius: var(--radius-md, 8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.incinerator-stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
    rgba(31, 221, 254, 0.05) 0%,
    transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.incinerator-stat-item:hover {
  background: rgba(31, 221, 254, 0.06);
  border-color: rgba(31, 221, 254, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(31, 221, 254, 0.1);
}

.incinerator-stat-item:hover::before {
  opacity: 1;
}

.incinerator-stat-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(var(--oui-color-base-foreground), 0.55);
}

.incinerator-stat-value {
  font-size: var(--font-size-lg, 1.125rem);
  font-weight: 700;
  color: rgb(var(--oui-color-base-foreground));
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.incinerator-stat-item.incinerator-trend-up .incinerator-stat-value {
  color: var(--color-success, #10b981);
  font-size: var(--font-size-xl, 1.25rem);
}

.incinerator-stat-item.incinerator-trend-down .incinerator-stat-value {
  color: var(--color-warning, #f59e0b);
  font-size: var(--font-size-xl, 1.25rem);
}

.incinerator-stat-item.incinerator-supply-full {
  background: rgba(245, 158, 11, 0.04);
  border-color: rgba(245, 158, 11, 0.12);
}

.incinerator-stat-item.incinerator-supply-full::before {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, transparent 100%);
}

.incinerator-stat-item.incinerator-supply-full:hover {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.22);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.08);
}

.incinerator-stat-item.incinerator-last-burn {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.12);
}

.incinerator-stat-item.incinerator-last-burn::before {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, transparent 100%);
}

.incinerator-stat-item.incinerator-last-burn:hover {
  background: rgba(16, 185, 129, 0.07);
  border-color: rgba(16, 185, 129, 0.22);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

.incinerator-last-burn .incinerator-stat-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.incinerator-last-burn-amount {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-success, #10b981);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
  letter-spacing: -0.01em;
}

.incinerator-solscan-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 0.4rem 0.875rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.12) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
  letter-spacing: 0.02em;
}

.incinerator-solscan-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(16, 185, 129, 0.2) 100%);
  border-color: rgba(16, 185, 129, 0.55);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.incinerator-no-burn {
  color: rgba(var(--oui-color-base-foreground), 0.4);
  font-style: italic;
}

/* Light mode overrides for incinerator sub-cards */
html.light .incinerator-stat-item {
  background: rgba(31, 221, 254, 0.04);
  border-color: rgba(31, 221, 254, 0.12);
}
html.light .incinerator-stat-item:hover {
  background: rgba(31, 221, 254, 0.07);
  border-color: rgba(31, 221, 254, 0.2);
}
html.light .incinerator-stat-item.incinerator-supply-full {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.15);
}
html.light .incinerator-stat-item.incinerator-last-burn {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.15);
}
html.light .incinerator-last-burn-amount {
  color: var(--color-success-dark, #059669);
  text-shadow: none;
}
html.light .incinerator-solscan-btn {
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}
html.light .incinerator-solscan-btn:hover {
  color: #047857;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
}

/* Mobile: same card layout, stats stack to 1 column (matches dashboard 768px breakpoint) */
@media (max-width: 768px) {
  .incinerator-stats-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
}

.stat-card {
  background: var(--color-surface) !important; /* #0a2240 - using surface token (close match) */
  /* Same navy blue as Stream video cards */
  border: 1px solid rgba(var(--line), var(--line-opacity));
  border-radius: var(--oui-rounded-xl);
  padding: var(--spacing-lg);
  text-align: center;
  backdrop-filter: blur(12px);
  transition: all var(--transition-slow);
}

/* White background for light mode stat cards */
html.light .stat-card {
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 255, 255, 0.98) 100%) !important;
}

.stat-card:hover {
  border-color: rgba(var(--oui-color-primary), 0.3);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, .3),
    0 0 0 1px rgba(var(--oui-color-primary), 0.2);
  transform: translateY(-2px) scale(1.02);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.stat-icon {
  font-size: var(--font-size-3xl); /* 1.875rem - using closest token (2rem → 1.875rem) */
  opacity: 0.8;
}

.stat-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin: var(--spacing-sm) 0;
  color: var(--color-text);
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  opacity: 0.8;
}

.stat-change {
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
}

.stat-change.positive {
  color: var(--color-success);
}

html.light .stat-change.positive {
  color: var(--color-success-dark, #059669);
  /* Use darker variant for better contrast on light backgrounds */
}

.stat-change.negative {
  color: var(--color-danger);
}

html.light .stat-change.negative {
  color: var(--color-danger-dark, #dc2626);
  /* Use darker variant for better contrast on light backgrounds */
}

.positions-card {
  grid-column: span 2;
}

.content-card {
  grid-column: span 1;
}

.staking-card {
  grid-column: span 1;
  position: relative;
  overflow: hidden;
}

.staking-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dx-emerald), var(--dx-cyan), var(--dx-emerald));
  background-size: 200% 100%;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.paper-trading-card {
  grid-column: span 1;
}

.positions-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.position-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
}

.position-symbol {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
}

.position-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  text-align: right;
}

.position-pnl {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
}

.position-pnl.positive {
  color: var(--color-success); /* #10b981 */
  /* Green for positive PnL - explicit color */
  font-weight: 600;
}

html.light .position-pnl.positive {
  color: var(--color-success-dark, #059669);
  /* Use darker variant for better contrast on light backgrounds */
}

.position-pnl.negative {
  color: var(--color-danger); /* #ef4444 */
  /* Red for negative PnL - explicit color */
  font-weight: 600;
}

html.light .position-pnl.negative {
  color: var(--color-danger-dark, #dc2626);
  /* Use darker variant for better contrast on light backgrounds */
}

/* Position side styling - long green, short red */
.position-side {
  font-weight: 600;
  text-transform: lowercase;
}

/* Handle both uppercase and lowercase class names */
.position-side.long,
.position-side.LONG {
  color: var(--color-success); /* #10b981 */
  /* Green for long positions */
}

.position-side.short,
.position-side.SHORT {
  color: var(--color-danger); /* #ef4444 */
  /* Red for short positions */
}

/* Ensure position side colors work in both light and dark mode */
html.light .position-side.long,
html.light .position-side.LONG,
html:not(.light) .position-side.long,
html:not(.light) .position-side.LONG {
  color: var(--color-success-dark, #059669) !important;
  /* Use darker variant for better contrast on light backgrounds */
}

html.light .position-side.short,
html.light .position-side.SHORT,
html:not(.light) .position-side.short,
html:not(.light) .position-side.SHORT {
  color: var(--color-danger-dark, #dc2626) !important;
  /* Use darker variant for better contrast on light backgrounds */
}

/* ===== Staking Pool Overview ===== */
.staking-pool-overview {
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--spacing-md);
  border-radius: 1rem;
}

.pool-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

@media (max-width: 768px) {
  .pool-stats-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
}

.pool-stat-item {
  text-align: center;
  padding: var(--spacing-md);
  background: transparent;
  border: none;
  border-radius: 1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.pool-stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(31, 221, 254, 0.08) 0%,
      rgba(255, 255, 255, 0.05) 25%,
      rgba(16, 185, 129, 0.08) 50%,
      rgba(255, 255, 255, 0.05) 75%,
      rgba(31, 221, 254, 0.08) 100%);
  background-size: 200% 200%;
  border-radius: 1rem;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 8px 32px rgba(31, 221, 254, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.2),
    inset 0 -1px 1px rgba(0, 0, 0, 0.1);
  animation: gloss-shimmer 3s ease-in-out infinite;
  z-index: 0;
}

@keyframes gloss-shimmer {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.pool-stat-item:hover::before {
  opacity: 0.9;
  box-shadow:
    0 12px 40px rgba(31, 221, 254, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    inset 0 -1px 1px rgba(0, 0, 0, 0.15);
}

.pool-stat-item:hover {
  transform: translateY(-2px);
}

.pool-stat-label,
.pool-stat-value {
  position: relative;
  z-index: 1;
}

.pool-stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.pool-stat-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}

.pool-stat-value.apy-value {
  background: linear-gradient(135deg, var(--dx-emerald), var(--dx-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: var(--font-size-3xl); /* 1.875rem - using closest token (1.75rem → 1.875rem) */
  line-height: 1.2;
}

/* ===== User Staking Status ===== */
.user-staking-status {
  padding-top: var(--spacing-md);
}

.staking-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

@media (max-width: 480px) {
  .staking-status-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.staking-status-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}

.staking-amount-display {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  background: transparent;
  border: none;
  border-radius: 1rem;
  margin-bottom: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.staking-amount-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(31, 221, 254, 0.12) 0%,
      rgba(255, 255, 255, 0.08) 25%,
      rgba(16, 185, 129, 0.12) 50%,
      rgba(255, 255, 255, 0.08) 75%,
      rgba(31, 221, 254, 0.12) 100%);
  background-size: 200% 200%;
  border-radius: 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 8px 32px rgba(31, 221, 254, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1),
    inset 0 0 60px rgba(31, 221, 254, 0.1);
  animation: gloss-shimmer 4s ease-in-out infinite;
  z-index: 0;
}

.staking-amount-display::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  animation: mirror-sweep 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes mirror-sweep {
  0% {
    left: -100%;
  }

  100% {
    left: 150%;
  }
}

.staking-amount-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

.staking-amount-value {
  font-size: var(--font-size-4xl); /* 2.25rem - using closest token (2.5rem → 2.25rem) */
  font-weight: 800;
  background: linear-gradient(135deg, var(--dx-emerald), var(--dx-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

/* Make rewards earned even more prominent when displayed in the main area */
.staking-amount-value.reward-value {
  font-size: var(--font-size-5xl); /* 3rem = 48px */
  font-weight: 900;
  background: linear-gradient(135deg, var(--dx-emerald), var(--dx-cyan), var(--dx-emerald));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
  filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.3));
}

@keyframes gradient-shift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@media (max-width: 768px) {
  .staking-amount-value {
    font-size: var(--font-size-3xl); /* 1.875rem - using closest token (2rem → 1.875rem) */
  }

  .staking-amount-value.reward-value {
    font-size: var(--font-size-4xl); /* 2.25rem - using closest token (2.5rem → 2.25rem) */
  }
}

/* ===== Lock Period Progress ===== */
.lock-period-section {
  margin-bottom: var(--spacing-lg);
  border-radius: 1rem;
  padding: var(--spacing-md);
}

.lock-period-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.lock-period-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.lock-period-progress-text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--dx-emerald);
}

.lock-period-progress-bar {
  width: 100%;
  height: 12px;
  background: transparent;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: var(--spacing-xs);
  position: relative;
  border: none;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 2px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lock-period-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dx-emerald), var(--dx-cyan), var(--dx-emerald));
  background-size: 200% 100%;
  border-radius: 6px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 10px rgba(31, 221, 254, 0.3);
  animation: gradient-flow 3s ease infinite;
}

@keyframes gradient-flow {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.lock-period-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.lock-period-dates {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.lock-arrow {
  color: var(--dx-emerald);
}

/* ===== Countdown Timer ===== */
.countdown-timer-section {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  background: transparent;
  border: none;
  border-radius: 1rem;
  margin-bottom: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.countdown-timer-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(31, 221, 254, 0.1) 0%,
      rgba(255, 255, 255, 0.06) 25%,
      rgba(16, 185, 129, 0.1) 50%,
      rgba(255, 255, 255, 0.06) 75%,
      rgba(31, 221, 254, 0.1) 100%);
  background-size: 200% 200%;
  border-radius: 1rem;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow:
    0 8px 32px rgba(31, 221, 254, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.2),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1),
    inset 0 0 40px rgba(31, 221, 254, 0.08);
  animation: gloss-shimmer 3.5s ease-in-out infinite;
  z-index: 0;
}

.countdown-timer-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.25),
      transparent);
  animation: mirror-sweep 4s ease-in-out infinite;
  z-index: 1;
  border-radius: 1rem;
}

.countdown-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  z-index: 2;
}

.countdown-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  position: relative;
  z-index: 2;
}

@media (max-width: 480px) {
  .countdown-display {
    gap: var(--spacing-xs);
  }
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  padding: var(--spacing-md);
  background: transparent;
  border: none;
  border-radius: 1rem;
  position: relative;
  transition: all 0.2s ease;
}

.countdown-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(31, 221, 254, 0.08) 0%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(31, 221, 254, 0.08) 100%);
  background-size: 200% 200%;
  border-radius: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 4px 16px rgba(31, 221, 254, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -1px 1px rgba(0, 0, 0, 0.1);
  opacity: 0.7;
  transition: opacity 0.2s ease;
  animation: gloss-shimmer 4s ease-in-out infinite;
  z-index: 0;
}

.countdown-item:hover::before {
  opacity: 1;
  box-shadow:
    0 6px 24px rgba(31, 221, 254, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.2),
    inset 0 -1px 1px rgba(0, 0, 0, 0.12);
}

.countdown-item:hover {
  transform: translateY(-2px);
}

.countdown-value {
  font-size: var(--font-size-4xl); /* 2.25rem - using closest token (2.5rem → 2.25rem) */
  font-weight: 800;
  background: linear-gradient(135deg, var(--dx-emerald), var(--dx-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .countdown-value {
    font-size: var(--font-size-3xl); /* 1.875rem - using closest token (2rem → 1.875rem) */
  }
}

.countdown-unit {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.countdown-separator {
  font-size: var(--font-size-3xl); /* 1.875rem - using closest token (2rem → 1.875rem) */
  font-weight: 700;
  color: var(--dx-emerald);
  margin: 0 var(--spacing-xs);
  opacity: 0.5;
  position: relative;
  z-index: 2;
}

@media (max-width: 480px) {
  .countdown-separator {
    font-size: var(--font-size-2xl); /* 1.5rem = 24px */
    margin: 0 4px;
  }
}

/* ===== Staking Info Grid ===== */
.staking-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

@media (max-width: 480px) {
  .staking-info-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
}

.staking-stat {
  text-align: center;
}

.staking-stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
}

.staking-stat-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
}

/* ===== Staking Pool Overview ===== */
.staking-pool-overview {
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--spacing-md);
  border-radius: 1rem;
}

.pool-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

@media (max-width: 768px) {
  .pool-stats-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
}

.pool-stat-item {
  text-align: center;
  padding: var(--spacing-md);
  background: transparent;
  border: none;
  border-radius: 1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.pool-stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(31, 221, 254, 0.08) 0%,
      rgba(255, 255, 255, 0.05) 25%,
      rgba(16, 185, 129, 0.08) 50%,
      rgba(255, 255, 255, 0.05) 75%,
      rgba(31, 221, 254, 0.08) 100%);
  background-size: 200% 200%;
  border-radius: 1rem;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 8px 32px rgba(31, 221, 254, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.2),
    inset 0 -1px 1px rgba(0, 0, 0, 0.1);
  animation: gloss-shimmer 3s ease-in-out infinite;
  z-index: 0;
}

@keyframes gloss-shimmer {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.pool-stat-item:hover::before {
  opacity: 0.9;
  box-shadow:
    0 12px 40px rgba(31, 221, 254, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    inset 0 -1px 1px rgba(0, 0, 0, 0.15);
}

.pool-stat-item:hover {
  transform: translateY(-2px);
}

.pool-stat-label,
.pool-stat-value {
  position: relative;
  z-index: 1;
}

.pool-stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.pool-stat-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}

.pool-stat-value.apy-value {
  background: linear-gradient(135deg, var(--dx-emerald), var(--dx-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: var(--font-size-3xl); /* 1.875rem - using closest token (1.75rem → 1.875rem) */
  line-height: 1.2;
}

/* ===== User Staking Status ===== */
.user-staking-status {
  padding-top: var(--spacing-md);
}

.staking-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

@media (max-width: 480px) {
  .staking-status-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.staking-status-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}

.staking-amount-display {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  background: transparent;
  border: none;
  border-radius: 1rem;
  margin-bottom: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.staking-amount-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(31, 221, 254, 0.12) 0%,
      rgba(255, 255, 255, 0.08) 25%,
      rgba(16, 185, 129, 0.12) 50%,
      rgba(255, 255, 255, 0.08) 75%,
      rgba(31, 221, 254, 0.12) 100%);
  background-size: 200% 200%;
  border-radius: 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 8px 32px rgba(31, 221, 254, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1),
    inset 0 0 60px rgba(31, 221, 254, 0.1);
  animation: gloss-shimmer 4s ease-in-out infinite;
  z-index: 0;
}

.staking-amount-display::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  animation: mirror-sweep 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes mirror-sweep {
  0% {
    left: -100%;
  }

  100% {
    left: 150%;
  }
}

.staking-amount-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

.staking-amount-value {
  font-size: var(--font-size-4xl); /* 2.25rem - using closest token (2.5rem → 2.25rem) */
  font-weight: 800;
  background: linear-gradient(135deg, var(--dx-emerald), var(--dx-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

/* Make rewards earned even more prominent when displayed in the main area */
.staking-amount-value.reward-value {
  font-size: var(--font-size-5xl); /* 3rem = 48px */
  font-weight: 900;
  background: linear-gradient(135deg, var(--dx-emerald), var(--dx-cyan), var(--dx-emerald));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
  filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.3));
}

@keyframes gradient-shift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@media (max-width: 768px) {
  .staking-amount-value {
    font-size: var(--font-size-3xl); /* 1.875rem - using closest token (2rem → 1.875rem) */
  }

  .staking-amount-value.reward-value {
    font-size: var(--font-size-4xl); /* 2.25rem - using closest token (2.5rem → 2.25rem) */
  }
}

/* ===== Lock Period Progress ===== */
.lock-period-section {
  margin-bottom: var(--spacing-lg);
  border-radius: 1rem;
  padding: var(--spacing-md);
}

.lock-period-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.lock-period-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.lock-period-progress-text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--dx-emerald);
}

.lock-period-progress-bar {
  width: 100%;
  height: 12px;
  background: transparent;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: var(--spacing-xs);
  position: relative;
  border: none;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 2px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lock-period-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dx-emerald), var(--dx-cyan), var(--dx-emerald));
  background-size: 200% 100%;
  border-radius: 6px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 10px rgba(31, 221, 254, 0.3);
  animation: gradient-flow 3s ease infinite;
}

@keyframes gradient-flow {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.lock-period-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.lock-period-dates {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.lock-arrow {
  color: var(--dx-emerald);
}

/* ===== Countdown Timer ===== */
.countdown-timer-section {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  background: transparent;
  border: none;
  border-radius: 1rem;
  margin-bottom: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.countdown-timer-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(31, 221, 254, 0.1) 0%,
      rgba(255, 255, 255, 0.06) 25%,
      rgba(16, 185, 129, 0.1) 50%,
      rgba(255, 255, 255, 0.06) 75%,
      rgba(31, 221, 254, 0.1) 100%);
  background-size: 200% 200%;
  border-radius: 1rem;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow:
    0 8px 32px rgba(31, 221, 254, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.2),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1),
    inset 0 0 40px rgba(31, 221, 254, 0.08);
  animation: gloss-shimmer 3.5s ease-in-out infinite;
  z-index: 0;
}

.countdown-timer-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.25),
      transparent);
  animation: mirror-sweep 4s ease-in-out infinite;
  z-index: 1;
  border-radius: 1rem;
}

.countdown-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  z-index: 2;
}

.countdown-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  position: relative;
  z-index: 2;
}

@media (max-width: 480px) {
  .countdown-display {
    gap: var(--spacing-xs);
  }
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  padding: var(--spacing-md);
  background: transparent;
  border: none;
  border-radius: 1rem;
  position: relative;
  transition: all 0.2s ease;
}

.countdown-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(31, 221, 254, 0.08) 0%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(31, 221, 254, 0.08) 100%);
  background-size: 200% 200%;
  border-radius: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 4px 16px rgba(31, 221, 254, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -1px 1px rgba(0, 0, 0, 0.1);
  opacity: 0.7;
  transition: opacity 0.2s ease;
  animation: gloss-shimmer 4s ease-in-out infinite;
  z-index: 0;
}

.countdown-item:hover::before {
  opacity: 1;
  box-shadow:
    0 6px 24px rgba(31, 221, 254, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.2),
    inset 0 -1px 1px rgba(0, 0, 0, 0.12);
}

.countdown-item:hover {
  transform: translateY(-2px);
}

.countdown-value {
  font-size: var(--font-size-4xl); /* 2.25rem - using closest token (2.5rem → 2.25rem) */
  font-weight: 800;
  background: linear-gradient(135deg, var(--dx-emerald), var(--dx-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .countdown-value {
    font-size: var(--font-size-3xl); /* 1.875rem - using closest token (2rem → 1.875rem) */
  }
}

.countdown-unit {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.countdown-separator {
  font-size: var(--font-size-3xl); /* 1.875rem - using closest token (2rem → 1.875rem) */
  font-weight: 700;
  color: var(--dx-emerald);
  margin: 0 var(--spacing-xs);
  opacity: 0.5;
  position: relative;
  z-index: 2;
}

@media (max-width: 480px) {
  .countdown-separator {
    font-size: var(--font-size-2xl); /* 1.5rem = 24px */
    margin: 0 4px;
  }
}

/* ===== No Staking State ===== */
.no-staking-state {
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
  position: relative;
  border-radius: 1rem;
}

.no-staking-state::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(31, 221, 254, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0;
  }
}

.no-staking-state .empty-icon {
  font-size: var(--font-size-5xl); /* 3rem - using closest token (4rem → 3rem) */
  margin-bottom: var(--spacing-lg);
  opacity: 0.6;
  filter: drop-shadow(0 4px 12px rgba(31, 221, 254, 0.2));
  position: relative;
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

.no-staking-state .empty-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
  position: relative;
  z-index: 1;
}

.no-staking-state .empty-description {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xl);
  max-width: 350px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.no-staking-state .btn-primary {
  position: relative;
  z-index: 1;
  padding: var(--spacing-md) var(--spacing-xl);
  font-weight: 600;
  font-size: var(--font-size-base);
}

/* ===== Staking Actions ===== */
.staking-actions {
  margin-top: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: var(--spacing-md) var(--spacing-lg);
  font-weight: 600;
  font-size: var(--font-size-base);
  border-radius: 1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-block::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-block:hover::before {
  width: 300px;
  height: 300px;
}

.btn-block:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
}

.btn-block:disabled::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* Discount Eligibility Badge */
.discount-eligibility {
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

.discount-eligibility .badge {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--border-radius-full);
}

/* Staking requirement hint */
.staking-requirement-hint {
  border-radius: 1rem;
  padding: var(--spacing-xs) var(--spacing-sm);
}

/* Badge success for pool status */
.badge-success {
  border-radius: 9999px;
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* Lock period dates */
.lock-period-dates {
  border-radius: 0.75rem;
  padding: var(--spacing-xs) var(--spacing-sm);
}

/* ===== Staking Info Items ===== */
.staking-info-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: transparent;
  border: none;
  border-radius: 1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.staking-info-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(31, 221, 254, 0.08) 0%,
      rgba(255, 255, 255, 0.05) 25%,
      rgba(16, 185, 129, 0.08) 50%,
      rgba(255, 255, 255, 0.05) 75%,
      rgba(31, 221, 254, 0.08) 100%);
  background-size: 200% 200%;
  border-radius: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 4px 16px rgba(31, 221, 254, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.18),
    inset 0 -1px 1px rgba(0, 0, 0, 0.1);
  opacity: 0.65;
  transition: opacity 0.3s ease;
  animation: gloss-shimmer 3s ease-in-out infinite;
  z-index: 0;
}

.staking-info-item:hover::before {
  opacity: 0.9;
  box-shadow:
    0 8px 24px rgba(31, 221, 254, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.25),
    inset 0 -1px 2px rgba(0, 0, 0, 0.12);
}

.staking-info-item:hover {
  transform: translateY(-2px);
}

.staking-info-item>* {
  position: relative;
  z-index: 1;
}

.staking-info-item .info-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.staking-info-item .info-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.staking-info-item .info-value.reward-value {
  background: linear-gradient(135deg, var(--dx-emerald), var(--dx-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Tier Badge ===== */
.tier-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-badge.bronze {
  background: rgba(205, 127, 50, 0.2);
  color: #CD7F32;
  border: 1px solid rgba(205, 127, 50, 0.3);
}

.tier-badge.silver {
  background: rgba(192, 192, 192, 0.2);
  color: #C0C0C0;
  border: 1px solid rgba(192, 192, 192, 0.3);
}

.tier-badge.gold {
  background: rgba(255, 215, 0, 0.2);
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .pool-stats-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .staking-info-grid {
    grid-template-columns: 1fr;
  }

  .countdown-display {
    gap: var(--spacing-xs);
  }

  .countdown-item {
    min-width: 50px;
  }

  .countdown-value {
    font-size: var(--font-size-2xl); /* 1.5rem = 24px */
  }

  .staking-amount-value {
    font-size: var(--font-size-2xl); /* 1.5rem = 24px */
  }
}

.paper-trading-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-lg);
  margin-top: var(--spacing-md);
}

.paper-trading-stat {
  text-align: center;
}

.paper-trading-stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
}

.paper-trading-stat-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
}

.subscription-status {
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-sm);
}

.subscription-price {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin: var(--spacing-sm) 0;
}

/* Fix primary color contrast on light mode */
html.light .subscription-price {
  color: var(--color-primary-dark, #0284c7);
}

.subscription-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

/* ===== Empty States ===== */
/* Trading Bot Actions - Center CTA button */
.trading-bot-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: var(--spacing-md);
  width: 100%;
}

.empty-state {
  text-align: center;
  padding: var(--spacing-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.empty-icon {
  font-size: var(--font-size-5xl); /* 3rem = 48px */
  opacity: 0.5;
}

.empty-state p {
  color: var(--color-text-secondary);
  margin: 0;
  font-size: var(--font-size-sm); /* 0.875rem - using design token */
}

/* Helper text in empty states (second paragraph) */
.empty-state p + p {
  margin-top: var(--space-2); /* 0.5rem (8px) - using design token */
}

/* ===== Position Tabs ===== */
.positions-tabs {
  display: flex;
  gap: var(--space-2); /* 8px - using design token */
  margin-bottom: var(--space-4); /* 16px - using design token */
  border-bottom: 1px solid var(--color-border); /* Using design token */
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.positions-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-base);
  position: relative;
  top: 1px;
  /* Align with border */
}

.positions-tab-btn:hover {
  color: var(--color-text);
  background-color: var(--bg-tertiary);
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.positions-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Fix primary color contrast on light mode */
html.light .positions-tab-btn.active {
  color: var(--color-primary-dark, #0284c7);
  border-bottom-color: var(--color-primary-dark, #0284c7);
  font-weight: var(--font-weight-semibold);
}

.positions-tab-btn.active:hover {
  background-color: transparent;
}

/* ===== Responsive Design ===== */

/* Tablet styles - make text smaller for stat cards */
@media (max-width: 1024px) and (min-width: 769px) {
  .dashboard-row {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .content-card,
  .positions-card {
    grid-column: span 1;
  }

  /* Make stat card text smaller on tablets */
  .stat-card-small .stat-title-compact {
    font-size: clamp(0.65rem, 1vw, 0.8rem) !important;
  }

  .stat-card-small .stat-value-compact {
    font-size: clamp(0.75rem, 1.5vw, 1.2rem) !important;
    max-height: 2rem !important;
    line-height: 1.1 !important;
    margin: calc(var(--spacing-md) + 1.2rem) 0 0.25rem 0 !important;
  }

  .stat-card-small .stat-label-compact {
    margin-top: 0.5rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 0.8 !important;
  }

  /* Test box tablet styles */
  .test-stat-title {
    font-size: clamp(0.65rem, 1vw, 0.8rem);
  }

  .test-stat-value {
    font-size: clamp(0.75rem, 1.5vw, 1.2rem);
    max-height: 2rem;
    line-height: 1.1;
    margin: 42px 0 0.25rem 0;
  }

  .test-stat-label {
    font-size: clamp(0.6rem, 1vw, 0.7rem);
    margin-top: 0.5rem;
  }
}

@media (max-width: 1024px) {
  .dashboard-row {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .content-card,
  .positions-card {
    grid-column: span 1;
  }
}

/* ===== Tablet and Landscape Mode Optimizations ===== */

/* Tablet Portrait and Landscape (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {

  /* Optimize stat cards for tablet - 2x2 grid layout (iPad Pro portrait) */
  .dashboard-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto repeat(2, auto) auto !important;
    gap: var(--spacing-md) !important;
  }

  /* Welcome message spans all columns */
  .welcome-message-wrapper {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  /* Stat cards in 2x2 grid */
  .dashboard-stats-row>.dashboard-card.stat-card-small {
    grid-row: auto !important;
  }

  /* DX Trade Balance - top left */
  .dashboard-stats-row>.dashboard-card:nth-child(2) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  /* Total PnL - top right */
  .dashboard-stats-row>.dashboard-card:nth-child(4) {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  /* Active Positions - bottom left */
  .dashboard-stats-row>.dashboard-card:nth-child(5) {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }

  /* Trading Volume - bottom right */
  .dashboard-stats-row>.dashboard-card:nth-child(6) {
    grid-column: 2 !important;
    grid-row: 3 !important;
  }

  /* DX Growth Chart - spans both columns below 2x2 grid */
  .dashboard-stats-row>.dashboard-card-graph {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    width: 100% !important;
  }

  /* Stat card text sizing for tablet - optimized for 2x2 grid */
  .stat-card-small .stat-title-compact {
    font-size: clamp(0.85rem, 1.8vw, 1rem) !important;
    font-weight: 500 !important;
    margin-bottom: var(--spacing-xs) !important;
  }

  .stat-card-small .stat-value-compact {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem) !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    margin: var(--spacing-xs) 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    max-height: 2.4em !important;
  }

  .stat-card-small .stat-label-compact {
    font-size: clamp(0.75rem, 1.4vw, 0.9rem) !important;
    margin-top: var(--spacing-xs) !important;
    opacity: 0.8 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* Increase card padding and adjust aspect ratio for 2x2 grid */
  .stat-card-small {
    padding: var(--spacing-md) var(--spacing-lg) !important;
    aspect-ratio: 1.2 / 1 !important;
    min-height: 130px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
  }

  /* Optimize stat card header for 2x2 layout */
  .stat-card-small .stat-header-compact {
    margin-bottom: var(--spacing-sm) !important;
  }

  /* Optimize stat card icons */
  .stat-card-small .stat-icon-compact {
    width: 32px !important;
    height: 32px !important;
    font-size: var(--font-size-lg) !important; /* 1.125rem - using closest token (1.2rem → 1.125rem) */
  }

  /* Optimize stat card action buttons (refresh, dropdown) */
  .stat-card-small .stat-header-actions {
    gap: var(--spacing-xs) !important;
  }

  .stat-card-small .stat-action-emoji,
  .stat-card-small .stat-filter-select {
    min-width: 36px !important;
    min-height: 36px !important;
    font-size: var(--font-size-sm) !important; /* 0.875rem - using closest token (0.9rem → 0.875rem) */
    padding: var(--spacing-xs) var(--spacing-sm) !important;
  }

  /* Staking card optimizations for tablet */
  .staking-card {
    grid-column: span 2;
  }

  .pool-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--spacing-md);
  }

  .staking-info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  /* Staking amount display for tablet - less constricted */
  .staking-amount-display {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  .staking-amount-value {
    font-size: clamp(2.5rem, 5vw, 3rem);
  }

  /* Countdown timer for tablet - less constricted */
  .countdown-display {
    gap: var(--spacing-md);
  }

  .countdown-item {
    min-width: 70px;
    padding: var(--spacing-md);
  }

  .countdown-value {
    font-size: clamp(1.5rem, 3vw, 1.75rem);
  }

  /* Live streams - optimize for tablet - less constricted */
  .sidebar-box {
    padding: var(--spacing-lg) !important;
  }

  #related .rel {
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
  }

  #related .rel .thumb {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
  }

  #related .rel .t .tt {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.5;
  }

  #related .rel .t .m {
    font-size: clamp(0.8rem, 1.4vw, 1rem);
  }

  .sidebar-title {
    font-size: clamp(1.2rem, 2.2vw, 1.5rem) !important;
    margin-bottom: var(--spacing-lg) !important;
  }
}

/* Landscape Orientation Optimizations */
/* Exclude iPhone 14 landscape (768px-1024px) - it uses portrait layout instead */
@media (orientation: landscape) and (max-width: 767px) {
  /* Only apply to smaller landscape devices (< 768px) */

  /* Optimize dashboard layout for landscape - less constricted */
  .dashboard-stats-row {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
  }

  /* Reduce vertical padding in landscape but keep horizontal */
  .dashboard-card {
    padding: var(--spacing-md) var(--spacing-xl);
  }

  .stat-card-small {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  /* Optimize staking for landscape - use horizontal layout */
  .staking-card {
    grid-column: span 2;
  }

  .pool-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
  }

  .staking-info-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
  }

  /* Staking amount display - less constricted in landscape */
  .staking-amount-display {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .staking-amount-value {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  }

  /* Countdown timer - horizontal layout */
  .countdown-display {
    flex-direction: row;
    justify-content: center;
    gap: var(--spacing-xs);
  }

  .countdown-item {
    min-width: 50px;
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .countdown-value {
    font-size: clamp(1rem, 2vw, 1.25rem);
  }

  .countdown-label {
    font-size: clamp(0.65rem, 1.2vw, 0.75rem);
  }

  /* Lock period progress bar - thinner in landscape */
  .lock-period-progress-bar {
    height: 8px;
  }

  /* Live streams - optimize for landscape - less constricted */
  .sidebar-box {
    padding: var(--spacing-md) var(--spacing-lg) !important;
  }

  #related {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
  }

  #related .rel {
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-md);
  }

  #related .rel .thumb {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
  }

  #related .rel .t .tt {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    line-height: 1.4;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  #related .rel .t .m {
    font-size: clamp(0.75rem, 1.3vw, 0.9rem);
  }

  .sidebar-title {
    font-size: clamp(1.1rem, 2vw, 1.4rem) !important;
    margin-bottom: var(--spacing-md) !important;
  }
}

/* Tablet Landscape Specific - Match Portrait Layout (2x2 grid) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {

  /* Match tablet portrait 2x2 grid layout */
  .dashboard-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto repeat(2, auto) auto !important;
    gap: var(--spacing-md) !important;
  }

  /* Welcome message spans all columns */
  .welcome-message-wrapper {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  /* Stat cards in 2x2 grid */
  .dashboard-stats-row>.dashboard-card.stat-card-small {
    grid-row: auto !important;
  }

  /* DX Trade Balance - top left */
  .dashboard-stats-row>.dashboard-card:nth-child(2) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  /* Total PnL - top right */
  .dashboard-stats-row>.dashboard-card:nth-child(4) {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  /* Active Positions - bottom left */
  .dashboard-stats-row>.dashboard-card:nth-child(5) {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }

  /* Trading Volume - bottom right */
  .dashboard-stats-row>.dashboard-card:nth-child(6) {
    grid-column: 2 !important;
    grid-row: 3 !important;
  }

  /* DX Growth Chart - spans both columns below 2x2 grid */
  .dashboard-stats-row>.dashboard-card-graph {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    width: 100% !important;
  }

  .staking-card {
    grid-column: span 2;
  }

  .pool-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Stat card text sizing for tablet landscape - optimized for 2x2 grid (matches portrait) */
  .stat-card-small .stat-title-compact {
    font-size: clamp(0.85rem, 1.8vw, 1rem) !important;
    font-weight: 500 !important;
    margin-bottom: var(--spacing-xs) !important;
  }

  .stat-card-small .stat-value-compact {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem) !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    margin: var(--spacing-xs) 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    max-height: 2.4em !important;
  }

  .stat-card-small .stat-label-compact {
    font-size: clamp(0.75rem, 1.4vw, 0.9rem) !important;
    margin-top: var(--spacing-xs) !important;
    opacity: 0.8 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .stat-card-small {
    padding: var(--spacing-md) var(--spacing-lg) !important;
    aspect-ratio: 1.2 / 1 !important;
    min-height: 130px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
  }

  /* Stat filter buttons - ensure they fit */
  .stat-filter {
    gap: var(--spacing-xs);
    flex-wrap: nowrap;
  }

  .stat-filter-btn {
    padding: var(--space-1) var(--space-2);
    font-size: clamp(0.7rem, 1vw, 0.8rem);
  }

  /* Live streams - optimize for landscape tablet */
  .sidebar-box {
    padding: var(--spacing-md) !important;
  }

  #related {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  #related .rel {
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
  }

  #related .rel .thumb {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    aspect-ratio: 16/9;
  }

  #related .rel .t {
    padding: 0;
  }

  #related .rel .t .tt {
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    line-height: 1.3;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  #related .rel .t .m {
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  }

  .sidebar-title {
    font-size: clamp(1rem, 1.8vw, 1.25rem) !important;
    margin-bottom: var(--spacing-md) !important;
  }
}

@media (max-width: 768px) {
  .dashboard-row {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    /* Reduced gap on mobile for better spacing */
  }

  .content-card,
  .positions-card,
  .staking-card,
  .paper-trading-card {
    grid-column: span 1;
  }
  }

  .staking-info-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .paper-trading-stats {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

/* ===== Loading States ===== */
.loading-skeleton {
  background: linear-gradient(90deg,
      var(--bg-tertiary) 25%,
      var(--bg-secondary) 50%,
      var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: var(--border-radius-sm);
  height: 20px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ===== Time Filter Buttons ===== */
.stat-filter {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

.stat-filter-btn {
  /* Layout */
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);

  /* Visual */
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);

  /* Interactions */
  cursor: pointer;
  transition: all var(--transition-base);
  user-select: none;

  /* Remove default outline - only show on keyboard focus */
  outline: none;

  /* Typography */
  white-space: nowrap;
  text-align: center;
}

.stat-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-primary);
  color: var(--color-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.stat-filter-btn.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  border-color: transparent;
  color: var(--color-text);
  box-shadow: var(--shadow-primary);
  font-weight: var(--font-weight-semibold);
}

/* Focus indicator - only visible on keyboard navigation (not touch) */
.stat-filter-btn:focus-visible {
  outline: 2px solid var(--color-primary, #1FDDFE);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(31, 221, 254, 0.15);
}

/* Remove focus styles on mobile touch - prevent sticky focus states */
@media (max-width: 768px) {
  .stat-filter-btn:focus {
    outline: none;
    box-shadow: none;
  }

  .stat-filter-btn:active {
    /* Keep active state visible on mobile for touch feedback */
    transform: scale(0.98);
  }

  /* Ensure active state displays correctly on mobile */
  .stat-filter-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)) !important;
    border-color: transparent !important;
    color: var(--color-text) !important; /* #ffffff - using text token */
    box-shadow: var(--shadow-primary) !important;
    font-weight: var(--font-weight-semibold) !important;
  }

  /* Light mode active state on mobile */
  html.light .stat-filter-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)) !important;
    color: var(--color-text) !important; /* #ffffff - using text token */
  }
}

html.light .stat-filter-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--color-text-secondary);
}

html.light .stat-filter-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: var(--color-primary);
  color: var(--color-text);
}

html.light .stat-filter-btn.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: var(--color-text); /* #ffffff - using text token */
}

/* Premium Badge Styling */
.badge-premium {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
  color: var(--color-text) !important; /* #ffffff - using text token */
  font-weight: 600;
  font-size: var(--font-size-xs); /* 0.75rem = 12px */
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3) !important;
}

html.light .badge-premium {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
  color: var(--color-text) !important; /* #ffffff - using text token */
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3) !important;
}

/* Mobile: Make chart controls fit in one line */
@media (max-width: 768px) {
  .dashboard-card-graph .card-header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }

  .dashboard-card-graph .card-title {
    font-size: var(--font-size-sm) !important; /* 0.875rem - using closest token (0.9rem → 0.875rem) */
    margin-bottom: 0;
  }
  
  /* DX Plus card header responsive */
  .dx-plus-signals-card .card-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .dx-plus-signals-card .card-title {
    font-size: var(--font-size-base);
  }
  
  .dx-plus-signals-card .card-header-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Container for all filter buttons */
  .dashboard-card-graph .card-header>div:last-child {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 2px !important;
    flex-shrink: 1;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
  }

  .dashboard-card-graph .card-header>div:last-child::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
  }
  
  /* DX Plus card header responsive */
  .dx-plus-signals-card .card-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .dx-plus-signals-card .card-title {
    font-size: var(--font-size-base);
  }
  
  .dx-plus-signals-card .card-header-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .dashboard-card-graph .stat-filter {
    margin-top: 0 !important;
    gap: 2px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0;
  }

  .dashboard-card-graph .stat-filter-btn {
    padding: 3px 6px !important;
    font-size: 9px !important; /* 9px - too small for design token, keeping as is for fine-tuning */
    white-space: nowrap;
    flex-shrink: 0;
    min-width: auto;
  }

  .dashboard-card-graph .growth-chart-toggle {
    padding: 3px 6px !important;
    min-width: 28px;
    height: 24px;
    flex-shrink: 0;
  }

  .dashboard-card-graph .growth-chart-toggle .toggle-icon {
    font-size: var(--font-size-xs); /* 12px - using closest token (10px → 12px) */
  }

  /* Collapsible chart - mobile only */
  .growth-chart-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 4px 8px !important;
    min-width: 32px;
    height: 28px;
    border-radius: 6px;
    transition: transform 0.3s ease;
  }

  .growth-chart-toggle .toggle-icon {
    font-size: var(--font-size-xs); /* 12px = 0.75rem */
    transition: transform 0.3s ease;
  }

  .dashboard-card-graph.collapsed .growth-chart-toggle .toggle-icon {
    transform: rotate(-90deg);
  }

  .growth-chart-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 551px;
    opacity: 1;
  }

  .dashboard-card-graph.collapsed .growth-chart-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Hide toggle button on desktop */
.growth-chart-toggle {
  display: none !important;
}

@media (max-width: 768px) {
  .growth-chart-toggle {
    display: flex !important;
  }

  .mobile-only {
    display: block !important;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  /* Mobile filter buttons for PNL and Volume - ultra compact horizontal layout */
  .stat-filter-buttons {
    display: inline-flex;
    gap: 1px;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    height: 14px;
    line-height: 1;
    margin: 0;
    padding: 0;
  }
  
  .stat-filter-buttons .stat-filter-btn {
    min-width: 28px;
    width: 28px;
    height: 20px;
    padding: 0;
    margin: 0;
    font-size: 0.5rem; /* 8px - too small for design token, keeping as is for fine-tuning */
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    box-sizing: border-box;
    /* Ensure proper touch target - minimum 44x44px for accessibility */
    position: relative;
    z-index: 10;
  }
  
  /* Increase touch area with pseudo-element */
  .stat-filter-buttons .stat-filter-btn::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    z-index: -1;
  }
  
  .stat-filter-buttons .stat-filter-btn.active {
    background: rgba(31, 221, 254, 0.25);
    border-color: rgba(31, 221, 254, 0.5);
    color: var(--color-primary); /* #1fddfe */
  }
  
  .stat-filter-buttons .stat-filter-btn:active {
    transform: scale(0.9);
    background: rgba(31, 221, 254, 0.35);
  }
  
  html.light .stat-filter-buttons .stat-filter-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.7);
  }
  
  html.light .stat-filter-buttons .stat-filter-btn.active {
    background: rgba(31, 221, 254, 0.2);
    border-color: rgba(31, 221, 254, 0.4);
    color: var(--color-primary-dark); /* #0ea5e9 */
  }
  
  /* Ensure header doesn't expand - keep it minimal */
  .stat-card-small .stat-header-compact.stat-header-with-actions {
    min-height: 14px;
    height: 14px;
    max-height: 14px;
    margin-bottom: var(--spacing-xs);
    position: relative;
  }
  
  /* Position buttons absolutely so they don't push content */
  .stat-card-small .stat-header-compact .stat-filter-buttons {
    position: absolute;
    right: 0;
    top: 0;
    z-index: 100;
    margin: 0;
    padding: 0;
    pointer-events: auto !important;
  }
  
  /* Ensure buttons are clickable on mobile */
  .stat-card-small .stat-header-compact .stat-filter-buttons .stat-filter-btn {
    pointer-events: auto !important;
    position: relative;
    z-index: 101;
    cursor: pointer;
  }
  
  /* Ensure buttons container doesn't push content */
  .stat-card-small .stat-header-compact .stat-filter-buttons {
    position: absolute;
    right: 0;
    top: 0;
    z-index: 10;
  }

  .mobile-only.btn,
  .mobile-only button {
    display: flex !important;
  }
}

/* Hide toggle button on desktop */
.growth-chart-toggle {
  display: none;
}

/* Button styles moved above - removing duplicate */

/* ===== Recent Live Streams (matching watch.html format) ===== */
.sidebar-box {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 12px) !important;
  padding: 12px 16px 16px 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

.sidebar-box:hover {
  box-shadow: var(--shadow-2);
}

html.light .sidebar-box {
  background: var(--color-background); /* #ffffff - light mode background */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

html.light .sidebar-box:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.sidebar-title {
  margin: 0 0 20px 0;
  font-size: var(--font-size-lg); /* 18px = 1.125rem */
  font-weight: 800;
  color: var(--color-text) !important; /* #ffffff - using text token */
  line-height: 1.4;
  letter-spacing: -0.01em;
}

html.light .sidebar-title {
  color: var(--color-text) !important;
}

.rel {
  display: flex;
  gap: var(--space-3);
  padding: 12px;
  border-radius: 12px !important;
  cursor: pointer;
  transition: all var(--transition-slow);
  margin-bottom: var(--space-2);
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.rel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(16, 185, 129, .08) 0%, rgba(16, 185, 129, .02) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.rel:last-child {
  margin-bottom: 0;
}

.rel:hover {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

.rel:hover::before {
  opacity: 1;
}

html.light .rel:hover {
  background: rgba(0, 0, 0, .05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.rel .t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.rel .t .tt {
  font-weight: 700;
  font-size: var(--font-size-sm); /* 14px = 0.875rem */
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  color: var(--color-text) !important; /* #ffffff - using text token */
  transition: color 0.3s ease;
  margin-bottom: var(--space-1);
}

.rel:hover .t .tt {
  color: var(--color-success) !important;
}

html.light .rel .t .tt {
  color: var(--color-text) !important;
}

html.light .rel:hover .t .tt {
  color: var(--color-success) !important;
}

.rel .t .m {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: var(--font-size-xs); /* 12px = 0.75rem */
  font-weight: 500;
  transition: color 0.3s ease;
}

.rel:hover .t .m {
  color: var(--color-text) !important; /* #ffffff - using text token */
}

html.light .rel .t .m {
  color: rgba(0, 0, 0, 0.7) !important;
}

html.light .rel:hover .t .m {
  color: var(--color-text) !important;
}

.rel .t .js-likes-related {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: var(--font-size-xs); /* 12px = 0.75rem */
  line-height: 1.4;
  font-weight: 500;
}

.rel:hover .t .js-likes-related {
  color: var(--color-text) !important; /* #ffffff - using text token */
}

html.light .rel .t .js-likes-related {
  color: rgba(0, 0, 0, 0.7) !important;
}

html.light .rel:hover .t .js-likes-related {
  color: var(--color-text) !important;
}

.rel .thumb {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  flex-shrink: 0;
  border-radius: 10px !important;
  overflow: hidden;
  aspect-ratio: 16/9;
  border: 1px solid var(--line);
  background: var(--color-background); /* #0e1118 - using background token (close match) */
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.rel .thumb::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(16, 185, 129, .1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.rel .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
  display: block;
}

.rel:hover .thumb {
  transform: scale(1.05);
  border-color: rgba(16, 185, 129, .3);
  box-shadow: 0 4px 12px rgba(16, 185, 129, .15);
}

.rel:hover .thumb::after {
  opacity: 1;
}

.rel:hover .thumb img {
  transform: scale(1.08);
  filter: brightness(1.05) saturate(1.1);
}

html.light .rel .thumb {
  background: var(--color-surface); /* #f0f0f0 - light mode surface */
}

/* Refresh button animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ===== Positions Table Scrolling ===== */
/* Limit positions table to show 5 rows with scrolling */
#positionsList .table-responsive,
#historyPositionsList .table-responsive {
  max-height: 320px;
  /* Approximately 5 rows (64px per row) */
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
}

/* Custom scrollbar styling for positions table */
#positionsList .table-responsive::-webkit-scrollbar,
#historyPositionsList .table-responsive::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#positionsList .table-responsive::-webkit-scrollbar-track,
#historyPositionsList .table-responsive::-webkit-scrollbar-track {
  background: var(--bg-elev, #1a1a1a);
  border-radius: 4px;
}

#positionsList .table-responsive::-webkit-scrollbar-thumb,
#historyPositionsList .table-responsive::-webkit-scrollbar-thumb {
  background: var(--color-primary, #1FDDFE);
  border-radius: 4px;
}

#positionsList .table-responsive::-webkit-scrollbar-thumb:hover,
#historyPositionsList .table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-light, #4de8ff);
}

/* Ensure table header stays visible when scrolling */
#positionsList .table-responsive table thead,
#historyPositionsList .table-responsive table thead {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, rgba(31, 221, 254, 0.15), rgba(31, 221, 254, 0.05));
  border-bottom: 2px solid rgba(31, 221, 254, 0.3);
  z-index: 10;
}

/* Table header styling */
.positions-table thead th {
  background: linear-gradient(135deg, rgba(31, 221, 254, 0.15), rgba(31, 221, 254, 0.05)) !important;
  color: var(--text, #ffffff);
  font-weight: var(--font-weight-semibold);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid rgba(31, 221, 254, 0.3);
  position: relative;
}

/* Sortable header styling */
.positions-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.positions-table thead th.sortable:hover {
  background: linear-gradient(135deg, rgba(31, 221, 254, 0.25), rgba(31, 221, 254, 0.15)) !important;
}

/* Sort icon styling */
.positions-table thead th .sort-icon {
  display: inline-block;
  margin-left: 6px;
  font-size: var(--font-size-xs); /* 0.75rem = 12px */
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.positions-table thead th.sortable:hover .sort-icon {
  opacity: 1;
}

.positions-table thead th.sort-asc .sort-icon::after {
  content: ' ↑';
  opacity: 1;
  color: var(--color-primary, #1FDDFE);
}

.positions-table thead th.sort-desc .sort-icon::after {
  content: ' ↓';
  opacity: 1;
  color: var(--color-primary, #1FDDFE);
}

.positions-table thead th.sort-asc .sort-icon,
.positions-table thead th.sort-desc .sort-icon {
  opacity: 1;
}

/* Table row height for consistent 5-row display */
#positionsList .table-responsive table tbody tr,
#historyPositionsList .table-responsive table tbody tr {
  height: 48px;
  /* Consistent row height */
}

/* PnL positive/negative styling */
.positions-table .position-pnl.positive {
  color: var(--color-success) !important; /* #10b981 */
  /* Green for positive PnL */
  font-weight: 600 !important;
}

.positions-table .position-pnl.negative {
  color: var(--color-danger) !important; /* #ef4444 */
  /* Red for negative PnL */
  font-weight: 600 !important;
}

/* Ensure PnL colors work in both light and dark mode */
html.light .positions-table .position-pnl.positive,
html:not(.light) .positions-table .position-pnl.positive {
  color: var(--color-success) !important; /* #10b981 */
}

html.light .positions-table .position-pnl.negative,
html:not(.light) .positions-table .position-pnl.negative {
  color: var(--color-danger) !important; /* #ef4444 */
}

/* Premium VAL Balance Styling - High-end design */
.val-balance-gradient {
  font-weight: 800 !important;
  /* Base font size - will be adjusted dynamically by JavaScript */
  font-size: clamp(2rem, 4vw, 3.5rem) !important;
  background: linear-gradient(135deg,
      #10b981 0%,
      #34d399 30%,
      #6ee7b7 60%,
      #10b981 100%) !important;
  background-size: 200% 200% !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  letter-spacing: -0.03em !important;
  line-height: 1.1 !important;
  position: relative;
  z-index: 2;
  /* Ensure text doesn't overflow - dimensions stay fixed */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  /* Smooth font size transitions */
  transition: font-size 0.3s ease;

  /* Animated gradient */
  animation: gradientShift 4s ease infinite;

  /* Premium glow effect */
  filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.4)) drop-shadow(0 2px 6px rgba(16, 185, 129, 0.3));

  /* Text stroke for extra depth */
  -webkit-text-stroke: 0.5px rgba(16, 185, 129, 0.2);
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* ===== Light Mode Fixes ===== */
/* Fix refresh button visibility in light mode */
html.light .btn-refresh-premium {
  background: rgba(31, 221, 254, 0.15) !important;
  color: var(--color-text) !important; /* #0f172a - slate 900, using text token */
  border-color: rgba(31, 221, 254, 0.4) !important;
  opacity: 1 !important;
}

html.light .btn-refresh-premium:hover:not(:disabled) {
  background: rgba(31, 221, 254, 0.2) !important;
  border-color: rgba(31, 221, 254, 0.5) !important;
  color: var(--color-text) !important; /* #0f172a - slate 900, using text token */
}

html.light .btn-refresh-premium:disabled,
html.light .btn-refresh-premium.loading {
  background: rgba(31, 221, 254, 0.1) !important;
  border-color: rgba(31, 221, 254, 0.3) !important;
  color: var(--color-text-tertiary) !important; /* #64748b - slate 500, using text-tertiary token */
}

/* Fix gray text in cards for light mode - improve contrast */
html.light .dashboard-card,
html.light .stat-card {
  color: var(--color-text); /* #0f172a - slate 900, using text token */
}

html.light .stat-label,
html.light .stat-label-compact,
html.light .info-label,
html.light .staking-stat-label,
html.light .empty-state p,
html.light .card-description {
  color: var(--color-text-secondary) !important; /* #334155 - slate 700, using text-secondary token */
  /* Slate 700 - Better contrast than Slate 600 */
  opacity: 1 !important;
}

html.light .stat-value,
html.light .stat-value-compact,
html.light .info-value,
html.light .staking-stat-value {
  color: var(--color-text) !important; /* #0f172a - slate 900, using text token */
}

html.light .empty-state p {
  color: var(--color-text-tertiary) !important; /* #64748b - slate 500, using text-tertiary token */
}

html.light .card-title,
html.light .stat-title,
html.light .stat-title-compact {
  color: var(--color-text) !important; /* #0f172a - slate 900, using text token */
}

/* Fix positions table header in light mode */
html.light .positions-table thead th {
  background: linear-gradient(135deg, rgba(31, 221, 254, 0.1), rgba(31, 221, 254, 0.05)) !important;
  color: var(--color-text) !important; /* #0f172a - slate 900, using text token */
}

/* Fix text in card body for light mode */
html.light .card-body,
html.light .card-body p,
html.light .card-body span {
  color: var(--color-text); /* #0f172a - slate 900, using text token */
}

html.light .card-body .text-secondary {
  color: var(--color-text-secondary) !important; /* #334155 - slate 700, using text-secondary token */
  /* Slate 700 - Better contrast for bright screens */
}

/* Light mode: Keep text black for gradient CTAs in positions and staking cards */
html.light .positions-card .btn-primary,
html.light .staking-card .btn-primary,
html.light .positions-card .btn-primary:hover,
html.light .staking-card .btn-primary:hover {
  color: var(--color-text) !important; /* #0f172a - slate 900, using text token */
}

/* ===== Mobile Bottom Navigation Support ===== */
@media (max-width: 768px) {

  /* Mobile padding adjustments - no header on mobile */
  .dashboard-main {
    padding: var(--spacing-sm) 0;
    /* Account for mobile nav height + safe area inset */
    /* Mobile nav is ~56px base height + safe area bottom */
    padding-bottom: calc(var(--spacing-md) + 56px + env(safe-area-inset-bottom, 0px));
    padding-top: var(--spacing-md);
    /* Add top padding since header is hidden */
    /* Minimum padding ensures content is always visible */
    min-height: calc(100vh - env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  .dashboard-content {
    padding: 0 16px !important;
    /* Equal horizontal padding on both sides for proper alignment */
    /* Account for mobile nav height + safe area */
    padding-bottom: calc(var(--spacing-sm) + 56px + env(safe-area-inset-bottom, 0px)) !important;
    gap: var(--spacing-sm);
    /* Reduced gap on mobile for better card spacing */
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Reduce card padding on mobile for better spacing */
  .dashboard-card {
    padding: var(--spacing-sm) var(--spacing-md);
    /* Reduced vertical padding, keep horizontal for readability */
  }

  .stat-card-compact {
    padding: var(--spacing-xs) var(--spacing-sm);
    /* More compact on mobile */
  }

  /* Optimize card body padding on mobile */
  .card-body {
    padding: var(--spacing-sm) !important;
    gap: var(--spacing-sm) !important;
  }

  /* Ensure proper wrapping for three-column layout */
  .dashboard-row-three-columns>.dashboard-card {
    min-width: 0;
    /* Allow cards to shrink properly */
    width: 100%;
  }

  /* Welcome message wrapper adjustments */
  .welcome-message-wrapper {
    margin-bottom: var(--spacing-sm) !important;
    padding: 0 !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* Revoke button is now only in wallet dropdown menu (removed from Welcome section) */

  /* Ensure welcome title wraps properly on mobile */
  .welcome-message-wrapper .dashboard-title {
    white-space: normal !important;
    word-break: break-word;
  }

  /* Ensure mobile nav is visible on mobile */
  .mobile-nav {
    display: flex !important;
  }

  /* Hide top header token balance pill on mobile (it's in bottom nav now) */
  .top-header .token-balance-pill,
  .top-header-right .token-balance-pill {
    display: none !important;
  }

  /* Wallet pill stays visible in header on mobile - users need to connect */

  /* Refresh emoji is now inside balance value - always visible */

  /* Reduce spacing in dashboard rows on mobile */
  .dashboard-row {
    gap: var(--spacing-sm);
  }

  .dashboard-stats-row {
    gap: var(--spacing-sm);
  }
}

@media (min-width: 769px) {

  /* Show wallet pill on desktop */
  .top-header .wallet-pill,
  .top-header-right .wallet-pill {
    display: flex !important;
  }

  /* Show token balance pill on desktop */
  /* Need high specificity to override the global .token-balance-pill rule */
  .top-header .token-balance-pill,
  .top-header-right .token-balance-pill,
  #tokenBalancePill.token-balance-pill {
    display: flex !important;
  }

  /* Ensure welcome wrapper doesn't wrap on desktop */
  .welcome-message-wrapper {
    flex-wrap: nowrap !important;
  }

  .welcome-message-wrapper .dashboard-title {
    white-space: nowrap !important;
  }
}

@media (min-width: 769px) {

  /* Hide mobile nav on desktop */
  .mobile-nav {
    display: none !important;
  }
}

/* Transaction Toast Notifications - Stackable, Bottom-Right */
#wallet-transaction-toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10002;
  pointer-events: none;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  align-items: flex-end;
}

.wallet-transaction-toast {
  position: relative;
  background: linear-gradient(180deg, rgba(26, 29, 41, .95) 0%, rgba(21, 24, 33, .98) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  color: var(--text);
  font-size: var(--font-size-sm); /* 14px = 0.875rem */
  font-weight: 500;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(255, 255, 255, .08);
  opacity: 0;
  transform: translateX(400px) scale(0.95);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
  cursor: pointer;
}

.wallet-transaction-toast.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.wallet-transaction-toast.added {
  border-color: rgba(16, 185, 129, .5);
  background: linear-gradient(135deg, rgba(26, 29, 41, .98) 0%, rgba(21, 24, 33, .98) 100%),
    linear-gradient(135deg, rgba(16, 185, 129, .2) 0%, rgba(5, 150, 105, .12) 100%);
  background-blend-mode: normal, overlay;
  color: var(--color-success-light); /* #6ee7b7 - emerald 200, using success-light token */
}

.wallet-transaction-toast.added::before {
  content: '+';
  font-size: var(--font-size-xl); /* 20px = 1.25rem */
  font-weight: 700;
  color: var(--color-success); /* #10b981 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(16, 185, 129, .2);
  flex-shrink: 0;
}

.wallet-transaction-toast.removed {
  border-color: rgba(59, 130, 246, .5);
  background: linear-gradient(135deg, rgba(26, 29, 41, .98) 0%, rgba(21, 24, 33, .98) 100%),
    linear-gradient(135deg, rgba(59, 130, 246, .2) 0%, rgba(37, 99, 235, .12) 100%);
  background-blend-mode: normal, overlay;
  color: var(--color-info-light); /* #93c5fd - blue 300, using info-light token */
}

.wallet-transaction-toast.removed::before {
  content: '−';
  font-size: var(--font-size-xl); /* 20px = 1.25rem */
  font-weight: 700;
  color: var(--color-info); /* #3b82f6 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(59, 130, 246, .2);
  flex-shrink: 0;
}

.wallet-transaction-toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wallet-transaction-toast-title {
  font-weight: 600;
  font-size: var(--font-size-sm); /* 14px = 0.875rem */
  line-height: 1.3;
}

.wallet-transaction-toast-amount {
  font-weight: 700;
  font-size: var(--font-size-base); /* 16px = 1rem */
  font-family: 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.wallet-transaction-toast:hover {
  transform: translateX(-4px) scale(1.02);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, .5),
    0 0 0 1px rgba(255, 255, 255, .1);
}

html.light .wallet-transaction-toast {
  background: rgba(255, 255, 255, .98);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, .15),
    0 0 0 1px rgba(0, 0, 0, .05);
}

html.light .wallet-transaction-toast.added {
  border-color: rgba(16, 185, 129, .4);
  background: rgba(236, 253, 245, .95);
  color: var(--color-success-dark); /* #059669 */
}

html.light .wallet-transaction-toast.added::before {
  color: var(--color-success-dark); /* #059669 */
  background: rgba(16, 185, 129, .15);
}

html.light .wallet-transaction-toast.removed {
  border-color: rgba(59, 130, 246, .4);
  background: rgba(239, 246, 255, .95);
  color: var(--color-info-dark); /* #2563eb */
}

html.light .wallet-transaction-toast.removed::before {
  color: var(--color-info-dark); /* #2563eb */
  background: rgba(59, 130, 246, .15);
}

@media (max-width: 768px) {
  #wallet-transaction-toasts {
    bottom: 100px;
    right: 16px;
    left: 16px;
    align-items: stretch;
  }

  .wallet-transaction-toast {
    max-width: none;
    min-width: auto;
    transform: translateY(100px) scale(0.95);
    background: linear-gradient(180deg, rgba(15, 18, 26, .98) 0%, rgba(10, 13, 20, .99) 100%);
    box-shadow:
      0 8px 24px rgba(0, 0, 0, .7),
      0 0 0 1px rgba(255, 255, 255, .1);
  }

  .wallet-transaction-toast.added {
    background: linear-gradient(180deg, rgba(15, 18, 26, .98) 0%, rgba(10, 13, 20, .99) 100%),
      linear-gradient(135deg, rgba(16, 185, 129, .25) 0%, rgba(5, 150, 105, .15) 100%);
    background-blend-mode: normal, overlay;
  }

  .wallet-transaction-toast.removed {
    background: linear-gradient(180deg, rgba(15, 18, 26, .98) 0%, rgba(10, 13, 20, .99) 100%),
      linear-gradient(135deg, rgba(59, 130, 246, .25) 0%, rgba(37, 99, 235, .15) 100%);
    background-blend-mode: normal, overlay;
  }

  .wallet-transaction-toast.show {
    transform: translateY(0) scale(1);
  }

  .wallet-transaction-toast:hover {
    transform: translateY(-2px) scale(1.01);
  }
}

/* ===== Trading Bot Activation Flow ===== */
.bot-activation-flow {
  padding: var(--spacing-lg);
}

.activation-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.activation-header h3 {
  font-size: var(--font-size-2xl); /* 1.5rem = 24px */
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.activation-header p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm); /* 0.875rem - using closest token (0.9rem → 0.875rem) */
}

.activation-steps {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.activation-step {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  background: var(--card-bg);
  transition: opacity 0.3s ease;
}

.step-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-weight: bold;
  font-size: var(--font-size-base); /* 1rem = 16px */
}

.step-header h4 {
  flex: 1;
  margin: 0;
  font-size: var(--font-size-lg); /* 1.125rem - using closest token (1.1rem → 1.125rem) */
  color: var(--color-text);
}

.step-status {
  font-size: var(--font-size-lg); /* 1.125rem - using closest token (1.2rem → 1.125rem) */
}

.step-status.completed {
  color: var(--color-success); /* #10b981 */
}

.step-content {
  margin-top: var(--spacing-md);
}

.step-content p {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.education-box {
  background: rgba(31, 221, 254, 0.1);
  border: 1px solid rgba(31, 221, 254, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.education-box strong {
  display: block;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.education-box ul {
  margin: var(--spacing-sm) 0 0 var(--spacing-md);
  padding: 0;
  list-style: disc;
}

.education-box li {
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

.education-box a {
  color: var(--color-primary);
  text-decoration: underline;
}

.status-message {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm); /* 0.875rem - using closest token (0.9rem → 0.875rem) */
}

.status-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success); /* #10b981 */
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger); /* #ef4444 */
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===== Trading Bot Card Dropdown ===== */
.card-header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm); /* 8px - using design token */
  position: relative;
}

/* Remove underline from links styled as buttons */
.card-header-actions .btn,
.card-header-actions a.btn {
  text-decoration: none;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-size-lg); /* 1.125rem - using closest token (1.2rem → 1.125rem) */
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-toggle:hover {
  background: var(--hover-bg);
  color: var(--color-text);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--spacing-xs);
  background: rgba(20, 25, 35, 0.98) !important; /* Solid dark background for better visibility */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  z-index: 1000;
  display: none;
  overflow: hidden;
  backdrop-filter: blur(10px); /* Add blur effect for better contrast */
  -webkit-backdrop-filter: blur(10px);
}

/* Light mode - solid white background */
html.light .dropdown-menu {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dropdown.active .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  padding: var(--spacing-md);
  background: transparent;
  border: none;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: var(--font-size-sm); /* 0.875rem - using closest token (0.9rem → 0.875rem) */
}

.dropdown-item:hover {
  background: var(--hover-bg);
}

.dropdown-item span:first-child {
  font-size: var(--font-size-lg); /* 1.125rem - using closest token (1.1rem → 1.125rem) */
}

/* Light mode support */
html.light .education-box {
  background: rgba(31, 221, 254, 0.05);
  border-color: rgba(31, 221, 254, 0.2);
}

html.light .education-box strong {
  color: var(--color-text);
}

html.light .education-box li {
  color: var(--text-secondary);
}

/* ===== DX Plus Signals Card ===== */
.dx-plus-signals-card {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.dx-plus-signals-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    #8b5cf6 50%, 
    transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dx-plus-signals-card:hover::before {
  opacity: 0.8;
}

.dx-plus-signals-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: var(--shadow-md), 0 4px 20px rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

/* DX Plus card uses default card-header styling - no custom overrides needed */
.dx-plus-signals-card .card-icon {
  filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.5));
}

/* DX Plus Toggle Switch */
.dx-plus-toggle-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 0.75rem;
}

/* Responsive toggle on mobile */
@media (max-width: 768px) {
  .dx-plus-toggle-container {
    margin-right: 0.5rem;
    gap: 0.375rem;
  }
  
  .dx-plus-toggle-text {
    font-size: 0.75rem;
  }
}

.dx-plus-toggle-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.dx-plus-toggle-switch {
  opacity: 0;
  width: 0;
  height: 0;
}

.dx-plus-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(107, 114, 128, 0.5);
  transition: 0.3s;
  border-radius: 24px;
}

.dx-plus-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dx-plus-toggle-switch:checked + .dx-plus-toggle-slider {
  background-color: #8b5cf6;
}

.dx-plus-toggle-switch:checked + .dx-plus-toggle-slider:before {
  transform: translateX(20px);
}

.dx-plus-toggle-switch:focus + .dx-plus-toggle-slider {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

.dx-plus-toggle-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.dx-plus-toggle-loading .dx-plus-toggle-switch {
  cursor: wait;
  opacity: 0.6;
}

.dx-plus-toggle-loading .dx-plus-toggle-slider {
  opacity: 0.7;
  cursor: wait;
}

.dx-plus-toggle-loading .dx-plus-toggle-text {
  color: var(--color-text-dim);
  opacity: 0.8;
}

.badge-dx-plus {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  color: var(--color-text) !important;
  font-weight: 600;
  font-size: var(--font-size-xs); /* 0.75rem = 12px */
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3) !important;
}

html.light .badge-dx-plus {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  color: var(--color-text) !important;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3) !important;
}

/* Responsive badge on mobile */
@media (max-width: 768px) {
  .badge-dx-plus {
    font-size: 0.625rem; /* 10px on mobile */
    padding: 3px 8px;
  }
}

.dx-plus-signals-card .card-body {
  padding: 1.5rem;
}

/* Mobile: Reduce padding on small screens */
@media (max-width: 640px) {
  .dx-plus-signals-card .card-body {
    padding: 1rem;
  }
  
  .dx-plus-signal-item {
    padding: 1rem;
  }
  
  .symbol-name {
    font-size: 1rem;
  }
  
  .signal-value {
    font-size: 0.875rem;
  }
  
  .signal-pnl {
    font-size: 1rem;
  }
}

/* Empty State (No Access) */
.dx-plus-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dx-plus-empty-state.hidden {
  display: none !important;
}

.dx-plus-empty-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
  filter: grayscale(0.3);
}

.dx-plus-empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.dx-plus-empty-message {
  font-size: 1rem;
  color: var(--text-dim);
  margin: 0;
  max-width: 400px;
}

.dx-plus-empty-subtext {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin: 0;
  opacity: 0.8;
}

.dx-plus-upgrade-btn {
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  font-size: var(--font-size-sm);
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  transition: all 0.2s ease;
  min-height: 36px;
}

.trading-bot-upgrade-btn {
  margin-top: var(--space-2);
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: var(--font-size-base);
  background: linear-gradient(135deg, #fbbf24 0%, #10b981 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 44px;
  border-radius: 8px;
  width: 100%;
  max-width: 280px;
  position: relative;
  overflow: hidden;
}

.trading-bot-upgrade-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.trading-bot-upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.5);
}

.trading-bot-upgrade-btn:hover::before {
  width: 300px;
  height: 300px;
}

.trading-bot-upgrade-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.dx-plus-upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* Loading State */
.dx-plus-loading-state {
  text-align: center;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dx-plus-loading-state.hidden {
  display: none !important;
}

.dx-plus-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.dx-plus-loading-text {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin: 0;
}

/* DX Plus Stats - Use trading-bot-stats styling with purple theme */
.dx-plus-signals-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  animation: fadeInUp 0.4s ease-out;
}

.dx-plus-signals-stats .stat-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  background: rgba(139, 92, 246, 0.03);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-md, 8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dx-plus-signals-stats .stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.05) 0%, 
    transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dx-plus-signals-stats .stat-item:hover {
  background: rgba(139, 92, 246, 0.06);
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.dx-plus-signals-stats .stat-item:hover::before {
  opacity: 1;
}

.dx-plus-signals-stats .stat-item-label {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.dx-plus-signals-stats .stat-item-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.dx-plus-signals-stats .stat-item-value.positive {
  color: var(--color-success, #22c55e) !important;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.dx-plus-signals-stats .stat-item-value.negative {
  color: var(--color-danger, #ef4444) !important;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* Responsive for DX Plus stats */
@media (max-width: 768px) {
  .dx-plus-signals-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
  
  .dx-plus-signals-stats .stat-item {
    padding: var(--space-2);
  }
  
  .dx-plus-signals-stats .stat-item-value {
    font-size: var(--font-size-lg);
  }
}

/* Light Mode for DX Plus stats */
html.light .dx-plus-signals-stats .stat-item {
  background: rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.15);
}

html.light .dx-plus-signals-stats .stat-item:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.25);
}

html.light .dx-plus-signals-stats .stat-item-value.positive {
  color: var(--color-success-dark, #059669) !important;
}

html.light .dx-plus-signals-stats .stat-item-value.negative {
  color: var(--color-danger-dark, #dc2626) !important;
}

/* Bot Safety: status row + Pause/Resume buttons */
.dx-plus-bot-safety {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: var(--space-3, 0.75rem);
  background: rgba(139, 92, 246, 0.04);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-md, 8px);
  flex-wrap: wrap;
}

.dx-plus-bot-safety-btn {
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.3;
}

.dx-plus-bot-safety-btn--secondary {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.dx-plus-bot-safety-btn--secondary:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.12);
}

.dx-plus-bot-safety-btn--primary {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.dx-plus-bot-safety-btn--primary:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.12);
}

html.light .dx-plus-bot-safety {
  background: rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.12);
}

html.light .dx-plus-bot-safety-btn--secondary {
  color: #d97706;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

html.light .dx-plus-bot-safety-btn--primary {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

/* Content Area */
.dx-plus-signals-content {
  display: block;
}

.dx-plus-signals-content.hidden {
  display: none !important;
}

/* Signal List Container */
.dx-plus-signals-list-container {
  min-height: 200px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.dx-plus-signals-list-container::-webkit-scrollbar {
  width: 6px;
}

.dx-plus-signals-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.dx-plus-signals-list-container::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 3px;
}

.dx-plus-signals-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

.dx-plus-signals-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

/* Signal Item */
.dx-plus-signal-item {
  padding: 1.25rem;
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.8) 0%, 
    rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.dx-plus-signal-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%);
  opacity: 1;
  transition: opacity 0.2s ease;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.dx-plus-signal-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(139, 92, 246, 0.3) 50%, 
    transparent 100%);
  opacity: 0.6;
}

.dx-plus-signal-item:hover {
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2), 
              0 0 0 1px rgba(139, 92, 246, 0.1);
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.9) 0%, 
    rgba(15, 23, 42, 1) 100%);
}

.dx-plus-signal-item:hover::before {
  opacity: 1;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

.signal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Mobile: Stack header elements */
@media (max-width: 640px) {
  .signal-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .signal-item-meta {
    width: 100%;
    justify-content: space-between;
  }
}

.signal-item-symbol {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.symbol-name {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.signal-badge {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.signal-badge-long {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.signal-badge-short {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.signal-item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.signal-time {
  color: var(--text-dim);
  font-weight: 500;
}

.signal-status {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.signal-status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.signal-status-pending {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.signal-status-filled {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.signal-item-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* Mobile responsive: Stack columns on small screens */
@media (max-width: 768px) {
  .signal-item-details {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .signal-detail-row {
    padding: 0.75rem;
    background: rgba(139, 92, 246, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(139, 92, 246, 0.1);
  }
}

/* Tablet: 2 columns */
@media (min-width: 769px) and (max-width: 1024px) {
  .signal-item-details {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Make P&L row span full width on tablet */
  .signal-pnl-row {
    grid-column: 1 / -1;
  }
}

.signal-detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.signal-detail-row:hover {
  transform: translateX(2px);
}

.signal-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.signal-value {
  font-size: 1rem;
  color: var(--color-text);
  font-weight: 600;
}

.signal-pnl-breakdown {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(139, 92, 246, 0.15);
  grid-column: 1 / -1; /* Span full width on all screen sizes */
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Desktop: Display P&L breakdown as horizontal grid */
@media (min-width: 769px) {
  .signal-pnl-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
}

.signal-pnl-breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(139, 92, 246, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 92, 246, 0.1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.signal-pnl-breakdown-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.05) 0%, 
    transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.signal-pnl-breakdown-item:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.signal-pnl-breakdown-item:hover::before {
  opacity: 1;
}

.signal-pnl-breakdown-item.total {
  border: 2px solid rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.08);
}

.signal-pnl-breakdown-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.signal-pnl-breakdown-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}

.signal-pnl-breakdown-value.positive {
  color: #22c55e;
}

.signal-pnl-breakdown-value.negative {
  color: #ef4444;
}

.signal-pnl-breakdown-item.total .signal-pnl-breakdown-value {
  font-size: 1.25rem;
  font-weight: 800;
}

.signal-pnl-breakdown-note {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  font-style: italic;
}

.signal-pnl-breakdown-subtext {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.signal-pnl-breakdown-info {
  cursor: help;
  color: var(--text-dim);
  font-size: 0.75rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.signal-pnl-breakdown-info:hover {
  opacity: 1;
}

.signal-pnl-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(139, 92, 246, 0.15);
  grid-column: 1 / -1; /* Span full width on all screen sizes */
  background: rgba(139, 92, 246, 0.05);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 92, 246, 0.1);
  margin-left: 0;
  margin-right: 0;
}

.signal-pnl {
  font-size: 1.125rem;
  font-weight: 700;
}

.signal-pnl.positive {
  color: #22c55e;
}

.signal-pnl.negative {
  color: #ef4444;
}

/* Empty State (Has Access but No Signals) */
.dx-plus-signals-content .dx-plus-empty-state {
  padding: 2.5rem 1.5rem;
}

.dx-plus-signals-content .dx-plus-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.dx-plus-signals-content .dx-plus-empty-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.dx-plus-signals-content .dx-plus-empty-message {
  font-size: 0.875rem;
}

/* Mobile: Reduce padding on small screens */
@media (max-width: 640px) {
  .dx-plus-signals-card .card-body {
    padding: 1rem;
  }
  
  .dx-plus-signal-item {
    padding: 1rem;
  }
  
  .symbol-name {
    font-size: 1rem;
  }
  
  .signal-value {
    font-size: 0.875rem;
  }
  
  .signal-pnl {
    font-size: 1rem;
  }
}

/* Light mode support */
/* ===== DX Plus Credential Generation Modal ===== */
/* Matches Premium bot modal styling exactly */
.dx-plus-credential-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  overflow-y: auto;
}

.dx-plus-credential-modal.hidden {
  display: none;
}

.credential-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s ease;
}

.credential-modal-content {
  position: relative;
  background: var(--color-surface) !important; /* #0f172a - dark mode */
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px;
  max-width: 500px;
  width: 95%;
  margin: 2rem auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
  z-index: 1;
  transition: all 0.3s ease;
}

.credential-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  position: relative;
  background: var(--color-surface) !important; /* #0f172a - dark mode */
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.credential-header-text {
  flex: 1;
  min-width: 0; /* Allow text to shrink on small screens */
}

.credential-modal-header h2 {
  margin: 0 0 0.5rem 0;
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: var(--font-size-xl); /* 1.25rem = 20px */
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}

.credential-modal-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: var(--font-size-sm); /* 0.875rem */
  line-height: 1.5;
}

.credential-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: var(--font-size-2xl); /* 1.5rem = 24px */
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.credential-modal-close:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

.credential-modal-body {
  padding: 1.5rem;
  background: var(--color-surface) !important; /* #0f172a - dark mode */
  color: rgba(255, 255, 255, 0.95) !important;
  text-align: center;
}

.credential-info-box {
  background: rgba(31, 221, 254, 0.1);
  border: 1px solid rgba(31, 221, 254, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  text-align: left;
}

.credential-info-box strong {
  display: block;
  margin-bottom: var(--spacing-sm);
  color: rgba(255, 255, 255, 0.95) !important;
}

.credential-info-box ul {
  margin: var(--spacing-sm) 0 0 var(--spacing-md);
  padding: 0;
  list-style: disc;
}

.credential-info-box li {
  margin-bottom: var(--spacing-xs);
  color: rgba(255, 255, 255, 0.7) !important;
  line-height: 1.5;
}

.credential-info-box a {
  color: var(--color-primary) !important;
  text-decoration: underline;
}

.btn-large {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: var(--font-size-lg);
  font-weight: 600;
  width: 100%;
  background: linear-gradient(135deg, #1fddfe 0%, #0ea5e9 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(31, 221, 254, 0.3);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

/* Responsive button text */
.btn-large .btn-text-full {
  display: inline;
}

.btn-large .btn-text-short {
  display: none;
}

/* Show short text on smaller screens */
@media (max-width: 480px) {
  .btn-large .btn-text-full {
    display: none;
  }
  
  .btn-large .btn-text-short {
    display: inline;
  }
  
  .btn-large {
    font-size: var(--font-size-base); /* Slightly smaller on mobile */
    padding: var(--spacing-sm) var(--spacing-md);
  }
}

/* Tablet: show full text but allow wrapping if needed */
@media (min-width: 481px) and (max-width: 768px) {
  .btn-large {
    white-space: normal;
    line-height: 1.4;
  }
}

.btn-large:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 221, 254, 0.4);
  background: linear-gradient(135deg, #67e8f9 0%, #1fddfe 100%);
}

.btn-large:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(31, 221, 254, 0.3);
}

.btn-large:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.credential-modal-body .status-message {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  text-align: left;
}

.credential-modal-body .status-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success); /* #10b981 */
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.credential-modal-body .status-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger); /* #ef4444 */
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===== Light Mode Support ===== */
html.light .credential-modal-overlay {
  background: rgba(0, 0, 0, 0.5) !important;
}

html.light .credential-modal-content {
  background: var(--color-background) !important; /* #ffffff - light mode background */
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

html.light .credential-modal-header {
  background: var(--color-background) !important; /* #ffffff - light mode background */
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

html.light .credential-modal-header h2 {
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light .credential-modal-header p {
  color: rgba(0, 0, 0, 0.7) !important;
}

/* Responsive header text on small screens */
@media (max-width: 480px) {
  .credential-modal-header h2 {
    font-size: var(--font-size-lg); /* Slightly smaller on mobile */
    flex-wrap: wrap;
  }
  
  .credential-modal-header p {
    font-size: var(--font-size-xs); /* Smaller subtitle on mobile */
  }
  
  .credential-modal-header {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .credential-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
}

html.light .credential-modal-close {
  color: rgba(0, 0, 0, 0.6) !important;
}

html.light .credential-modal-close:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: rgba(0, 0, 0, 0.9) !important;
}

html.light .credential-modal-body {
  background: var(--color-background) !important; /* #ffffff - light mode background */
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light .credential-info-box {
  background: rgba(31, 221, 254, 0.08);
  border: 1px solid rgba(31, 221, 254, 0.2);
}

html.light .credential-info-box strong {
  color: var(--color-text) !important; /* #1a1a1a - light mode text */
}

html.light .credential-info-box li {
  color: rgba(0, 0, 0, 0.7) !important;
}

html.light .credential-info-box a {
  color: var(--color-primary) !important;
}

html.light .dx-plus-signals-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

/* Light mode handled by default card-header and stat-item styles */

html.light .dx-plus-signal-item {
  background: linear-gradient(135deg, 
    rgba(248, 250, 252, 0.95) 0%, 
    rgba(241, 245, 249, 1) 100%);
  border-color: rgba(139, 92, 246, 0.2);
}

html.light .dx-plus-signal-item::before {
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

html.light .dx-plus-signal-item:hover {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15), 
              0 0 0 1px rgba(139, 92, 246, 0.1);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.98) 0%, 
    rgba(248, 250, 252, 1) 100%);
}

html.light .signal-item-header {
  border-bottom-color: rgba(139, 92, 246, 0.15);
}

html.light .signal-pnl-row {
  border-top-color: rgba(139, 92, 246, 0.15);
  background: rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.1);
}

@media (max-width: 768px) {
  html.light .signal-detail-row {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.1);
  }
}

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

/* ===== Signal Item Header and Badge Styles ===== */
.dx-plus-signal-item {
  position: relative;
  overflow: visible;
}

.signal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.signal-item-symbol {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0; /* Allow text to shrink */
}

.symbol-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.signal-badge-long {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.signal-badge-short {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.signal-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.signal-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.signal-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.signal-status.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.signal-status.filled {
  background: rgba(31, 221, 254, 0.2);
  color: var(--color-primary);
  border: 1px solid rgba(31, 221, 254, 0.3);
}

.signal-status.stopped {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .signal-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .signal-item-symbol {
    width: 100%;
  }
  
  .signal-item-meta {
    width: 100%;
    justify-content: space-between;
  }
}

/* Light mode support */
html.light .symbol-name {
  color: rgba(0, 0, 0, 0.9);
}

html.light .signal-time {
  color: rgba(0, 0, 0, 0.6);
}

/* ===== Signal P&L Breakdown Tooltip Styles ===== */
.signal-pnl-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  position: relative;
  z-index: 1;
}

/* Stack vertically on tablets and smaller screens */
@media (max-width: 1024px) {
  .signal-pnl-breakdown {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Ensure parent containers allow tooltip overflow */
.dx-plus-signal-item,
.signal-item-details {
  overflow: visible !important;
  position: relative;
}

.signal-pnl-breakdown-item {
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  position: relative;
  transition: all 0.2s ease;
  overflow: visible; /* Allow tooltips to overflow */
  z-index: 1; /* Base z-index for stacking context */
}

.signal-pnl-breakdown-item:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
  z-index: 2; /* Raise on hover to ensure tooltip appears above */
}

.signal-pnl-breakdown-item.total {
  border-width: 2px;
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.4);
  font-weight: 600;
}

.signal-pnl-breakdown-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.signal-pnl-breakdown-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(31, 221, 254, 0.2);
  color: var(--color-primary);
  font-size: 10px;
  cursor: help;
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 10; /* Higher z-index for the info icon itself */
}

.signal-pnl-breakdown-info:hover {
  background: rgba(31, 221, 254, 0.3);
  transform: scale(1.1);
}

/* Tooltip container - High z-index to appear above cards */
.signal-pnl-breakdown-info::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.98);
  color: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: normal;
  width: 240px;
  max-width: calc(100vw - 2rem);
  text-align: left;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.signal-pnl-breakdown-info::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(15, 23, 42, 0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100000;
}

.signal-pnl-breakdown-info:hover::before,
.signal-pnl-breakdown-info:hover::after {
  opacity: 1;
}

.signal-pnl-breakdown-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.signal-pnl-breakdown-value.positive {
  color: #10b981;
}

.signal-pnl-breakdown-value.negative {
  color: #ef4444;
}

.signal-pnl-breakdown-subtext {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.25rem;
}

.signal-pnl-breakdown-note {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.25rem;
  font-style: italic;
}

/* Light mode support */
html.light .signal-pnl-breakdown-item {
  background: rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.2);
}

html.light .signal-pnl-breakdown-item:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
}

html.light .signal-pnl-breakdown-label {
  color: rgba(0, 0, 0, 0.8);
}

html.light .signal-pnl-breakdown-info::before {
  background: rgba(255, 255, 255, 0.98);
  color: rgba(0, 0, 0, 0.9);
  border-color: rgba(139, 92, 246, 0.3);
}

html.light .signal-pnl-breakdown-info::after {
  border-top-color: rgba(255, 255, 255, 0.98);
}

html.light .signal-pnl-breakdown-subtext {
  color: rgba(0, 0, 0, 0.6);
}

html.light .signal-pnl-breakdown-note {
  color: rgba(0, 0, 0, 0.7);
}
