:root {
  /* Color Palette - Deep Space Cyber Theme */
  --bg-dark: #070a12;
  --bg-panel: rgba(15, 23, 42, 0.75);
  --bg-panel-solid: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: rgba(15, 23, 42, 0.8);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(99, 102, 241, 0.4);
  --border-color-accent: rgba(6, 182, 212, 0.3);

  /* Gradients & Accents */
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --grad-ceo: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(168, 85, 247, 0.2));
  --grad-cmo: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
  --grad-cto: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(20, 184, 166, 0.2));
  --grad-btn: linear-gradient(135deg, #6366f1, #8b5cf6);
  --grad-btn-hover: linear-gradient(135deg, #4f46e5, #7c3aed);

  /* Status Colors */
  --status-pending: #94a3b8;
  --status-running: #f59e0b;
  --status-completed: #10b981;
  --status-failed: #f43f5e;
  --status-waiting: #3b82f6;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Typography */
  --font-sans: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows */
  --shadow-panel: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 2px rgba(255, 255, 255, 0.05);
  --shadow-glow-indigo: 0 0 25px rgba(99, 102, 241, 0.25);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.25);
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(ellipse at 15% 10%, rgba(99, 102, 241, 0.15) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 90%, rgba(6, 182, 212, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.4);
}

/* Main Layout Structure */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem 1rem 1.25rem;
  gap: 0.85rem;
}

/* Header & Brand Toolbar */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow-panel);
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: rotate(45deg);
  animation: shine 4s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%) rotate(45deg); }
  20%, 100% { transform: translateX(100%) rotate(45deg); }
}

.logo-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #ffffff 30%, #a5f3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.version-tag {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 600;
  background: rgba(6, 182, 212, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Header Stats Metrics Bar */
.header-center {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-widget {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
}

.stat-icon {
  font-size: 1.1rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: white;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* Health Bar */
.health-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.health-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.8);
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  transition: all 0.2s ease;
}

.health-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
}

.health-chip.healthy {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
  color: #a7f3d0;
}

.health-chip.healthy .dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.health-chip.warning {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
  color: #fde68a;
}

.health-chip.warning .dot {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.health-chip.error {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.08);
  color: #fecdd3;
}

.health-chip.error .dot {
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
}

