:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-hover: #222633;
  --bg-input: #12141c;
  --border: #2a2e3a;
  --text: #e4e6ed;
  --text-dim: #8b8fa3;
  --text-muted: #5c6074;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --orange: #f97316;
  --cyan: #06b6d4;
  --sidebar-w: 220px;
  --sidebar-collapsed-w: 60px;
  --radius: 8px;
  --radius-sm: 6px;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-card: #ffffff;
  --bg-hover: #eef0f4;
  --bg-input: #f0f1f5;
  --border: #d8dbe3;
  --text: #1a1d27;
  --text-dim: #5c6074;
  --text-muted: #8b8fa3;
  --accent: #4f46e5;
  --accent-hover: #6366f1;
}

[data-theme="light"] .leaflet-tile-pane { filter: none; }
[data-theme="light"] .leaflet-control-zoom a { background: #fff !important; color: #333 !important; border-color: #ccc !important; }
[data-theme="light"] #map-canvas { background: #e8e8e8; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app-shell {
  display: block !important;
  width: 100%;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width 0.2s ease;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
}

.sidebar.collapsed .logo-text-accent,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sidebar-footer .version,
.sidebar.collapsed .sidebar-footer .btn-logout,
.sidebar.collapsed .sidebar-footer .theme-toggle-label {
  display: none;
}

.sidebar.collapsed .sidebar-logo { padding: 16px; justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }

.sidebar-toggle {
  position: absolute;
  top: 12px;
  right: -14px;
  width: 28px;
  height: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  z-index: 101;
  transition: transform 0.2s;
}

.sidebar-toggle:hover { color: var(--text); border-color: var(--accent); }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

/* Theme toggle in sidebar footer */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
}

.theme-toggle:hover { color: var(--text-dim); }
.theme-toggle-icon { font-size: 16px; }
.theme-toggle-label { font-size: 11px; }

