/* Dashboard v7 Styles - Projects Bar + 2-column layout */

/* Projects Bar (compact multi-project) */
.cockpit-projects-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0 20px;
  margin: 0 20px;
  position: relative;
  z-index: 1;
}

/* MC-018/T-011: Override quand cockpit-projects-bar est inline dans le cmd-bar header (Agents view) */
.cockpit-cmd-bar .cockpit-projects-bar {
  padding: 0;
  margin: 0;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  gap: 6px;
}
.cockpit-cmd-bar .cockpit-project-pill {
  min-width: auto;
  max-width: none;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
}
.cockpit-cmd-bar .pill-bar-wrap {
  margin-top: 2px;
  height: 2px;
}

.cockpit-project-pill {
  flex: 0 0 auto;
  min-width: 140px;
  max-width: 160px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  position: relative;
}

/* T-007: Deactivate button — discrete, visible on hover */
.pill-deactivate-btn {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 3px;
  color: #444;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
  padding: 0;
}
.cockpit-project-pill:hover .pill-deactivate-btn {
  opacity: 1;
}
.pill-deactivate-btn:hover {
  color: #e06060;
  background: rgba(224,96,96,.12);
}

.cockpit-project-pill:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover, #35373f);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

.cockpit-project-pill.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(80,144,208,.15);
}

.cockpit-project-code {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.cockpit-project-percent {
  font-size: 10px;
  color: var(--text2);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cockpit-project-bar-wrap {
  height: 5px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.cockpit-project-bar {
  height: 100%;
  border-radius: 999px;
  transition: width .35s ease;
}

/* Agents Stage (moved outside left-col) */
.cockpit-agents-stage {
  padding: 0 20px 20px;
}

/* Bottom Grid (2 columns) */
.cockpit-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 0 20px 20px;
  position: relative;
  z-index: 1;
}

/* Section Card */
.cockpit-section-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  min-height: 450px;
  display: flex;
  flex-direction: column;
}

/* Section Header */
.cockpit-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.cockpit-section-header[onclick] {
  cursor: pointer;
  transition: opacity .15s ease;
}

.cockpit-section-header[onclick]:hover {
  opacity: 0.8;
}

.cockpit-section-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text);
}

.cockpit-section-meta {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

/* Section Tabs */
.cockpit-section-tabs {
  display: flex;
  gap: 8px;
}

.cockpit-section-tab {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s ease;
}

.cockpit-section-tab:hover {
  background: rgba(255,255,255,0.05);
}

.cockpit-section-tab.active {
  background: rgba(93,200,160,0.1);
  border-color: rgba(93,200,160,0.2);
  color: var(--green);
}

/* Project Details */
.cockpit-project-details {
  margin-bottom: 20px;
}

.cockpit-project-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 6px;
}

.cockpit-project-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 12px;
}

.cockpit-project-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text2);
}

.cockpit-project-progress .cockpit-project-bar-wrap {
  flex: 1;
  height: 8px;
}

/* Task List */
.cockpit-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}

.cockpit-task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.cockpit-task-item:hover {
  transform: translateX(2px);
  background: #181922;
  border-color: var(--border);
}

.cockpit-task-item.active {
  background: rgba(80,144,208,0.08);
  border-left: 3px solid var(--blue);
  box-shadow: inset 0 0 0 1px rgba(80,144,208,.1);
}

.cockpit-task-item.completed {
  opacity: 0.6;
}

.cockpit-task-item.completed .cockpit-task-title {
  text-decoration: line-through;
  color: #666;
}

/* Task Checkbox */
.cockpit-task-checkbox {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  font-size: 13px;
  font-weight: 900;
  color: transparent;
}

.cockpit-task-item.completed .cockpit-task-checkbox {
  background: rgba(77,184,77,0.2);
  border-color: var(--green);
  color: var(--green);
}

.cockpit-task-item.active .cockpit-task-checkbox {
  border-color: var(--blue);
}

/* Task Info */
.cockpit-task-info {
  flex: 1;
  min-width: 0;
}

.cockpit-task-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.cockpit-task-id {
  font-size: 10px;
  color: #666;
  font-family: 'Space Mono', monospace;
  flex-shrink: 0;
  margin-right: 4px;
}

.cockpit-task-meta {
  font-size: 10px;
  color: #666;
}

/* Task Right Side */
.cockpit-task-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Task Status Badge */
.cockpit-task-status {
  flex: 0 0 auto;
  font-size: 9px;
  padding: 3px 6px;
  border-radius: 5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.cockpit-task-status.active {
  background: rgba(80,144,208,0.1);
  color: var(--blue);
  animation: pulse-soft 2s infinite;
}

.cockpit-task-status.done {
  background: rgba(77,184,77,0.1);
  color: var(--green);
}

.cockpit-task-status.pending {
  background: rgba(200,168,48,0.15);
  color: var(--yellow);
  border: 1px solid rgba(200,168,48,0.2);
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Agent Tag */
.cockpit-agent-tag {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Right Panels */
.cockpit-right-panel {
  flex: 1;
  overflow-y: auto;
}

.cockpit-right-panel.hidden {
  display: none;
}

/* Activity Log in right panel */
.cockpit-right-panel .cockpit-activity-log {
  height: 100%;
}

.cockpit-right-panel .cockpit-log-body {
  max-height: none;
  overflow-y: auto;
}

/* Responsive */
@media (max-width: 1200px) {
  .cockpit-bottom-grid {
    grid-template-columns: 1fr;
  }
}
