/* Activity Dashboard overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  z-index: 1000;
}

.dashboard {
  width: 700px;
  max-width: 90vw;
  max-height: 70vh;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-popup);
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.header h3 {
  margin: 0;
  font-size: var(--font-lg);
  font-weight: 600;
}

.headerActions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--fg-muted);
  font-size: var(--font-md);
}

.row {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  gap: 6px;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border);
}

.row:last-child {
  border-bottom: none;
}

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

.activeRow {
  border-left-color: var(--accent);
  background: var(--bg-highlight);
}

.idleRow {
  opacity: 0.65;
}

.idleRow:hover {
  opacity: 1;
}

.rowMain {
  display: grid;
  grid-template-columns: 1fr 80px 120px 80px 28px;
  align-items: center;
  gap: 12px;
}

/* Terminal name + optional project badge — both in the 1fr column */
.nameCell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.termName {
  font-size: var(--font-md);
  color: var(--fg-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project {
  font-size: var(--font-xs);
  color: var(--fg-muted);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.agent {
  font-size: var(--font-sm);
  color: var(--fg-muted);
  text-transform: capitalize;
}

.status {
  font-size: var(--font-sm);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  white-space: nowrap;
}

.statusWorking {
  background: rgba(78, 201, 176, 0.2);
  color: var(--success);
  font-weight: 600;
}

.statusWaiting {
  background: rgba(220, 220, 170, 0.2);
  color: var(--warning);
}

.statusRateLimited {
  background: rgba(244, 135, 113, 0.2);
  color: var(--error);
}

.statusIdle {
  background: var(--bg-tertiary);
  color: var(--fg-muted);
}

.lastActivity {
  font-size: var(--font-sm);
  color: var(--fg-muted);
  text-align: right;
  white-space: nowrap;
}

/* Promote to global workspace button */
.promoteBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-sm);
  opacity: 0.4;
  transition: opacity 0.15s, color 0.15s;
}

.promoteBtn:hover {
  opacity: 1;
  color: var(--fg-primary);
  background: var(--bg-highlight);
}

.promoteBtn.promoted {
  opacity: 1;
  color: var(--accent);
}

.promoteBtn.promoted:hover {
  color: var(--fg-primary);
}

/* Sub-rows: current task, last prompt, agent intent */
.subRow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-left: 2px;
  min-width: 0;
}

.subIcon {
  flex-shrink: 0;
  color: var(--fg-secondary);
  opacity: 0.6;
}

.subText {
  font-size: var(--font-xs);
  color: var(--fg-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

.footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: var(--font-sm);
  color: var(--fg-muted);
}
