/* ==========================================================================
   The Edge Line — shared design system
   Palette:
     bg:          #0b0f17  (near-black)
     surface:     #111827  (cards, nav, tables)
     surface-2:   #1a2332  (hover, subtle raised)
     border:      #1f2937
     text:        #e5e7eb
     text-muted:  #9ca3af
     accent:      #10b981  (emerald — buttons, active, highlights)
     logo-gold:   #ffd700  (reserved for the wordmark)
     danger:      #ef4444
   ========================================================================== */

:root {
  --bg: #0b0f17;
  --surface: #111827;
  --surface-2: #1a2332;
  --border: #1f2937;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #10b981;
  --gold: #ffd700;
  --danger: #ef4444;
  --success: #10b981;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); }
a:hover { color: var(--text); }

/* ==== Navigation ==== */
nav.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
nav.site .logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.3px;
  text-decoration: none;
}
nav.site .logo .edge { color: var(--gold); }
nav.site .nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}
nav.site .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 6px 4px;
}
nav.site .nav-links a:hover { color: var(--text); }
nav.site .nav-links a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
}

/* ==== Layout ==== */
main.page {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px 60px;
}
main.narrow { max-width: 900px; }

h1 { font-size: 32px; margin: 0 0 8px; }
h2 { font-size: 22px; color: var(--accent); margin: 0 0 16px; }
h3 { font-size: 18px; margin: 0 0 10px; }
.subtitle { color: var(--text-muted); margin: 0 0 24px; }

/* ==== Cards / sections ==== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.section { margin-bottom: 24px; }

/* ==== Tables ==== */
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
table.data th, table.data td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
table.data th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
  white-space: nowrap;
}
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--accent); }
table.data th.sorted { color: var(--accent); }
table.data td.num, table.data th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }

/* ==== Badges / pills ==== */
.badge {
  display: inline-block;
  padding: 3px 9px;
  background: var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #d1d5db;
}
.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg);
}

/* ==== Buttons & controls ==== */
.btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { filter: brightness(1.1); }
.btn.ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn.ghost:hover { color: var(--text); border-color: var(--text-muted); }

select, input[type="text"], input[type="number"], input[type="search"] {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
select:focus, input:focus { outline: none; border-color: var(--accent); }

label.inline { color: var(--text-muted); font-size: 14px; }

.toggle {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}
.toggle button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.toggle button.active {
  background: var(--accent);
  color: var(--bg);
}
.toggle button:not(.active):hover { color: var(--text); }

/* ==== Utility ==== */
.loading { padding: 40px; text-align: center; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.pos { color: var(--accent); }
.neg { color: var(--danger); }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ==== Footer ==== */
footer.site {
  padding: 30px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
footer.site a { color: var(--text-muted); text-decoration: none; margin: 0 10px; }
footer.site a:hover { color: var(--accent); }

@media (max-width: 700px) {
  nav.site { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  nav.site .nav-links { gap: 14px; font-size: 13px; }
  main.page { padding: 0 16px 40px; }
  h1 { font-size: 26px; }
}
