:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --text-dim: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --orange: #db6d28;
}
* { 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);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Auth screen ─────────────────────────── */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  flex-direction: column;
  gap: 12px;
}
#auth-screen h1 { font-size: 18px; font-weight: 600; }
#auth-screen input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  width: 320px;
  font-size: 14px;
}
#auth-screen button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
#auth-error {
  color: var(--red);
  font-size: 13px;
  display: none;
}

/* ── Main layout ─────────────────────────── */
#app { display: none; }
header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 { font-size: 16px; font-weight: 600; }
#status-bar {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-dim);
}
#status-bar .val { color: var(--text); }

.content { padding: 20px; }

/* ── Bot cards ───────────────────────────── */
.bot-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.bot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  flex: 1;
  min-width: 200px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.bot-card .bot-avatar {
  width: 120px;
  height: 120px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.bot-card .bot-info { flex: 1; }
.bot-card .bot-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 8px;
  text-transform: capitalize;
}
.bot-card .bot-detail {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.bot-card .bot-detail .val { color: var(--text); }
.status-idle { color: var(--text-dim); }
.status-working { color: var(--green); }
.status-reviewing { color: var(--yellow); }

/* ── Kanban board ────────────────────────── */
.board-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin-bottom: 24px;
  padding-bottom: 8px;
}
.kanban-col {
  min-width: 200px;
  flex: 1;
}
.kanban-col-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.kanban-col-header .count {
  background: var(--border);
  border-radius: 10px;
  padding: 0 7px;
  font-size: 11px;
}
.issue-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 6px;
  font-size: 13px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.issue-card:hover {
  border-color: var(--accent);
}
.issue-card .issue-id {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 11px;
}
.issue-card .issue-title {
  margin-top: 2px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
}
.issue-card .issue-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}

/* ── Activity feed ───────────────────────── */
.feed-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.feed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.feed-item {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  gap: 12px;
}
.feed-item:last-child { border-bottom: none; }
.feed-time {
  color: var(--text-dim);
  white-space: nowrap;
  font-size: 12px;
  min-width: 140px;
}
.feed-event { color: var(--text); }
.feed-bot {
  font-weight: 600;
  text-transform: capitalize;
}

/* ── Issue detail ─────────────────────────── */
.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.detail-back {
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
}
.detail-back:hover { text-decoration: underline; }
.detail-linear {
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
}
.detail-linear:hover { text-decoration: underline; }
.detail-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}
.detail-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.detail-meta strong { color: var(--text); }
.detail-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  margin-top: 24px;
}
.detail-loading {
  color: var(--text-dim);
  font-size: 14px;
}
.worklog-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.worklog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.worklog-bot-tag {
  font-weight: 600;
  font-size: 12px;
  text-transform: capitalize;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text);
}
.worklog-time {
  font-size: 12px;
  color: var(--text-dim);
}
.worklog-section {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.worklog-section:last-child { border-bottom: none; }
.worklog-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.worklog-section-label.prompt { color: var(--yellow); }
.worklog-section-label.response { color: var(--green); }
.worklog-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.worklog-body p { margin-bottom: 8px; }
.worklog-body p:last-child { margin-bottom: 0; }
.worklog-body h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 12px 0 4px;
}
.worklog-body code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

.detail-events {
  max-height: 180px;
}

/* ── Misc ────────────────────────────────── */
.error-banner {
  background: #2d1214;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 8px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}
