/* 
 * POLYMARKET MM TERMINAL
 * Financial Terminal Noir Aesthetic
 * Distinctive typography with Orbitron + JetBrains Mono
 * Dark, sophisticated with glowing accents
 */

:root {
  /* Color Palette - Cyberpunk Financial */
  --bg-void: #0a0e14;
  --bg-deep: #0d1117;
  --bg-card: #151b23;
  --bg-card-elevated: #1a2129;
  --bg-hover: #1f2831;
  
  /* Neon Accents */
  --neon-cyan: #00ffff;
  --neon-magenta: #ff00ff;
  --neon-green: #00ff9f;
  --neon-red: #ff0055;
  --neon-yellow: #ffff00;
  --neon-blue: #0099ff;
  
  /* Softer Glows */
  --glow-cyan: rgba(0, 255, 255, 0.8);
  --glow-magenta: rgba(255, 0, 255, 0.8);
  --glow-green: rgba(0, 255, 159, 0.8);
  --glow-red: rgba(255, 0, 85, 0.8);
  
  /* Text */
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-dim: #484f58;
  
  /* Borders */
  --border-default: rgba(0, 255, 255, 0.2);
  --border-bright: rgba(0, 255, 255, 0.5);
  --border-accent: var(--neon-cyan);
  
  /* Shadows & Glows */
  --shadow-glow-cyan: 0 0 20px rgba(0, 255, 255, 0.3), 0 0 40px rgba(0, 255, 255, 0.1);
  --shadow-glow-magenta: 0 0 20px rgba(255, 0, 255, 0.3), 0 0 40px rgba(255, 0, 255, 0.1);
  --shadow-glow-green: 0 0 20px rgba(0, 255, 159, 0.3);
  --shadow-glow-red: 0 0 20px rgba(255, 0, 85, 0.3);
  
  /* Grid */
  --grid-color: rgba(0, 255, 255, 0.05);
}

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

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  zoom: 0.72; /* 28% zoom reduction (0.9 * 0.8 = 20% additional reduction) */
}

/* Animated Grid Background */
.grid-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes gridMove {
  0% { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}

/* CRT Scanline Effect */
.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0, 255, 255, 0.02) 51%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 999;
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  0% { transform: translateY(0); }
  100% { transform: translateY(100vh); }
}

/* Terminal Header */
.terminal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.5rem 0.75rem;
  background: var(--bg-deep);
  border-bottom: 2px solid var(--border-accent);
  box-shadow: var(--shadow-glow-cyan), 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  width: 100%;
  box-sizing: border-box;
}

.header-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-row-bottom {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
}

.terminal-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.logo-bracket {
  color: var(--neon-cyan);
  text-shadow: var(--shadow-glow-cyan);
  animation: bracketPulse 2s ease-in-out infinite;
}

.logo-text {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px var(--glow-cyan));
}

@keyframes bracketPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.terminal-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}


.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: rgba(0, 255, 159, 0.1);
  border: 1px solid var(--neon-green);
  border-radius: 4px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: var(--neon-green);
  text-shadow: var(--shadow-glow-green);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: var(--shadow-glow-green);
}

.status-dot.pulsing {
  animation: pulse 1.5s ease-in-out infinite;
}

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

.terminal-time {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: var(--shadow-glow-cyan);
  letter-spacing: 0.05em;
}

.last-update-header {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.header-time-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.header-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: var(--shadow-glow-cyan);
  letter-spacing: 0.05em;
}

/* Bot mode indicator colors */
.header-value.cyan {
  color: var(--neon-cyan);
  text-shadow: var(--shadow-glow-cyan);
}

.header-value.yellow {
  color: var(--neon-yellow);
  text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
  animation: pulse-warning 2s ease-in-out infinite;
}

.header-value.red {
  color: var(--neon-red, #ff4444);
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
  animation: pulse-critical 1s ease-in-out infinite;
}

.header-value.orange {
  color: #ff8c00;
  text-shadow: 0 0 10px rgba(255, 140, 0, 0.5);
  animation: pulse-graceful 1.5s ease-in-out infinite;
}

@keyframes pulse-graceful {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

@keyframes pulse-critical {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

#exit-time-header .header-value {
  color: var(--neon-yellow);
  text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

#next-cycle-header .header-value {
  color: var(--neon-green);
  text-shadow: var(--shadow-glow-green);
}

/* Main Container */
.terminal-container {
  position: relative;
  z-index: 1;
  padding: 2rem 1.5rem;
  max-width: 2000px;
  margin: 0 auto;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 1.25rem;
  position: relative;
  overflow: visible;
  transition: all 0.3s ease;
  animation: slideIn 0.5s ease-out backwards;
  min-height: fit-content;
}

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

.metric-card:nth-child(1) { animation-delay: 0.05s; }
.metric-card:nth-child(2) { animation-delay: 0.1s; }
.metric-card:nth-child(3) { animation-delay: 0.15s; }
.metric-card:nth-child(4) { animation-delay: 0.2s; }
.metric-card:nth-child(5) { animation-delay: 0.25s; }
.metric-card:nth-child(6) { animation-delay: 0.3s; }

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-elevated);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), var(--shadow-glow-cyan);
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.metric-value-large {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  animation: valueGlow 3s ease-in-out infinite;
}

.metric-value-xlarge {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 30px currentColor;
  animation: valueGlow 3s ease-in-out infinite;
}

@keyframes valueGlow {
  0%, 100% { opacity: 1; text-shadow: 0 0 20px currentColor; }
  50% { opacity: 0.9; text-shadow: 0 0 30px currentColor; }
}

/* Status Card */
.status-card .metric-value-large {
  color: var(--neon-green);
  text-shadow: var(--shadow-glow-green);
}

.metric-sublabels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.metric-sublabels > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sublabel {
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.subvalue {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.health-score {
  color: var(--neon-green);
  text-shadow: var(--shadow-glow-green);
}

/* PnL Card */
.pnl-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 255, 159, 0.05) 100%);
  border-color: var(--neon-green);
}

.pnl-value {
  color: var(--neon-green);
  text-shadow: var(--shadow-glow-green);
}

.pnl-value.negative {
  color: var(--neon-red);
  text-shadow: var(--shadow-glow-red);
}

