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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  height: 100vh;
  overflow: hidden;
}

.header {
  background: #2d3748;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 1.5rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status .connected {
  color: #48bb78;
}

.status .disconnected {
  color: #f56565;
}

.board-container {
  padding: 1rem;
  height: calc(100vh - 70px);
  overflow-x: auto;
}

.board {
  display: flex;
  gap: 1rem;
  min-width: max-content;
  height: 100%;
}

.lane {
  background: #e2e8f0;
  border-radius: 8px;
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.lane-header {
  background: #cbd5e0;
  padding: 0.75rem;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lane-count {
  background: #718096;
  color: white;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
}

.lane-content {
  padding: 0.75rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card {
  background: white;
  border-radius: 6px;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card-title {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.card-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #718096;
}

.card-agent {
  background: #e2e8f0;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.card-status {
  text-transform: uppercase;
  font-size: 0.625rem;
  font-weight: 600;
}

.status-queued { color: #ed8936; }
.status-in-progress { color: #4299e1; }
.status-blocked { color: #f56565; }
.status-done { color: #48bb78; }

.priority-high { border-left: 3px solid #f56565; }
.priority-medium { border-left: 3px solid #ed8936; }
.priority-low { border-left: 3px solid #48bb78; }

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.close {
  float: right;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .lane {
    width: 280px;
    min-width: 280px;
  }
  
  .header h1 {
    font-size: 1.25rem;
  }
}

/* Swimlane Styles */
.swimlane {
  background: white;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.swimlane-header {
  background: #f7fafc;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
}

.swimlane-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.objective-icon {
  font-size: 1.25rem;
}

.swimlane-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-bar {
  width: 100px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: #4a5568;
  font-weight: 500;
}

.swimlane-lanes {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f7fafc;
}

.done-group-header {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Update existing lane styles for swimlane context */
.swimlane .lane {
  background: white;
}

.swimlane .lane-header {
  background: #edf2f7;
}

/* Dashboard Panels */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-panel {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Agent Status Panel */
.agent-status-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.agent-status-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.agent-status-panel .stats {
  display: flex;
  gap: 0.75rem;
}

.agent-status-panel .stat {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.stat.idle { background: #c6f6d5; color: #22543d; }
.stat.busy { background: #fed7d7; color: #742a2a; }
.stat.offline { background: #e2e8f0; color: #4a5568; }

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.agent-card {
  border-radius: 6px;
  padding: 0.75rem;
  border: 2px solid transparent;
}

.agent-card.idle { background: #f0fff4; border-color: #68d391; }
.agent-card.busy { background: #fff5f5; border-color: #fc8181; }
.agent-card.offline { background: #f7fafc; border-color: #cbd5e0; }

.agent-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.agent-name {
  font-weight: 600;
  flex: 1;
}

.agent-status-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.1);
}

.current-task {
  font-size: 0.8rem;
  color: #4a5568;
  margin-top: 0.5rem;
}

.last-seen {
  font-size: 0.7rem;
  color: #718096;
  margin-top: 0.25rem;
}

/* Blocked Cards Panel */
.blocked-panel.empty {
  background: #f0fff4;
  border: 2px solid #68d391;
}

.blocked-panel.has-items {
  background: #fff5f5;
  border: 2px solid #fc8181;
}

.blocked-panel h3 {
  margin: 0 0 0.5rem 0;
}

.blocked-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blocked-item {
  background: white;
  padding: 0.5rem;
  border-radius: 4px;
  border-left: 3px solid #e53e3e;
}

.blocked-reason {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.blocked-meta {
  font-size: 0.75rem;
  color: #718096;
}

.dependency {
  color: #e53e3e;
  font-weight: 500;
}

/* Cost Panel */
.cost-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cost-panel h3 {
  margin: 0;
}

.total-cost {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
}

.objective-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.objective-cost {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: #f7fafc;
  border-radius: 4px;
}

.objective-name {
  font-weight: 500;
  text-transform: capitalize;
}

.objective-amount {
  font-weight: 600;
  color: #2d3748;
}

/* Responsive */
@media (max-width: 1200px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .agents-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
