/* ═══════════════════════════════════════════════════════════════
   Radbot Mission Control — Style Sheet
   Dark theme inspired by Linear.app
═══════════════════════════════════════════════════════════════ */

/* ── ApertureAI Mission Control Login ───────────────────────── */
body.mc-login-body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(139,92,246,.30), transparent 30%),
    radial-gradient(circle at 60% 20%, rgba(103,232,249,.16), transparent 28%),
    linear-gradient(135deg, #03050a 0%, #0b1020 52%, #140d24 100%);
}

.mc-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}

.mc-login-card {
  width: min(440px, 100%);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 30px;
  padding: 34px;
  background: linear-gradient(180deg, rgba(14,18,29,.88), rgba(7,9,14,.78));
  box-shadow: 0 36px 110px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter: blur(18px);
}

.mc-login-orb {
  position: absolute;
  width: 330px;
  height: 330px;
  right: -140px;
  top: -150px;
  border-radius: 42% 58% 68% 32% / 38% 35% 65% 62%;
  background: linear-gradient(135deg, rgba(99,102,241,.55), rgba(103,232,249,.20), rgba(139,92,246,.42));
  filter: blur(.3px);
  opacity: .72;
  pointer-events: none;
}

.mc-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.mc-login-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 0 34px rgba(103,232,249,.20);
}

.mc-login-kicker {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.mc-login-brand h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.mc-login-copy {
  position: relative;
  z-index: 1;
  margin: 18px 0 22px;
  color: var(--text-secondary);
  font-size: 14px;
}

.mc-login-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.mc-login-form label {
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
}

.mc-login-form input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  padding: 12px 13px;
  background: rgba(3,5,10,.62);
  color: var(--text-primary);
  outline: none;
  font: inherit;
}

.mc-login-form input:focus {
  border-color: rgba(103,232,249,.58);
  box-shadow: 0 0 0 4px rgba(103,232,249,.09);
}

.mc-login-form button {
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  color: white;
  font-weight: 750;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #67e8f9);
  box-shadow: 0 18px 45px rgba(99,102,241,.28);
}

.mc-login-error {
  position: relative;
  z-index: 1;
  margin: -4px 0 14px;
  border: 1px solid rgba(239,68,68,.38);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(239,68,68,.12);
  color: #fecaca;
}

.mc-login-footnote {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

:root {
  color-scheme: dark;
  --bg-primary:   #07090d;
  --bg-secondary: rgba(13,17,24,0.78);
  --bg-tertiary:  rgba(255,255,255,0.055);
  --bg-hover:     rgba(255,255,255,0.075);
  --bg-active:    rgba(99,102,241,0.18);

  --text-primary:   #f5f7fb;
  --text-secondary: #b9c3d4;
  --text-muted:     #657186;

  --accent:        #6366f1;
  --accent-dim:    rgba(139,92,246,0.28);
  --accent-glow:   rgba(103,232,249,0.16);
  --cyan:          #67e8f9;
  --violet:        #8b5cf6;

  --border:  rgba(255,255,255,0.10);
  --border2: rgba(255,255,255,0.065);

  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #67e8f9;

  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  24px;

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

  --sidebar-w: 240px;
  --chat-w: 320px;

  --transition: 150ms ease;
  --shadow: 0 28px 80px rgba(0,0,0,.40), inset 0 1px 0 rgba(255,255,255,.05);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(99,102,241,.24), transparent 34%),
    radial-gradient(circle at 82% 2%, rgba(103,232,249,.14), transparent 32%),
    radial-gradient(circle at 60% 100%, rgba(16,185,129,.08), transparent 33%),
    var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(13,17,24,.96), rgba(8,11,17,.88));
  border-right: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.035);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border2);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.sidebar-logo .logo-icon {
  font-size: 18px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin: 1px 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 450;
  transition: background var(--transition), color var(--transition);
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--text-primary);
}