.pnl-breakdown {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pnl-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pnl-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pnl-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pnl-number.positive {
  color: var(--neon-green);
}

.pnl-number.negative {
  color: var(--neon-red);
}

.pnl-divider {
  width: 1px;
  height: 40px;
  background: var(--border-default);
}

.pnl-balance-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-default);
}

.balance-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.balance-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.balance-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Position Card */
.position-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 153, 255, 0.05) 100%);
}

.position-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.position-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bar-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  min-width: 40px;
  color: var(--text-primary);
}

.bar-container {
  flex: 1;
  height: 32px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  transition: width 0.5s ease;
}

.yes-fill {
  background: linear-gradient(90deg, transparent, var(--neon-green));
  box-shadow: inset 0 0 20px rgba(0, 255, 159, 0.3);
}

.no-fill {
  background: linear-gradient(90deg, transparent, var(--neon-red));
  box-shadow: inset 0 0 20px rgba(255, 0, 85, 0.3);
}

.bar-value {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  z-index: 1;
}

/* ========================================
   EXPOSURE GAUGE - Visual USD-based Display
   ======================================== */

.exposure-gauge {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 255, 255, 0.05) 100%);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.exposure-gauge:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
}

.gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.gauge-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Skew Badge (ON/OFF indicator) */
.skew-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.skew-badge.active {
  background: rgba(0, 255, 159, 0.2);
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 15px rgba(0, 255, 159, 0.4);
  animation: pulse-green 2s infinite;
}

.skew-badge.inactive {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 159, 0.3); }
  50% { box-shadow: 0 0 20px rgba(0, 255, 159, 0.5); }
}

/* Dual Exposure Values (Shares + USD) */
.exposure-values {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

.exposure-value-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.exposure-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.exposure-value-item.exposure-usd .exposure-number {
  color: var(--neon-cyan);
  text-shadow: var(--shadow-glow-cyan);
}

.exposure-unit {
  font-size: 0.55rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.exposure-divider {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Visual Gauge Bar */
.gauge-bar-container {
  margin-bottom: 0.75rem;
}

.gauge-bar {
  position: relative;
  height: 24px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: visible;
}

.gauge-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg,
    rgba(0, 255, 159, 0.8) 0%,
    rgba(0, 255, 255, 0.8) 50%,
    rgba(255, 159, 0, 0.8) 80%,
    rgba(255, 0, 85, 0.9) 100%
  );
  border-radius: 12px;
  transition: width 0.4s ease;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* Threshold Marker */
.gauge-threshold-marker {
  position: absolute;
  top: -6px;
  bottom: -6px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  transition: left 0.4s ease;
}

.threshold-line {
  width: 3px;
  height: 36px;
  background: var(--neon-yellow);
  box-shadow: 0 0 10px rgba(255, 255, 0, 0.6);
  border-radius: 2px;
}

.threshold-label {
  position: absolute;
  top: -18px;
  font-size: 0.5rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  color: var(--neon-yellow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
}

/* Gauge Labels */
.gauge-labels {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
}

.gauge-label-left {
  text-align: left;
}

.gauge-label-threshold {
  color: var(--neon-yellow);
  font-weight: 600;
  text-shadow: 0 0 5px rgba(255, 255, 0, 0.3);
}

.gauge-label-right {
  text-align: right;
}

/* Skew Effect Row */
.skew-effect-row {
  display: flex;
  justify-content: space-around;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-default);
}

.skew-effect-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.skew-effect-label {
  font-size: 0.5rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.skew-effect-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--neon-cyan);
  transition: all 0.3s ease;
}

.skew-effect-value.positive {
  color: var(--neon-green);
  text-shadow: var(--shadow-glow-green);
}

.skew-effect-value.negative {
  color: var(--neon-red);
  text-shadow: var(--shadow-glow-red);
}

/* Legacy net-value class for compatibility */
.net-value {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
}

/* Orders Card */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.order-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.order-stat:hover {
  background: rgba(0, 255, 255, 0.05);
  border-color: var(--border-bright);
  transform: scale(1.05);
}

.order-stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

.order-stat-value.green {
  color: var(--neon-green);
  text-shadow: var(--shadow-glow-green);
}

.order-stat-value.red {
  color: var(--neon-red);
  text-shadow: var(--shadow-glow-red);
}

.order-stat-value.cyan {
  color: var(--neon-cyan);
  text-shadow: var(--shadow-glow-cyan);
}

.order-stat-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Volume Card */
.volume-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 0, 255, 0.05) 100%);
  border-color: rgba(255, 0, 255, 0.3);
}

.volume-card .metric-value-large {
  color: var(--neon-magenta);
  text-shadow: var(--shadow-glow-magenta);
}

.volume-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.volume-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan));
  box-shadow: 0 0 10px var(--glow-magenta);
  animation: volumePulse 2s ease-in-out infinite;
}

@keyframes volumePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Markets Card */
.markets-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 255, 255, 0.05) 100%);
  grid-column: 1 / -1; /* Span full width */
}

.markets-card .metric-value-large {
  color: var(--neon-cyan);
  text-shadow: var(--shadow-glow-cyan);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.market-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.market-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.market-status i {
  font-size: 1.25rem;
  color: var(--neon-cyan);
  animation: radar 2s linear infinite;
}

@keyframes radar {
  0% { opacity: 0.3; transform: rotate(0deg); }
  50% { opacity: 1; }
  100% { opacity: 0.3; transform: rotate(360deg); }
}

/* Markets List Mini - Inside Card */
.markets-card-detailed {
  grid-column: 1 / -1; /* Span full width */
}

.markets-list-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  max-height: none;
  overflow: visible;
}

.market-mini-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 0.75rem;
  transition: all 0.3s ease;
}

.market-mini-card:hover {
  border-color: var(--border-bright);
  background: rgba(0, 255, 255, 0.05);
  transform: translateY(-2px);
}

.market-mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-default);
}

.market-mini-card h6 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.bot-mode-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  margin-left: 0.5rem;
}

.bot-mode-badge.cyan {
  background: rgba(0, 255, 255, 0.15);
  color: var(--cyan);
  border: 1px solid var(--cyan);
}

.bot-mode-badge.yellow {
  background: rgba(255, 255, 0, 0.15);
  color: var(--yellow);
  border: 1px solid var(--yellow);
  animation: pulse-warning 2s ease-in-out infinite;
}

