* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0f1117; --bg-card: #1a1d27; --bg-sidebar: #141620;
  --border: #2a2d3a; --text: #e4e4e7; --text-muted: #8b8d9a;
  --accent: #6366f1; --green: #22c55e; --blue: #3b82f6;
  --yellow: #eab308; --red: #ef4444; --gray: #6b7280;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 240px; background: var(--bg-sidebar); border-right: 1px solid var(--border); padding: 24px 0; display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100; }
.sidebar-brand { padding: 0 20px 24px; border-bottom: 1px solid var(--border); }
.sidebar-brand h1 { font-size: 16px; font-weight: 700; color: var(--accent); letter-spacing: 0.5px; }
.sidebar-brand p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--text-muted); text-decoration: none; font-size: 14px; transition: all 0.15s; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: var(--text); background: rgba(99,102,241,0.1); }
.sidebar-nav a.active { border-right: 2px solid var(--accent); }
.sidebar-nav .icon { width: 18px; text-align: center; }

/* Main */
.main { margin-left: 240px; flex: 1; padding: 24px 32px; min-height: 100vh; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.stat-card .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat-card .sub { font-size: 12px; color: var(--text-muted); }

/* Cards grid */
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; margin-bottom: 24px; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.panel h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.panel h2 .count { background: var(--accent); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }

/* Agent cards */
.agent-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.agent-item:last-child { border-bottom: none; }
.agent-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.agent-info { flex: 1; }
.agent-info .name { font-weight: 600; font-size: 14px; }
.agent-info .role { font-size: 12px; color: var(--text-muted); }

/* Status badges */
.badge { font-size: 11px; padding: 3px 10px; border-radius: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-active { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-built { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-blocked { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-planned { background: rgba(107,114,128,0.15); color: var(--gray); }
.badge-paused { background: rgba(107,114,128,0.15); color: var(--gray); }
.badge-pending { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-approved { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-denied { background: rgba(239,68,68,0.15); color: var(--red); }

/* Project cards */
.project-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.project-item:last-child { border-bottom: none; }
.project-item .proj-header { display: flex; justify-content: space-between; align-items: center; }
.project-item .proj-name { font-weight: 600; font-size: 14px; }
.project-item .proj-status { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Activity */
.activity-item { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.activity-dot.build { background: var(--blue); }
.activity-dot.system { background: var(--accent); }
.activity-dot.decision { background: var(--green); }
.activity-dot.policy { background: var(--yellow); }
.activity-dot.milestone { background: var(--green); }
.activity-text { font-size: 13px; flex: 1; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.activity-agent { font-size: 11px; color: var(--accent); font-weight: 600; }

/* Blocker */
.blocker-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.blocker-item:last-child { border-bottom: none; }
.blocker-item .blocker-title { font-weight: 600; font-size: 13px; color: var(--yellow); }
.blocker-item .blocker-project { font-size: 12px; color: var(--text-muted); }

/* Approval actions */
.approval-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.approval-item:last-child { border-bottom: none; }
.approval-actions { display: flex; gap: 8px; margin-top: 8px; }
.btn { padding: 5px 14px; border-radius: 6px; border: none; font-size: 12px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn-approve { background: var(--green); color: #fff; }
.btn-deny { background: var(--red); color: #fff; }

/* Scrollable panels */
.panel-scroll { max-height: 400px; overflow-y: auto; }
.panel-scroll::-webkit-scrollbar { width: 4px; }
.panel-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Memory view */
.memory-content { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; font-family: 'SF Mono', Monaco, monospace; font-size: 13px; white-space: pre-wrap; max-height: 500px; overflow-y: auto; color: var(--text-muted); }

/* Page sections (hidden by default) */
.page { display: none; }
.page.active { display: block; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-brand p, .sidebar-nav span { display: none; }
  .sidebar-brand h1 { font-size: 12px; }
  .main { margin-left: 60px; padding: 16px; }
  .panel-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
