/* ===== Project Card ===== */
.factory-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 150ms;
}

.factory-card:hover {
  box-shadow: var(--shadow-md);
}

.factory-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.factory-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.factory-card-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.factory-card-status.active { background: var(--accent-light); color: var(--accent); }
.factory-card-status.pending { background: var(--bg-secondary); color: var(--text-muted); }
.factory-card-status.completed { background: #D1FAE5; color: #059669; }
.factory-card-status.early-terminated { background: #FEF3C7; color: #D97706; }
.factory-card-status.aborted { background: #FEE2E2; color: #EF4444; }
.factory-card-status.error { background: #FEE2E2; color: #EF4444; }

.factory-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.factory-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.factory-card-progress {
  font-weight: 700;
  color: var(--accent);
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-light);
}

.factory-card-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity 150ms, color 150ms;
}

.factory-card:hover .factory-card-delete {
  opacity: 1;
}

.factory-card-delete:hover {
  color: #EF4444;
}

/* ===== Card-level Stepper (dots) ===== */
.factory-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.factory-step {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.factory-step-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  transition: background 200ms, box-shadow 200ms;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}

.factory-step-dot.done { background: #059669; color: white; font-size: 0; }
.factory-step-dot.done::after { content: ""; display: block; width: 6px; height: 3px; border-left: 1.5px solid white; border-bottom: 1.5px solid white; transform: rotate(-45deg) translateY(-0.5px); }
.factory-step-dot.active { background: var(--accent); color: white; box-shadow: 0 0 0 3px var(--accent-light); animation: factory-pulse 2s ease-in-out infinite; }
.factory-step-dot.pending { background: var(--border); color: var(--text-muted); }
.factory-step-dot.error { background: #EF4444; color: white; box-shadow: 0 0 0 3px #FEE2E2; font-size: 9px; font-weight: 800; }

@keyframes factory-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-light); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 15%, transparent); }
}

.factory-step-line {
  width: 12px;
  height: 2px;
  background: var(--border);
}

.factory-step-line.done { background: #059669; }