.bot-mode-badge.red {
  background: rgba(255, 0, 0, 0.15);
  color: var(--red);
  border: 1px solid var(--red);
  animation: pulse-error 1.5s ease-in-out infinite;
}

.bot-mode-badge.orange {
  background: rgba(255, 140, 0, 0.15);
  color: #ff8c00;
  border: 1px solid #ff8c00;
  animation: pulse-warning 2s ease-in-out infinite;
}

.exit-mode-card {
  border-color: var(--yellow) !important;
  box-shadow: 0 0 10px rgba(255, 255, 0, 0.2);
}

.exit-mode-card:has(.bot-mode-badge.red) {
  border-color: var(--red) !important;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.exit-mode-card:has(.bot-mode-badge.orange) {
  border-color: #ff8c00 !important;
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.3);
}

@keyframes pulse-warning {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
  }
}

@keyframes pulse-error {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.9);
  }
}

.market-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  font-size: 0.7rem;
}

.market-mini-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.market-mini-stat-label {
  color: var(--text-muted);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.market-mini-stat-value {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.7rem;
}


/* Terminal Sections */
.terminal-section {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.terminal-section:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 255, 255, 0.05);
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-header:hover {
  background: rgba(0, 255, 255, 0.1);
}

.section-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title i {
  color: var(--neon-cyan);
  font-size: 1.25rem;
}

/* Refresh Countdown Timer */
.refresh-countdown {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.3s ease;
}

.refresh-countdown:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 255, 255, 0.12);
}

.refresh-countdown i {
  color: var(--neon-cyan);
  font-size: 1rem;
  animation: spin-slow 3s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.countdown-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.countdown-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: var(--shadow-glow-cyan);
  min-width: 70px;
  text-align: center;
}

.countdown-bar {
  width: 80px;
  height: 4px;
  background: rgba(0, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.countdown-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
  border-radius: 2px;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--glow-cyan);
}

.refresh-countdown.refreshing {
  border-color: var(--neon-green);
  background: rgba(0, 255, 159, 0.15);
}

.refresh-countdown.refreshing i {
  color: var(--neon-green);
  animation: spin-fast 0.5s linear infinite;
}

@keyframes spin-fast {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.refresh-countdown.refreshing .countdown-value {
  color: var(--neon-green);
  text-shadow: var(--shadow-glow-green);
}

/* Responsive countdown styles */
@media (max-width: 768px) {
  .refresh-countdown {
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
  }

  .countdown-label {
    display: none;
  }

  .countdown-value {
    font-size: 0.85rem;
    min-width: 60px;
  }

  .countdown-bar {
    width: 50px;
  }
}

@media (max-width: 480px) {
  .refresh-countdown {
    padding: 0.3rem 0.5rem;
    gap: 0.4rem;
  }

  .countdown-value {
    font-size: 0.75rem;
  }

  .countdown-bar {
    width: 40px;
    height: 3px;
  }

  .refresh-countdown i {
    font-size: 0.85rem;
  }
}

.terminal-btn {
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-btn:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: var(--border-bright);
  color: var(--neon-cyan);
}

.terminal-btn i {
  transition: transform 0.3s ease;
}

.section-content {
  padding: 1.5rem;
  transition: all 0.3s ease;
  max-height: 2000px;
  overflow: hidden;
}

.section-content.collapsed {
  max-height: 0;
  padding: 0;
  opacity: 0;
}

/* Invariants Grid */
.invariants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.invariant-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.invariant-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.invariant-item:hover {
  transform: translateY(-4px);
  border-color: var(--border-bright);
  background: rgba(0, 255, 255, 0.05);
}

.invariant-item:hover::before {
  opacity: 1;
}

.invariant-icon {
  font-size: 2rem;
}

.invariant-icon.invariant-ok {
  color: var(--neon-green);
  filter: drop-shadow(var(--shadow-glow-green));
}

.invariant-icon.invariant-warning {
  color: var(--neon-yellow);
  filter: drop-shadow(0 0 10px rgba(255, 255, 0, 0.5));
}

.invariant-icon.invariant-error {
  color: var(--neon-red);
  filter: drop-shadow(var(--shadow-glow-red));
}

.invariant-label {
  font-size: 0.625rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.invariant-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.invariant-value.invariant-ok {
  color: var(--neon-green);
}

.invariant-value.invariant-warning {
  color: var(--neon-yellow);
}

.invariant-value.invariant-error {
  color: var(--neon-red);
}

/* ============================================================================
   REDESIGNED INVARIANT MONITOR (6 Sections)
   ============================================================================ */

/* Health Score Badge */
.health-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  padding: 0 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.health-score.health-ok {
  background: rgba(0, 255, 65, 0.2);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
}

.health-score.health-warning {
  background: rgba(255, 255, 0, 0.2);
  color: var(--neon-yellow);
  border: 1px solid var(--neon-yellow);
}

.health-score.health-error {
  background: rgba(255, 0, 80, 0.2);
  color: var(--neon-red);
  border: 1px solid var(--neon-red);
}

/* 6 Sections Grid Layout */
.invariants-sections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

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

@media (max-width: 768px) {
  .invariants-sections-grid {
    grid-template-columns: 1fr;
  }
}

/* Individual Section Card */
.invariant-section {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.invariant-section:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
}

.invariant-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 255, 255, 0.05);
  border-bottom: 1px solid var(--border-default);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.invariant-section-header i {
  font-size: 0.875rem;
  color: var(--neon-cyan);
}

.invariant-section-content {
  padding: 1rem;
  min-height: 80px;
}

/* Compact Invariant Item (for generic sections) */
.invariant-item-compact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.invariant-item-compact:last-child {
  border-bottom: none;
}

.invariant-status-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
}

.invariant-status-icon.invariant-ok {
  color: var(--neon-green);
}

.invariant-status-icon.invariant-warning {
  color: var(--neon-yellow);
}

.invariant-status-icon.invariant-error {
  color: var(--neon-red);
}

.invariant-item-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.invariant-item-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.invariant-item-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
}

.invariant-item-value.invariant-ok {
  color: var(--neon-green);
}

.invariant-item-value.invariant-warning {
  color: var(--neon-yellow);
}

.invariant-item-value.invariant-error {
  color: var(--neon-red);
}

