:root {
  --bg: #0e1116;
  --card: #161b22;
  --border: #2a3140;
  --text: #e6edf3;
  --muted: #8b96a5;
  --accent: #3b82f6;
  --accent-2: #8b5cf6;
  --green: #22c55e;
  --red: #ef4444;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 28px 24px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #181d28, #0e1116);
}
header h1 {
  margin: 0;
  font-size: 24px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
header .tagline { margin: 4px 0 0; color: var(--muted); }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 17px; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
input, select, textarea {
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}
textarea { resize: vertical; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.right { justify-content: flex-end; margin-top: 14px; }

button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}
button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
}
button.primary:disabled { opacity: .5; cursor: wait; }
button.ghost { background: var(--bg); border: 1px solid var(--border); color: var(--text); }
button.ghost.small { padding: 4px 9px; font-size: 12px; font-weight: 500; }
button.danger { background: var(--red); color: #fff; }
button.danger.small { padding: 6px 12px; font-size: 12px; }
button.ghost:hover { border-color: var(--accent); }

.inline-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.inline-edit label { margin: 0; flex: 1 1 180px; }
.inline-edit input, .inline-edit select { margin-top: 4px; }
.inline-edit .row { flex-basis: 100%; margin-top: 8px; }
.edit-row { background: var(--card); }
.edit-row td { border-bottom: none; padding: 8px 10px; }

.status { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.hint a { color: var(--accent); }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.score { color: var(--green); font-weight: 700; }

.tablewrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 13px; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: capitalize;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}
.pill.new { color: #93c5fd; border-color: #3b82f6; }
.pill.researching { color: #fcd34d; border-color: #f59e0b; }
.pill.built { color: #6ee7b7; border-color: #10b981; }
.pill.contacted { color: #a5b4fc; border-color: #8b5cf6; }
.pill.closed { color: #9ca3af; border-color: #6b7280; }

@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }