/* ═══════════════════════════════════════════
   MISSION CONTROL — Dark Design System
   Accent: Cyan #06b6d4 (vs SPY amber)
   ═══════════════════════════════════════════ */

:root {
  --bg-base:     #080b0f;
  --bg-surface:  #0e1318;
  --bg-elevated: #141b22;
  --bg-overlay:  #1a2330;
  --border:      #1e2d3d;
  --border-light:#243447;

  --text-primary:   #e2e8f0;
  --text-secondary: #7c8fa0;
  --text-muted:     #4a5a6a;

  --accent:       #06b6d4;
  --accent-hover: #0891b2;
  --accent-muted: rgba(6,182,212,0.12);

  --success:       #10b981;
  --success-muted: rgba(16,185,129,0.12);
  --danger:        #ef4444;
  --danger-muted:  rgba(239,68,68,0.12);
  --warning:       #f59e0b;
  --warning-muted: rgba(245,158,11,0.12);
  --info:          #3b82f6;
  --info-muted:    rgba(59,130,246,0.12);

  --font-ui:   "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono","Fira Code",monospace;

  --sidebar-w:  220px;
  --radius:     6px;
  --transition: 150ms ease;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-family:var(--font-ui);font-size:14px;line-height:1.5;color:var(--text-primary);background:var(--bg-base);-webkit-font-smoothing:antialiased}
