/* MC Dashboard V2 — Design System */

:root {
  /* Surfaces */
  --bg-primary: #1E1E1E;
  --bg-secondary: #2D2D2D;
  --bg-tertiary: #3D3D3D;
  --bg-overlay: rgba(0, 0, 0, 0.6);

  /* Borders */
  --border: #4D4D4D;
  --border-subtle: #3A3A3A;

  /* Text */
  --text-primary: #E8E8E8;
  --text-secondary: #A8A8A8;
  --text-muted: #6E6E6E;

  /* Status */
  --status-success: #2ECC71;
  --status-error: #E74C3C;
  --status-warning: #F39C12;
  --status-idle: #95A5A6;
  --status-info: #3498DB;

  /* Agent colors */
  --agent-atlas: #FFFFFF;
  --agent-viper: #2ECC71;
  --agent-quill: #3498DB;
  --agent-forge: #F39C12;
  --agent-radar: #9B59B6;

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 32px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;

  /* Sidebar */
  --sidebar-width: 220px;
}

/* === Reset & Base === */

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

html, body {
  height: 100%;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

a { color: var(--status-info); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

/* === Layout === */

.v2-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.v2-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.v2-sidebar-header {
  padding: var(--gap-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.v2-sidebar-header h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.v2-sidebar-header .version-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--status-success);
  color: var(--status-success);
  font-family: 'JetBrains Mono', monospace;
  opacity: 0.7;
}

.v2-sidebar-nav {
  padding: var(--gap-sm) 0;
  flex: 1;
}

.v2-nav-item {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 10px var(--gap-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  border-left: 3px solid transparent;
}

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

.v2-nav-item.active {
  background: rgba(46, 204, 113, 0.08);
  color: var(--status-success);
  border-left-color: var(--status-success);
}

.v2-nav-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.v2-nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.v2-nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.v2-sidebar-footer {
  padding: var(--gap-md);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.v2-sidebar-footer .sse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-idle);
  transition: background var(--transition-normal);
}

.v2-sidebar-footer .sse-dot.connected { background: var(--status-success); }
.v2-sidebar-footer .sse-dot.error { background: var(--status-error); }

/* Main content */
.v2-main {
  flex: 1;
  overflow-y: auto;
  padding: var(--gap-lg);
  padding-bottom: 56px; /* space for collapsed chat pane */
}

.v2-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-lg);
}

.v2-main-header h2 {
  font-size: 20px;
  font-weight: 600;
}

/* === KPI Tiles === */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-md);
  margin-bottom: var(--gap-lg);
}

.kpi-tile {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--gap-md);
}

.kpi-tile .kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--gap-xs);
}

.kpi-tile .kpi-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.kpi-tile .kpi-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: var(--gap-xs);
}

/* === Agent Cards Grid === */

.agent-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap-md);
  margin-bottom: var(--gap-lg);
}

.agent-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--gap-md);
  border-left: 3px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.agent-card:hover {
  background: var(--bg-tertiary);
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-sm);
}

.agent-card-icon {
  font-size: 20px;
}

.agent-card-name {
  font-weight: 600;
  font-size: 14px;
}

.agent-card-role {
  font-size: 11px;
  color: var(--text-muted);
}

.agent-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--gap-sm);
  font-size: 12px;
}

.agent-card-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.active { background: var(--status-success); box-shadow: 0 0 6px var(--status-success); }
.status-dot.idle { background: var(--status-idle); }
.status-dot.error { background: var(--status-error); box-shadow: 0 0 6px var(--status-error); }

.agent-card-last-activity {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--gap-sm);
  font-family: 'JetBrains Mono', monospace;
}

.agent-card.expanded {
  background: var(--bg-tertiary);
}

.agent-card-detail {
  margin-top: var(--gap-sm);
  padding-top: var(--gap-sm);
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.agent-card-detail-item {
  display: flex;
  gap: 0.5rem;
  padding: 3px 0;
  line-height: 1.35;
}

.agent-card-detail-time {
  flex-shrink: 0;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  min-width: 2.5rem;
}

.agent-card-detail-text {
  color: var(--text-secondary);
}

/* Activity feed expanded item */
.activity-item.expanded .activity-data {
  white-space: normal;
  -webkit-line-clamp: unset;
}

/* === Content Split (Activity Feed + Approvals) === */

.content-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--gap-lg);
}