/* Bot Mode Display */
.bot-mode-display {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bot-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.bot-mode-badge.mode-quoting {
  background: rgba(0, 255, 65, 0.15);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
}

.bot-mode-badge.mode-exit-prep {
  background: rgba(255, 255, 0, 0.15);
  color: var(--neon-yellow);
  border: 1px solid var(--neon-yellow);
  animation: pulse-yellow 2s infinite;
}

.bot-mode-badge.mode-exit {
  background: rgba(255, 0, 80, 0.15);
  color: var(--neon-red);
  border: 1px solid var(--neon-red);
  animation: pulse-red 1s infinite;
}

@keyframes pulse-yellow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 0, 0.4); }
  50% { box-shadow: 0 0 10px 5px rgba(255, 255, 0, 0.2); }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 0, 80, 0.4); }
  50% { box-shadow: 0 0 15px 5px rgba(255, 0, 80, 0.3); }
}

.bot-mode-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timer-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.timer-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  color: var(--neon-cyan);
}

.timer-value.in-exit {
  color: var(--neon-red);
  font-weight: 700;
}

/* Skew Threshold Display */
.skew-threshold-display {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skew-gauge {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.skew-gauge-label {
  display: flex;
  justify-content: space-between;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
}

.skew-gauge-label span:first-child {
  color: var(--neon-cyan);
  font-weight: 600;
}

.threshold-marker {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.skew-gauge-bar {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.skew-gauge-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.skew-gauge-fill.invariant-ok {
  background: linear-gradient(90deg, var(--neon-green), rgba(0, 255, 65, 0.5));
}

.skew-gauge-fill.invariant-warning {
  background: linear-gradient(90deg, var(--neon-yellow), rgba(255, 255, 0, 0.5));
}

.skew-gauge-fill.invariant-error {
  background: linear-gradient(90deg, var(--neon-red), rgba(255, 0, 80, 0.5));
}

.skew-threshold-line {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--neon-cyan);
  box-shadow: 0 0 5px var(--neon-cyan);
}

.skew-info-row {
  display: flex;
  gap: 1rem;
}

.skew-info-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.skew-info-label {
  font-size: 0.625rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.skew-info-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.skew-info-value.active {
  color: var(--neon-green);
}

.skew-info-value.inactive {
  color: var(--text-secondary);
}

/* Take-Profit Display */
.take-profit-display {
  display: flex;
  gap: 0.75rem;
}

.tp-stat {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.tp-stat i {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.tp-stat.invariant-ok i {
  color: var(--neon-green);
}

.tp-stat.invariant-warning i {
  color: var(--neon-yellow);
}

.tp-stat.invariant-error i {
  color: var(--neon-red);
}

.tp-stat-info {
  display: flex;
  flex-direction: column;
}

.tp-stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tp-stat-label {
  font-size: 0.5rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.chart-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.chart-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.chart-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.chart-container {
  position: relative;
  height: 250px;
}

canvas {
  filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.1));
}

/* Terminal Tables */
.terminal-table-container {
  overflow-x: auto;
  border-radius: 8px;
}

.terminal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.terminal-table thead {
  background: rgba(0, 255, 255, 0.1);
  border-bottom: 2px solid var(--border-bright);
}

.terminal-table th {
  padding: 1rem;
  text-align: left;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--neon-cyan);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-default);
}

.terminal-table tbody tr {
  border-bottom: 1px solid var(--border-default);
  transition: all 0.2s ease;
}

.terminal-table tbody tr:hover {
  background: rgba(0, 255, 255, 0.05);
  transform: translateX(4px);
}

.terminal-table td {
    padding: 1rem;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

/* Market Cards in Markets Section */
.market-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.market-card:hover {
  border-color: var(--border-bright);
  background: rgba(0, 255, 255, 0.05);
  transform: translateX(4px);
}

.market-card h6 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-default);
}

/* Utility Classes */
.green {
  color: var(--neon-green) !important;
  text-shadow: var(--shadow-glow-green);
}

.red {
  color: var(--neon-red) !important;
  text-shadow: var(--shadow-glow-red);
}

.cyan {
  color: var(--neon-cyan) !important;
  text-shadow: var(--shadow-glow-cyan);
}

.positive {
  color: var(--neon-green);
}

.negative {
  color: var(--neon-red);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-magenta));
  border-radius: 5px;
  box-shadow: 0 0 10px var(--glow-cyan);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--glow-cyan), var(--glow-magenta));
}

