/* ─── reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #0f1115;
  color: #e8eaed;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

/* ─── toolbar ────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #262a33;
}
.toolbar-title { font-weight: 700; font-size: 15px; color: #e8eaed; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; }
.last-updated { font-size: 12px; color: #8a8f98; }

/* ─── generic button/badge ───────────────────────────────── */
.btn {
  background: #1e2127;
  border: 1px solid #2a2e37;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: #c8ccd4;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.6;
}
.btn:hover { border-color: #4a4e58; color: #e8eaed; }
.btn-agent { padding: 6px 12px; }

/* ─── login overlay ──────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.login-box {
  background: #1a1d23;
  border: 1px solid #2a2e37;
  border-radius: 12px;
  padding: 28px 32px;
  width: 320px;
}
.login-box h2 { font-size: 16px; color: #eceff4; margin-bottom: 16px; }
.login-box input {
  width: 100%;
  background: #13161b;
  border: 1px solid #2a2e37;
  border-radius: 6px;
  padding: 8px 12px;
  color: #e8eaed;
  font-size: 14px;
  outline: none;
  margin-bottom: 10px;
}
.login-box input:focus { border-color: #7aa2f7; }
.login-box button {
  width: 100%;
  background: #2a3a6a;
  border: 1px solid #3a4a8a;
  border-radius: 6px;
  color: #a8c0ff;
  padding: 8px;
  font-size: 14px;
  cursor: pointer;
}
.login-box button:hover { background: #3a4a8a; }
.login-error { color: #f38ba8; font-size: 12px; margin-top: 8px; display: none; }

/* ─── overview grid ──────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px;
}
.grid-footer {
  text-align: center;
  color: #565b66;
  font-size: 12px;
  padding-bottom: 14px;
}

/* ─── agent tile ─────────────────────────────────────────── */
.tile {
  background: #171a20;
  border: 1px solid #262a33;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.tile:hover { border-color: #4a4e58; }
.tile.dev { opacity: .8; }

.tile-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #2a2e37;
  background: #23272f;
  flex-shrink: 0;
}
.tile-info { flex: 1; min-width: 0; }
.tile-name { font-weight: 700; color: #eceff4; font-size: 14px; }
.tile-role { font-size: 11px; color: #8a8f98; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tile-now { font-size: 12px; color: #c8ccd4; margin-bottom: 6px; }
.tile-goal { font-size: 12px; color: #8a8f98; margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── progress bar ───────────────────────────────────────── */
.tile-progress { display: flex; gap: 6px; align-items: center; }
.bar-track { flex: 1; height: 6px; background: #23272f; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }
.tile-count { font-size: 11px; color: #8a8f98; white-space: nowrap; }

/* ─── status dots ────────────────────────────────────────── */
.status-on   { font-size: 11px; color: #7ee787; white-space: nowrap; }
.status-busy { font-size: 11px; color: #f0c674; white-space: nowrap; }
.status-off  { font-size: 11px; color: #565b66; white-space: nowrap; }

/* ─── dev badge ──────────────────────────────────────────── */
.dev-badge {
  font-size: 9px;
  color: #f0c674;
  border: 1px solid #5a4a2a;
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ─── agent page layout ──────────────────────────────────── */
.page { max-width: 940px; margin: 0 auto; padding: 18px; }

.agent-header {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #262a33;
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.agent-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #2a2e37;
  background: #23272f;
  flex-shrink: 0;
}
.agent-info { flex: 1; }
.agent-name { font-weight: 700; color: #eceff4; font-size: 18px; line-height: 1.3; }
.agent-role { font-size: 13px; color: #8a8f98; margin-top: 2px; }
.agent-machine { font-size: 12px; color: #565b66; margin-top: 2px; }

/* ─── section ────────────────────────────────────────────── */
.section { margin-bottom: 16px; }
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #7a808a;
  margin-bottom: 6px;
}

/* ─── panel (info box) ───────────────────────────────────── */
.panel {
  background: #13161b;
  border: 1px solid #20242c;
  border-radius: 8px;
  padding: 10px 12px;
}
.panel-text { font-size: 12px; color: #c8ccd4; line-height: 1.6; }

/* ─── tasks 3-column ─────────────────────────────────────── */
.tasks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.task-col {
  background: #13161b;
  border: 1px solid #20242c;
  border-radius: 8px;
  padding: 10px;
}
.task-col-header-ip   { font-size: 12px; color: #f0c674; margin-bottom: 8px; }
.task-col-header-bl   { font-size: 12px; color: #8a8f98; margin-bottom: 8px; }
.task-col-header-done { font-size: 12px; color: #7ee787; margin-bottom: 8px; }
.task-item      { font-size: 12px; color: #c8ccd4;  margin-bottom: 6px; }
.task-item-bl   { font-size: 12px; color: #9aa0aa;  margin-bottom: 6px; }
.task-item-done { font-size: 12px; color: #6b7280; margin-bottom: 6px; text-decoration: line-through; }
.task-more      { font-size: 12px; color: #565b66; }
.task-empty     { font-size: 12px; color: #565b66; font-style: italic; }

/* ─── two-column layout ──────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── MCP list ───────────────────────────────────────────── */
.mcp-row { font-size: 12px; line-height: 1.9; }
.mcp-dot-on  { color: #7ee787; }
.mcp-dot-off { color: #565b66; }
.mcp-lbl-on  { color: #c8ccd4; }
.mcp-lbl-off { color: #565b66; }

/* ─── history / links ────────────────────────────────────── */
.history-item { font-size: 12px; color: #9aa0aa; line-height: 1.8; }
.link-item {
  font-size: 12px;
  color: #7aa2f7;
  line-height: 1.9;
  display: block;
  text-decoration: none;
}
.link-item:hover { text-decoration: underline; }

/* ─── back link ──────────────────────────────────────────── */
.back-link {
  font-size: 12px;
  color: #7aa2f7;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 14px;
}
.back-link:hover { text-decoration: underline; }

/* ─── goal html block ────────────────────────────────────── */
.goal-html {
  font-size: 13px;
  color: #c8ccd4;
  line-height: 1.55;
}
.goal-html h1, .goal-html h2, .goal-html h3 { color: #eceff4; margin: 8px 0 4px; }
.goal-html p  { margin-bottom: 6px; }
.goal-html ul, .goal-html ol { padding-left: 18px; margin-bottom: 6px; }
.goal-html a  { color: #7aa2f7; }

/* ─── add-task button inline ─────────────────────────────── */
.btn-add-task {
  background: none;
  border: none;
  color: #7aa2f7;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  text-decoration: underline dotted;
}
.btn-add-task:hover { color: #a8c0ff; }

/* ─── empty / error states ───────────────────────────────── */
.empty-state { color: #565b66; font-style: italic; font-size: 12px; }
.err-page { padding: 40px; color: #f38ba8; }
