/* ── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #090c10;
  --sidebar: #0d1117;
  --card: #161b22;
  --card2: #1c2128;
  --border: #21262d;
  --border2: #30363d;
  --text: #e6edf3;
  --muted: #7d8590;
  --muted2: #484f58;
  --green: #3fb950;
  --green-dim: #1a7f37;
  --red: #f85149;
  --red-dim: #4a1212;
  --blue: #58a6ff;
  --blue-dim: #1f3e6e;
  --orange: #ffa657;
  --yellow: #e3b341;
  --purple: #6C63FF;

  --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.5; overflow: hidden; height: 100vh; }
.hidden { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login ────────────────────────────────────────────────────────────── */
#login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #0d1117 0%, var(--bg) 70%);
}
.login-box {
  width: 340px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 36px 32px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-icon { font-size: 40px; margin-bottom: 10px; color: var(--blue); }
.login-logo h1 { font-size: 20px; font-weight: 700; }
.login-logo p { font-size: 12px; color: var(--muted); margin-top: 4px; }
#login-form { display: flex; flex-direction: column; gap: 10px; }
.login-err { color: var(--red); font-size: 12px; text-align: center; min-height: 18px; }

/* ── App layout ───────────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; }
#statusbar {
  height: 30px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.ws-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex-shrink: 0; transition: background 0.3s; }
.ws-dot.ok { background: var(--green); }
.run-badge { font-size: 11px; color: var(--green); font-weight: 600; }
#main-layout { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
#sidebar {
  width: 210px;
  min-width: 210px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.logo-icon { font-size: 22px; color: var(--blue); }
.logo-name { font-size: 13px; font-weight: 700; }
.logo-sub { font-size: 10px; color: var(--muted); }

nav#sidenav { flex: 1; display: flex; flex-direction: column; }
.nav-section { padding: 10px 0 2px; }
.nav-section.nav-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: 10px; }
.nav-label { font-size: 10px; font-weight: 600; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.8px; padding: 0 14px 5px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.1s, color 0.1s;
  font-size: 13px;
  user-select: none;
  position: relative;
  border-radius: 0;
}
.nav-item .ni { font-size: 13px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--card); color: var(--text); font-weight: 500; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--blue);
}
.nav-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.nav-pill { margin-left: auto; font-size: 9px; background: var(--green-dim); color: var(--green); padding: 1px 5px; border-radius: 8px; font-weight: 700; }

/* ── Main content ─────────────────────────────────────────────────────── */
#content-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#tab-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px 0;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}
#tab-bar::-webkit-scrollbar { height: 0; }
.app-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  white-space: nowrap;
  transition: all 0.1s;
  position: relative;
  top: 1px;
  user-select: none;
}
.app-tab:hover { color: var(--text); background: var(--card); }
.app-tab.active { color: var(--text); background: var(--bg); border-color: var(--border); font-weight: 500; }
.tab-close { opacity: 0; font-size: 14px; line-height: 1; margin-left: 2px; color: var(--muted2); }
.app-tab:hover .tab-close { opacity: 1; }
.tab-close:hover { color: var(--red); }
#content { flex: 1; overflow-y: auto; padding: 22px 26px; }

/* ── Terminal ─────────────────────────────────────────────────────────── */
#term-wrap {
  height: 260px;
  background: #070a0e;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: height 0.2s ease;
  flex-shrink: 0;
}
#term-wrap.collapsed { height: 32px; }
#term-header {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
#term-arrow { font-size: 10px; color: var(--muted); }
.term-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
#term-running-label { font-size: 11px; color: var(--green); margin-left: 8px; }
#terminal { flex: 1; overflow-y: auto; padding: 8px 12px; font-family: var(--mono); font-size: 12px; line-height: 1.6; }
.tl { white-space: pre-wrap; word-break: break-all; }
.tl.out { color: #c9d1d9; }
.tl.err { color: var(--orange); }
.tl.info { color: var(--blue); }
.tl.ok { color: var(--green); }
.tl.fail { color: var(--red); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s;
  white-space: nowrap;
  font-family: var(--font);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--green-dim); border-color: #2ea043; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2ea043; }
.btn-secondary { background: var(--card2); border-color: var(--border2); color: var(--text); }
.btn-secondary:hover { background: var(--border2); }
.btn-danger { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: #7f1d1d; color: #fff; }
.btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--card2); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; }
.tbtn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px 7px; border-radius: 4px; font-family: var(--font); }
.tbtn:hover { background: var(--border2); color: var(--text); }

/* ── Form inputs ──────────────────────────────────────────────────────── */
.inp {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.inp:focus { border-color: var(--blue); }
.inp::placeholder { color: var(--muted2); }
select.inp { cursor: pointer; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 160px; }
.form-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── Page headers ─────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 18px; font-weight: 700; }
.page-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.card + .card { margin-top: 12px; }