/* === Activity Feed === */

.activity-feed {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: 500px;
}

.activity-feed-header {
  padding: var(--gap-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
}

.activity-feed-header .new-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--status-info);
  color: white;
  font-weight: 500;
  display: none;
}

.activity-feed-header .new-badge.visible { display: inline-block; }

.activity-feed-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--gap-sm);
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-sm);
  padding: var(--gap-sm);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

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

.activity-item .agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-item .activity-content {
  flex: 1;
  min-width: 0;
}

.activity-item .activity-type {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.activity-item .activity-data {
  font-size: 11px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: default;
}

.activity-item .activity-time {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

/* === Approval Inbox === */

.approval-inbox {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: 500px;
}

.approval-inbox-header {
  padding: var(--gap-md);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.approval-inbox-header .count-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--status-warning);
  color: white;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

.approval-inbox-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--gap-sm);
}

.approval-item {
  padding: var(--gap-sm) var(--gap-md);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
  margin-bottom: var(--gap-sm);
  background: var(--bg-primary);
}

.approval-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-xs);
}

.approval-item-title {
  font-size: 13px;
  font-weight: 500;
}

.approval-item-age {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.approval-item-agent {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: var(--gap-sm);
}

.approval-item-actions {
  display: flex;
  gap: var(--gap-sm);
  align-items: center;
}

/* Approval detail panel */
.approval-item.expanded {
  background: var(--bg-tertiary);
}

.approval-detail {
  margin: 0.5rem 0;
  padding: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.approval-detail-section {
  margin-bottom: 0.75rem;
}

.approval-detail-section:last-of-type {
  margin-bottom: 0.5rem;
}

.approval-detail-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.approval-detail-text {
  color: var(--text-primary);
  white-space: pre-wrap;
}

.approval-detail-field {
  display: flex;
  gap: 0.75rem;
  padding: 2px 0;
}

.approval-detail-field-key {
  color: var(--text-muted);
  text-transform: capitalize;
  min-width: 6rem;
  flex-shrink: 0;
}

.approval-detail-field-val {
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}

.approval-detail-path-item {
  display: flex;
  gap: 0.5rem;
  padding: 3px 0;
  border-left: 2px solid var(--border-subtle);
  padding-left: 0.5rem;
  margin-left: 0.25rem;
}

.approval-detail-path-time {
  flex-shrink: 0;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  min-width: 3rem;
}

.approval-detail-path-text {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.approval-detail-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
}

.approval-item-feedback {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  resize: none;
}

.approval-item-feedback::placeholder { color: var(--text-muted); }

.btn-approve, .btn-reject {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  transition: opacity var(--transition-fast);
}

.btn-approve {
  background: var(--status-success);
  color: #111;
}

.btn-reject {
  background: var(--status-error);
  color: white;
}

.btn-approve:hover, .btn-reject:hover { opacity: 0.85; }
.btn-approve:disabled, .btn-reject:disabled { opacity: 0.4; cursor: not-allowed; }

.approval-empty {
  padding: var(--gap-lg);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* === Auth Overlay === */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.auth-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-xl);
  width: 360px;
}

.auth-box h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--gap-md);
}

.auth-box input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  margin-bottom: var(--gap-md);
}

.auth-box input:focus {
  outline: none;
  border-color: var(--status-info);
}

.auth-box .auth-btn {
  width: 100%;
  padding: 10px;
  background: var(--status-info);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
}

.auth-box .auth-error {
  color: var(--status-error);
  font-size: 12px;
  margin-top: var(--gap-sm);
  display: none;
}

/* === Utility === */

.hidden { display: none !important; }

.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === Module Tabs === */

.module-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: var(--gap-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  width: fit-content;
}

.module-tab {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.module-tab:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.module-tab.active { background: var(--bg-tertiary); color: var(--text-primary); }

/* === Split Pane === */

.split-pane {
  display: flex;
  gap: var(--gap-md);
  min-height: 400px;
}

.split-pane-master {
  flex-shrink: 0;
  overflow-y: auto;
}

.split-pane-detail {
  flex: 1;
  min-width: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--gap-md);
  overflow-y: auto;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.split-pane-detail.has-content {
  align-items: flex-start;
  justify-content: flex-start;
  color: var(--text-primary);
  display: block;
}

/* === Detail Panel === */

.detail-panel { }

.detail-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--gap-md);
  padding-bottom: var(--gap-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.detail-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: var(--gap-md);
  margin-bottom: var(--gap-sm);
}

