:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2129;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --orange: #db6d28;
  --purple: #bc8cff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  display: flex;
  min-height: 100vh;
}

nav {
  width: 280px;
  min-width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

nav h2 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.5px;
}

nav a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.15s;
  margin-bottom: 2px;
}

nav a:hover { color: var(--text); background: var(--surface-2); }
nav a.active { color: var(--accent); background: rgba(88,166,255,0.1); font-weight: 600; }

nav .nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 16px 0 6px 12px;
  font-weight: 600;
}

main {
  margin-left: 280px;
  flex: 1;
  padding: 48px 64px;
  max-width: 1000px;
}

h1 { font-size: 32px; margin-bottom: 8px; color: var(--text); font-weight: 700; }
.subtitle { color: var(--text-muted); font-size: 16px; margin-bottom: 32px; }
h2 { font-size: 24px; margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); color: var(--text); }
h3 { font-size: 18px; margin: 28px 0 12px; color: var(--accent); }
h4 { font-size: 15px; margin: 20px 0 8px; color: var(--text); }
p { margin-bottom: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
ul, ol { margin: 8px 0 16px 24px; }
li { margin-bottom: 6px; }

table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 14px; }
th { background: var(--surface-2); text-align: left; padding: 10px 14px; border: 1px solid var(--border); font-weight: 600; color: var(--text); white-space: nowrap; }
td { padding: 9px 14px; border: 1px solid var(--border); vertical-align: top; }
tr:nth-child(even) { background: var(--surface); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 24px 0; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.stat-card .number { font-size: 28px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.stat-card .label { font-size: 13px; color: var(--text-muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-high { background: rgba(63,185,80,0.15); color: var(--green); }
.badge-medium { background: rgba(210,153,34,0.15); color: var(--yellow); }
.badge-low { background: rgba(248,81,73,0.15); color: var(--red); }
.badge-info { background: rgba(88,166,255,0.15); color: var(--accent); }

.callout { border-left: 3px solid var(--accent); background: var(--surface); padding: 16px 20px; margin: 20px 0; border-radius: 0 6px 6px 0; }
.callout.warning { border-left-color: var(--yellow); }
.callout.danger { border-left-color: var(--red); }
.callout.success { border-left-color: var(--green); }
.callout strong { display: block; margin-bottom: 4px; }

pre { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px; overflow-x: auto; margin: 12px 0 20px; font-size: 13px; line-height: 1.5; }
code { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; }
p code, li code, td code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }

.sources { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }
.sources h2 { border-bottom: none; font-size: 18px; margin-top: 0; }
.sources ul { font-size: 13px; }
.sources li { color: var(--text-muted); }

.page-nav { display: flex; justify-content: space-between; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.page-nav a { background: var(--surface); border: 1px solid var(--border); padding: 12px 20px; border-radius: 8px; font-size: 14px; transition: all 0.15s; }
.page-nav a:hover { background: var(--surface-2); text-decoration: none; border-color: var(--accent); }

@media (max-width: 900px) {
  nav { display: none; }
  main { margin-left: 0; padding: 24px; }
}