/* Responsive Design */
@media (max-width: 1400px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 768px) {
  .terminal-header {
    padding: 0.75rem 1rem 0.5rem;
    gap: 0.5rem;
  }

  .header-row-top {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .header-left {
    flex-shrink: 0;
  }

  .header-right {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-nav {
    gap: 0.5rem;
  }

  .header-row-bottom {
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .terminal-logo {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  .terminal-subtitle {
    font-size: 0.65rem;
  }

  .status-indicator {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.5rem;
  }

  .status-dot {
    width: 8px;
    height: 8px;
  }

  .header-time-info {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
    gap: 0.4rem;
  }

  .header-label {
    font-size: 0.6rem;
  }

  .header-value {
    font-size: 0.75rem;
  }

  .terminal-time {
    font-size: 1rem;
  }

  .last-update-header {
    font-size: 0.65rem;
  }
  
  .terminal-container {
    padding: 1rem 1rem;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .orders-grid {
    grid-template-columns: 1fr;
  }
  
  .invariants-grid {
    grid-template-columns: 1fr;
  }
  
  .markets-list-mini {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .terminal-header {
    padding: 0.5rem 0.75rem 0.4rem;
    gap: 0.4rem;
  }

  .header-row-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .header-right {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem;
  }

  .header-row-bottom {
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .terminal-logo {
    font-size: 1rem;
  }

  .terminal-subtitle {
    font-size: 0.6rem;
  }

  .header-nav {
    gap: 0.4rem;
  }

  .status-indicator {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }

  .header-time-info {
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
  }

  .header-label {
    font-size: 0.55rem;
  }

  .header-value {
    font-size: 0.7rem;
  }

  .terminal-time {
    font-size: 0.9rem;
  }

  .last-update-header {
    font-size: 0.6rem;
  }

  /* Hide less critical info on very small screens */
  #bot-mode-header,
  #exit-time-header,
  #next-cycle-header {
    display: none !important;
  }
}

/* Orderbook Display */
.orderbook-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
}

.orderbook-side {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.orderbook-side:hover {
  border-color: var(--border-bright);
  background: rgba(0, 0, 0, 0.3);
}

.orderbook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-default);
}

.orderbook-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin: 0;
  text-transform: uppercase;
}

.orderbook-title.green {
  color: var(--neon-green);
  text-shadow: var(--shadow-glow-green);
}

.orderbook-title.red {
  color: var(--neon-red);
  text-shadow: var(--shadow-glow-red);
}

.spread-info {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid var(--border-default);
  border-radius: 4px;
}

.spread-info.spread-tight {
  background: rgba(0, 255, 0, 0.1);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.spread-info.spread-wide {
  background: rgba(255, 165, 0, 0.1);
  border-color: #ffa500;
  color: #ffa500;
}

.orderbook-section {
  margin-bottom: 1.5rem;
}

.orderbook-section:last-child {
  margin-bottom: 0;
}

.orderbook-section-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.orderbook-section-buy .orderbook-section-label {
  background: rgba(0, 255, 159, 0.1);
  color: var(--neon-green);
  border-left: 3px solid var(--neon-green);
}

.orderbook-section-sell .orderbook-section-label {
  background: rgba(255, 0, 85, 0.1);
  color: var(--neon-red);
  border-left: 3px solid var(--neon-red);
}

.orderbook-section-label i {
  font-size: 1rem;
}

.orderbook-table {
  font-size: 0.8rem;
}

.orderbook-table thead th {
  font-size: 0.7rem;
  padding: 0.75rem 0.5rem;
}

.orderbook-table tbody td {
  padding: 0.65rem 0.5rem;
}

.orderbook-price {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--neon-cyan);
}

.orderbook-section-buy .orderbook-price {
  color: var(--neon-green);
}

.orderbook-section-sell .orderbook-price {
  color: var(--neon-red);
}

/* Current Price Indicator */
.orderbook-price-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  margin: 1rem 0;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--border-default);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.orderbook-price-indicator::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent, rgba(0, 255, 255, 0.05), transparent);
  pointer-events: none;
}

.price-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.price-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--neon-cyan);
  text-shadow: var(--shadow-glow-cyan);
  animation: valueGlow 3s ease-in-out infinite;
}

/* YES side price indicator */
#yes-price-indicator {
  border-color: rgba(0, 255, 159, 0.3);
}

#yes-price-indicator .price-value {
  color: var(--neon-green);
  text-shadow: var(--shadow-glow-green);
}

/* NO side price indicator */
#no-price-indicator {
  border-color: rgba(255, 0, 85, 0.3);
}

#no-price-indicator .price-value {
  color: var(--neon-red);
  text-shadow: var(--shadow-glow-red);
}

/* Responsive orderbook */
@media (max-width: 1200px) {
  .orderbook-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .orderbook-side {
    padding: 1rem;
  }
  
  .orderbook-title {
    font-size: 1rem;
  }
  
  .spread-info {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }
  
  .orderbook-section-label {
    font-size: 0.65rem;
    padding: 0.4rem 0.5rem;
  }
  
  .orderbook-table {
    font-size: 0.75rem;
  }
  
  .orderbook-table thead th {
    font-size: 0.65rem;
    padding: 0.5rem 0.4rem;
  }
  
  .orderbook-table tbody td {
    padding: 0.5rem 0.4rem;
  }
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

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

@keyframes shimmer {
  to { left: 100%; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: var(--border-bright);
  color: var(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-cyan);
}

.nav-btn.active {
  background: rgba(0, 255, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: var(--shadow-glow-cyan);
}

.nav-btn i {
  font-size: 1rem;
}

.nav-divider {
  width: 1px;
  height: 30px;
  background: var(--border-default);
  margin: 0 0.5rem;
}

@media (max-width: 768px) {
  .nav-label {
    display: none;
  }

  .nav-btn {
    padding: 0.5rem;
  }

  .nav-divider {
    height: 24px;
    margin: 0 0.25rem;
  }
}

/* ============================================
   SETTINGS VIEW STYLES
   ============================================ */

.settings-view {
  animation: fadeIn 0.3s ease-out;
}

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

/* Settings Header */
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-default);
}

.settings-title-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-main-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
}

.settings-main-title i {
  color: var(--neon-cyan);
  text-shadow: var(--shadow-glow-cyan);
}

.settings-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.settings-actions {
  display: flex;
  gap: 1rem;
}

/* Settings Buttons */
.settings-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.settings-btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  color: var(--bg-void);
  box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.settings-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 255, 255, 0.4);
}

.settings-btn-primary:active {
  transform: translateY(0);
}

.settings-btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.settings-btn-secondary {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

.settings-btn-secondary:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: var(--border-bright);
  color: var(--neon-cyan);
}

.settings-btn-danger {
  background: linear-gradient(135deg, var(--neon-red), #ff3366);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

.settings-btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 85, 0.4);
}

.settings-btn-add {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 255, 159, 0.1);
  border: 1px dashed var(--neon-green);
  color: var(--neon-green);
}

.settings-btn-add:hover {
  background: rgba(0, 255, 159, 0.2);
  border-style: solid;
}

.settings-btn i {
  font-size: 1rem;
}

/* Loading state for buttons */
.settings-btn.loading {
  position: relative;
  color: transparent;
}

.settings-btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-default);
  border-radius: 8px;
}

.settings-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.settings-tab:hover {
  background: rgba(0, 255, 255, 0.05);
  color: var(--text-primary);
}

.settings-tab.active {
  background: rgba(0, 255, 255, 0.1);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.settings-tab i {
  font-size: 1.25rem;
}

/* Settings Tab Content */
.settings-tab-content {
  animation: fadeIn 0.3s ease-out;
}

/* Settings Sections */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.settings-section:hover {
  border-color: var(--border-bright);
}

.settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-section-header:hover {
  background: rgba(0, 255, 255, 0.1);
}

.settings-section-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-section-title i {
  color: var(--neon-cyan);
  font-size: 1.25rem;
}

.settings-section-header > i {
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.settings-section-header.collapsed > i {
  transform: rotate(-90deg);
}

.settings-section-content {
  padding: 1.5rem;
  transition: all 0.3s ease;
  max-height: 2000px;
  overflow: hidden;
}

.settings-section-content.collapsed {
  max-height: 0;
  padding: 0 1.5rem;
  opacity: 0;
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Settings Fields */
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-field label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-hint {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  padding: 0.15rem 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.settings-field input[type="number"],
.settings-field input[type="text"],
.settings-field select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.settings-field input:focus,
.settings-field select:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.1), var(--shadow-glow-cyan);
  background: rgba(0, 0, 0, 0.5);
}

.settings-field input:hover,
.settings-field select:hover {
  border-color: var(--border-bright);
}

.settings-field input.invalid,
.settings-field select.invalid {
  border-color: var(--neon-red);
  box-shadow: 0 0 0 3px rgba(255, 0, 85, 0.1);
}

.settings-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.settings-field select option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.5rem;
}

/* Field Description */
.field-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.4;
  font-weight: 400;
  margin-top: -0.25rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(0, 255, 255, 0.2);
}

