:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1c2129;
  --border: #30363d;
  --text: #e6edf3;
  --text2: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --purple: #bc8cff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-left { display: flex; align-items: baseline; gap: 12px; }
h1 { font-size: 20px; font-weight: 600; }
.subtitle { color: var(--text2); font-size: 14px; }
.header-right { display: flex; gap: 12px; }

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 13px;
  color: var(--text2);
}

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green); }
.dot.blue { background: var(--accent); }
.dot.gray { background: var(--text2); }

.auth-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px;
}

.auth-bar input {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  width: 280px;
}

.auth-bar button, .refresh-btn, .comment-form button {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.auth-bar button:hover, .refresh-btn:hover, .comment-form button:hover { opacity: 0.9; }

.content { padding: 16px 24px; }

.filters { display: flex; gap: 8px; margin-bottom: 16px; }

.filters select {
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}

.layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }

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

/* ── Wall cards ──────────────────────────────────────────────────────────── */

.wall { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--accent); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.card-repo {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  background: rgba(88,166,255,0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.card-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.status-planning { background: rgba(188,140,255,0.15); color: var(--purple); }
.status-in_progress { background: rgba(210,153,34,0.15); color: var(--yellow); }
.status-pr_open { background: rgba(63,185,80,0.15); color: var(--green); }
.status-merged { background: rgba(139,148,158,0.15); color: var(--text2); }
.status-abandoned { background: rgba(248,81,73,0.15); color: var(--red); }

.card-desc { font-size: 14px; line-height: 1.4; margin-bottom: 8px; }

.card-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text2);
}

.card-files { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.file-tag {
  font-size: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text2);
  font-family: monospace;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.sidebar { display: flex; flex-direction: column; gap: 12px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.panel h3 {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agents-list { display: flex; flex-direction: column; gap: 6px; }

.agent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.agent-row .dot { width: 6px; height: 6px; }

.repo-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.repo-bar-fill { height: 6px; border-radius: 3px; background: var(--accent); }

.stats-detail { font-size: 13px; line-height: 1.8; color: var(--text2); }
.stats-detail strong { color: var(--text); }

/* ── Modal ───────────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
  z-index: 100;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h2 { font-size: 16px; }

.close-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 22px;
  cursor: pointer;
}

.modal-section { margin-bottom: 16px; }

.modal-section label {
  font-size: 12px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-section p, .modal-section a { font-size: 14px; margin-top: 4px; }
.modal-section a { color: var(--accent); text-decoration: none; }
.modal-section a:hover { text-decoration: underline; }

.comment-thread {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.comment {
  padding: 10px;
  background: var(--surface2);
  border-radius: 6px;
  margin-bottom: 8px;
}

.comment-author { font-size: 12px; font-weight: 600; color: var(--accent); }
.comment-time { font-size: 11px; color: var(--text2); margin-left: 8px; }
.comment-body { font-size: 13px; margin-top: 4px; line-height: 1.4; }

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.comment-form input, .comment-form textarea {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.comment-form button { align-self: flex-end; }

.empty-state {
  text-align: center;
  color: var(--text2);
  padding: 40px 0;
  font-size: 14px;
}
