:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --crit: #f85149;
  --high: #d29922;
  --med: #58a6ff;
  --low: #3fb950;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

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

/* Nav */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; color: var(--text); }
.nav-brand span { color: var(--accent); }

.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a {
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--surface2); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.badge-role {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-role.admin  { border-color: #d29922; color: #d29922; }
.badge-role.client { border-color: #58a6ff; color: #58a6ff; }
.badge-role.hunter { border-color: #3fb950; color: #3fb950; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

/* Flash messages */
.flash-list { list-style: none; margin-bottom: 20px; }
.flash-list li {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
}
.flash-success { background: #1a3a1f; border: 1px solid var(--success); color: var(--success); }
.flash-danger  { background: #3b1212; border: 1px solid var(--danger);  color: var(--danger); }
.flash-warning { background: #3b2a00; border: 1px solid var(--warning); color: var(--warning); }
.flash-info    { background: #0f2744; border: 1px solid var(--accent);  color: var(--accent); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-size: 18px; font-weight: 600; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-number { font-size: 32px; font-weight: 700; color: var(--accent); }
.stat-label  { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: opacity .15s;
  text-decoration: none;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn-primary  { background: var(--accent);   color: #0d1117; }
.btn-success  { background: var(--success);  color: #0d1117; }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-outline  {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--surface2); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Severity badges */
.sev {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.sev-critical { background: #3b1212; color: var(--crit); border: 1px solid var(--crit); }
.sev-high     { background: #3b2a00; color: var(--high); border: 1px solid var(--high); }
.sev-medium   { background: #0f2744; color: var(--med);  border: 1px solid var(--med); }
.sev-low      { background: #1a3a1f; color: var(--low);  border: 1px solid var(--low); }

/* Status badges */
.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.status-new       { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.status-submitted { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.status-reviewing { background: #0f2744; color: var(--accent); border: 1px solid var(--accent); }
.status-triaging  { background: #0f2744; color: var(--accent); border: 1px solid var(--accent); }
.status-accepted  { background: #1a3a1f; color: var(--success); border: 1px solid var(--success); }
.status-rejected  { background: #3b1212; color: var(--danger); border: 1px solid var(--danger); }
.status-resolved  { background: #1d2d1d; color: #3fb950; border: 1px solid #3fb950; }
.status-active    { background: #1a3a1f; color: var(--success); border: 1px solid var(--success); }
.status-closed    { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.status-pending   { background: #3b2a00; color: var(--warning); border: 1px solid var(--warning); }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { min-height: 100px; resize: vertical; font-family: inherit; }
select.form-control { cursor: pointer; }

/* Auth pages */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo h1 { font-size: 24px; }
.auth-logo span { color: var(--accent); }
.auth-logo p { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* Program detail */
.scope-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  white-space: pre-wrap;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.reward-table { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.reward-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  text-align: center;
  min-width: 90px;
}
.reward-item .amount { font-size: 20px; font-weight: 700; color: var(--accent); }
.reward-item .label  { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

/* Locked details */
.locked-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}
.locked-icon { font-size: 40px; margin-bottom: 12px; }
.locked-box p { color: var(--text-muted); margin-bottom: 20px; }

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state p { margin-bottom: 16px; }

/* Section title */
.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

/* Divider */
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Findings toolbar */
.findings-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.findings-toolbar-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.findings-search {
  flex: 1;
  min-width: 160px;
  max-width: 280px;
}
.findings-select {
  width: auto;
  min-width: 130px;
}
.findings-export { white-space: nowrap; }
.findings-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Sort links in table headers */
.sort-link {
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.sort-link:hover { color: var(--text); text-decoration: none; }
.sort-link.sort-active { color: var(--accent); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 0 4px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  background: var(--surface2);
  transition: background .15s;
}
.page-btn:hover { background: var(--border); text-decoration: none; color: var(--text); }
.page-current { background: var(--accent); color: #0d1117; border-color: var(--accent); font-weight: 700; }
.page-current:hover { background: var(--accent); }
.page-disabled { color: var(--text-muted); cursor: default; pointer-events: none; }