/* ── KPI Grid ─────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--kc, var(--blue)); }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.kpi-sub { font-size: 11px; color: var(--green); margin-top: 2px; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border2); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--card2); cursor: pointer; }
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }

/* ── Badges ───────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.badge-new { background: #1d3557; color: #58a6ff; }
.badge-warm { background: #4a2500; color: var(--orange); }
.badge-hot { background: #4a1212; color: var(--red); }
.badge-cold { background: #1c2128; color: var(--muted); }
.badge-closed { background: #1a3524; color: var(--green); }
.badge-dead { background: #1c2128; color: var(--muted2); }
.badge-pending { background: #2d2600; color: var(--yellow); }
.badge-done { background: #1a3524; color: var(--green); }
.badge-overdue { background: var(--red-dim); color: var(--red); }
.badge-run { background: var(--green-dim); color: var(--green); }
.badge-default { background: var(--card2); color: var(--muted); border: 1px solid var(--border2); }

/* ── Sections ─────────────────────────────────────────────────────────── */
.sec { margin-bottom: 22px; }
.sec-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sec-count { font-size: 11px; color: var(--muted2); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ── Project cards ────────────────────────────────────────────────────── */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.proj-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
}
.proj-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--pc, var(--blue)); }
.proj-card:hover { border-color: var(--pc, var(--blue)); transform: translateY(-1px); }
.proj-card-top { display: flex; align-items: flex-start; gap: 11px; }
.proj-emoji { font-size: 24px; line-height: 1; }
.proj-name { font-size: 14px; font-weight: 600; }
.proj-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.proj-footer { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; align-items: center; }

/* ── Project detail header ────────────────────────────────────────────── */
.proj-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.proj-color-bar { width: 4px; height: 44px; border-radius: 2px; flex-shrink: 0; }
.proj-header-emoji { font-size: 32px; }
.proj-header-name { font-size: 19px; font-weight: 700; }
.proj-header-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Commands ─────────────────────────────────────────────────────────── */
.cmd-list { display: flex; flex-direction: column; gap: 8px; }
.cmd-item { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 13px 15px; }
.cmd-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cmd-label { font-size: 13px; font-weight: 500; }
.cmd-input-row { display: flex; gap: 8px; margin-top: 10px; }

/* ── File browser ─────────────────────────────────────────────────────── */
.flist { background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.fitem { display: flex; align-items: center; gap: 9px; padding: 8px 13px; border-bottom: 1px solid var(--border); font-size: 12px; }
.fitem:last-child { border-bottom: none; }
.fitem.clickable { cursor: pointer; }
.fitem.clickable:hover { background: var(--card2); }
.fitem.file-active { background: var(--blue-dim); }
.ficon { width: 16px; text-align: center; font-size: 12px; flex-shrink: 0; }
.fname { flex: 1; font-family: var(--mono); color: var(--text); }
.fsize { font-size: 11px; color: var(--muted2); margin-right: 6px; }
.fdate { font-size: 11px; color: var(--muted2); white-space: nowrap; }

/* ── File editor ──────────────────────────────────────────────────────── */
.editor-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.editor-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--sidebar); border-bottom: 1px solid var(--border); }
.editor-filename { font-family: var(--mono); font-size: 12px; color: var(--muted); flex: 1; }
.editor-dirty { color: var(--orange); }
#editor-textarea {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  background: #070a0e;
  border: none;
  padding: 14px;
  color: #c9d1d9;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  outline: none;
  display: block;
}

