:root {
  --bg: #0a1020;
  --bg-2: #0f1730;
  --panel: #131c36;
  --panel-2: #1a2547;
  --text: #eef3ff;
  --muted: #96a3c7;
  --accent: #7aa2ff;
  --accent-2: #9c7dff;
  --good: #2fd39b;
  --warn: #ffbd59;
  --danger: #ff718a;
  --border: #253255;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
}
button, input, textarea, select {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 12px;
}
button { cursor: pointer; background: var(--accent); color: #08101e; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
pre { margin: 0; }
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(12, 18, 37, 0.95);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.nav { display: grid; gap: 10px; }
.nav-link {
  text-align: left;
  background: transparent;
  color: var(--text);
}
.nav-link.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #08101e;
}
.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}
.content {
  padding: 24px;
  overflow: auto;
}
.view { display: none; }
.view.active { display: block; }
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.telemetry-grid, .two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.compact-panel { padding: 12px 18px; margin-bottom: 16px; }
.ticket-toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.panel, .card, .column {
  border: 1px solid var(--border);
  background: rgba(19, 28, 54, 0.96);
  border-radius: 18px;
}
.panel { padding: 18px; }
.card, .activity-item, .memory-item, .agent-item, .chat-item { padding: 12px; }
.column { padding: 12px; }
.panel-title, .inline-form, .form-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.panel-title { justify-content: space-between; margin-bottom: 12px; }
.inline-form { flex-wrap: wrap; }
.stack-form { display: grid; gap: 10px; }
.chat-list, .activity-list, .memory-list, .agent-list { max-height: 62vh; overflow: auto; padding-right: 4px; }
.chat-item, .activity-item, .memory-item, .agent-item, .card { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.03); }
.comment-item { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.chat-item.assistant { border-left: 4px solid var(--accent); }
.chat-item.user { border-left: 4px solid var(--accent-2); }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-right: 6px;
  background: rgba(122, 162, 255, 0.16);
  color: #bfd1ff;
}
.meta { color: var(--muted); font-size: 12px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-size: 12px; margin: 0 0 8px; }
.subtle { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pre-block, .pre-mini {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #d9e4ff;
}
.pre-block { min-height: 180px; }
.pre-mini { margin-top: 10px; }
.key-value-list { display: grid; gap: 10px; }
.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.spaced-top { margin-top: 10px; }
.status-online { color: var(--good); }
.status-standby { color: var(--warn); }
.status-offline { color: var(--danger); }
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-wrap { width: min(520px, 100% - 24px); }
.login-panel { padding: 22px; }
.error-text { color: var(--danger); }
@media (max-width: 1100px) {
  .app-shell, .stats-grid, .telemetry-grid, .two-col, .kanban {
    grid-template-columns: 1fr;
  }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .view-header { flex-direction: column; align-items: stretch; }
}
