/* pages/connectome.css - Connectome (Nin) deploy panel */

.connectome-section {
  margin-bottom: var(--space-xl);
}

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

/* --- Nin card ------------------------------------------------------------ */

.nin-card .nin-session-id {
  font-family: var(--font-mono, monospace);
  color: var(--accent-secondary);
}

.nin-stats {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

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

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

.service-stat-value.muted {
  color: var(--text-muted);
}

/* 'error' state used by the Nin card (failed service) — missing from the
   shared badge/dot classes, defined here */
.service-status-badge.error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--status-error);
}

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

/* --- Repo rows ------------------------------------------------------------ */

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

.connectome-repo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 6px);
}

.connectome-repo-row.error {
  border-color: var(--status-error);
}

.repo-main {
  flex: 1;
  min-width: 0;
}

.repo-name {
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  margin-bottom: var(--space-xs);
}

.repo-git-line {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-branch {
  color: var(--accent-secondary);
  font-family: var(--font-mono, monospace);
}

.repo-commit {
  font-family: var(--font-mono, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-meta-line {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.repo-badge {
  padding: 1px 8px;
  border-radius: 10px;
  font-size: var(--text-xs);
  border: 1px solid var(--border-color);
}

.repo-badge.uptodate {
  color: var(--status-success);
  border-color: var(--status-success);
}

.repo-badge.behind {
  color: var(--status-warning);
  border-color: var(--status-warning);
}

.repo-badge.ahead {
  color: var(--accent-secondary);
}

.repo-badge.dirty {
  color: var(--status-error);
  border-color: var(--status-error);
}

.repo-badge.error {
  color: var(--status-error);
  border-color: var(--status-error);
}

.repo-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.repo-status-text {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* --- Deploy pane ------------------------------------------------------------ */

.deploy-pane {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 6px);
  padding: var(--space-md);
}

.deploy-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  font-family: var(--font-mono, monospace);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.deploy-status-badge {
  padding: 1px 10px;
  border-radius: 10px;
  font-size: var(--text-xs);
  border: 1px solid var(--border-color);
  text-transform: uppercase;
}

.deploy-status-badge.running {
  color: var(--status-warning);
  border-color: var(--status-warning);
}

.deploy-status-badge.done {
  color: var(--status-success);
  border-color: var(--status-success);
}

.deploy-status-badge.failed {
  color: var(--status-error);
  border-color: var(--status-error);
}

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

.deploy-step {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  font-family: var(--font-mono, monospace);
}

.deploy-step.ok .deploy-step-icon { color: var(--status-success); }
.deploy-step.failed .deploy-step-icon { color: var(--status-error); }
.deploy-step.running .deploy-step-icon { color: var(--status-warning); }

.deploy-step-output {
  flex-basis: 100%;
  margin: 0 0 var(--space-xs) var(--space-lg);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border-left: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 700px) {
  .connectome-repo-row {
    flex-direction: column;
    align-items: stretch;
  }
  .repo-actions {
    justify-content: flex-end;
  }
}
