:root {
  color-scheme: light dark;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background-color: #0f172a;
  color: #f8fafc;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 60%);
}

header,
footer {
  text-align: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
}

.subtitle {
  margin: 0.25rem 0 0;
  color: #94a3b8;
  font-size: 0.95rem;
}

main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.ticker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  background: rgba(30, 41, 59, 0.85);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 20px 45px rgba(2, 6, 23, 0.45);
  max-width: 960px;
  width: 100%;
}

.ticker div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #64748b;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: inherit;
  border: 1px solid rgba(148, 163, 184, 0.25);
  min-width: 120px;
  text-transform: capitalize;
}

.status-pill[data-status='rally'] {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
}

.status-pill[data-status='selloff'] {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

.connection {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 1rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-online {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
}

.status-offline {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
}

.core-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.controls {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.controls button {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: none;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #f8fafc;
  font-weight: 600;
  cursor: pointer;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.panel {
  background: rgba(30, 41, 59, 0.75);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(100, 116, 139, 0.25);
  min-height: 200px;
}

.panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric-grid div {
  background: rgba(15, 23, 42, 0.55);
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead {
  background: rgba(15, 23, 42, 0.45);
}

.data-table th,
.data-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.data-table tbody {
  max-height: 240px;
  overflow-y: auto;
}

.data-table tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.3);
}

.gain {
  color: #22c55e;
}

.loss {
  color: #ef4444;
}

.panel-controls {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.panel-controls button {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: none;
  background: linear-gradient(135deg, #fb7185, #f97316);
  color: #f8fafc;
  font-weight: 600;
  cursor: pointer;
}

footer {
  font-size: 0.85rem;
  color: #64748b;
}
