:root {
  --bg-color: #0b0e14;
  --panel-bg: rgba(18, 24, 38, 0.75);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --signal-red: #ef4444;
  --setup-orange: #f97316;
  --watch-yellow: #eab308;
  --green-gain: #22c55e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Glow Effect */
.background-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
.glow-1 {
  top: -100px;
  left: -100px;
  background: var(--accent-cyan);
}
.glow-2 {
  bottom: -100px;
  right: -100px;
  background: var(--accent-purple);
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 24px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0284c7, #9333ea);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.3);
}

.logo-area h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Status Indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-connected {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.status-connected .dot {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}
.status-connecting {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.status-connecting .dot {
  background: #eab308;
  box-shadow: 0 0 10px #eab308;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.status-disconnected {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 20px;
}
.stat-card-red { border-left: 4px solid var(--signal-red); }
.stat-card-orange { border-left: 4px solid var(--setup-orange); }
.stat-card-yellow { border-left: 4px solid var(--watch-yellow); }

.stat-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
}
.stat-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}
.search-box input:focus {
  border-color: var(--accent-cyan);
}

.filter-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.custom-select {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

/* Table Card */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
}

.data-table td {
  padding: 16px 20px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.pair-cell {
  font-size: 15px;
}
.price-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.tf-pill {
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}
.badge-signal {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}
.badge-setup {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}
.badge-watch {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.drop-text { color: #f87171; font-weight: 600; }
.rec-text { color: #4ade80; font-weight: 600; }

.time-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sym-tag {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

/* Progress Bar */
.progress-cell {
  min-width: 140px;
}
.progress-bar-container {
  height: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f97316, #22c55e);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 11px;
  color: var(--text-muted);
}

/* Risk Info */
.risk-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.sl-val { color: #f87171; }
.tp-val { color: #4ade80; }

.trade-btn {
  display: inline-block;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.trade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.empty-state {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer {
  text-align: center;
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-muted);
}