.detail-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.detail-stat-label { color: var(--text-secondary); }
.detail-stat-value { font-weight: 500; }

.detail-list-item {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 6px 0;
  font-size: 12px;
}

.detail-list-name { font-weight: 500; }
.detail-list-sub { color: var(--text-muted); font-size: 11px; }

.detail-note {
  margin-top: var(--gap-md);
  padding: var(--gap-sm) var(--gap-md);
  background: rgba(231, 76, 60, 0.1);
  border-left: 3px solid var(--status-error);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-actions {
  display: flex;
  gap: var(--gap-sm);
  margin-top: var(--gap-md);
  padding-top: var(--gap-md);
  border-top: 1px solid var(--border);
}

.dm-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--status-info);
  color: white;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.interaction-channel {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}

/* === Data Table === */

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.data-table thead th:hover { color: var(--text-primary); }

.data-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: var(--bg-tertiary); }

.data-table-empty {
  text-align: center;
  padding: var(--gap-lg) !important;
  color: var(--text-muted);
}

.sort-arrow {
  font-size: 10px;
  color: var(--text-muted);
}

/* === Stage Badge === */

.stage-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 10px;
  white-space: nowrap;
}

.content-status-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 10px;
  white-space: nowrap;
  text-transform: capitalize;
}

/* === Kanban Board === */

.kanban-board {
  display: flex;
  gap: var(--gap-sm);
  overflow-x: auto;
  padding-bottom: var(--gap-sm);
}

.kanban-col {
  min-width: 140px;
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  padding: var(--gap-sm) var(--gap-sm);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kanban-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-count {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
}

.kanban-list {
  flex: 1;
  min-height: 60px;
  padding: var(--gap-xs);
  overflow-y: auto;
  max-height: 400px;
}

.kanban-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--gap-sm);
  margin-bottom: var(--gap-xs);
  cursor: grab;
  transition: border-color var(--transition-fast);
}

.kanban-card:hover { border-color: var(--border); }

.kanban-card-title {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 2px;
}

.kanban-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.kanban-card-value {
  font-size: 11px;
  color: var(--status-success);
  margin-top: 4px;
}

.kanban-ghost {
  opacity: 0.4;
  background: var(--bg-tertiary);
}

/* === Content Calendar === */

.content-calendar {
  width: 100%;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-md);
}

.calendar-nav-btn {
  padding: 4px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: background var(--transition-fast);
}

.calendar-nav-btn:hover { background: var(--bg-tertiary); }

.calendar-month-label {
  font-weight: 600;
  font-size: 15px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 1px;
}

.calendar-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendar-day {
  background: var(--bg-secondary);
  min-height: 80px;
  padding: 4px 6px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.calendar-day:hover { background: var(--bg-tertiary); }
.calendar-day.out-of-month { opacity: 0.3; }
.calendar-day.today { background: rgba(52, 152, 219, 0.08); }

.calendar-day-num {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 2px;
}

.calendar-day.today .calendar-day-num { color: var(--status-info); font-weight: 700; }

.calendar-event-dot {
  font-size: 10px;
  padding: 1px 4px;
  background: rgba(52, 152, 219, 0.15);
  border-radius: 2px;
  color: var(--agent-quill);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.calendar-event-dot:hover { background: rgba(52, 152, 219, 0.3); }

.calendar-more {
  font-size: 9px;
  color: var(--text-muted);
  padding: 1px 4px;
}

/* Content preview */

.content-preview {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--gap-md);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

/* === Priority Badge (Intel) === */

.priority-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 10px;
  white-space: nowrap;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

/* === Filter Bar (Intel) === */

.filter-bar {
  display: flex;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-md);
  align-items: center;
}

.filter-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.filter-select:focus { outline: none; border-color: var(--status-info); }

.filter-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  flex: 1;
  max-width: 200px;
}

.filter-input::placeholder { color: var(--text-muted); }
.filter-input:focus { outline: none; border-color: var(--status-info); }

/* === Budget Bars === */

.budget-bars {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.budget-bar-wrap {
  padding: var(--gap-sm) var(--gap-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.budget-bar-wrap:hover { background: var(--bg-tertiary); }

.budget-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--gap-xs);
  font-size: 13px;
}

.budget-bar {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-normal);
  min-width: 2px;
}