.nav-item .nav-icon { font-size: 14px; width: 18px; text-align: center; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--info);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-status { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.status-dot.offline { background: var(--text-muted); }
.status-dot.warning { background: var(--warning); }

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

.page-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.page-body::-webkit-scrollbar { width: 6px; }
.page-body::-webkit-scrollbar-track { background: transparent; }
.page-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Chat Panel ────────────────────────────────────────────── */
.chat-panel {
  width: var(--chat-w);
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-header-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  gap: 3px;
}

.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; align-items: flex-start; }

.msg-bubble {
  padding: 8px 11px;
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.msg.assistant .msg-bubble {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-left-radius: 3px;
  border: 1px solid var(--border);
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 2px;
}

.typing-indicator {
  align-self: flex-start;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius);
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

.chat-input-area {
  padding: 10px;
  border-top: 1px solid var(--border2);
  flex-shrink: 0;
}

.chat-input-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12.5px;
  resize: none;
  min-height: 36px;
  max-height: 100px;
  outline: none;
  transition: border-color var(--transition);
  line-height: 1.4;
}

.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: background var(--transition);
}

.chat-send-btn:hover { background: #7c74ff; }
.chat-send-btn:disabled { background: var(--accent-dim); cursor: not-allowed; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font);
}

.btn-primary {
  background: linear-gradient(135deg,var(--accent),var(--violet));
  color: #fff;
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 14px 34px rgba(99,102,241,.28);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 4px 9px; font-size: 11.5px; }
.btn-icon { padding: 5px 8px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

.badge-green  { background: rgba(34,197,94,0.15);  color: var(--success); }
.badge-blue   { background: rgba(59,130,246,0.15); color: var(--info);    }
.badge-red    { background: rgba(239,68,68,0.15);  color: var(--danger);  }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-purple { background: var(--accent-glow);     color: var(--accent);  }
.badge-gray   { background: rgba(96,96,112,0.2);   color: var(--text-muted); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: linear-gradient(135deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}

.card-sm { padding: 12px; }
.card-hover:hover { border-color: rgba(103,232,249,.28); background: rgba(255,255,255,.06); cursor: pointer; }

/* Portal-theme alert rows */
.mc-live-alert-card { border-color: rgba(103,232,249,.22); box-shadow: var(--shadow); }
.mc-alert-pill { display:inline-flex; gap:5px; align-items:center; border:1px solid rgba(103,232,249,.30); background:rgba(103,232,249,.10); color:#cffafe; border-radius:999px; padding:4px 9px; font-size:11px; font-weight:800; }
.mc-alert-pill.tech { border-color:rgba(139,92,246,.32); background:rgba(139,92,246,.12); color:#ddd6fe; }
.mc-alert-grid { display:flex; flex-direction:column; gap:8px; }
.mc-alert-row { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(220px,.9fr); gap:12px; padding:12px; border:1px solid var(--border2); border-radius:14px; background:rgba(255,255,255,.035); }
.mc-alert-row.critical { border-color:rgba(239,68,68,.34); background:linear-gradient(135deg,rgba(244,63,94,.14),rgba(255,255,255,.025)); }
.mc-alert-row.warning { border-color:rgba(245,158,11,.30); background:linear-gradient(135deg,rgba(245,158,11,.11),rgba(255,255,255,.025)); }
.mc-alert-row.info { border-color:rgba(103,232,249,.26); background:linear-gradient(135deg,rgba(103,232,249,.10),rgba(255,255,255,.025)); }
.mc-alert-title { color:var(--text-primary); font-weight:800; font-size:13px; }
.mc-alert-title span { margin-left:6px; color:#cffafe; border:1px solid rgba(103,232,249,.25); border-radius:999px; padding:1px 6px; font-size:10px; text-transform:uppercase; }
.mc-alert-meta { color:var(--text-secondary); font-size:11px; margin-top:3px; }
.mc-alert-action { color:#dbeafe; font-size:12px; line-height:1.45; margin-top:7px; }
.mc-alert-evidence { color:var(--text-muted); font:600 11px/1.45 var(--font-mono); overflow:hidden; }
.mc-alert-evidence div { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ── Stats Row ──────────────────────────────────────────────── */
.stats-row {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}
.stats-row-4 { grid-template-columns: repeat(4, 1fr); }
.stats-row-3 { grid-template-columns: repeat(3, 1fr); }
.stats-row-2 { grid-template-columns: repeat(2, 1fr); }

.stat-card {
  background: rgba(255,255,255,.045);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Activity Feed ──────────────────────────────────────────── */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.activity-item:hover { background: var(--bg-hover); }

.activity-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.activity-body { flex: 1; min-width: 0; }
.activity-text { color: var(--text-secondary); line-height: 1.4; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ── Kanban ─────────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  height: calc(100% - 120px);
  min-height: 400px;
}

.kanban-col {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kanban-col-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.kanban-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex: 1;
}

.kanban-count {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kanban-cards::-webkit-scrollbar { width: 3px; }
.kanban-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.task-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.task-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.task-card.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.task-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.task-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}

.task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.assignee-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.assignee-avatar.radbot { background: var(--accent); }
.assignee-avatar.doc    { background: var(--info); }

.priority-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.priority-dot.high   { background: var(--danger);  }
.priority-dot.medium { background: var(--warning); }
.priority-dot.low    { background: var(--success); }

.kanban-drop-zone {
  min-height: 50px;
  border: 2px dashed transparent;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.kanban-drop-zone.drag-active {
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

/* ── Calendar ───────────────────────────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: 50px repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-secondary);
}

.cal-header-cell {
  padding: 8px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cal-time-cell {
  padding: 6px 8px;
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: right;
  border-right: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
  background: var(--bg-secondary);
  white-space: nowrap;
}

.cal-cell {
  min-height: 40px;
  border-right: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
  padding: 2px;
  position: relative;
}

.cal-event {
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-bottom: 1px;
  transition: opacity var(--transition);
}

.cal-event:hover { opacity: 0.8; }

/* ── Projects Grid ──────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.project-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.project-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.project-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

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

.project-detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.project-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.project-task-col {
  background: var(--bg-tertiary);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 120px;
}

.project-task-col-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.project-task-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 6px;
}

.project-task-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.project-task-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.project-task-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.project-task-empty {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

.owner-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-bar-wrap {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.project-next {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Memory Page ────────────────────────────────────────────── */
.memory-layout {
  display: grid;
  grid-template-columns: 200px 1fr 280px;
  gap: 12px;
  height: calc(100vh - 140px);
}

.memory-file-list {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 8px;
}

.memory-file-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.memory-file-item:hover { background: var(--bg-hover); }
.memory-file-item.active { background: var(--accent-dim); }

.memory-file-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.memory-file-size {
  font-size: 10.5px;
  color: var(--text-muted);
}

.memory-viewer {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.memory-viewer h1, .memory-viewer h2, .memory-viewer h3 {
  color: var(--text-primary);
  font-weight: 600;
  margin: 16px 0 8px;
}

.memory-viewer h1 { font-size: 18px; }
.memory-viewer h2 { font-size: 15px; }
.memory-viewer h3 { font-size: 13px; }

.memory-viewer p { margin-bottom: 8px; }
.memory-viewer ul, .memory-viewer ol { margin: 8px 0 8px 20px; }
.memory-viewer li { margin-bottom: 4px; }
.memory-viewer code {
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.memory-viewer pre {
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 8px 0;
}
.memory-viewer pre code { background: none; padding: 0; }

.memory-editor-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.memory-editor-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

.memory-editor-textarea {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  resize: none;
  outline: none;
  line-height: 1.6;
}

/* ── Docs Page ──────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  gap: 12px;
  height: calc(100vh - 140px);
}

.docs-list-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.docs-preview-panel {
  width: 380px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all var(--transition);
}

.docs-preview-panel.hidden { width: 0; border: none; overflow: hidden; }

.docs-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border2);
}

.docs-file-row:hover { background: var(--bg-hover); }
.docs-file-row.active { background: var(--bg-active); }

.docs-file-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-file-meta { font-size: 11px; color: var(--text-muted); }

.docs-search-card {
  margin-bottom: 8px;
  cursor: pointer;
}

.docs-search-card:hover {
  border-color: var(--accent-dim);
}

.search-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.search-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.docs-search-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-search-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.docs-search-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover { border-color: var(--accent-dim); color: var(--text-primary); }
.filter-btn.active { background: var(--accent-dim); border-color: var(--accent-dim); color: var(--text-primary); }

/* ── Team Page ──────────────────────────────────────────────── */
.mission-banner {
  background: linear-gradient(135deg, var(--accent-dim) 0%, rgba(30,30,42,0.8) 100%);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.mission-banner p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  max-width: 600px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.team-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.team-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
}

.team-avatar.is-text {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--info);
}

.team-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.team-role { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }

.team-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.team-meta-row {
  display: flex;
  gap: 6px;
}

.team-meta-label { color: var(--text-muted); width: 80px; flex-shrink: 0; }
.team-meta-value { color: var(--text-secondary); }

.team-capabilities {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border2);
}

.capabilities-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.capability-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.capability-pill {
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ── Office Page ────────────────────────────────────────────── */
.office-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  height: calc(100vh - 140px);
}

#officeCanvas {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #0a0a14;
  max-width: 100%;
  cursor: pointer;
}

.office-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ── Conversations ──────────────────────────────────────────── */
.conv-layout {
  display: flex;
  gap: 12px;
  height: calc(100vh - 140px);
}

.conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }

.conv-thread-panel {
  width: 380px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conv-item {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.conv-item:hover { border-color: var(--accent-dim); background: var(--bg-hover); }
.conv-item.active { border-color: var(--accent); }

.conv-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.conv-role-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}

.conv-role-badge.user {
  background: rgba(108,99,255,0.2);
  color: var(--accent);
}

.conv-role-badge.assistant {
  background: rgba(34,197,94,0.15);
  color: var(--success);
}

.conv-ts { font-size: 11px; color: var(--text-muted); }
.conv-channel { font-size: 11px; color: var(--text-muted); }
.conv-snippet { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; }

.thread-msg {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
}

.thread-msg.user { background: var(--accent-glow); border-color: var(--accent-dim); }
.thread-msg.assistant { background: var(--bg-tertiary); }

.thread-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.thread-text {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ── Status Cards ───────────────────────────────────────────── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.status-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.status-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.status-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-card-refresh {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 3px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.status-card-refresh:hover { background: var(--bg-hover); color: var(--text-primary); }

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.ok { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-indicator.warn { background: var(--warning); }
.status-indicator.error { background: var(--danger); }
.status-indicator.unknown { background: var(--text-muted); }

.status-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.status-kv {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid var(--border2);
}

.status-kv:last-child { border-bottom: none; }
.status-kv-key { color: var(--text-muted); }
.status-kv-val { color: var(--text-secondary); font-family: var(--font-mono); font-size: 11.5px; }

.status-last-checked {
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ── Search Bar ─────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  transition: border-color var(--transition);
}

.search-bar:focus-within { border-color: var(--accent); }

.search-input {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 0;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
}

.search-input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 14px; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 380px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

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

.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
}

.form-select { cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── Toggle ─────────────────────────────────────────────────── */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle input { display: none; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }

.toggle-track::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: all var(--transition);
}

.toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* ── Misc ───────────────────────────────────────────────────── */
.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 8px;
  text-align: center;
}

.empty-state .empty-icon { font-size: 32px; }
.empty-state .empty-text { font-size: 13px; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.divider {
  height: 1px;
  background: var(--border2);
  margin: 16px 0;
}

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

mark {
  background: rgba(108,99,255,0.35);
  color: var(--text-primary);
  border-radius: 3px;
  padding: 0 2px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }

/* ── Scrollable list ────────────────────────────────────────── */
.scroll-list {
  overflow-y: auto;
  max-height: 100%;
}

.scroll-list::-webkit-scrollbar { width: 4px; }
.scroll-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Tasks layout with activity sidebar ─────────────────────── */
.tasks-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 16px;
  height: calc(100vh - 140px);
}

.tasks-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 12px;
}

.tasks-activity {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow-y: auto;
}

.tasks-stat-bar {
  display: flex;
  gap: 16px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.tasks-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tasks-stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.tasks-stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.2s ease forwards; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse { animation: pulse 1.5s infinite; }

/* ── Drag and drop ──────────────────────────────────────────── */
.task-card[draggable="true"] { cursor: grab; }
.task-card[draggable="true"]:active { cursor: grabbing; }
.task-card.dragging { opacity: 0.4; }

.kanban-cards.drop-target {
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
}

/* ── Mini cron list ─────────────────────────────────────────── */
.cron-list-table {
  width: 100%;
  border-collapse: collapse;
}

.cron-list-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.cron-list-table td {
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border2);
}

.cron-list-table tr:hover td { background: var(--bg-hover); }

.cron-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.cron-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.cron-calendar-day {
  background: var(--bg-secondary);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cron-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.cron-calendar-label {
  font-weight: 600;
  color: var(--text-primary);
}

.cron-calendar-count {
  font-size: 10px;
  color: var(--text-muted);
}

.cron-calendar-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cron-calendar-empty {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.cron-event {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border2);
  border-left: 3px solid transparent;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.cron-event-time {
  font-weight: 600;
  color: var(--text-primary);
}

.cron-event-disabled {
  opacity: 0.5;
}

/* Inline tooltip */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 100;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ── Missing classes (v3) ──────────────────────────────────── */
.markdown-body { font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.markdown-body h1 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 14px 0 8px; }
.markdown-body h2 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 12px 0 6px; }
.markdown-body h3 { font-size: 13px; font-weight: 600; color: var(--text-primary); margin: 10px 0 5px; }
.markdown-body p  { margin: 6px 0; }
.markdown-body ul { margin: 4px 0 4px 18px; }
.markdown-body li { margin: 2px 0; }
.markdown-body a  { color: var(--accent); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body code { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px; font-family: var(--font-mono); font-size: 11.5px; }
.markdown-body pre { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.markdown-body pre code { background: none; border: none; padding: 0; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.markdown-body blockquote { border-left: 3px solid var(--accent-dim); padding-left: 10px; color: var(--text-muted); margin: 6px 0; }
.markdown-body strong { color: var(--text-primary); font-weight: 600; }

.toast { position: relative; }

.page-panel { }

.nav-section-title {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Portal-format radiology worklist for Mission Control Studies */
.mc-report-topbar { display:flex; gap:16px; align-items:center; justify-content:space-between; margin-bottom:22px; }
.mc-report-search { flex:1; display:flex; align-items:center; gap:10px; padding:12px 14px; background:rgba(255,255,255,.04); border:1px solid var(--border); border-radius:14px; color:var(--text-secondary); max-width:760px; }
.mc-report-search input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:var(--text-primary); padding:0; }
.mc-kbd { font:600 11px var(--font-mono); color:var(--text-muted); border:1px solid var(--border); border-radius:6px; padding:3px 6px; }
.mc-report-user { display:flex; align-items:center; gap:10px; color:var(--text-secondary); font-size:13px; white-space:nowrap; }
.mc-avatar { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,#1e293b,#334155); display:grid; place-items:center; color:#fff; border:1px solid var(--border); }
.mc-report-hero { display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:18px; background:linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.025)); border:1px solid var(--border); border-radius:28px; padding:24px; box-shadow:0 28px 80px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05); overflow:hidden; position:relative; margin-bottom:18px; }
.mc-report-hero:before { content:""; position:absolute; right:-90px; top:-110px; width:320px; height:320px; background:radial-gradient(circle, rgba(103,232,249,.20), transparent 60%); }
.mc-report-hero > * { position:relative; }
.mc-eyebrow { display:inline-flex; gap:8px; align-items:center; color:#a5b4fc; font:700 12px var(--font-mono); letter-spacing:.1em; text-transform:uppercase; }
.mc-dot { width:8px; height:8px; border-radius:50%; background:var(--success); box-shadow:0 0 18px var(--success); }
.mc-report-hero h2 { margin:12px 0 10px; font-size:clamp(30px,4vw,48px); line-height:.98; letter-spacing:-.055em; color:#f5f7fb; }
.mc-sub { margin:0; color:#b9c3d4; font-size:15px; line-height:1.55; max-width:760px; }
.mc-report-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.mc-btn { border:1px solid var(--border); border-radius:12px; padding:10px 14px; background:rgba(255,255,255,.045); color:#e5e7eb; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; font-weight:800; text-decoration:none; }
.mc-btn.primary { background:linear-gradient(135deg,var(--accent),#8b5cf6); border-color:rgba(255,255,255,.18); color:#fff; box-shadow:0 14px 34px rgba(99,102,241,.28); }
.mc-status-panel { background:rgba(3,7,18,.50); border:1px solid var(--border); border-radius:22px; padding:16px; box-shadow:inset 0 1px 0 rgba(255,255,255,.05); }
.mc-status-panel h3 { margin:0 0 10px; font-size:16px; color:var(--text-primary); }
.mc-step { display:grid; grid-template-columns:24px 1fr auto; gap:10px; align-items:start; padding:9px 0; border-top:1px solid var(--border2); }
.mc-step:first-of-type { border-top:0; }
.mc-num { width:22px; height:22px; display:grid; place-items:center; border-radius:8px; background:rgba(103,232,249,.12); color:#cffafe; font:800 11px var(--font-mono); }
.mc-step b { font-size:13px; display:block; color:var(--text-primary); }
.mc-step small { display:block; color:var(--text-secondary); margin-top:2px; line-height:1.35; }
.mc-tag { color:#cbd5e1; font:800 11px var(--font-mono); }
.mc-report-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin:0 0 18px; }
.mc-metric { background:rgba(255,255,255,.045); border:1px solid var(--border2); border-radius:18px; padding:16px; }
.mc-metric .label { color:var(--text-secondary); font-size:12px; margin-bottom:10px; text-transform:uppercase; letter-spacing:.08em; }
.mc-metric .value { font:800 28px/1 var(--font); letter-spacing:-.04em; color:var(--text-primary); }
.mc-metric .delta { margin-top:8px; color:var(--success); font-size:12px; }
.mc-worklist { background:rgba(13,17,24,.72); border:1px solid var(--border); border-radius:24px; overflow:hidden; box-shadow:0 28px 80px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05); }
.mc-section-head { padding:16px 18px; border-bottom:1px solid var(--border2); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mc-section-head h3 { margin:0; font-size:16px; color:var(--text-primary); }
.mc-meta { color:var(--text-secondary); font-size:12px; line-height:1.45; margin-top:3px; }
.mc-filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.mc-location-filter { display:inline-flex; align-items:center; gap:8px; color:#cbd5e1; background:rgba(255,255,255,.045); border:1px solid var(--border2); border-radius:999px; padding:5px 10px; font-size:12px; }
.mc-location-filter span { color:var(--text-secondary); font-weight:800; letter-spacing:.04em; text-transform:uppercase; font-size:10px; }
.mc-location-filter select { color:#e5e7eb; background:transparent; border:0; outline:0; font:inherit; min-width:132px; cursor:pointer; }
.mc-location-filter select option { color:#0f172a; background:#f8fafc; }
.mc-chip, .mc-tech-toggle { color:#cbd5e1; background:rgba(255,255,255,.045); border:1px solid var(--border2); border-radius:999px; padding:6px 10px; font-size:12px; }
.mc-chip { appearance:none; font:inherit; cursor:pointer; }
.mc-chip:hover { border-color:rgba(103,232,249,.26); color:#e0f2fe; }
.mc-chip.active { background:rgba(103,232,249,.12); border-color:rgba(103,232,249,.3); color:#cffafe; }
.mc-case-list { display:flex; flex-direction:column; }
.mc-case-card { display:grid; grid-template-columns:150px minmax(220px,1.05fr) minmax(280px,1.45fr) minmax(150px,.8fr) 118px; gap:16px; align-items:center; padding:16px 18px; border-top:1px solid var(--border2); background:rgba(255,255,255,.012); }
.mc-case-card:hover { background:rgba(255,255,255,.04); }
.mc-triage { display:inline-flex; align-items:center; gap:7px; border-radius:999px; padding:6px 10px; font:800 12px var(--font); max-width:100%; }
.mc-triage:before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; box-shadow:0 0 14px currentColor; }
.mc-triage-red { color:#ffe4e6; background:linear-gradient(135deg,rgba(244,63,94,.24),rgba(239,68,68,.11)); border:1px solid rgba(251,113,133,.35); }
.mc-triage-amber { color:#fde68a; background:rgba(245,158,11,.12); border:1px solid rgba(245,158,11,.25); }
.mc-triage-green { color:#bbf7d0; background:rgba(16,185,129,.11); border:1px solid rgba(16,185,129,.25); }
.mc-patient-name { font-weight:800; font-size:16px; color:#f8fafc; }
.mc-synopsis { color:#dbeafe; line-height:1.42; font-size:13px; }
.mc-open-btn { color:#fff; background:rgba(99,102,241,.18); border:1px solid rgba(139,92,246,.36); border-radius:10px; padding:9px 13px; font-weight:900; display:inline-flex; justify-content:center; text-decoration:none; }
.mc-open-btn:hover { background:linear-gradient(135deg,var(--accent),#8b5cf6); }
.mc-tech-detail { display:none; color:var(--text-muted); font-size:11px; margin-top:4px; }
#page-studies.show-tech .mc-tech-detail { display:block; }
.mc-empty { margin:18px; background:rgba(255,255,255,.035); padding:24px; border-radius:16px; color:var(--text-secondary); border:1px solid var(--border2); }
@media (max-width:1180px) { .mc-case-card { grid-template-columns:1fr; } .mc-report-cards { grid-template-columns:1fr 1fr; } .mc-report-hero { grid-template-columns:1fr; } }
@media (max-width:760px) { .mc-report-topbar { flex-direction:column; align-items:stretch; } .mc-report-cards { grid-template-columns:1fr; } }


/* ── Mission Control Complete Card Refresh ─────────────────────
   Linear-style operational cards: every card explains purpose, source,
   and live/error/empty state instead of implying truth by decoration.
──────────────────────────────────────────────────────────────── */
.card,
.stat-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.022));
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 18px 55px rgba(0,0,0,.22);
}
.card::before,
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(113,112,255,.55), transparent);
  opacity: .55;
  pointer-events: none;
}
.card:hover,
.stat-card:hover { border-color: rgba(113,112,255,.24); background: linear-gradient(180deg, rgba(255,255,255,.072), rgba(255,255,255,.032)); }

.mc-card-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.mc-card-title {
  color:var(--text-primary);
  font-size:13px;
  font-weight:750;
  letter-spacing:-.01em;
}
.mc-card-purpose {
  color:var(--text-muted);
  font-size:11.5px;
  line-height:1.4;
  margin-top:2px;
}
.mc-source-chip,
.mc-state-strip {
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid rgba(255,255,255,.085);
  background:rgba(255,255,255,.035);
  color:var(--text-muted);
  border-radius:999px;
  padding:3px 8px;
  font-size:10.5px;
  font-weight:700;
  letter-spacing:.02em;
  white-space:nowrap;
}
.mc-state-strip { margin-top:10px; width:max-content; }
.mc-state-strip.is-live,
.stat-card.is-live .mc-source-chip { color:#bbf7d0; border-color:rgba(16,185,129,.34); background:rgba(16,185,129,.10); }
.mc-state-strip.is-empty,
.stat-card.is-empty .mc-source-chip { color:#fde68a; border-color:rgba(245,158,11,.32); background:rgba(245,158,11,.10); }
.mc-state-strip.is-disconnected,
.stat-card.is-disconnected .mc-source-chip { color:#fecaca; border-color:rgba(239,68,68,.34); background:rgba(239,68,68,.10); }
.stat-card.is-disconnected { border-color:rgba(239,68,68,.22); }
.stat-card.is-empty { border-color:rgba(245,158,11,.20); }
.stat-card.is-live { border-color:rgba(16,185,129,.18); }

.stat-card .stat-label { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.stat-card .stat-label::after { content: attr(data-source); color:var(--text-muted); font-size:10px; text-transform:none; letter-spacing:0; font-weight:650; opacity:.8; }
.stat-value { font-weight:650; }

.mc-doc-hero {
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);
  gap:16px;
  align-items:stretch;
  margin-bottom:16px;
}
.mc-doc-hero-main,
.mc-doc-feature-card {
  border:1px solid rgba(255,255,255,.09);
  border-radius:22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(113,112,255,.18), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.024));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 24px 70px rgba(0,0,0,.26);
  padding:20px;
  overflow:hidden;
}
.mc-doc-kicker { color:#a5b4fc; font-size:11px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; margin-bottom:8px; }
.mc-doc-title { font-size:28px; line-height:1.05; letter-spacing:-.04em; font-weight:720; margin-bottom:8px; }
.mc-doc-copy { color:var(--text-secondary); font-size:13px; line-height:1.55; max-width:760px; }
.mc-doc-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }
.mc-doc-feature-card { display:flex; flex-direction:column; gap:10px; }
.mc-doc-feature-title { font-weight:760; font-size:14px; color:var(--text-primary); }
.mc-doc-feature-meta { color:var(--text-muted); font-size:11.5px; line-height:1.45; }
.mc-doc-feature-row { display:flex; align-items:center; justify-content:space-between; gap:10px; border-top:1px solid var(--border2); padding-top:10px; margin-top:auto; }

.mc-function-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.mc-function-card { border:1px solid var(--border2); border-radius:16px; padding:12px; background:rgba(255,255,255,.028); }
.mc-function-title { font-weight:750; font-size:12.5px; color:var(--text-primary); }
.mc-function-copy { margin-top:4px; color:var(--text-muted); font-size:11.5px; line-height:1.45; }

@media (max-width: 1100px) {
  .mc-doc-hero { grid-template-columns:1fr; }
  .mc-function-grid { grid-template-columns:1fr; }
}


/* ── Bot Control Pages ──────────────────────────────────────── */
.bot-control-shell { display:flex; flex-direction:column; gap:16px; }
.bot-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; border:1px solid var(--border); border-radius:24px; padding:20px; background:radial-gradient(circle at 12% 0%,rgba(103,232,249,.14),transparent 32%),linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.024)); box-shadow:var(--shadow); }
.bot-identity { display:flex; gap:14px; align-items:flex-start; }
.bot-avatar { width:44px; height:44px; border-radius:15px; display:flex; align-items:center; justify-content:center; color:white; font-size:22px; background:linear-gradient(135deg,var(--accent),var(--violet)); box-shadow:0 0 35px rgba(99,102,241,.22); }
.bot-title { font-size:22px; font-weight:780; letter-spacing:-.04em; }
.bot-subtitle { color:var(--text-secondary); font-size:12.5px; margin-top:3px; }
.bot-action-row { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.bot-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.bot-two-col { display:grid; grid-template-columns:1.2fr .8fr; gap:16px; }
.bot-kv { display:grid; grid-template-columns:150px 1fr; gap:8px 12px; font-size:12px; }
.bot-kv div:nth-child(odd) { color:var(--text-muted); }
.bot-code { font-family:var(--font-mono); font-size:11px; color:var(--text-secondary); white-space:pre-wrap; overflow:auto; max-height:180px; background:rgba(0,0,0,.22); border:1px solid var(--border2); border-radius:12px; padding:10px; }
@media(max-width:1100px){ .bot-grid,.bot-two-col{grid-template-columns:1fr}.bot-hero{flex-direction:column}.bot-action-row{justify-content:flex-start} }
