:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #22252f;
  --border: #2a2d3a;
  --text: #e1e4ed;
  --text-muted: #8b8fa3;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --yellow: #eab308;
  --purple: #a855f7;
  --font: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

/* Nav */
.top-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.nav-brand a {
  color: var(--blue);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.nav-links { display: flex; gap: 0.25rem; align-items: center; flex: 1; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  transition: all 0.15s;
}
.nav-links a:hover { background: var(--surface-hover); color: var(--text); }
.nav-links a.active { background: var(--border); color: var(--text); }

/* Container */
.container { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }

/* Flash */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 13px;
}
.flash.notice { background: #1a2e1a; border: 1px solid var(--green); color: var(--green); }
.flash.alert { background: #2e1a1a; border: 1px solid var(--red); color: var(--red); }

/* Page headers */
h1 { font-size: 18px; font-weight: 600; margin-bottom: 1rem; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 0.75rem; color: var(--text-muted); }

/* Grid */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.card-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

/* Stat cards */
.stat { text-align: center; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); margin-top: 0.25rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
tr:hover { background: var(--surface-hover); }

/* Colors */
.green { color: var(--green); }
.red { color: var(--red); }
.blue { color: var(--blue); }
.yellow { color: var(--yellow); }
.purple { color: var(--purple); }
.muted { color: var(--text-muted); }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-buy { background: #1a2e1a; color: var(--green); }
.badge-sell { background: #2e1a1a; color: var(--red); }
.badge-pending { background: #2e2a1a; color: var(--yellow); }
.badge-filled { background: #1a2e1a; color: var(--green); }
.badge-vetoed { background: #2e1a1a; color: var(--red); }
.badge-low_confidence { background: #2e2a1a; color: var(--yellow); }
.badge-approved { background: #1a2e1a; color: var(--green); }
.badge-regime {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.badge-trending_bull { background: #1a2e1a; color: var(--green); }
.badge-trending_bear { background: #2e1a1a; color: var(--red); }
.badge-range_bound { background: #1a1a2e; color: var(--blue); }
.badge-high_volatility { background: #2e2a1a; color: var(--yellow); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: var(--font);
}
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-primary { background: var(--blue); color: white; }

/* Empty state */
.empty { text-align: center; padding: 2rem; color: var(--text-muted); }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-toggle {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.dropdown-toggle:hover { background: var(--surface-hover); color: var(--text); }
.dropdown-toggle::after { content: " \25BE"; font-size: 10px; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 160px;
  padding: 0.25rem 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.dropdown-right { left: auto; right: 0; }
.dropdown-menu a, .dropdown-menu button {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  font-size: 12px;
  white-space: nowrap;
}
.dropdown-menu a:hover { background: var(--surface-hover); color: var(--text); }
.dropdown:hover .dropdown-menu { display: block; }
.account-toggle { color: var(--blue) !important; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .top-nav { flex-direction: column; gap: 0.5rem; padding: 0.5rem; }
  .nav-brand { text-align: center; }
  .nav-links { flex-wrap: wrap; justify-content: center; gap: 0.15rem; }
  .nav-links a { padding: 0.3rem 0.5rem; font-size: 11px; }
  .container { padding: 0.75rem; }
  h1 { font-size: 16px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 10px; }
  table { font-size: 11px; }
  th, td { padding: 0.35rem 0.4rem; }
  .card { padding: 0.75rem; }
  .btn { padding: 0.4rem 0.75rem; font-size: 11px; }
  .badge { font-size: 10px; padding: 0.1rem 0.35rem; }

  /* Make tables scroll horizontally on mobile */
  .card { overflow-x: auto; }
  table { min-width: 600px; }
}
