/* ---- Settings › Pipelines (B-073, pages/settings-pipelines.js). Prefix .spl- ---- */
.settings-page.spl-page { max-width: 820px; }
/* The stage editor (components/pipeline-editor.js) replaces the list in place and needs the full width. */
.settings-page.spl-page.spl-editing { max-width: none; display: flex; flex-direction: column; min-height: 0; flex: 1; }

.spl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-6); margin-bottom: var(--sp-6); }
.spl-head .settings-title { margin-bottom: var(--sp-3); }
.spl-intro { margin: 0; color: var(--text); line-height: 21px; max-width: 560px; }
.spl-add { gap: var(--sp-3); flex: none; margin-top: var(--sp-1); }
.spl-add .ic svg { width: 14px; height: 14px; display: block; }
.spl-readonly { margin-bottom: var(--sp-5); }

.spl-list {
  display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-surface); overflow: hidden;
}
.spl-list[data-loaded='0'] { padding: var(--sp-5); }

.spl-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-4); min-height: 48px; padding: 0 var(--sp-5) 0 var(--sp-4);
  border-top: 1px solid var(--border); transition: background var(--t-fast) var(--ease);
}
.spl-row:first-child { border-top: 0; }
.spl-row[data-id]:hover { background: var(--bg-hover); }
.spl-row.is-dragging { display: none; }
/* The dragged row's place while it is lifted (UX-129). */
.spl-slot {
  flex: none; box-sizing: border-box; height: 48px; margin: var(--sp-1) var(--sp-3); border: 1px dashed var(--border-strong);
  border-radius: var(--r-md); background: var(--bg-app);
}
.spl-row.is-new { animation: spl-new 1.6s var(--ease) 1; }
@keyframes spl-new { from { background: var(--bg-selected); } to { background: transparent; } }

.spl-header {
  min-height: 36px; background: var(--bg-app); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2);
}
.spl-header .spl-main { cursor: default; }
.spl-handle-space { width: 24px; flex: none; }

.spl-handle {
  width: 24px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--text-muted); cursor: grab; padding: 0;
}
.spl-handle svg { width: 16px; height: 16px; display: block; }
.spl-handle:hover { color: var(--text-2); background: rgba(0, 0, 0, 0.05); }
.spl-handle:active { cursor: grabbing; }
.spl-handle:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 0; }

/* Name | Stages | Deals: the whole block is one button for admins (opens the stage editor). */
.spl-main {
  flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 120px 110px; align-items: center;
  gap: var(--sp-5); min-height: 47px; padding: 0 var(--sp-2); border: 0; background: none; font: inherit; color: inherit;
  text-align: left;
}
button.spl-main { cursor: pointer; border-radius: var(--r-sm); }
button.spl-main:hover .spl-name { color: var(--link); }
button.spl-main:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.spl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-semibold); }
.spl-header .spl-name { font-weight: var(--fw-semibold); }
.spl-count { display: inline-flex; align-items: center; gap: var(--sp-3); color: var(--text-2); white-space: nowrap; }
.spl-count .ic svg { width: 14px; height: 14px; display: block; }

.spl-actions { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 92px; justify-content: flex-end; }
.spl-header .spl-actions { min-height: 1px; }
.spl-act { width: 28px; height: 28px; color: var(--text-2); opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.spl-act svg { width: 16px; height: 16px; }
.spl-row:hover .spl-act, .spl-act:focus-visible, .spl-row:focus-within .spl-act { opacity: 1; }
.spl-act:disabled { opacity: 0 !important; pointer-events: none; }
.spl-del:hover { color: var(--red); }
/* UX-130: a pipeline with deals: the trash is shown but blocked; its tip says why. */
.spl-del.is-blocked, .spl-del.is-blocked:hover { color: var(--text-muted); cursor: not-allowed; background: none; }
.spl-row:hover .spl-del.is-blocked, .spl-del.is-blocked:focus-visible { opacity: 0.45; }

/* Delete dialog: the kit confirm card with an 18px/600 title and room for the server's refusal. */
.spl-dialog { --spl-error-bg: #fdeceb; }
.spl-dialog-title { margin: 0; font-size: 18px; line-height: 24px; font-weight: var(--fw-semibold); color: var(--text); }
.spl-dialog-error {
  padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md); background: var(--spl-error-bg); color: var(--red);
  font-size: var(--fs-md); line-height: 20px;
}
.spl-dialog-error[hidden] { display: none; }

/* The lifted copy: solid card with the board's card-drag shadow, so it never mixes with the text under it. */
.spl-ghost {
  position: fixed; z-index: 1000; pointer-events: none; box-sizing: border-box; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-surface); cursor: grabbing;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.08), 0 0 4px rgba(0, 0, 0, 0.12);
}
.spl-ghost .spl-act { opacity: 0; }
.spl-ghost.is-snapping { transition: transform 150ms ease; }
html.spl-grabbing, html.spl-grabbing * { cursor: grabbing !important; user-select: none; }
.spl-drop-line {
  flex: none; height: 2px; margin: -1px var(--sp-3); background: var(--blue-bright); border-radius: 1px;
  position: relative; z-index: 1;
}

.spl-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); padding: var(--sp-9) var(--sp-6);
  text-align: center; color: var(--text-2);
}
.spl-empty-art, .spl-empty-art svg { width: 120px; height: 96px; display: block; }
.spl-empty-title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text); }
.spl-empty-text { max-width: 320px; }

.spl-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

@media (max-width: 640px) {
  .spl-head { flex-direction: column; }
  .spl-main { grid-template-columns: minmax(0, 1fr) auto; }
  .spl-deals { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .spl-row, .spl-act, .spl-ghost.is-snapping { transition: none; }
  .spl-row.is-new { animation: none; }
}
