:root {
  --bg: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --border: #1e293b;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #475569;
  --accent: #10b981;
  --accent-dim: #065f46;
  --danger: #ef4444;
  --danger-dim: #7f1d1d;
  --warning: #f59e0b;
  --warning-dim: #78350f;
  --info: #3b82f6;
  --info-dim: #1e3a5f;
  --radius: 6px;
  --font: "IBM Plex Sans", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
}

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

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

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

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

.sidebar {
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.sidebar-brand h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.sidebar-brand span {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--bg-card-hover); color: var(--text); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(16,185,129,0.05); }

.nav-icon { width: 18px; text-align: center; font-size: 15px; }

.nav-section {
  padding: 14px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  opacity: 0.55;
  text-transform: uppercase;
}

.main {
  margin-left: 220px;
  flex: 1;
  padding: 24px 32px;
  max-width: 1200px;
}

/* Quickstart step bar */
.qs-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.qs-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-card);
}

.qs-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
}

.qs-step.active {
  color: var(--text);
  border-color: var(--accent);
}

.qs-step.active .qs-step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #04120c;
}

.qs-step.done {
  color: var(--accent);
}

.qs-step.done .qs-step-num {
  border-color: var(--accent);
  color: var(--accent);
}

.qs-step-line {
  flex: 0 0 28px;
  height: 1px;
  background: var(--border);
}

/* Page header */
.page-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

/* Score */
.score-ring {
  width: 120px;
  height: 120px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-ring svg {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

.score-ring .value {
  font-size: 32px;
  font-weight: 800;
  z-index: 1;
}

.score-ring .label {
  position: absolute;
  bottom: 8px;
  font-size: 11px;
  color: var(--text-muted);
  z-index: 1;
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }

/* Metric */
.metric {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-fatal { background: var(--danger-dim); color: var(--danger); }
.badge-high { background: #7f1d1d; color: #fca5a5; }
.badge-medium { background: var(--warning-dim); color: var(--warning); }
.badge-low { background: var(--info-dim); color: var(--info); }
.badge-success { background: var(--accent-dim); color: var(--accent); }
.badge-pending { background: var(--warning-dim); color: var(--warning); }
.badge-done { background: var(--accent-dim); color: var(--accent); }

/* Table */
.table-wrap { overflow-x: auto; }

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

th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

tr:hover td { background: var(--bg-card-hover); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn:hover { background: var(--bg-card-hover); border-color: var(--text-muted); }

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

.btn-primary:hover { background: #059669; }

/* Input */
.input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

input[type="text"], input[type="url"], select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

input:focus, select:focus { border-color: var(--accent); }

/* Code block */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #c9d1d9;
  position: relative;
}

.code-block .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  cursor: pointer;
}

.code-block .copy-btn:hover { color: var(--text); }

/* Progress bar */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Issue list */
.issue-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.issue-item:last-child { border-bottom: none; }

.issue-severity {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.issue-content { flex: 1; }
.issue-title { font-size: 13px; font-weight: 600; }
.issue-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
