/* Miniforge Web Dashboard - Production Styles
 * Mid-century modern industrial aesthetic
 * Themeable design system (dark, light, high-contrast)
 * No build step required
 */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Roboto+Condensed:wght@400;700&family=Roboto+Mono:wght@400;500&display=swap');

/*============================================================================*/
/* THEME SYSTEM - Mid-Century Modern Industrial Aesthetic                    */
/*============================================================================*/

/* Default theme: Aurora Dark */
:root,
[data-theme="aurora_dark"],
[data-theme="dark"] {
  --bg-primary: #1e1b4b;
  --bg-secondary: #3d005b;
  --bg-tertiary: rgba(102, 0, 153, 0.55);
  --bg-hover: #312d81;

  --text-primary: #fffbf1;
  --text-secondary: #d1b2e0;
  --text-muted: #b0a0d6;

  --color-brand-primary: #ffc721;
  --color-brand-secondary: #ffb12e;

  --color-risk-critical: #f75680;
  --color-pr-ready: #82d99e;
  --color-pr-blocked: #ff8c2e;
  --color-train-active: #49d5e0;

  --color-status-success: #82d99e;
  --color-status-warning: #ff8c2e;
  --color-status-error: #f75680;
  --color-status-info: #49d5e0;

  --color-kanban-blocked: #ff8c2e;
  --color-kanban-ready: #49d5e0;
  --color-kanban-running: #ffc780;
  --color-kanban-done: #82d99e;

  --border-color: rgba(143, 96, 194, 0.46);
  --border-active: var(--color-brand-primary);

  --shadow-sm: 0 1px 3px rgba(40, 28, 92, 0.28);
  --shadow-md: 0 4px 6px rgba(40, 28, 92, 0.34);
  --shadow-lg: 0 10px 20px rgba(40, 28, 92, 0.42);
}

[data-theme="warm_light"] {
  --bg-primary: #f5f0e6;
  --bg-secondary: #fffaf2;
  --bg-tertiary: rgba(237, 209, 199, 0.72);
  --bg-hover: #eadfd2;

  --text-primary: #1f292e;
  --text-secondary: #66757f;
  --text-muted: #7b878e;

  --color-brand-primary: #9c3d1f;
  --color-brand-secondary: #7f3118;

  --color-risk-critical: #cc2e38;
  --color-pr-ready: #52734d;
  --color-pr-blocked: #a87319;
  --color-train-active: #2494a3;

  --color-status-success: #52734d;
  --color-status-warning: #a87319;
  --color-status-error: #cc2e38;
  --color-status-info: #2494a3;

  --color-kanban-blocked: #a87319;
  --color-kanban-ready: #2494a3;
  --color-kanban-running: #c7a13b;
  --color-kanban-done: #52734d;

  --border-color: #d6c9b8;
  --border-active: var(--color-brand-primary);

  --shadow-sm: 0 1px 3px rgba(61, 40, 28, 0.09);
  --shadow-md: 0 4px 6px rgba(61, 40, 28, 0.13);
  --shadow-lg: 0 10px 20px rgba(61, 40, 28, 0.18);
}

[data-theme="cool_light"] {
  --bg-primary: #f0f2f7;
  --bg-secondary: #f7faff;
  --bg-tertiary: rgba(219, 230, 245, 0.78);
  --bg-hover: #dde7f5;

  --text-primary: #1a2433;
  --text-secondary: #6b7a8f;
  --text-muted: #808d9e;

  --color-brand-primary: #2e66a6;
  --color-brand-secondary: #244f83;

  --color-risk-critical: #ad382e;
  --color-pr-ready: #388562;
  --color-pr-blocked: #b37a1f;
  --color-train-active: #1f99a8;

  --color-status-success: #388562;
  --color-status-warning: #b37a1f;
  --color-status-error: #ad382e;
  --color-status-info: #1f99a8;

  --color-kanban-blocked: #b37a1f;
  --color-kanban-ready: #1f99a8;
  --color-kanban-running: #c39a2f;
  --color-kanban-done: #388562;

  --border-color: #c7d0de;
  --border-active: var(--color-brand-primary);

  --shadow-sm: 0 1px 3px rgba(26, 35, 50, 0.08);
  --shadow-md: 0 4px 6px rgba(26, 35, 50, 0.12);
  --shadow-lg: 0 10px 20px rgba(26, 35, 50, 0.16);
}