/* Field Error */
.field-error {
  font-size: 0.75rem;
  color: var(--neon-red);
  min-height: 1.2em;
}

/* Toggle Switch */
.settings-field-toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.toggle-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  width: 56px;
  height: 28px;
  display: inline-block;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-default);
  border-radius: 28px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(0, 255, 159, 0.2);
  border-color: var(--neon-green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(28px);
  background: var(--neon-green);
  box-shadow: 0 0 10px rgba(0, 255, 159, 0.5);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.1);
}

/* Danger Toggle (Graceful Exit) */
.toggle-switch-danger input:checked + .toggle-slider {
  background: rgba(255, 0, 85, 0.2);
  border-color: var(--neon-red);
}

.toggle-switch-danger input:checked + .toggle-slider::before {
  transform: translateX(28px);
  background: var(--neon-red);
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
}

.graceful-exit-toggle {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255, 0, 85, 0.3);
}

.graceful-exit-toggle .toggle-label {
  color: var(--neon-red);
  font-weight: 600;
}

/* Market Card in Settings */
.market-settings-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.market-settings-card:hover {
  border-color: var(--border-bright);
  background: rgba(0, 255, 255, 0.03);
}

.market-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
}

.market-settings-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.market-settings-title .market-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-settings-title .market-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-enabled-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--neon-green);
  background: rgba(0, 255, 159, 0.15);
  border: 1px solid rgba(0, 255, 159, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.market-settings-actions {
  display: flex;
  gap: 0.5rem;
}

.market-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
}

.market-settings-btn:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: var(--border-bright);
  color: var(--neon-cyan);
}

.market-settings-btn.delete:hover {
  background: rgba(255, 0, 85, 0.1);
  border-color: var(--neon-red);
  color: var(--neon-red);
}

.market-settings-content {
  transition: all 0.3s ease;
  max-height: 1000px;
  overflow: hidden;
}

.market-settings-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

/* Asset Card in Settings */
.asset-settings-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.asset-settings-card:hover {
  border-color: var(--border-bright);
}

.asset-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
}

.asset-settings-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--neon-yellow);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.asset-settings-content {
  transition: all 0.3s ease;
}

.asset-settings-content.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

/* Loading State */
.settings-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

.settings-loading i {
  font-size: 1.25rem;
  color: var(--neon-cyan);
}

/* Empty State */
.settings-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.settings-empty i {
  font-size: 3rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastSlideIn 0.3s ease-out;
  max-width: 400px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.toast-exit {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideOut {
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.toast-message {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Toast Variants */
.toast-success {
  border-color: var(--neon-green);
  border-left: 3px solid var(--neon-green);
}

.toast-success .toast-icon {
  color: var(--neon-green);
}

.toast-success .toast-title {
  color: var(--neon-green);
}

.toast-error {
  border-color: var(--neon-red);
  border-left: 3px solid var(--neon-red);
}

.toast-error .toast-icon {
  color: var(--neon-red);
}

.toast-error .toast-title {
  color: var(--neon-red);
}

.toast-warning {
  border-color: var(--neon-yellow);
  border-left: 3px solid var(--neon-yellow);
}

.toast-warning .toast-icon {
  color: var(--neon-yellow);
}

.toast-warning .toast-title {
  color: var(--neon-yellow);
}

.toast-info {
  border-color: var(--neon-cyan);
  border-left: 3px solid var(--neon-cyan);
}

.toast-info .toast-icon {
  color: var(--neon-cyan);
}

.toast-info .toast-title {
  color: var(--neon-cyan);
}

/* ============================================
   MODAL DIALOGS
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--shadow-glow-cyan);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-confirm {
  max-width: 450px;
}

/* Password Modal */
.modal-password {
  max-width: 400px;
}

.modal-password .modal-title i {
  color: var(--neon-magenta);
}

.password-prompt {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.password-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  letter-spacing: 0.1em;
  transition: all 0.2s ease;
}

.password-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.password-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0;
}

.password-error {
  background: rgba(255, 0, 85, 0.1);
  border: 1px solid rgba(255, 0, 85, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--neon-red);
  font-size: 0.85rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: shake 0.3s ease-out, fadeIn 0.2s ease-out;
}

.password-error i {
  font-size: 1.1rem;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Password Modal Buttons */
.modal-password .modal-footer {
  gap: 12px;
}

.btn-secondary,
.btn-primary {
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-bright);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  color: var(--bg-void);
  box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 255, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary i {
  font-size: 1rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 255, 255, 0.05);
  border-bottom: 1px solid var(--border-default);
}

.modal-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.modal-title i {
  color: var(--neon-cyan);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--neon-red);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-default);
}

/* Warnings List */
.warnings-list {
  background: rgba(255, 255, 0, 0.05);
  border: 1px solid var(--neon-yellow);
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
}

.warnings-list-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--neon-yellow);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.warnings-list ul {
  margin: 0;
  padding-left: 1.5rem;
}

.warnings-list li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

/* ============================================
   SETTINGS RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .settings-header {
    flex-direction: column;
    gap: 1rem;
  }

  .settings-actions {
    width: 100%;
  }

  .settings-actions .settings-btn {
    flex: 1;
    justify-content: center;
  }

  .settings-main-title {
    font-size: 1.5rem;
  }

  .settings-tabs {
    flex-direction: column;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .market-settings-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .market-settings-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .toast-container {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 20px;
  }

  .toast {
    max-width: 100%;
  }

  .modal-content {
    width: 95%;
    margin: 10px;
  }
}

/* ============================================================================
   EXPORT TRADES MODAL STYLES
   ============================================================================ */

