/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --border:    #2a2d3a;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --green:     #22c55e;
  --red:       #ef4444;
  --yellow:    #eab308;
  --blue:      #3b82f6;
  --accent:    #6366f1;
  --radius:    8px;
  --font:      'Inter', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ───────────────────────────────────────────────────────── */
.app { display: flex; flex-direction: column; min-height: 100vh; }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

nav { display: flex; gap: 4px; }

nav a {
  padding: 6px 14px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 500;
  transition: all 0.15s;
}

nav a:hover { color: var(--text); background: var(--border); }
nav a.active { color: var(--text); background: var(--accent); }

.header-right { margin-left: auto; color: var(--muted); font-size: 12px; }

main { padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Grid helpers ─────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack  { display: flex; flex-direction: column; gap: 16px; }

/* ── Stat blocks ──────────────────────────────────────────────────── */
.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Regime badge ─────────────────────────────────────────────────── */
.regime {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.regime.TRENDING    { background: rgba(34,197,94,0.15);  color: var(--green);  }
.regime.CHOPPY      { background: rgba(234,179,8,0.15);  color: var(--yellow); }
.regime.BEARISH     { background: rgba(239,68,68,0.15);  color: var(--red);    }
.regime.INSUFFICIENT{ background: rgba(100,116,139,0.15);color: var(--muted);  }
.regime.UNKNOWN     { background: rgba(100,116,139,0.15);color: var(--muted);  }

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

/* ── Tables ───────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Colour helpers ───────────────────────────────────────────────── */
.green  { color: var(--green);  }
.red    { color: var(--red);    }
.yellow { color: var(--yellow); }
.muted  { color: var(--muted);  }
.bold   { font-weight: 600; }

/* ── Regime calendar ──────────────────────────────────────────────── */
.calendar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cal-day {
  width: 28px; height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  cursor: default;
  position: relative;
}
.cal-day[title] { cursor: help; }
.cal-day.TRENDING    { background: rgba(34,197,94,0.25);  color: var(--green);  }
.cal-day.CHOPPY      { background: rgba(234,179,8,0.25);  color: var(--yellow); }
.cal-day.BEARISH     { background: rgba(239,68,68,0.25);  color: var(--red);    }
.cal-day.INSUFFICIENT{ background: rgba(100,116,139,0.1); color: var(--muted);  }
.cal-day.empty       { background: transparent; }

/* ── Progress bar ─────────────────────────────────────────────────── */
.bar-wrap { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.bar-label { width: 100px; font-size: 12px; color: var(--muted); }
.bar-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 3px; transition: width 0.3s; }
.bar-pct   { width: 40px; text-align: right; font-size: 12px; }

/* ── Pill badges ──────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.pill.pass   { background: rgba(34,197,94,0.15);  color: var(--green);  }
.pill.fail   { background: rgba(239,68,68,0.1);   color: var(--muted);  }
.pill.open   { background: rgba(59,130,246,0.15); color: var(--blue);   }
.pill.closed { background: rgba(100,116,139,0.1); color: var(--muted);  }

/* ── Empty state ──────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 13px;
}

/* ── Chart container ──────────────────────────────────────────────── */
.chart-wrap { position: relative; height: 220px; }

/* ── Page header ──────────────────────────────────────────────────── */
.page-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  header { gap: 16px; }
  nav a  { padding: 6px 10px; font-size: 13px; }
}
