:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-alt: #0f151d;
  --card: rgba(19, 25, 34, 0.92);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f3f5f7;
  --muted: #99a4b3;
  --accent: #f4b844;
  --accent-2: #6bd1ff;
  --good: #34d399;
  --warn: #f97316;
  --bad: #f87171;
  --shadow: 0 30px 80px rgba(4, 8, 13, 0.65);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 10%, rgba(244, 184, 68, 0.18), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(107, 209, 255, 0.2), transparent 50%),
    linear-gradient(180deg, #06080b 0%, #0b0f14 45%, #0d1218 100%);
}

.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.05), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.06), transparent 50%);
  mix-blend-mode: screen;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.brand {
  display: flex;
  gap: 20px;
  align-items: center;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(244, 184, 68, 0.35), rgba(107, 209, 255, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 28px;
}

.brand-copy h1 {
  margin: 4px 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 40px;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.sub {
  margin: 0;
  color: var(--muted);
  max-width: 420px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn {
  background: var(--accent);
  color: #111827;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(244, 184, 68, 0.35);
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.card-head h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
  font-size: 12px;
  font-weight: 600;
}

.pill.connected {
  background: rgba(52, 211, 153, 0.2);
  color: #a7f3d0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.value {
  font-size: 18px;
  font-weight: 600;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.metric {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pnl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.pnl-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.bar {
  height: 100%;
  transition: width 0.4s ease;
}

.bar.realized {
  background: linear-gradient(90deg, #34d399, #16a34a);
}

.bar.unrealized {
  background: linear-gradient(90deg, #60a5fa, #38bdf8);
}

.pnl-foot {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.error {
  margin-top: 16px;
  font-size: 13px;
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  display: none;
}

.error.show {
  display: block;
}

.table {
  overflow-x: auto;
}

.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.positions-meta {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  padding: 12px 0;
  color: var(--muted);
}

@media (max-width: 720px) {
  .shell {
    padding: 36px 20px 64px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-copy h1 {
    font-size: 32px;
  }
}
