/* ================================================
   QA/QC Stages Panel
   ================================================ */

.stages-panel {
  width: var(--stages-w);
  min-width: var(--stages-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  overflow: hidden;
}

/* Panel Header */
.stages-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--gold-border);
  flex-shrink: 0;
}
.stages-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Stages Scroll */
.stages-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Stage Item ── */
.stage-item {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.stage-item:hover { border-color: var(--gold-border-hv); }
.stage-item.open  { border-color: rgba(201,168,76,0.45); box-shadow: var(--shadow-gold); }

/* Stage Header (accordion trigger) */
.stage-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}
.stage-header:hover { background: var(--bg-card-hover); }

/* Stage Number Badge */
.stage-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold-dim), rgba(201,168,76,0.5));
  border: 1px solid var(--gold-border-hv);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-bright);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.stage-item.open .stage-num {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #0e0e0e;
  box-shadow: 0 2px 10px rgba(201,168,76,0.3);
}

/* Stage Icon */
.stage-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stage-icon svg { width: 18px; height: 18px; stroke: var(--gold); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Stage Title */
.stage-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.stage-item.open .stage-title { color: var(--gold-light); }

/* Chevron */
.stage-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.stage-chevron svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stage-item.open .stage-chevron { transform: rotate(180deg); color: var(--gold); }

/* Stage Body */
.stage-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
}
.stage-item.open .stage-body { max-height: 320px; }
.stage-body-inner {
  padding: 0 14px 14px;
  border-top: 1px solid var(--gold-border);
  padding-top: 12px;
}

/* Disciplines Grid */
.disciplines-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px 8px;
  margin-bottom: 12px;
}
.discipline-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-secondary);
  padding: 4px 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.discipline-item:hover {
  background: var(--gold-glow);
  color: var(--gold-light);
  transform: translateY(-0.5px);
}
.discipline-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-dim);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.discipline-item:hover .discipline-dot {
  background: var(--gold);
  box-shadow: 0 0 5px var(--gold);
}

/* Quick Action Buttons */
.stage-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.stage-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.stage-btn svg { width: 13px; height: 13px; stroke: var(--gold); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.stage-btn:hover {
  background: var(--gold-glow);
  border-color: var(--gold-border-hv);
  color: var(--gold);
  transform: translateY(-1px);
}
.stage-btn:active { transform: scale(0.97); }

/* Stage Selection Header Action */
.stage-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--gold-glow);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 8px;
  opacity: 0.85;
}
.stage-select-btn svg {
  stroke: var(--gold);
  transition: stroke 0.2s ease;
}
.stage-select-btn:hover {
  opacity: 1;
  background: var(--gold);
  color: #0e0e0e;
  border-color: var(--gold-border-hv);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.35);
  transform: translateY(-0.5px);
}
.stage-select-btn:hover svg {
  stroke: #0e0e0e;
}
.stage-select-btn:active {
  transform: scale(0.95);
}
