:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --border: #2a2f3a;
  --text: #e6e9ef;
  --muted: #8b93a7;
  --accent: #4f8cff;
  --good: #3ecf8e;
  --warn: #f5b544;
  --bad: #f56565;
}

* { box-sizing: border-box; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.brand { font-weight: 700; letter-spacing: .02em; }
.userbox { color: var(--muted); font-size: 14px; }
.userbox a { color: var(--accent); cursor: pointer; }

main { max-width: 1080px; margin: 0 auto; padding: 24px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.login-card { max-width: 380px; margin: 8vh auto 0; }
.login-card h1 { margin: 0 0 16px; font-size: 22px; }

form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
input:focus { outline: none; border-color: var(--accent); }

button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }

.error { color: var(--bad); font-size: 13px; margin: 4px 0 0; }
.hidden { display: none !important; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 16px;
}
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 16px; }
.panel h2:not(:first-child) { margin-top: 22px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.stat .num { font-size: 24px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }

.pipeline { display: flex; flex-direction: column; gap: 8px; }
.stage { display: flex; align-items: center; gap: 12px; }
.stage .bar {
  height: 22px;
  background: var(--accent);
  border-radius: 5px;
  min-width: 4px;
  transition: width .3s ease;
}
.stage .name { width: 150px; color: var(--muted); font-size: 13px; }
.stage .val { font-size: 13px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.row .t { font-weight: 600; }
.row .m { color: var(--muted); font-size: 13px; }

.narrative { color: var(--muted); font-size: 14px; }
.recs { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.recs .action { font-weight: 700; color: var(--accent); }
.recs .reason { color: var(--muted); font-size: 13px; }
.prio { float: right; font-size: 12px; color: var(--warn); }