.export-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.export-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
}

.export-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.export-modal-content {
  background: linear-gradient(135deg, #1a2129 0%, #151b23 100%);
  margin: 8% auto;
  padding: 0;
  border-radius: 12px;
  width: 600px;
  max-width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
              0 0 40px rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.3);
  animation: slideDown 0.3s ease;
}

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

.export-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(102, 126, 234, 0.3);
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.export-modal-header h3 {
  margin: 0;
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.export-modal-header h3 i {
  margin-right: 8px;
  color: #667eea;
}

.export-modal-close {
  color: var(--text-secondary);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0 8px;
}

.export-modal-close:hover {
  color: #667eea;
  transform: scale(1.2);
}

.export-modal-body {
  padding: 24px;
}

.export-field {
  margin-bottom: 20px;
}

.export-field label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.export-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.export-checkboxes.crypto-assets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.export-checkboxes.crypto15m-markets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.export-select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.export-select option {
  background: #1a2129;
  color: var(--text-primary);
  padding: 8px;
}

.export-checkbox {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-checkbox:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.5);
}

.export-checkbox input[type="checkbox"] {
  margin: 0;
  margin-right: 10px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #667eea;
}

.export-checkbox .checkbox-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.export-checkbox .checkbox-label i {
  margin-right: 6px;
  color: #667eea;
}

.export-date-range {
  display: flex;
  align-items: center;
  gap: 12px;
}

.export-date-range input[type="date"] {
  flex: 1;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  transition: all 0.2s ease;
}

.export-date-range input[type="date"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.export-date-range input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.date-separator {
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.export-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  display: none;
  align-items: center;
  gap: 8px;
}

.export-status i {
  font-size: 16px;
}

.export-status.loading {
  display: flex;
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.export-status.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.export-status.success {
  display: flex;
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.export-status.error {
  display: flex;
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.export-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid rgba(102, 126, 234, 0.3);
  background: rgba(0, 0, 0, 0.2);
}

.export-modal-footer button {
  min-width: 120px;
}

/* Responsive adjustments for export modal */
@media (max-width: 768px) {
  .export-modal-content {
    width: 95%;
    margin: 5% auto;
  }

  .export-checkboxes.crypto-assets {
    grid-template-columns: 1fr;
  }

  .export-date-range {
    flex-direction: column;
    gap: 8px;
  }

  .export-date-range input[type="date"] {
    width: 100%;
  }

  .date-separator {
    display: none;
  }

  .export-modal-footer {
    flex-direction: column;
  }

  .export-modal-footer button {
    width: 100%;
  }
}

/* ============================================================================
   ACTIVITY LOG STYLES
   ============================================================================ */

.logs-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logs-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logs-filter-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logs-filter-select:hover {
  border-color: var(--accent-primary);
}

.logs-filter-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.1);
}

.logs-filter-select option {
  background: #1a2129;
  color: var(--text-primary);
}

.logs-clear-btn {
  padding: 4px 8px !important;
  min-width: auto !important;
}

.logs-clear-btn:hover {
  background: rgba(244, 67, 54, 0.2) !important;
  border-color: #f44336 !important;
}

.logs-container {
  max-height: 400px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 136, 0.3) transparent;
}

.logs-container::-webkit-scrollbar {
  width: 6px;
}

.logs-container::-webkit-scrollbar-track {
  background: transparent;
}

.logs-container::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 136, 0.3);
  border-radius: 3px;
}

.logs-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 136, 0.5);
}

.logs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  gap: 8px;
}

.logs-empty i {
  font-size: 32px;
  opacity: 0.5;
}

.log-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14.4px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid transparent;
  animation: logSlideIn 0.2s ease-out;
  transition: background 0.15s ease;
}

@keyframes logSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.log-entry:hover {
  background: rgba(0, 0, 0, 0.35);
}

/* Log level colors */
.log-entry.log-info {
  border-left-color: #2196f3;
}

.log-entry.log-success {
  border-left-color: #4caf50;
}

.log-entry.log-warning {
  border-left-color: #ff9800;
}

.log-entry.log-error {
  border-left-color: #f44336;
}

.log-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.log-info .log-icon {
  color: #2196f3;
}

.log-success .log-icon {
  color: #4caf50;
}

.log-warning .log-icon {
  color: #ff9800;
}

.log-error .log-icon {
  color: #f44336;
}