.budget-alert {
  font-size: 11px;
  color: var(--status-warning);
  margin-top: var(--gap-xs);
  font-weight: 500;
}

/* === Burn Chart (Budget) === */

.burn-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding: var(--gap-sm) 0;
}

.burn-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.burn-chart-bar {
  width: 100%;
  max-width: 24px;
  background: var(--status-info);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height var(--transition-normal);
}

.burn-chart-bar:hover { opacity: 0.8; }

.burn-chart-label {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
}

/* === Chat Pane === */

.chat-pane {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: height var(--transition-normal);
  height: 42px;
  overflow: hidden;
}

.chat-pane.expanded {
  height: 340px;
}

.chat-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--gap-md);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.chat-toggle-bar:hover { background: var(--bg-tertiary); }

.chat-toggle-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.chat-toggle-hint {
  font-size: 10px;
  color: var(--text-muted);
}

.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  overflow: hidden;
}

.chat-input-wrap {
  display: flex;
  gap: var(--gap-sm);
  padding: var(--gap-sm) var(--gap-md);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.chat-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
}

.chat-input::placeholder { color: var(--text-muted); }
.chat-input:focus { outline: none; border-color: var(--status-info); }

.chat-submit {
  padding: 8px 14px;
  background: var(--status-info);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: opacity var(--transition-fast);
}

.chat-submit:hover { opacity: 0.85; }
.chat-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Autocomplete */
.chat-autocomplete {
  position: absolute;
  bottom: 100%;
  left: var(--gap-md);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 160px;
  z-index: 60;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
}

.chat-ac-item {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.chat-ac-item:hover, .chat-ac-item.active { background: var(--bg-tertiary); }

.chat-ac-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Chat content: history + quick actions */
.chat-content {
  flex: 1;
  display: flex;
  gap: var(--gap-md);
  overflow: hidden;
  padding: var(--gap-sm) var(--gap-md);
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

.chat-history-empty {
  text-align: center;
  padding: var(--gap-lg);
  color: var(--text-muted);
  font-size: 12px;
}

.chat-quick-actions {
  width: 240px;
  flex-shrink: 0;
  overflow-y: auto;
  border-left: 1px solid var(--border-subtle);
  padding-left: var(--gap-md);
}

/* Directive items */
.directive-item {
  padding: var(--gap-sm);
  border-radius: var(--radius-sm);
  margin-bottom: var(--gap-xs);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
}

.directive-item.directive-error {
  border-color: var(--status-error);
  color: var(--status-error);
  font-size: 12px;
}

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

.directive-agent {
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.directive-status {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.directive-message {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.directive-result {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.directive-time {
  font-size: 10px;
  color: var(--text-muted);
}

/* Quick Actions */
.quick-actions-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.quick-action-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-action-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.quick-action-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.quick-action-btn {
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
}

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

/* Responsive: collapse sidebar on narrow screens */
@media (max-width: 900px) {
  .v2-sidebar { width: 56px; min-width: 56px; }
  .v2-nav-item span:not(.nav-icon) { display: none; }
  .v2-sidebar-header h1,
  .v2-sidebar-header .version-badge,
  .v2-sidebar-footer span { display: none; }
  .agent-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .content-split { grid-template-columns: 1fr; }
  .split-pane { flex-direction: column; }
  .split-pane-master { width: 100% !important; }
  .kanban-board { flex-wrap: wrap; }
  .kanban-col { min-width: 120px; }
  .calendar-grid { grid-template-columns: repeat(7, 1fr); }
  .calendar-day { min-height: 50px; }
  .chat-pane { left: 56px; }
  .chat-quick-actions { display: none; }
}

/* ── Agent Feedback Section ── */
.feedback-section { margin: 1rem 0; }
.feedback-section-header {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.5rem; font-size: 0.9rem;
}
.feedback-list { display: flex; flex-direction: column; gap: 0.5rem; }
.feedback-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--border); border-radius: 6px;
  padding: 0.75rem 1rem;
}
.feedback-card-top {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem;
}
.feedback-type-badge {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  padding: 0.1rem 0.4rem; border: 1px solid var(--border);
  border-radius: 3px; color: var(--text-secondary);
}
