:root {
  --bg: #0b0d14;
  --surface: #141721;
  --surface2: #1a1e2e;
  --border: #252a3a;
  --text: #e1e4ed;
  --text-dim: #6b7194;
  --accent: #6c5ce7;
  --green: #00d68f;
  --green-dim: rgba(0,214,143,0.12);
  --red: #ff6b6b;
  --yellow: #ffd93d;
  --blue: #4dabf7;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

/* Header */
header { margin-bottom: 1.5rem; }

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle { color: var(--text-dim); font-size: 0.9rem; }

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  background: var(--surface);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.dot.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

.dot.offline { background: var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.stat-card.highlight {
  border-color: var(--green);
  background: linear-gradient(135deg, var(--surface), rgba(0,214,143,0.04));
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-value.small { font-size: 0.9rem; }

.stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Section header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

h2 {
  font-size: 1rem;
  color: var(--text-dim);
  font-weight: 600;
}

.filters {
  display: flex;
  gap: 0.5rem;
}

.filters select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
}

.filters select:focus { border-color: var(--accent); }

/* Table */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead th {
  background: var(--surface2);
  padding: 0.65rem 0.8rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr {
  border-top: 1px solid var(--border);
  transition: background 0.12s;
}

tbody tr:hover { background: rgba(108, 92, 231, 0.06); }

td {
  padding: 0.55rem 0.8rem;
  white-space: nowrap;
}

.mono {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.82rem;
}

.exchange { font-weight: 600; }
.exchange.buy { color: var(--green); }
.exchange.sell { color: var(--red); }

.spread.high {
  color: var(--green);
  font-weight: 700;
  background: var(--green-dim);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.spread.medium { color: var(--yellow); font-weight: 600; }
.spread.low { color: var(--text-dim); }

.profit { color: var(--green); font-weight: 600; }

.step {
  font-size: 0.75rem;
  color: var(--text-dim);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty */
.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 3rem;
  text-align: center;
  color: var(--text-dim);
}

.empty code {
  display: inline-block;
  margin-top: 0.8rem;
  background: var(--bg);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-family: 'Consolas', monospace;
  color: var(--green);
  font-size: 0.9rem;
}

/* Footer */
footer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 1.3rem; }
  h1 { font-size: 1.2rem; }
}