body{min-height:100vh;display:flex}
a{color:var(--accent);text-decoration:none;transition:color var(--transition)}
a:hover{color:var(--accent-hover)}
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
*{scrollbar-width:thin;scrollbar-color:var(--border) transparent}

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.25rem 1rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100%{opacity:1}50%{opacity:0.4}
}
.sidebar-nav {
  padding: 0.75rem 0.5rem;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
  margin-bottom: 2px;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-item.active { color: var(--accent); background: var(--accent-muted); }
.nav-item .badge-count {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Main layout ─────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.page-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.page-body { padding: 1.5rem; flex: 1; }

/* ── Cards ───────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.card-body { padding: 1rem; }

/* ── Stat cards ──────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-card.ok    { border-left: 3px solid var(--success); }
.stat-card.warn  { border-left: 3px solid var(--warning); }
.stat-card.error { border-left: 3px solid var(--danger);  }
.stat-card.info  { border-left: 3px solid var(--accent);  }

/* ── Status badges ───────────────────────── */
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.idle    { background: var(--warning); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.error   { background: var(--danger); }
.status-dot.restarting { background: var(--warning); animation: pulse 1s infinite; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.badge-success { background: var(--success-muted); color: var(--success); }
.badge-danger  { background: var(--danger-muted);  color: var(--danger);  }
.badge-warning { background: var(--warning-muted); color: var(--warning); }
.badge-info    { background: var(--info-muted);    color: var(--info);    }
.badge-accent  { background: var(--accent-muted);  color: var(--accent);  }
.badge-muted   { background: var(--bg-elevated);   color: var(--text-muted); }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: var(--font-ui);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary  { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger   { background: var(--danger-muted); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover  { background: var(--danger); color: white; }
.btn-success  { background: var(--success-muted); color: var(--success); border: 1px solid var(--success); }
.btn-success:hover { background: var(--success); color: white; }
.btn-ghost    { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

/* ── Tables ──────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-elevated); color: var(--text-primary); }

/* ── Terminal / Log viewer ───────────────── */
.terminal {
  background: #020508;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  min-height: 400px;
}
.terminal .log-line { white-space: pre-wrap; word-break: break-all; }
.terminal .log-error   { color: #f87171; }
.terminal .log-warn    { color: #fbbf24; }
.terminal .log-info    { color: #60a5fa; }
.terminal .log-success { color: #34d399; }
.terminal .log-default { color: #94a3b8; }

/* ── Agent cards ─────────────────────────── */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.agent-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.agent-card.online  { border-top: 2px solid var(--success); }
.agent-card.idle    { border-top: 2px solid var(--warning); }
.agent-card.offline { border-top: 2px solid var(--text-muted); }
.agent-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.agent-model {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.agent-log {
  background: #020508;
  border-radius: 4px;
  padding: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-height: 50px;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 0.75rem;
  max-height: 80px;
  overflow-y: auto;
}

/* ── KPI cards ───────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  position: relative;
}
.kpi-label  { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.4rem; }
.kpi-value  { font-size: 1.5rem; font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); line-height: 1.2; }
.kpi-unit   { font-size: 0.75rem; color: var(--text-secondary); margin-left: 3px; }
.kpi-target { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; }
.kpi-bar    { height: 3px; background: var(--border); border-radius: 2px; margin-top: 0.5rem; overflow: hidden; }
.kpi-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.5s ease; }

/* ── Approval cards ──────────────────────── */
.approval-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.approval-card.approved { border-left-color: var(--success); opacity: 0.6; }
.approval-card.rejected { border-left-color: var(--danger); opacity: 0.6; }
.approval-meta { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.approval-action { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); background: var(--bg-elevated); padding: 0.5rem; border-radius: 4px; margin: 0.5rem 0; }
.approval-expires { font-size: 0.7rem; color: var(--warning); }

/* ── Modal ───────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.modal-footer { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* ── Forms ───────────────────────────────── */
.form-group { margin-bottom: 0.875rem; }
.form-label { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.35rem; font-weight: 500; }
.form-control {
  width: 100%; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.5rem 0.75rem; color: var(--text-primary);
  font-family: var(--font-ui); font-size: 0.85rem;
  transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--accent); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Project tabs ────────────────────────── */
.project-tabs { display: flex; gap: 0.25rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.project-tab {
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.project-tab:hover { color: var(--text-primary); }
.project-tab.active { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }

/* ── Activity feed ───────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.activity-text { color: var(--text-secondary); flex: 1; }
.activity-source { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); }

/* ── Cron table ──────────────────────────── */
.cron-ok    { color: var(--success); }
.cron-error { color: var(--danger); }
.cron-warn  { color: var(--warning); }
.cron-never { color: var(--text-muted); }

/* ── Docker ──────────────────────────────── */
.container-up      { color: var(--success); }
.container-down    { color: var(--danger); }
.container-restart { color: var(--warning); }

/* ── Utilities ───────────────────────────── */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-1         { gap: 0.25rem; }
.gap-2         { gap: 0.5rem; }
.gap-3         { gap: 0.75rem; }
.gap-4         { gap: 1rem; }
.mt-1{margin-top:0.25rem} .mt-2{margin-top:0.5rem} .mt-3{margin-top:0.75rem} .mt-4{margin-top:1rem}
.mb-1{margin-bottom:0.25rem} .mb-2{margin-bottom:0.5rem} .mb-3{margin-bottom:0.75rem} .mb-4{margin-bottom:1rem}
.p-1{padding:0.25rem} .p-2{padding:0.5rem} .p-3{padding:0.75rem} .p-4{padding:1rem}
.text-sm  { font-size: 0.8rem; }
.text-xs  { font-size: 0.72rem; }
.text-mono{ font-family: var(--font-mono); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ══════════════════════════════════════════
   KANBAN BOARD — Agent Sector View
   ══════════════════════════════════════════ */

.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}

.kanban-col {
  min-width: 220px;
  max-width: 240px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid;
  background: var(--bg-elevated);
}

.kanban-col-icon { font-size: 1rem; }

.kanban-col-title {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.kanban-cards {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 80px;
}

.kanban-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: default;
}
.kanban-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.kanban-card.status-online  { border-left: 3px solid var(--success); }
.kanban-card.status-idle    { border-left: 3px solid var(--warning); }
.kanban-card.status-configured { border-left: 3px solid var(--border-light); }
.kanban-card.status-offline { border-left: 3px solid var(--danger); opacity: 0.6; }

.kanban-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.agent-icon { font-size: 1.2rem; flex-shrink: 0; }
.agent-name-sm {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.agent-model-sm {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.status-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-pill.online     { background: var(--success-muted); color: var(--success); }
.status-pill.idle       { background: var(--warning-muted); color: var(--warning); }
.status-pill.configured { background: var(--bg-overlay);    color: var(--text-muted); }
.status-pill.offline    { background: var(--danger-muted);  color: var(--danger); }

.kanban-card-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.kanban-card-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 0.5rem;
}
.cap-tag {
  font-size: 0.62rem;
  background: var(--accent-muted);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.kanban-empty {
  text-align: center;
  padding: 1.5rem 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.btn-xs {
  padding: 2px 8px !important;
  font-size: 0.72rem !important;
}

/* Sector accent colors on column header */
.kanban-col:nth-child(1) .kanban-col-header { border-color: #06b6d4; }
.kanban-col:nth-child(2) .kanban-col-header { border-color: #8b5cf6; }
.kanban-col:nth-child(3) .kanban-col-header { border-color: #10b981; }
.kanban-col:nth-child(4) .kanban-col-header { border-color: #f59e0b; }
.kanban-col:nth-child(5) .kanban-col-header { border-color: #ef4444; }

/* ══════════════════════════════════════════
   SPY INTELLIGENCE STRIP
   ══════════════════════════════════════════ */

.spy-strip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid #8b5cf6;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.spy-strip-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8b5cf6;
  margin-bottom: 0.6rem;
}

.spy-stats-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.spy-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.spy-stat-val {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.spy-stat-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.spy-stat-div {
  width: 1px;
  height: 30px;
  background: var(--border);
}

/* ══════════════════════════════════════════
   STAT CARDS — extras
   ══════════════════════════════════════════ */

.stat-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.stat-sub.text-danger { color: var(--danger); }

/* ══════════════════════════════════════════
   BADGE COUNT in buttons
   ══════════════════════════════════════════ */
.badge-count.ml-1 { margin-left: 4px; }

/* ══════════════════════════════════════════
   MOBILE — Responsive sidebar
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.5rem;
  }
  .sidebar-brand {
    padding: 0.5rem 1rem;
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.25rem;
    flex: 1;
  }
  .nav-item { padding: 0.4rem 0.6rem; font-size: 0.78rem; }
  .sidebar-footer { display: none; }
  body { flex-direction: column; }
  .main-content { margin-left: 0 !important; }
  .kanban-board { padding-bottom: 2rem; }
  .spy-stats-row { gap: 0.75rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   KANBAN BOARD — Agent Sector View
   ══════════════════════════════════════════ */

.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}

.kanban-col {
  min-width: 220px;
  max-width: 240px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid;
  background: var(--bg-elevated);
}

.kanban-col-icon { font-size: 1rem; }

.kanban-col-title {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.kanban-cards {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 80px;
}

.kanban-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: default;
}
.kanban-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.kanban-card.status-online  { border-left: 3px solid var(--success); }
.kanban-card.status-idle    { border-left: 3px solid var(--warning); }
.kanban-card.status-configured { border-left: 3px solid var(--border-light); }
.kanban-card.status-offline { border-left: 3px solid var(--danger); opacity: 0.6; }

.kanban-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.agent-icon { font-size: 1.2rem; flex-shrink: 0; }
.agent-name-sm {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.agent-model-sm {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.status-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-pill.online     { background: var(--success-muted); color: var(--success); }
.status-pill.idle       { background: var(--warning-muted); color: var(--warning); }
.status-pill.configured { background: var(--bg-overlay);    color: var(--text-muted); }
.status-pill.offline    { background: var(--danger-muted);  color: var(--danger); }

.kanban-card-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.kanban-card-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 0.5rem;
}
.cap-tag {
  font-size: 0.62rem;
  background: var(--accent-muted);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.kanban-empty {
  text-align: center;
  padding: 1.5rem 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.btn-xs {
  padding: 2px 8px !important;
  font-size: 0.72rem !important;
}

/* Sector accent colors on column header */
.kanban-col:nth-child(1) .kanban-col-header { border-color: #06b6d4; }
.kanban-col:nth-child(2) .kanban-col-header { border-color: #8b5cf6; }
.kanban-col:nth-child(3) .kanban-col-header { border-color: #10b981; }
.kanban-col:nth-child(4) .kanban-col-header { border-color: #f59e0b; }
.kanban-col:nth-child(5) .kanban-col-header { border-color: #ef4444; }

/* ══════════════════════════════════════════
   SPY INTELLIGENCE STRIP
   ══════════════════════════════════════════ */

.spy-strip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid #8b5cf6;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.spy-strip-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8b5cf6;
  margin-bottom: 0.6rem;
}

.spy-stats-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.spy-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.spy-stat-val {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.spy-stat-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.spy-stat-div {
  width: 1px;
  height: 30px;
  background: var(--border);
}

/* ══════════════════════════════════════════
   STAT CARDS — extras
   ══════════════════════════════════════════ */

.stat-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.stat-sub.text-danger { color: var(--danger); }

/* ══════════════════════════════════════════
   BADGE COUNT in buttons
   ══════════════════════════════════════════ */
.badge-count.ml-1 { margin-left: 4px; }

/* ══════════════════════════════════════════
   MOBILE — Responsive sidebar
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.5rem;
  }
  .sidebar-brand {
    padding: 0.5rem 1rem;
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.25rem;
    flex: 1;
  }
  .nav-item { padding: 0.4rem 0.6rem; font-size: 0.78rem; }
  .sidebar-footer { display: none; }
  body { flex-direction: column; }
  .main-content { margin-left: 0 !important; }
  .kanban-board { padding-bottom: 2rem; }
  .spy-stats-row { gap: 0.75rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