[data-theme="royal_light"] {
  --bg-primary: #f8f2fc;
  --bg-secondary: #fbf6fd;
  --bg-tertiary: rgba(232, 213, 245, 0.82);
  --bg-hover: #ede0f6;

  --text-primary: #3e135a;
  --text-secondary: #73588e;
  --text-muted: #8b74a5;

  --color-brand-primary: #7b32a5;
  --color-brand-secondary: #602781;

  --color-risk-critical: #c55179;
  --color-pr-ready: #509c76;
  --color-pr-blocked: #ba8d3e;
  --color-train-active: #1f95af;

  --color-status-success: #509c76;
  --color-status-warning: #ba8d3e;
  --color-status-error: #c55179;
  --color-status-info: #1f95af;

  --color-kanban-blocked: #ba8d3e;
  --color-kanban-ready: #1f95af;
  --color-kanban-running: #dba84c;
  --color-kanban-done: #509c76;

  --border-color: #c2a4d8;
  --border-active: var(--color-brand-primary);

  --shadow-sm: 0 1px 3px rgba(72, 34, 102, 0.08);
  --shadow-md: 0 4px 6px rgba(72, 34, 102, 0.12);
  --shadow-lg: 0 10px 20px rgba(72, 34, 102, 0.16);
}

[data-theme="aurora_light"],
[data-theme="light"] {
  --bg-primary: #f4f4ff;
  --bg-secondary: #f8f1fe;
  --bg-tertiary: rgba(255, 228, 131, 0.22);
  --bg-hover: #e6e2fb;

  --text-primary: #252164;
  --text-secondary: #7466a6;
  --text-muted: #8b7dc1;

  --color-brand-primary: #f6ab1d;
  --color-brand-secondary: #e38e10;

  --color-risk-critical: #e25481;
  --color-pr-ready: #49ab81;
  --color-pr-blocked: #e06b14;
  --color-train-active: #148eb5;

  --color-status-success: #49ab81;
  --color-status-warning: #e06b14;
  --color-status-error: #e25481;
  --color-status-info: #148eb5;

  --color-kanban-blocked: #e06b14;
  --color-kanban-ready: #148eb5;
  --color-kanban-running: #d19440;
  --color-kanban-done: #49ab81;

  --border-color: #a497e0;
  --border-active: var(--color-brand-primary);

  --shadow-sm: 0 1px 3px rgba(66, 58, 120, 0.08);
  --shadow-md: 0 4px 6px rgba(66, 58, 120, 0.12);
  --shadow-lg: 0 10px 20px rgba(66, 58, 120, 0.16);
}

[data-theme="warm_dark"] {
  --bg-primary: #1a1a1f;
  --bg-secondary: #242428;
  --bg-tertiary: rgba(51, 46, 41, 0.88);
  --bg-hover: #322e2a;

  --text-primary: #ebe6de;
  --text-secondary: #9e9991;
  --text-muted: #847f78;

  --color-brand-primary: #d16b47;
  --color-brand-secondary: #bb5938;

  --color-risk-critical: #db4247;
  --color-pr-ready: #5c8a5c;
  --color-pr-blocked: #b8842e;
  --color-train-active: #3db3bd;

  --color-status-success: #5c8a5c;
  --color-status-warning: #b8842e;
  --color-status-error: #db4247;
  --color-status-info: #3db3bd;

  --color-kanban-blocked: #b8842e;
  --color-kanban-ready: #3db3bd;
  --color-kanban-running: #c2a448;
  --color-kanban-done: #5c8a5c;

  --border-color: #4c4742;
  --border-active: var(--color-brand-primary);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.42);
}

[data-theme="cool_dark"] {
  --bg-primary: #141924;
  --bg-secondary: #1f2430;
  --bg-tertiary: rgba(44, 52, 67, 0.86);
  --bg-hover: #2d3442;

  --text-primary: #e6ebf2;
  --text-secondary: #9ca9b7;
  --text-muted: #8491a0;

  --color-brand-primary: #6699d9;
  --color-brand-secondary: #4f82c0;

  --color-risk-critical: #c24d3d;
  --color-pr-ready: #52946b;
  --color-pr-blocked: #c28a33;
  --color-train-active: #38b9c7;

  --color-status-success: #52946b;
  --color-status-warning: #c28a33;
  --color-status-error: #c24d3d;
  --color-status-info: #38b9c7;

  --color-kanban-blocked: #c28a33;
  --color-kanban-ready: #38b9c7;
  --color-kanban-running: #ccb04d;
  --color-kanban-done: #52946b;

  --border-color: #434c5b;
  --border-active: var(--color-brand-primary);

  --shadow-sm: 0 1px 3px rgba(3, 8, 16, 0.24);
  --shadow-md: 0 4px 6px rgba(3, 8, 16, 0.32);
  --shadow-lg: 0 10px 20px rgba(3, 8, 16, 0.4);
}