/* ── Pipeline stages ──────────────────────────────────────────────────── */
.stages-scroll { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 14px; overflow-x: auto; }
.stages-row { display: flex; align-items: flex-start; min-width: max-content; }
.stage-node { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.stage-circle { width: 10px; height: 10px; border-radius: 50%; background: var(--border2); }
.stage-nm { font-size: 9px; color: var(--muted); text-align: center; width: 58px; line-height: 1.3; }
.stage-line { width: 24px; height: 2px; background: var(--border2); flex-shrink: 0; margin-bottom: 14px; }

/* ── Hermès ───────────────────────────────────────────────────────────── */
.hermes-layout { display: flex; gap: 16px; height: calc(100vh - 220px); min-height: 400px; }
.hermes-sidebar { width: 200px; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.hermes-project-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.1s;
}
.hermes-project-btn:hover { border-color: var(--blue); color: var(--text); }
.hermes-project-btn.active { border-color: var(--blue); background: var(--blue-dim); color: var(--text); }
.chat-wrap { flex: 1; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.chat-header { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.chat-header-title { font-size: 13px; font-weight: 600; flex: 1; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; gap: 10px; }
.chat-msg.assistant { flex-direction: row; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.chat-avatar.assistant { background: #1f3e6e; }
.chat-avatar.user { background: var(--green-dim); }
.chat-bubble {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.assistant { background: var(--card2); border: 1px solid var(--border); }
.chat-bubble.user { background: var(--blue-dim); border: 1px solid #1f3e6e; text-align: right; }
.chat-bubble code { background: #0d1117; padding: 2px 5px; border-radius: 4px; font-family: var(--mono); font-size: 11px; }
.chat-bubble pre { background: #0d1117; padding: 10px; border-radius: 6px; margin: 6px 0; overflow-x: auto; font-family: var(--mono); font-size: 11px; }
.chat-input-row { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-end; }
.chat-input-row textarea {
  flex: 1;
  background: #070a0e;
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 8px 11px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  resize: none;
  outline: none;
  line-height: 1.5;
  min-height: 38px;
  max-height: 120px;
}
.chat-input-row textarea:focus { border-color: var(--blue); }
.chat-typing { color: var(--muted); font-size: 12px; font-style: italic; }
.file-ctx-bar { background: var(--blue-dim); border: 1px solid #1f3e6e; border-radius: 6px; padding: 6px 10px; font-size: 11px; display: flex; align-items: center; gap: 8px; margin: 0 14px 4px; }

/* ── Contact detail ───────────────────────────────────────────────────── */
.contact-header { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.contact-name { font-size: 20px; font-weight: 700; }
.contact-meta { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.contact-meta-item { display: flex; align-items: center; gap: 5px; }
.contact-quick-actions { display: flex; gap: 8px; margin-top: 14px; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; transition: all 0.1s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--blue); font-weight: 500; }

/* ── Timeline ─────────────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 15px; top: 28px; bottom: -10px; width: 1px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--card2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.tl-content { flex: 1; }
.tl-title { font-size: 13px; font-weight: 500; }
.tl-body { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tl-time { font-size: 11px; color: var(--muted2); margin-top: 3px; }

/* ── Pipeline / Kanban ────────────────────────────────────────────────── */
.pipeline-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.pipeline-col { min-width: 240px; width: 240px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; flex-shrink: 0; }
.pipeline-col-header { padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.pipeline-col-name { font-size: 12px; font-weight: 600; }
.pipeline-col-count { font-size: 11px; color: var(--muted); background: var(--card2); padding: 1px 7px; border-radius: 10px; }
.pipeline-col-body { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 100px; overflow-y: auto; max-height: 500px; }
.deal-card { background: var(--card2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; cursor: pointer; transition: border-color 0.1s; }
.deal-card:hover { border-color: var(--blue); }
.deal-card-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.deal-card-meta { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.deal-card-value { font-size: 12px; font-weight: 600; color: var(--green); margin-top: 6px; }

/* ── Task card ────────────────────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; display: flex; align-items: flex-start; gap: 12px; }
.task-card:hover { border-color: var(--border2); }
.task-check { width: 18px; height: 18px; border: 1px solid var(--border2); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; transition: all 0.1s; }
.task-check:hover { border-color: var(--green); }
.task-check.done { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.task-body { flex: 1; }
.task-title { font-size: 13px; font-weight: 500; }
.task-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; }
.task-actions { display: flex; gap: 4px; }

/* ── Smart Lists ──────────────────────────────────────────────────────── */
.smartlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.smartlist-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.smartlist-card:hover { border-color: var(--blue); }
.smartlist-icon { font-size: 24px; margin-bottom: 8px; }
.smartlist-name { font-size: 14px; font-weight: 600; }
.smartlist-count { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Agent slots ──────────────────────────────────────────────────────── */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.agent-slot { background: var(--card); border: 1px dashed var(--border2); border-radius: 8px; padding: 20px 14px; text-align: center; }
.agent-icon { font-size: 28px; margin-bottom: 8px; opacity: 0.3; }
.agent-name { font-size: 13px; font-weight: 500; color: var(--muted); }
.agent-desc { font-size: 11px; color: var(--muted2); margin-top: 4px; }
.agent-lock { font-size: 10px; color: var(--border2); margin-top: 10px; letter-spacing: 0.5px; }

/* ── Code block ───────────────────────────────────────────────────────── */
.codeblock { background: #070a0e; border: 1px solid var(--border); border-radius: 6px; padding: 11px 13px; font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ── Empty states ─────────────────────────────────────────────────────── */
.empty { padding: 32px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.3; }
.empty-text { color: var(--muted); }
.empty-sub { font-size: 12px; color: var(--muted2); margin-top: 4px; }

/* ── Modal ────────────────────────────────────────────────────────────── */
#modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; display: flex; align-items: center; justify-content: center; }
#modal { background: var(--card); border: 1px solid var(--border2); border-radius: 10px; min-width: 400px; max-width: 600px; width: 90%; }
#modal-title { font-size: 15px; font-weight: 700; padding: 16px 20px; border-bottom: 1px solid var(--border); }
#modal-body { padding: 20px; }

/* ── Toast ────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 50px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-item {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  max-width: 300px;
  animation: slideIn 0.2s ease;
}
.toast-item.ok { border-left: 3px solid var(--green); }
.toast-item.err { border-left: 3px solid var(--red); }
@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }

/* ── Search bar ───────────────────────────────────────────────────────── */
.search-bar { position: relative; }
.search-bar input { padding-left: 30px; }
.search-bar::before { content: '🔍'; position: absolute; left: 9px; top: 8px; font-size: 12px; pointer-events: none; }

/* ── Scrollbars ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { display: none; }
  #content { padding: 14px; }
}
