:root {
  --bg: #0b0d10;
  --bg-1: #14171c;
  --bg-2: #1a1e24;
  --bg-3: #22272e;
  --border: #2a303a;
  --border-soft: #1f242c;
  --border-strong: #3a4150;
  --text: #f3f5f8;
  --text-dim: #b8bec8;
  --text-muted: #828996;
  --accent: #5ca8ff;
  --accent-soft: rgba(92, 168, 255, 0.14);
  --success: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --keegan: #a78bfa;
  --adam:   #4ade80;
  --cathy:  #fbbf24;
  --sean:   #5ca8ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}

/* ------------------------- Header ------------------------- */
.hdr {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(11, 13, 16, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.hdr-left, .hdr-right { display: flex; align-items: center; gap: 14px; }
.logo {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--accent);
  font-size: 16px;
}
.hdr-sub { color: var(--text-dim); font-size: 14px; }
.muted { color: var(--text-muted); font-size: 13px; }
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 0 var(--text-muted);
  transition: background 200ms, box-shadow 200ms;
}
.status-dot.live  { background: var(--success); box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18); }
.status-dot.error { background: var(--danger);  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18); }

/* ------------------------- Main ------------------------- */
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 44px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-actions { display: flex; align-items: center; gap: 12px; }

/* ---- Bulk edit list ---- */
.bulk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  margin: 8px 0 16px;
  padding-right: 4px;
}
.bulk-row {
  display: grid;
  grid-template-columns: 160px 1fr 48px;
  align-items: center;
  gap: 14px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--border-soft);
}
.bulk-row:last-child { border-bottom: none; }
.bulk-row .bulk-repo {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bulk-row input[type=range] {
  width: 100%;
  accent-color: var(--accent);
}
.bulk-row .bulk-pct {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--text-dim);
  text-align: right;
}
.dialog.dialog-wide { min-width: 560px; }
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  margin: 0 0 16px;
}

/* ------------------------- Team row ------------------------- */
.team-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .team-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .team-row { grid-template-columns: 1fr; } }

.team-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 18px;
  transition: border-color 150ms;
}
.team-card.online {
  border-color: var(--border);
  box-shadow: inset 3px 0 0 var(--success);
}
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #0a0b0d;
  flex-shrink: 0;
}
.avatar.keegan { background: var(--keegan); }
.avatar.adam   { background: var(--adam); }
.avatar.cathy  { background: var(--cathy); }
.avatar.sean   { background: var(--sean); }

.team-card .name { font-weight: 600; font-size: 15px; color: var(--text); }
.team-card .sub {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 2px;
}
.team-card .repo-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
}
.team-card .dot-active {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); display: inline-block;
  margin-right: 7px;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}
.team-card.idle .avatar { filter: grayscale(0.7) brightness(0.6); }
.team-card.idle .name   { color: var(--text-dim); }
.team-card.idle .sub    { color: var(--text-muted); }

/* ------------------------- Project grid ------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 150ms, transform 150ms;
}
.project-card:hover { border-color: var(--border); }
.project-card.active {
  border-color: rgba(92, 168, 255, 0.45);
  background: linear-gradient(180deg, rgba(92,168,255,0.04) 0%, var(--bg-1) 40%);
  box-shadow: 0 0 0 1px rgba(92, 168, 255, 0.2);
}

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.project-name {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.2px;
}
.project-actions { display: flex; align-items: center; gap: 6px; }

.progress-row {
  display: flex; align-items: center; gap: 12px;
}
.progress-track {
  flex: 1;
  height: 8px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #86c2ff);
  transition: width 300ms;
  border-radius: 4px;
}
.progress-label {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 42px;
  text-align: right;
}

.field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  padding: 2px 0;
}
.field .ico {
  width: 18px;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 13px;
  padding-top: 1px;
}
.field .val { color: var(--text); }
.field .val b { color: var(--text); font-weight: 600; }
.field.waiting .val { color: var(--warn); }
.field.waiting .ico { color: var(--warn); }
.field.active  .val { color: var(--success); }
.field.active  .ico { color: var(--success); }
.field.empty .val { color: var(--text-muted); font-style: normal; }
.field.empty .ico { opacity: 0.5; }

.pr-list {
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
  margin-top: 4px;
}
.pr-item {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px;
  align-items: center;
  padding: 4px 0;
}
.pr-item a {
  color: var(--text-dim);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.pr-item a:hover { color: var(--text); }
.pr-item .pr-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}
.pr-item .pr-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pr-item .pr-reviewers {
  color: var(--warn);
  font-size: 12px;
  flex-shrink: 0;
  background: rgba(251, 191, 36, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* ------------------------- Activity ------------------------- */
.activity-stream {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}
.activity-row {
  display: grid;
  grid-template-columns: 90px 120px 180px 1fr 90px;
  gap: 14px;
  padding: 14px 20px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
  transition: background 120ms;
}
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: var(--bg-2); }
.activity-row .ts {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}
.activity-row .type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: lowercase;
  background: var(--bg-3);
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.3px;
}
.activity-row .type.push         { background: rgba(92,168,255,0.18); color: #9cc5ff; }
.activity-row .type.pr_opened    { background: rgba(74,222,128,0.18); color: #86e8a5; }
.activity-row .type.pr_merged    { background: rgba(167,139,250,0.18); color: #c2b0fc; }
.activity-row .type.pr_closed    { background: rgba(248,113,113,0.14); color: #f9a1a1; }
.activity-row .type.review_requested,
.activity-row .type.review_submitted { background: rgba(251,191,36,0.18); color: #fdd57f; }
.activity-row .type.issue_comment,
.activity-row .type.pr_review_comment { background: rgba(148,163,184,0.18); color: #cbd5e1; }
.activity-row .type.issue_opened { background: rgba(74,222,128,0.14); color: #86e8a5; }
.activity-row .type.issue_closed { background: rgba(167,139,250,0.14); color: #c2b0fc; }
.activity-row .repo {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-dim);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-row .who {
  color: var(--text);
  font-weight: 600;
}
.activity-row .summary {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-row .summary b {
  color: var(--text);
  font-weight: 600;
  margin-right: 4px;
}
.activity-row a.link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  text-align: right;
  transition: color 120ms;
}
.activity-row a.link:hover { color: var(--accent); }
@media (max-width: 820px) {
  .activity-row { grid-template-columns: 70px 100px 1fr; padding: 12px 16px; }
  .activity-row .repo, .activity-row .link { display: none; }
}

/* ------------------------- Buttons ------------------------- */
.btn, .btn-ghost {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.btn:hover { background: var(--bg-3); border-color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-2); }

/* ------------------------- Empty states ------------------------- */
.empty-state {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-1);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* ------------------------- Dialog ------------------------- */
.dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-1);
  color: var(--text);
  padding: 24px;
  min-width: 420px;
}
.dialog::backdrop { background: rgba(0,0,0,0.6); }
.dialog h3 { margin: 0 0 18px; font-size: 15px; font-weight: 600; }
.dialog label {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 500;
}
.dialog input[type=text], .dialog input[type=password] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
}
.dialog input[type=range] { accent-color: var(--accent); }
.dialog-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 6px;
}
