:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --text: #e6e8ee;
  --muted: #8b93a7;
  --line: #2a2f3a;
  --accent: #4f8cff;
  --green: #2fbf71;
  --amber: #e0a43a;
  --red: #e05555;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand { font-weight: 700; letter-spacing: .3px; }
.muted { color: var(--muted); font-weight: 400; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12px;
  white-space: nowrap;
}
.chip b { font-weight: 600; }
.chip.red { border-color: #5b2a2a; color: #ffb3b3; background: #2a1515; }
.chip.green { border-color: #21503a; color: #9fe8c2; background: #12251c; }

.actions { display: flex; gap: 8px; align-items: center; }
button {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 6px 12px;
  cursor: pointer;
}
button:hover { border-color: #3c4352; }
button.danger { background: #3a1717; border-color: #6b2a2a; color: #ffb3b3; }
button.ghost { background: transparent; }
button.active { background: var(--accent); border-color: var(--accent); color: #06101f; }

main { padding: 20px; max-width: 1400px; margin: 0 auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.card .n { font-size: 24px; font-weight: 700; }
.card .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }

.tabs { display: flex; gap: 8px; margin: 8px 0 14px; }
.tab { display: none; }
.tab.active { display: block; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
tr:last-child td { border-bottom: none; }
td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }
.score { font-variant-numeric: tabular-nums; font-weight: 600; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.status.new { color: #bcd2ff; border-color: #2d4a7a; }
.status.project_created { color: #ffe0a3; border-color: #6b5322; }
.status.applied { color: #9fe8c2; border-color: #21503a; }
.status.rejected { color: #ffb3b3; border-color: #5b2a2a; }
.status.skipped { color: var(--muted); }

.events { list-style: none; padding: 0; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.events li { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.events li:last-child { border-bottom: none; }
.events time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.events .kind { font-weight: 600; }
.events .meta { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.limits .card .row { display: flex; justify-content: space-between; padding: 3px 0; }
.limits .card .row span:last-child { font-variant-numeric: tabular-nums; }

footer { margin-top: 16px; font-size: 12px; }

.login-body { display: grid; place-items: center; min-height: 100vh; }
.login { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; width: min(360px, 92vw); }
.login h1 { margin: 0 0 4px; font-size: 20px; }
.login label { display: block; margin: 18px 0 12px; color: var(--muted); font-size: 13px; }
.login input { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; }
.login button { width: 100%; padding: 9px; background: var(--accent); border-color: var(--accent); color: #06101f; font-weight: 600; }
.error { color: #ffb3b3; font-size: 13px; }