.log-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.log-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.log-time {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.log-category {
  font-size: 10.8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.log-category.cat-order {
  background: rgba(33, 150, 243, 0.2);
  color: #64b5f6;
}

.log-category.cat-fill {
  background: rgba(76, 175, 80, 0.2);
  color: #81c784;
}

.log-category.cat-position {
  background: rgba(156, 39, 176, 0.2);
  color: #ba68c8;
}

.log-category.cat-market {
  background: rgba(0, 188, 212, 0.2);
  color: #4dd0e1;
}

.log-category.cat-system {
  background: rgba(158, 158, 158, 0.2);
  color: #bdbdbd;
}

.log-category.cat-error {
  background: rgba(244, 67, 54, 0.2);
  color: #e57373;
}

.log-message {
  color: var(--text-primary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.log-details {
  display: flex;
  flex-direction: row;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
  flex-shrink: 0;
}

.log-details-item {
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

.log-details-key {
  color: var(--text-muted);
}

.log-details-value {
  color: var(--accent-secondary);
}

/* Auto-scroll indicator */
.logs-autoscroll {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 255, 136, 0.2);
  border: 1px solid var(--accent-primary);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-primary);
  cursor: pointer;
  display: none;
  transition: all 0.2s ease;
}

.logs-autoscroll:hover {
  background: rgba(0, 255, 136, 0.3);
}

.logs-autoscroll.visible {
  display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .logs-filters {
    flex-wrap: wrap;
  }

  .logs-filter-select {
    font-size: 10px;
    padding: 3px 6px;
  }

  .log-entry {
    padding: 6px 8px;
  }

  .log-message {
    font-size: 11px;
  }
}

/* ============================================================================
   TX LOGS (TRANSACTION LOGS) - FILLS DISPLAY
   ============================================================================ */

/* Tx log entry - BUY side */
.log-entry.log-tx-buy {
  border-left-color: #00ff88;
}

.log-entry.log-tx-buy .log-icon {
  color: #00ff88;
}

/* Tx log entry - SELL side */
.log-entry.log-tx-sell {
  border-left-color: #ff0844;
}

.log-entry.log-tx-sell .log-icon {
  color: #ff0844;
}

/* Tx log outcome badge */
.log-outcome {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
}

.log-outcome.green {
  background: rgba(0, 255, 136, 0.2);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.log-outcome.red {
  background: rgba(255, 8, 68, 0.2);
  color: #ff0844;
  border: 1px solid rgba(255, 8, 68, 0.3);
}

/* Tx log side badge */
.cat-tx.tx-side-buy {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.cat-tx.tx-side-sell {
  background: rgba(255, 8, 68, 0.15);
  color: #ff0844;
  border: 1px solid rgba(255, 8, 68, 0.3);
}

/* Tx log details layout */
.tx-log-details {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.tx-detail {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tx-label {
  font-size: 9px;
  color: #4affce;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-family: 'Orbitron', sans-serif;
}

.tx-value {
  font-size: 11px;
  color: #ffffff;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================================================
   TX SUMMARY (PAIRED BUY-SELL TRACKING)
   ============================================================================ */

/* Tx summary entry - Profitable trade */
.log-entry.log-tx-profit {
  border-left-color: #00ff88;
}

.log-entry.log-tx-profit .log-icon {
  color: #00ff88;
}

/* Tx summary entry - Losing trade */
.log-entry.log-tx-loss {
  border-left-color: #ff0844;
}

.log-entry.log-tx-loss .log-icon {
  color: #ff0844;
}

/* Tx summary entry - Open position */
.log-entry.log-tx-open {
  border-left-color: #4affce;
}

.log-entry.log-tx-open .log-icon {
  color: #4affce;
}

/* Tx summary status badges */
.cat-tx.tx-status-profit {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.cat-tx.tx-status-loss {
  background: rgba(255, 8, 68, 0.15);
  color: #ff0844;
  border: 1px solid rgba(255, 8, 68, 0.3);
}

.cat-tx.tx-status-open {
  background: rgba(74, 255, 206, 0.15);
  color: #4affce;
  border: 1px solid rgba(74, 255, 206, 0.3);
}

/* Tx summary details layout */
.tx-summary-details {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

/* P&L specific styling */
.tx-detail-pnl {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.tx-detail-pnl.tx-pnl-positive {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.tx-detail-pnl.tx-pnl-positive .tx-value {
  color: #00ff88;
}

.tx-detail-pnl.tx-pnl-negative {
  background: rgba(255, 8, 68, 0.1);
  border: 1px solid rgba(255, 8, 68, 0.2);
}

.tx-detail-pnl.tx-pnl-negative .tx-value {
  color: #ff0844;
}

/* Transaction description */
.tx-description {
  font-size: 11px;
  color: #8b95a5;
  margin-top: 4px;
  margin-bottom: 6px;
  font-family: 'Inter', sans-serif;
  font-style: italic;
  line-height: 1.4;
}

/* Exit time display */
.tx-exit-time {
  font-size: 10px;
  color: #8b95a5;
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-style: italic;
}

/* Exit mode badge styling */
.exit-mode-badge {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
  margin-left: 4px;
}

.exit-mode-badge.exit-mode-prep {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.exit-mode-badge.exit-mode-forced {
  background: rgba(255, 87, 34, 0.2);
  color: #ff5722;
  border: 1px solid rgba(255, 87, 34, 0.3);
}

.exit-mode-badge.exit-mode-generic {
  background: rgba(158, 158, 158, 0.2);
  color: #bdbdbd;
  border: 1px solid rgba(158, 158, 158, 0.3);
}

.exit-mode-badge.exit-mode-takeprofit {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Level badge styling */
.level-badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
  margin-left: 4px;
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

/* ============================================================================
   STRATEGY STATUS BANNER
   ============================================================================ */

/* Strategy status banner container */
.strategy-status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  border-left: 4px solid;
  animation: slideDown 0.3s ease-out;
}

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

/* Active strategy banner (green) */
.strategy-status-banner.strategy-active {
  background: rgba(0, 255, 136, 0.1);
  border-left-color: #00ff88;
  color: #00ff88;
}

.strategy-status-banner.strategy-active i {
  font-size: 18px;
  color: #00ff88;
}

/* Inactive strategy banner (warning yellow) */
.strategy-status-banner.strategy-inactive {
  background: rgba(255, 193, 7, 0.1);
  border-left-color: #ffc107;
  color: #ffdd57;
}

.strategy-status-banner.strategy-inactive i {
  font-size: 18px;
  color: #ffc107;
}

.strategy-status-banner strong {
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ============================================================================
   POSITIONS SUMMARY BARS (Above Open Positions table)
   ============================================================================ */

.positions-summary-bars {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--border-default);
}

.positions-summary-bars .position-bar {
  flex: 1;
}

/* Data source notes */
.data-source-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.data-source-note i {
  font-size: 0.8rem;
}

.data-source-note.polymarket-source {
  background: rgba(0, 255, 136, 0.08);
  color: rgba(0, 255, 136, 0.7);
  border-left: 2px solid rgba(0, 255, 136, 0.4);
}

.data-source-note.local-source {
  background: rgba(255, 193, 7, 0.08);
  color: rgba(255, 193, 7, 0.7);
  border-left: 2px solid rgba(255, 193, 7, 0.4);
}

/* ============================================================================
   DUST BADGE (Small positions < 5 shares)
   ============================================================================ */

.dust-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
  margin-left: 6px;
  background: rgba(158, 158, 158, 0.15);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
  vertical-align: middle;
}

/* ============================================================================
   RETRIES & PHANTOM BADGE (Take-profit SELL placement retries)
   ============================================================================ */

.retries-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
}

.retries-ok {
  color: #6e7681;
}

.retries-warning {
  color: #ffc107;
}

.phantom-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
  margin-left: 6px;
  background: rgba(224, 108, 117, 0.2);
  color: #e06c75;
  border: 1px solid rgba(224, 108, 117, 0.5);
  vertical-align: middle;
  animation: phantom-pulse 2s ease-in-out infinite;
}

@keyframes phantom-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 5px rgba(224, 108, 117, 0.3);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 10px rgba(224, 108, 117, 0.6);
  }
}