[data-theme="royal_dark"] {
  --bg-primary: #3d005b;
  --bg-secondary: #4f0a78;
  --bg-tertiary: rgba(102, 0, 153, 0.4);
  --bg-hover: #5d138b;

  --text-primary: #eadfcc;
  --text-secondary: #d1b2e0;
  --text-muted: #b79cc8;

  --color-brand-primary: #eadfcc;
  --color-brand-secondary: #cfbda7;

  --color-risk-critical: #d85782;
  --color-pr-ready: #7dc294;
  --color-pr-blocked: #d4ae59;
  --color-train-active: #48ced0;

  --color-status-success: #7dc294;
  --color-status-warning: #d4ae59;
  --color-status-error: #d85782;
  --color-status-info: #48ced0;

  --color-kanban-blocked: #d4ae59;
  --color-kanban-ready: #48ced0;
  --color-kanban-running: #efd188;
  --color-kanban-done: #7dc294;

  --border-color: rgba(209, 178, 224, 0.32);
  --border-active: var(--color-brand-primary);

  --shadow-sm: 0 1px 3px rgba(43, 9, 65, 0.24);
  --shadow-md: 0 4px 6px rgba(43, 9, 65, 0.32);
  --shadow-lg: 0 10px 20px rgba(43, 9, 65, 0.4);
}

/* High contrast theme: Maximum accessibility */
[data-theme="high-contrast"] {
  --bg-primary: #000000;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --bg-hover: #3a3a3a;

  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #b0b0b0;

  --color-brand-primary: #ff6d00;
  --color-brand-secondary: #dd2c00;

  --color-risk-critical: #ff1744;
  --color-pr-ready: #00e676;
  --color-pr-blocked: #ff9100;
  --color-train-active: #2979ff;

  --color-status-success: #00e676;
  --color-status-warning: #ff9100;
  --color-status-error: #ff1744;
  --color-status-info: #2979ff;

  --color-kanban-blocked: #ff9100;
  --color-kanban-ready: #2979ff;
  --color-kanban-running: #ffd600;
  --color-kanban-done: #00e676;

  --border-color: #4a4a4a;
  --border-active: #ffffff;

  --shadow-sm: 0 1px 3px rgba(255,255,255,0.2);
  --shadow-md: 0 4px 6px rgba(255,255,255,0.3);
  --shadow-lg: 0 10px 20px rgba(255,255,255,0.4);
}

/*============================================================================*/
/* DESIGN TOKENS - Theme-independent                                         */
/*============================================================================*/

:root {
  /* Spacing scale (8px base) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Typography - Industrial aesthetic */
  --font-primary: 'Roboto Condensed', 'Oswald', 'Bebas Neue', 'Impact', sans-serif;
  --font-mono: 'Roboto Mono', 'Courier New', monospace;
  --font-display: 'Bebas Neue', 'Oswald', 'Impact', sans-serif;
}

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

body {
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* Top Banner Layout */
.top-banner {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
  padding: var(--space-md) var(--space-xl);
}

.banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  max-width: 1800px;
  margin: 0 auto;
}

.banner-left {
  display: flex;
  align-items: flex-start;
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
}

.banner-logo {
  height: 60px;
  width: auto;
  display: block;
}

.logo-tagline {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  line-height: 1.3;
  font-weight: 400;
  max-width: 350px;
  padding-left: var(--space-xs);
}

.banner-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-scroll {
  display: flex;
  gap: var(--space-lg);
  overflow-x: auto;
  padding: var(--space-sm);
}

.event-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--text-secondary);
}

.event-icon {
  color: var(--color-status-success);
}

.banner-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.theme-picker {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.theme-picker label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.theme-select {
  min-width: 148px;
  font-family: var(--font-primary);
  font-size: 0.82rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
}

.theme-select:focus,
.theme-select:focus-visible {
  outline: 2px solid var(--border-active);
  outline-offset: 2px;
  border-radius: 2px;
}

.theme-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.ws-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 0.75rem;
}

.ws-text {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.connected {
  background: var(--color-status-success);
  box-shadow: 0 0 8px var(--color-status-success);
}

.status-dot.disconnected {
  background: var(--text-muted);
}

.status-dot.error {
  background: var(--color-status-error);
}

.status-dot.reconnecting {
  background: var(--color-status-warning);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--color-status-warning); }
  50% { opacity: 0.4; box-shadow: 0 0 12px var(--color-status-warning); }
}

.status-dot.running {
  background: var(--color-status-info);
  box-shadow: 0 0 6px var(--color-status-info);
}

.status-dot.completed {
  background: var(--color-status-success);
}

.status-dot.failed {
  background: var(--color-status-error);
}

.status-dot.stale {
  background: var(--text-muted);
}

/* Main content */
/* Dashboard layout with sidebar */
.dashboard {
  display: flex;
  height: calc(100vh - 100px);
  background: var(--bg-primary);
}

.sidebar {
  width: 220px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  overflow-y: auto;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.15s ease;
  font-size: 0.9rem;
}

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

.nav-item.active {
  background: var(--bg-tertiary);
  color: var(--color-brand-primary);
  border-left: 3px solid var(--color-brand-primary);
}

.nav-item .icon {
  font-size: 10px;
  color: var(--color-brand-primary);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  height: 100%;
}

.section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: var(--space-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#stats-section {
  grid-column: 1 / -1;
}

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-weight: 600;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.stat-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: var(--space-md);
  display: flex;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-direction: column;
  gap: var(--space-xs);
}

