/* Pipelines: the board (stage columns with cards), the pipeline editor and new-pipeline dialog.
   The side panel reuses the workflow builder's .fb-drawer styles. */
.pl { display: grid; gap: 12px; }
.pl-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-top .grow { flex: 1; }
.pl-pick { width: auto; min-width: 180px; font-weight: 700; }
.pl-sum { font-size: 12.5px; }
.pl-search { width: 200px; }

.pl-board { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 12px; align-items: flex-start; min-height: 420px; }
.pl-col { flex: 0 0 272px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 210px); }
/* Stage headers are joined arrows in the brand colour: rounded on the left, pointed on the right. */
.pl-col-head { position: relative; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 30px 0 18px; color: var(--brand-on);
  background: var(--brand); border-radius: 22px 0 0 22px; flex: none;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); font-size: 13.5px; }
.pl-col + .pl-col .pl-col-head { border-radius: 0; padding-left: 28px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%); }
.pl-col:last-child .pl-col-head { border-radius: 0 22px 22px 0; padding-right: 18px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 16px 50%); }
.pl-col:only-child .pl-col-head { border-radius: 22px; clip-path: none; padding: 0 18px; }
.pl-col-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; letter-spacing: .01em; }
.pl-count { margin-left: auto; min-width: 24px; text-align: center; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: rgba(255, 255, 255, .18); color: var(--brand-on); }
.pl-col-sub { flex: none; font-size: 12px; color: var(--muted); padding: 0 14px; font-variant-numeric: tabular-nums; }
.pl-col-body { flex: 1 1 auto; min-height: 120px; padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; margin: 0 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; transition: background .12s, box-shadow .12s; }
.pl-col-body.is-over { background: var(--accent-tint); box-shadow: inset 0 0 0 2px var(--accent); }
.pl-empty { flex: none; font-size: 12px; color: var(--faint); text-align: center; padding: 22px 0; border: 1.5px dashed var(--border-strong); border-radius: 14px; }
.pl-card { position: relative; display: grid; gap: 5px; text-align: left; padding: 11px 14px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--border); box-shadow: var(--shadow-1); cursor: pointer; color: var(--text); font: inherit; width: 100%; overflow: hidden; flex: none;
  transition: transform .12s var(--ease), box-shadow .12s; }
.pl-card[draggable="true"] { cursor: grab; }
.pl-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); border-color: var(--brand-tint-strong); }
.pl-card.is-drag { opacity: .45; transform: rotate(-1.5deg); }
.pl-card b { font-size: 13.5px; }
.pl-card-title { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.pl-card-meta .num { color: var(--text); font-weight: 600; }
.pl-card-meta .is-old { color: var(--warn-ink); font-weight: 600; }
.pl-card-meta .pill { font-size: 10.5px; padding: 0 7px; background: var(--brand-tint); color: var(--brand-ink); border-color: transparent; }
.pl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* editor */
.pe-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pe-stages li { border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; background: var(--surface); }
.pe-row { display: flex; align-items: center; gap: 4px; }
.pe-row .input { flex: 1; min-width: 0; height: 34px; }
.pe-row .icon-btn { width: 30px; height: 30px; }
.pe-row .icon-btn:disabled { opacity: .3; cursor: default; }
.pe-num { width: 20px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }

/* new pipeline */
.np-tpls { display: grid; gap: 8px; margin: 4px 0 6px; }
.np-tpl { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.np-tpl:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.np-tpl span { display: grid; gap: 2px; }
.np-tpl small { color: var(--muted); font-size: 12px; }

@media (max-width: 700px) {
  .pl-col { flex-basis: 240px; max-height: none; }
  .pl-search { width: 100%; }
}