.sidebar-logo {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.logo-icon { font-size: 24px; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
.logo-text-accent { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: var(--accent); }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item.active svg { stroke: #fff; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.version { font-size: 12px; color: var(--text-muted); }

/* Content */
.content {
  margin-left: var(--sidebar-w);
  margin-right: 0;
  padding: 24px 32px;
  width: calc(100vw - var(--sidebar-w));
  min-width: 0;
  transition: margin-left 0.2s ease, width 0.2s ease;
}

body.sidebar-collapsed .content {
  margin-left: var(--sidebar-collapsed-w);
  width: calc(100vw - var(--sidebar-collapsed-w));
}

.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.view-header h1 { font-size: 24px; font-weight: 600; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 24px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Buttons */
.btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* Agent Grid */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.agent-card:hover { border-color: var(--accent); transform: translateY(-1px); }

.agent-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.agent-name {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--red); }
.status-dot.connecting { background: var(--yellow); }

.agent-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.agent-metrics { display: flex; flex-direction: column; gap: 8px; }

.metric-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.metric-label {
  width: 36px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.metric-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.metric-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.metric-bar.cpu { background: var(--cyan); }
.metric-bar.ram { background: var(--accent); }
.metric-bar.disk { background: var(--orange); }
.metric-bar.warn { background: var(--yellow); }
.metric-bar.crit { background: var(--red); }

.metric-val {
  width: 40px;
  text-align: right;
  color: var(--text-dim);
  flex-shrink: 0;
}

.agent-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.agent-actions {
  display: flex;
  gap: 6px;
}

/* Agent card network info */
.agent-net-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.agent-net-info .net-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.agent-net-info .net-label { color: var(--text-muted); }
.agent-net-info .net-val { color: var(--text-dim); font-family: 'Cascadia Code', 'JetBrains Mono', monospace; font-size: 11px; }

.agent-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.agent-card-actions .btn { font-size: 11px; padding: 3px 8px; }

/* Logs modal */
.logs-output {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 12px;
  max-height: 60vh;
  overflow-y: auto;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-err { color: var(--red); }
.log-warn { color: var(--yellow); }
.log-crit { color: var(--red); font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr:hover { background: var(--bg-hover); }

/* Terminal */
.terminal {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
}

.terminal-output {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  line-height: 1.6;
}

.term-line { white-space: pre-wrap; word-break: break-all; }
.term-cmd { color: var(--cyan); }
.term-cmd::before { content: '$ '; color: var(--green); }
.term-stdout { color: var(--text); }
.term-stderr { color: var(--red); }
.term-info { color: var(--text-muted); font-style: italic; }
.term-exit-ok { color: var(--green); }
.term-exit-err { color: var(--red); }

.terminal-input-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  gap: 8px;
}

.terminal-prompt { color: var(--green); font-weight: 600; }

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.terminal-input:disabled { opacity: 0.5; }

/* Select */
.select-agent {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
  min-width: 180px;
}

.select-agent option { background: var(--bg-card); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 640px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 18px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }

.modal-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-metric {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.modal-metric-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.modal-metric-value { font-size: 20px; font-weight: 600; }
.modal-metric-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal-info {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.modal-info dt { color: var(--text-muted); font-size: 11px; text-transform: uppercase; margin-top: 8px; }
.modal-info dd { margin-left: 0; margin-top: 2px; }

/* Forms */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-row input,
.form-row select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.form-row input:focus,
.form-row select:focus { border-color: var(--accent); }

.form-actions { display: flex; gap: 8px; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

.badge-green { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-yellow { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-dim { background: rgba(91,96,116,0.2); color: var(--text-dim); }

/* Misc */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.refresh-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  opacity: 0;
  transition: opacity 0.3s;
}

.refresh-indicator.active { opacity: 1; }

.mono { font-family: 'Cascadia Code', 'JetBrains Mono', monospace; font-size: 12px; }

.truncate { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  z-index: 300;
  animation: toastIn 0.3s ease;
}

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Login */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 360px;
  text-align: center;
}

.login-logo {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--accent);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-card .form-row { margin-bottom: 16px; }

.login-card .form-row input {
  text-align: center;
  padding: 12px 16px;
  font-size: 14px;
}

.login-btn {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
}

.login-error {
  margin-top: 12px;
  color: var(--red);
  font-size: 13px;
  min-height: 20px;
}

/* Logout */
.btn-logout {
  margin-top: 8px;
  width: 100%;
  font-size: 11px;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-logout:hover { color: var(--red); border-color: var(--red); }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Badge blue */
.badge-blue { background: rgba(99,102,241,0.15); color: var(--accent); }

/* PPR overdue pulse */
.badge-red { animation: pulse-red 2s infinite; }
@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Map View */
.map-container {
  position: relative;
  height: calc(100vh - 80px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

#map-canvas {
  width: 100%;
  height: 100%;
  background: #1a1d27;
}

.map-panel {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 300px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  transition: transform 0.3s ease;
}

.map-panel.collapsed {
  transform: translateX(-300px);
}

.map-panel.collapsed .map-panel-toggle svg {
  transform: rotate(180deg);
}

.map-panel-toggle {
  position: absolute;
  top: 12px;
  right: -32px;
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  transition: color 0.15s;
}

.map-panel-toggle:hover { color: var(--text); }

.map-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.map-panel-header {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.map-panel-search input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
  margin-bottom: 12px;
}

.map-panel-search input:focus { border-color: var(--accent); }

.map-panel-section { margin-bottom: 16px; }

.map-panel-section-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.map-panel-section-title:hover { color: var(--text-dim); }

.map-panel-list { display: flex; flex-direction: column; gap: 4px; }

.map-panel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: grab;
  transition: background 0.15s;
  user-select: none;
}

.map-panel-item:hover { background: var(--bg-hover); }
.map-panel-item.dragging { opacity: 0.5; cursor: grabbing; }
.map-panel-item.placed { border-left: 2px solid var(--green); }

.map-panel-item .item-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.map-panel-item .item-icon.group-icon { background: rgba(99,102,241,0.2); color: var(--accent); }
.map-panel-item .item-icon.agent-icon { background: rgba(34,197,94,0.2); color: var(--green); }
.map-panel-item .item-icon.agent-icon.offline { background: rgba(239,68,68,0.2); color: var(--red); }

.map-panel-item .item-info { flex: 1; min-width: 0; }
.map-panel-item .item-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-panel-item .item-sub { font-size: 11px; color: var(--text-muted); }

/* Hierarchy on dashboard */
.group-section { margin-bottom: 24px; }
.group-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s;
}
.group-section-header:hover { border-color: var(--accent); }
.group-section-header .group-badge {
  background: rgba(99,102,241,0.15);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.group-section-header .group-label {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}
.group-section-header .group-stats {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
}

/* Agent table group badge */
.agent-group-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  background: rgba(99,102,241,0.12);
  color: var(--accent);
  margin-left: 4px;
}

/* Leaflet dark tiles */
.leaflet-container { background: #1a1d27; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(1.1) saturate(0.3); }
.leaflet-marker-pane { filter: none; }
.leaflet-popup-pane { filter: none; }
.leaflet-control-zoom a { background: var(--bg-card) !important; color: var(--text) !important; border-color: var(--border) !important; }
.leaflet-control-zoom a:hover { background: var(--bg-hover) !important; }

.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}
.leaflet-popup-tip { background: var(--bg-card) !important; border: 1px solid var(--border) !important; }
.leaflet-popup-content { margin: 12px 16px !important; font-size: 13px; }

/* Custom map markers */
.map-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.3);
}

.map-marker.marker-group { background: var(--accent); }
.map-marker.marker-agent { background: var(--green); }
.map-marker.marker-agent.offline { background: var(--red); }

/* Terminal available commands */
.term-commands {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
}

.term-commands-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
  margin-bottom: 4px;
}

.term-cmd-btn {
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-dim);
  font-size: 11px;
  font-family: 'Cascadia Code', 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.15s;
}

.term-cmd-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-hover); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: var(--sidebar-collapsed-w); }
  .sidebar .logo-text-accent,
  .sidebar .nav-item span,
  .sidebar-footer .version,
  .sidebar-footer .btn-logout,
  .sidebar-footer .theme-toggle-label { display: none; }
  .sidebar-logo { padding: 16px; justify-content: center; }
  .nav-item { justify-content: center; padding: 12px; }
  .sidebar-toggle { display: none; }
  .content { margin-left: var(--sidebar-collapsed-w); padding: 16px; }
  .agent-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .modal { width: 95%; }
}