.stat-card:hover {
  background: var(--bg-hover);
  border-color: var(--color-brand-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-status-info);
  line-height: 1;
}

.stat-value.critical,
.stat-value.risk-high {
  color: var(--color-risk-critical);
}

.stat-value.success {
  color: var(--color-status-success);
}

.stat-value.warning {
  color: var(--color-status-warning);
}

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

.stat-trend {
  font-size: 14px;
  margin-top: var(--space-xs);
}

.stat-trend.up {
  color: var(--color-status-success);
}

.stat-trend.down {
  color: var(--color-status-error);
}

.stat-trend.neutral {
  color: var(--text-muted);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
  cursor: pointer;
}

tbody tr:hover {
  background: var(--bg-hover);
}

tbody td {
  padding: var(--space-sm) var(--space-md);
}

.page-header {
  margin-bottom: var(--space-lg);
}

.page-header h1 {
  margin-bottom: var(--space-xs);
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Risk analysis */
.risk-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.risk-summary {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.risk-badge {
  padding: var(--space-xs) var(--space-sm);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.risk-badge.risk-high {
  background: color-mix(in srgb, var(--color-risk-critical) 20%, transparent);
  color: var(--color-risk-critical);
  border: 1px solid var(--color-risk-critical);
}

.risk-badge.risk-medium {
  background: color-mix(in srgb, var(--color-status-warning) 20%, transparent);
  color: var(--color-status-warning);
  border: 1px solid var(--color-status-warning);
}

.risk-badge.risk-low {
  background: color-mix(in srgb, var(--color-status-success) 20%, transparent);
  color: var(--color-status-success);
  border: 1px solid var(--color-status-success);
}

.risk-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.risk-item {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--text-muted);
  padding: var(--space-sm);
  border-radius: 3px;
}

.risk-item.risk-high {
  border-left-color: var(--color-risk-critical);
}

.risk-item.risk-medium {
  border-left-color: var(--color-status-warning);
}

.risk-item.risk-low {
  border-left-color: var(--color-status-success);
}

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

.risk-score {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-risk-critical);
}

.risk-name {
  color: var(--text-primary);
  font-size: 12px;
}

.risk-factors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.risk-factor {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* Activity feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.activity-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.activity-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: var(--space-sm);
  padding: var(--space-xs);
  background: var(--bg-tertiary);
  border-radius: 3px;
  font-size: 11px;
}

.activity-time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.activity-message {
  color: var(--text-secondary);
}

.activity-link {
  color: var(--color-brand-primary);
  text-decoration: none;
}

/* Fleet grid */
.fleet-grid {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.repo-groups {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-sm);
}

.repo-group {
  background: var(--bg-tertiary);
  padding: var(--space-sm);
  border-radius: 3px;
  border: 1px solid var(--border-color);
}

.repo-name {
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

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

/* Train cards */
.train-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.train-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: var(--space-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.train-card:hover {
  border-color: var(--color-brand-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.train-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.train-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.stat {
  text-align: center;
}

.train-stats .stat-label {
  font-size: 10px;
  color: var(--text-muted);
}

.train-stats .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-status-info);
}

/* Progress bar */
.progress {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-brand-primary);
  transition: width 0.3s ease;
}

.progress-fill.progress-success {
  background: var(--color-status-success);
}

.progress-fill.progress-error {
  background: var(--color-status-error);
}

/* Buttons */
.btn {
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.btn-primary {
  background: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--color-brand-secondary);
}

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

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

.btn-sm {
  padding: 4px 12px;
  font-size: 11px;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success {
  background: color-mix(in srgb, var(--color-status-success) 20%, transparent);
  color: var(--color-status-success);
}

.badge-warning {
  background: color-mix(in srgb, var(--color-status-warning) 20%, transparent);
  color: var(--color-status-warning);
}

.badge-error {
  background: color-mix(in srgb, var(--color-status-error) 20%, transparent);
  color: var(--color-status-error);
}

.badge-info {
  background: color-mix(in srgb, var(--color-status-info) 20%, transparent);
  color: var(--color-status-info);
}

.badge-neutral {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* Kanban view */
.kanban-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.kanban-header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.kanban-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
}

.kanban-title-row h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* Filter bar with chips */
.kanban-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.filter-chip:hover {
  background: var(--bg-hover);
  border-color: var(--color-brand-primary);
}

.filter-label {
  font-weight: 500;
}

.filter-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.filter-remove:hover {
  background: var(--color-status-error);
  color: white;
}

.filter-actions {
  display: flex;
  gap: var(--space-sm);
}

.filter-add {
  white-space: nowrap;
}

/* Global vs local filter styling */
.filter-chip-global {
  background: color-mix(in srgb, var(--color-brand-primary) 15%, var(--bg-tertiary));
  border-color: var(--color-brand-primary);
}

.filter-chip-global .filter-label::before {
  content: "🌐 ";
  opacity: 0.7;
}

.filter-chip-local {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

.filter-chip-local .filter-label::before {
  content: "📍 ";
  opacity: 0.5;
}

/* Filter chip menu */
.filter-chip-menu {
  position: relative;
  display: inline-flex;
}

.filter-chip-menu-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 var(--space-xs);
  transition: color 0.15s ease;
}

.filter-chip-menu-btn:hover {
  color: var(--text-primary);
}

.filter-chip-menu-items {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 100;
  margin-top: var(--space-xs);
}

.filter-chip-menu-items.show {
  display: block;
}

.filter-chip-menu-items button {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  text-align: left;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.filter-chip-menu-items button:hover {
  background: var(--bg-hover);
}

/* Global filter bar */
.global-filter-bar {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
  padding: var(--space-sm) var(--space-xl);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.global-filter-bar-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Pane filter section */
.pane-filter-section {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

.pane-filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

/* Filter modal */
.filter-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.filter-modal-content {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.filter-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.filter-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.filter-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.filter-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
}

.filter-section {
  margin-bottom: var(--space-lg);
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section-title {
  margin: 0 0 var(--space-sm) 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.filter-option:hover {
  background: var(--bg-hover);
}

.filter-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-option span {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.filter-modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* Kanban board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  flex: 1;
  overflow: hidden;
}

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

/* Kanban column status colors - UX best practices */
.kanban-column.blocked {
  border-left: 4px solid var(--color-kanban-blocked);
}

.kanban-column.blocked .column-header {
  background: color-mix(in srgb, var(--color-kanban-blocked) 15%, transparent);
  border-bottom-color: var(--color-kanban-blocked);
}

.kanban-column.ready {
  border-left: 4px solid var(--color-kanban-ready);
}

.kanban-column.ready .column-header {
  background: color-mix(in srgb, var(--color-kanban-ready) 15%, transparent);
  border-bottom-color: var(--color-kanban-ready);
}

.kanban-column.running {
  border-left: 4px solid var(--color-kanban-running);
}

.kanban-column.running .column-header {
  background: color-mix(in srgb, var(--color-kanban-running) 15%, transparent);
  border-bottom-color: var(--color-kanban-running);
}

.kanban-column.done {
  border-left: 4px solid var(--color-kanban-done);
}

.kanban-column.done .column-header {
  background: color-mix(in srgb, var(--color-kanban-done) 15%, transparent);
  border-bottom-color: var(--color-kanban-done);
}

.column-header {
  padding: var(--space-md);
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.column-header h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.column-count {
  font-size: 11px;
  color: var(--text-muted);
}

.column-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.kanban-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: var(--space-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.kanban-card:hover {
  border-color: var(--color-brand-primary);
  transform: translateX(4px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
  font-size: 10px;
  color: var(--text-muted);
}

.card-title {
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-sm);
}

.card-link {
  font-size: 10px;
  color: var(--color-brand-primary);
  text-decoration: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-color);
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: var(--space-xxl) var(--space-xl);
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  font-size: 1.25rem;
}

.empty-state p {
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.empty-code {
  display: inline-block;
  background: var(--bg-tertiary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  margin: var(--space-sm) 0;
}

.empty-hint {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.empty-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-top: var(--space-md);
}

/* Fleet view */
.aggregate-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: var(--space-md) var(--space-lg);
}

.pane-filter-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pane-filter-toolbar .filter-chips {
  min-height: 34px;
}

.fleet-header {
  margin-bottom: var(--space-lg);
}

.fleet-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.fleet-summary {
  display: flex;
  gap: var(--space-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.summary-divider {
  color: var(--text-tertiary);
}

.train-count,
.pr-count,
.repo-count {
  font-weight: 500;
}

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

.fleet-header .pane-filter-toolbar {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  width: 100%;
  justify-content: flex-end;
}

.fleet-table .train-name {
  font-weight: 500;
  color: var(--text-primary);
}

.fleet-table .train-stat {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fleet-table .train-progress {
  width: 200px;
}

/* ============================================================================
   Dashboard workflow summary
   ========================================================================= */

.workflow-summary {
  padding: 0;
}

.workflow-summary .section-title {
  margin: 0 0 var(--space-sm) 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.workflow-summary-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.workflow-summary-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: 6px;
  border-left: 3px solid var(--border-color);
}

.workflow-summary-item.wf-status-running {
  border-left-color: var(--color-status-info);
}

.workflow-summary-item.wf-status-completed {
  border-left-color: var(--color-status-success);
}

.workflow-summary-item.wf-status-failed {
  border-left-color: var(--color-status-error);
}

.workflow-summary-item.wf-status-stale {
  border-left-color: var(--text-muted);
  opacity: 0.7;
}

.wf-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wf-summary-name {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}

.wf-summary-name:hover {
  color: var(--color-brand-primary);
}

.wf-summary-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.wf-summary-detail {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================================================
   Workflow card list — expandable <details> cards
   ========================================================================= */

.workflow-card-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.workflow-card {
  background: var(--bg-secondary);
  border-radius: 6px;
  border-left: 3px solid var(--border-color);
  overflow: hidden;
}

.workflow-card[open] {
  border-left-color: var(--color-brand-primary);
}

.workflow-card-summary {
  display: grid;
  grid-template-columns: 24px 1fr auto auto 80px 60px 20px;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.workflow-card-summary::-webkit-details-marker {
  display: none;
}

.workflow-card-summary:hover {
  background: var(--bg-hover);
}

.workflow-card[open] > .workflow-card-summary {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.wf-status-dot {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wf-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-running {
  background: color-mix(in srgb, var(--color-status-info) 20%, var(--bg-secondary));
  color: var(--color-status-info);
}

.badge-completed {
  background: color-mix(in srgb, var(--color-status-success) 20%, var(--bg-secondary));
  color: var(--color-status-success);
}

.badge-failed {
  background: color-mix(in srgb, var(--color-status-error) 20%, var(--bg-secondary));
  color: var(--color-status-error);
}

.badge-stale {
  background: var(--bg-hover);
  color: var(--text-muted);
}

.badge-unknown {
  background: var(--bg-hover);
  color: var(--text-muted);
}

.wf-phase {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.wf-progress-inline {
  width: 60px;
}

.wf-progress-track {
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.wf-progress-fill {
  height: 100%;
  background: var(--color-status-info);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.wf-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

.wf-expand-icon {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.workflow-card[open] .wf-expand-icon {
  transform: rotate(90deg);
}

/* Workflow inline panel (expanded body) */
.workflow-card-body {
  padding: 0;
}

.workflow-panel {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.workflow-panel-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.workflow-panel-controls {
  display: flex;
  gap: var(--space-sm);
}

.btn-danger {
  color: var(--color-status-error);
  border-color: var(--color-status-error);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--color-status-error) 15%, var(--bg-tertiary));
}

/* Event timeline (shared: workflow panel + detail page) */
.workflow-panel-events {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.workflow-panel-events .section-title,
.workflow-timeline .section-title {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 400px;
  overflow-y: auto;
}

.event-list .event-item {
  display: grid;
  grid-template-columns: 65px 150px 100px 1fr;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-primary);
  border-radius: 3px;
  font-size: 0.8rem;
  white-space: normal;
  border-left: 3px solid var(--border-color);
}

.event-list .event-item.event-workflow-started {
  border-left-color: var(--color-status-info);
}

.event-list .event-item.event-workflow-completed {
  border-left-color: var(--color-status-success);
}

.event-list .event-item.event-workflow-failed {
  border-left-color: var(--color-status-error);
}

.event-list .event-item.event-workflow-phase-started {
  border-left-color: var(--color-status-warning);
}

.event-list .event-item.event-workflow-phase-completed {
  border-left-color: var(--color-status-success);
}

.event-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.event-type {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-status-info);
  font-weight: 500;
}

.event-phase {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 1px 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.event-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Workflow detail page (direct URL fallback) */
.workflow-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.workflow-detail .workflow-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.workflow-detail .workflow-header h2 {
  margin: 0;
  color: var(--text-primary);
}

.back-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--color-brand-primary);
}

.workflow-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Workflows view */
.workflows-section {
  margin-top: 0;
}

.workflows-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.workflows-title-group h2 {
  margin: 0 0 var(--space-xs) 0;
  color: var(--text-primary);
}

.workflows-title-group .subtitle {
  margin: 0 0 var(--space-xs) 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.workflows-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.evidence-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.evidence-title-group h2 {
  margin: 0 0 var(--space-xs) 0;
  color: var(--text-primary);
}

.evidence-title-group .subtitle {
  margin: 0;
  color: var(--text-secondary);
}

.workflows-header .pane-filter-toolbar,
.evidence-header .pane-filter-toolbar {
  margin-left: auto;
  justify-content: flex-end;
}

/* Evidence list */
.evidence-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.evidence-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: var(--space-md) 0 var(--space-xs) 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-xs);
}

.evidence-section-title:first-child {
  margin-top: 0;
}

.evidence-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.evidence-item:hover {
  border-color: var(--color-brand-primary);
}

.evidence-info h4 {
  margin: 0 0 2px 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.evidence-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.evidence-pending {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-style: italic;
}

/* Responsive */
@media (max-width: 1400px) {
  .banner-center {
    display: none;
  }
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }

  .banner-logo {
    height: 50px;
  }

  .logo-tagline {
    font-size: 0.75rem;
  }
}

@media (max-width: 768px) {
  .top-banner {
    padding: var(--space-md);
  }

  .banner-content {
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .banner-logo {
    height: 40px;
  }

  .logo-tagline {
    font-size: 0.7rem;
  }

  .dashboard {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .nav-item {
    white-space: nowrap;
  }

  .pane-filter-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .workflows-header,
  .evidence-header,
  .fleet-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .ws-text {
    display: none;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Filter System Enhancements - Visual Hierarchy & State
   ========================================================================= */

/* Scope indicators in modal header */
.scope-icon {
  font-size: 1.2em;
  margin-right: 0.25rem;
}

.scope-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scope-badge-global {
  background: #c8e6c9;
  color: #2e7d32;
  border: 1px solid #4CAF50;
}

.scope-badge-local {
  background: #bbdefb;
  color: #1565c0;
  border: 1px solid #2196F3;
}

/* Filter chips - improved visual hierarchy */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.875rem;
  margin: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
  font-weight: 500;
}

/* Global filter chips - green theme */
.filter-chip-global {
  background: #c8e6c9;
  color: #1b5e20;
  border: 1.5px solid #4CAF50;
}

.filter-chip-global:hover {
  background: #a5d6a7;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

/* Local/pane filter chips - blue theme */
.filter-chip-local {
  background: #bbdefb;
  color: #0d47a1;
  border: 1.5px solid #2196F3;
}

.filter-chip-local:hover {
  background: #90caf9;
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

/* Filter chip remove button */
.filter-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.3em;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.filter-remove:hover {
  opacity: 1;
}

/* Filter chip animation */
.chip-removing {
  animation: chip-fade-out 0.3s ease forwards;
}

@keyframes chip-fade-out {
  to {
    opacity: 0;
    transform: scale(0.8);
    margin: 0;
    padding: 0;
  }
}

/* Global filter bar styling */
.global-filter-bar {
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
  border-bottom: 2px solid #4CAF50;
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
}

/* Filter section visual hierarchy */
.filter-section {
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  border-left: 4px solid transparent;
}

.filter-section-global {
  border-left-color: #4CAF50;
  background: linear-gradient(90deg, rgba(200, 230, 201, 0.15) 0%, transparent 100%);
}

.filter-section-local {
  border-left-color: #2196F3;
  background: linear-gradient(90deg, rgba(187, 222, 251, 0.15) 0%, transparent 100%);
}

/* Filter modal improvements */
.filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 2px solid var(--border-color);
  gap: var(--space-md);
  flex-wrap: wrap;
}

.filter-modal-header h3 {
  flex: 1;
  margin: 0;
  display: flex;
  align-items: center;
}

/* Filter options - better touch targets and visual feedback */
.filter-option {
  display: flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-xs) 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s;
  min-height: 44px; /* WCAG touch target size */
}

.filter-option:hover {
  background-color: var(--hover-bg);
}

.filter-option input[type="checkbox"] {
  margin-right: var(--space-sm);
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.filter-option span {
  flex: 1;
  user-select: none;
}

.filter-options-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.filter-option-cloud {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.filter-option-cloud:hover {
  border-color: var(--color-brand-primary);
  background: var(--bg-hover);
}

.filter-option-cloud input[type="checkbox"] {
  margin: 0;
}

.filter-option-empty {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
}

.filter-option-empty .filter-text-input {
  width: 100%;
}

.filter-section-global-compact {
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  border-left: 2px solid var(--color-brand-primary);
  background: color-mix(in srgb, var(--color-brand-primary) 6%, transparent);
}

.filter-section-local-compact {
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.column-filter-label {
  cursor: pointer;
}

.column-filter-label:hover {
  color: var(--color-brand-primary);
}

.card-meta-filter {
  border: none;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.card-meta-filter:hover {
  color: var(--color-brand-primary);
  text-decoration: underline;
}

/* Checked state visual feedback */
.filter-checkbox:checked + span {
  font-weight: 600;
  color: var(--primary-color);
}

/* Filter actions */
.filter-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

/* Pane label in chips */
.pane-label {
  font-size: 0.7rem;
  opacity: 0.8;
  font-weight: 400;
  margin-left: 4px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

/* Filter count badges */
.filter-count {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Clear all button */
.clear-filters-btn {
  color: var(--error-color);
  transition: all 0.2s;
}

.clear-filters-btn:hover {
  background-color: rgba(244, 67, 54, 0.1);
}

/* Filter UX consistency overrides */
.global-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.global-filter-bar .filter-chips {
  flex: 1;
  min-height: 34px;
}

.global-filter-bar .filter-actions {
  margin-left: auto;
}

.pane-filter-toolbar {
  margin-left: auto;
  justify-content: flex-end;
}

.kanban-title-row .pane-filter-toolbar {
  flex: 1;
}

.workflows-header,
.evidence-header {
  align-items: center;
  flex-wrap: nowrap;
}

.workflows-title-group,
.evidence-title-group {
  min-width: 0;
}

.filter-modal-header h3 {
  font-size: 1rem;
  line-height: 1.25;
}

.filter-section-title {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.filter-text-input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: var(--space-xs) var(--space-sm);
}

.filter-option-cloud-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-option-cloud-btn:hover {
  border-color: var(--color-brand-primary);
  background: var(--bg-hover);
}

.filter-option-cloud-btn.active {
  border-color: var(--color-brand-primary);
  background: color-mix(in srgb, var(--color-brand-primary) 15%, var(--bg-tertiary));
  color: var(--text-primary);
}

.filter-option-cloud-label {
  font-weight: 500;
}

.filter-option-cloud-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Archived workflows section */
.archived-section {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-md);
}

.archived-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.archived-header h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

.archived-card {
  opacity: 0.85;
}

.archived-card .workflow-card-summary {
  grid-template-columns: 24px 1fr auto auto auto auto 20px;
}

.wf-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.wf-size {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

.workflow-card-actions {
  padding: var(--space-xs) var(--space-md);
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
}

.loading-spinner {
  padding: var(--space-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 768px) {
  .pane-filter-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .workflows-header,
  .evidence-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/*============================================================================*/
/* CONTROL PLANE                                                              */
/*============================================================================*/

.cp-page { padding: 0; }

.cp-header {
  margin-bottom: var(--space-md);
}
.cp-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin: 0;
}
.cp-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: var(--space-xs) 0 0;
}

/* Summary bar */
.cp-summary-bar {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.cp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}
.cp-stat-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}
.cp-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.cp-stat.stat-attention .cp-stat-value { color: var(--color-status-warning); }
.cp-stat.stat-decisions .cp-stat-value { color: var(--color-status-info); }

/* Two-column layout */
.cp-two-column {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-lg);
}
@media (max-width: 1024px) {
  .cp-two-column { grid-template-columns: 1fr; }
}

.cp-section h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 var(--space-sm);
}
.cp-count { color: var(--text-muted); font-weight: 400; }
.cp-count-attention { color: var(--color-status-warning); }

/* Agent cards grid */
.cp-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-sm);
}

.cp-agent-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  border-left: 3px solid var(--text-muted);
  transition: border-color 0.2s;
}
.cp-agent-card.status-running   { border-left-color: var(--color-status-info); }
.cp-agent-card.status-idle      { border-left-color: var(--color-pr-ready); }
.cp-agent-card.status-blocked   { border-left-color: var(--color-status-warning); }
.cp-agent-card.status-paused    { border-left-color: var(--text-muted); }
.cp-agent-card.status-failed    { border-left-color: var(--color-status-error); }
.cp-agent-card.status-unreachable { border-left-color: var(--color-status-error); opacity: 0.7; }
.cp-agent-card.status-completed { border-left-color: var(--color-pr-ready); opacity: 0.6; }
.cp-agent-card.status-terminated { border-left-color: var(--text-muted); opacity: 0.5; }

.cp-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}
.cp-vendor-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.cp-agent-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-status-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
}
.cp-status-badge.status-running   { color: var(--color-status-info); }
.cp-status-badge.status-blocked   { color: var(--color-status-warning); background: rgba(245, 124, 0, 0.15); }
.cp-status-badge.status-failed    { color: var(--color-status-error); }
.cp-status-badge.status-unreachable { color: var(--color-status-error); }

.cp-card-body {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}
.cp-task { margin-bottom: 2px; }
.cp-task .label, .cp-heartbeat .label {
  color: var(--text-muted);
  margin-right: var(--space-xs);
}

.cp-card-actions {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

/* Decision queue */
.cp-decision-queue {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.cp-decision-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  border-left: 3px solid var(--text-muted);
}
.cp-decision-item.priority-critical { border-left-color: var(--color-status-error); }
.cp-decision-item.priority-high     { border-left-color: var(--color-status-warning); }
.cp-decision-item.priority-medium   { border-left-color: var(--color-status-info); }
.cp-decision-item.priority-low      { border-left-color: var(--text-muted); }

.cp-decision-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}
.cp-priority-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}
.cp-priority-badge.priority-critical { color: var(--color-status-error); background: rgba(198, 40, 40, 0.15); }
.cp-priority-badge.priority-high     { color: var(--color-status-warning); background: rgba(245, 124, 0, 0.15); }
.cp-priority-badge.priority-medium   { color: var(--color-status-info); }
.cp-priority-badge.priority-low      { color: var(--text-muted); }

.cp-decision-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.cp-decision-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

.cp-decision-summary {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}
.cp-decision-context {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  padding: var(--space-xs);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.cp-decision-actions { margin-top: var(--space-xs); }

.cp-option-buttons {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.cp-decision-form {
  display: flex;
  gap: var(--space-xs);
}
.cp-input {
  flex: 1;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
.cp-input:focus {
  outline: none;
  border-color: var(--color-status-info);
}

.cp-empty-state, .cp-empty-decisions {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
}
.cp-empty-state .empty-icon { font-size: 2rem; margin-bottom: var(--space-sm); }
.cp-empty-state h3 { color: var(--text-secondary); margin-bottom: var(--space-xs); }
.cp-register-hint code {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.cp-empty-decisions .check-icon {
  color: var(--color-pr-ready);
  margin-right: var(--space-xs);
}