/* Workspace Panels Layout */
.workspace {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 0.85rem;
  flex: 1;
  min-height: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Base Panel Styling */
.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 1.15rem;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.control-panel {
  overflow-y: auto;
  padding-right: 0.85rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.panel-header.compact {
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
}

.panel-header h2, .panel-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
}

.panel-header .icon {
  font-size: 1.1rem;
}

.sub-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Forms & Controls */
.task-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-group input, 
.form-group select, 
.form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.form-group input::placeholder, 
.form-group textarea::placeholder {
  color: #475569;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.95);
}

/* Role Selection Selector Cards */
.role-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.role-card-option {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.45rem 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.role-card-option .role-icon {
  font-size: 1.1rem;
}

.role-card-option .role-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.role-card-option:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(30, 41, 59, 0.8);
}

.role-card-option.active[data-role="CEO"] {
  background: var(--grad-ceo);
  border-color: rgba(236, 72, 153, 0.5);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.2);
}
.role-card-option.active[data-role="CEO"] .role-title { color: #f472b6; }

.role-card-option.active[data-role="CMO"] {
  background: var(--grad-cmo);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}
.role-card-option.active[data-role="CMO"] .role-title { color: #60a5fa; }

.role-card-option.active[data-role="CTO"] {
  background: var(--grad-cto);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}
.role-card-option.active[data-role="CTO"] .role-title { color: #34d399; }

/* Delegation Switch Box */
.delegation-toggle-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  transition: all 0.2s ease;
}

.delegation-toggle-box:has(#autoDelegateCheck:checked) {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.help-text {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  line-height: 1.35;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--grad-btn);
  color: white;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: var(--grad-btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.btn-sm {
  padding: 0.32rem 0.65rem;
  font-size: 0.72rem;
  border-radius: 6px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Company Grid & List */
.company-card {
  margin-top: 0.6rem;
}

.company-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 170px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.company-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  cursor: pointer;
}

.company-item:hover, .company-item.selected {
  border-color: var(--accent-cyan);
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
  transform: translateX(2px);
}

.company-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.agent-badges {
  display: flex;
  gap: 0.2rem;
}

/* Badges */
.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-ceo { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-cmo { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-cto { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-omni { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-openai { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Execution Panel Filter & Search Toolbar */
.orchestration-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  flex-wrap: wrap;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 7px;
  padding: 0.4rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.filter-btn.active {
  background: var(--grad-btn);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.company-filter-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.company-filter-box select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color-accent);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  outline: none;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
}

.company-filter-box select:hover, .company-filter-box select:focus {
  border-color: var(--accent-cyan);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 380px;
  min-width: 220px;
}

.search-box input {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.4rem 0.85rem 0.4rem 2.2rem;
  font-size: 0.78rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.95);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.modal-container.timeline-modal {
  max-width: 760px;
  max-height: 82vh;
}

/* Task Orchestration Tree Cards */
.task-tree {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 0.25rem;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.15rem 1.35rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-primary);
  border-radius: 4px 0 0 4px;
}

.task-card[data-role="CEO"]::before { background: var(--accent-pink); }
.task-card[data-role="CMO"]::before { background: var(--accent-cyan); }
.task-card[data-role="CTO"]::before { background: var(--accent-emerald); }

.task-card:hover {
  border-color: var(--border-color-glow);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.task-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.task-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: white;
  line-height: 1.35;
  cursor: pointer;
  transition: color 0.2s ease;
}

.task-title:hover {
  color: var(--accent-cyan);
}

.read-more-btn {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  margin-left: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: all 0.2s ease;
}

.read-more-btn:hover {
  color: white;
  text-decoration: underline;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.company-tag {
  color: var(--text-muted);
  font-weight: 600;
}

/* Status Badges */
.status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-pending { 
  background: rgba(148, 163, 184, 0.15); 
  color: #cbd5e1; 
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.status-pending::before { background: #94a3b8; }

.status-running { 
  background: rgba(245, 158, 11, 0.15); 
  color: #fcd34d; 
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: pulse-glow 2s infinite; 
}
.status-running::before { background: #f59e0b; }

.status-waiting_for_delegates { 
  background: rgba(59, 130, 246, 0.15); 
  color: #93c5fd; 
  border: 1px solid rgba(59, 130, 246, 0.3);
  animation: pulse-glow 2s infinite; 
}
.status-waiting_for_delegates::before { background: #3b82f6; }

.status-completed { 
  background: rgba(16, 185, 129, 0.15); 
  color: #6ee7b7; 
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-completed::before { background: #10b981; }

.status-failed { 
  background: rgba(244, 63, 94, 0.15); 
  color: #fca5a5; 
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.status-failed::before { background: #f43f5e; }

@keyframes pulse-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(245, 158, 11, 0.2); }
  50% { opacity: 0.6; box-shadow: 0 0 2px rgba(245, 158, 11, 0.1); }
}

.task-description {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

/* Delegated Children Box & Multi-Column Grid */
.children-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
}

.children-header {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.65rem;
}

.child-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.child-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.child-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.child-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.child-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

/* Activity Timeline Panel */
.timeline-panel {
  display: flex;
  flex-direction: column;
}

.timeline-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.2rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.35rem;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: all 0.2s ease;
}

.timeline-item:hover {
  border-left-color: var(--accent-cyan);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 6px var(--accent-primary);
}

.timeline-item[data-type="task_created"]::before { background: var(--accent-cyan); }
.timeline-item[data-type="task_started"]::before { background: var(--accent-amber); }
.timeline-item[data-type="agent_response"]::before { background: var(--accent-emerald); }
.timeline-item[data-type="synthesis_completed"]::before { background: var(--accent-pink); }
.timeline-item[data-type="task_failed"]::before { background: var(--accent-rose); }

.timeline-time {
  font-size: 0.66rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.timeline-msg {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.timeline-msg strong {
  color: white;
}

/* Modal Executive Report Drawer */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-backdrop.hidden {
  display: none;
}

.modal-container {
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-color-glow);
  border-radius: 18px;
  width: 92%;
  max-width: 880px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), var(--shadow-glow-indigo);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fecdd3;
  border-color: rgba(244, 63, 94, 0.4);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.65;
  font-family: var(--font-sans);
  color: var(--text-main);
}

.modal-footer {
  padding: 0.85rem 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.3);
  border: 1px stroke var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.empty-icon {
  font-size: 2rem;
  opacity: 0.6;
}

/* Mobile Segmented View Switcher */
.mobile-tab-bar {
  display: none;
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 0.25rem;
}

.mobile-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-tab-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

/* Responsive Utilities & Mobile App Optimization */
@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 0.6rem;
    gap: 0.6rem;
    height: auto;
    min-height: 100vh;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
    gap: 0.75rem;
  }

  .header-left {
    justify-content: space-between;
  }

  .header-center {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem;
    gap: 0.5rem;
  }

  .stat-widget {
    flex-shrink: 0;
    padding: 0.35rem 0.65rem;
  }

  .header-right {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .health-bar {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .mobile-tab-bar {
    display: flex;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .panel.mobile-hidden {
    display: none !important;
  }

  .orchestration-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem;
  }

  .filter-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding: 4px;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .toolbar-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .company-filter-box select {
    width: 100%;
  }

  .search-box {
    max-width: 100%;
    width: 100%;
  }

  /* Form inputs mobile touch optimization */
  .form-group input, 
  .form-group select, 
  .form-group textarea {
    font-size: 16px; /* Prevents iOS Safari auto-zoom */
    padding: 0.65rem 0.85rem;
  }

  /* Mobile Slide-Up Bottom Drawer Modals */
  .modal-container {
    width: 100%;
    max-width: 100%;
    height: 90vh;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0;
    margin: 0;
    animation: slideUpBottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes slideUpBottom {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .children-grid {
    grid-template-columns: 1fr;
  }
}
