/* ═══════════════════════════════════════════════════════════════════════════
   Data Builder overview — "Pipeline Rings" (approved comp, 2026-09-07)

   A campaign portfolio read the way a project list is read: one quiet row each,
   a ring for how far it got through its four steps, and a status mark that
   differs in SHAPE as well as colour so it survives a colourblind reader and a
   greyscale print. Dense on purpose — this account holds 4,606 campaigns and the
   working set is the ~87 that are live.

   Scoped under .db-pr so none of it can reach the rest of the app. Mirrors' teal
   is kept for progress and the active state only; the primary button is ink.
   ═══════════════════════════════════════════════════════════════════════════ */

.db-pr {
  --pr-bg:      #FBFBFC;
  --pr-surface: #FFFFFF;
  --pr-ink:     #17181C;
  --pr-muted:   #6B6F76;
  --pr-faint:   #9A9EA6;
  --pr-line:    #E6E7EA;
  --pr-line-2:  #EEEFF1;
  --pr-hover:   #F7F8F9;
  --pr-sel:     #F0FBF9;

  --pr-deep:    #0F3A3A;

  --pr-live:    #0FB8A2;
  --pr-sched:   #C08A1A;
  --pr-held:    #D9463A;
  --pr-ended:   #9A9EA6;

  --pr-sans: "Figtree", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  /* The app's own control face and button colours, copied from .btn / .btn-teal
     in main.css so this page's toolbar is indistinguishable from every other. */
  --pr-ctl: "IBM Plex Sans", "Inter", system-ui, sans-serif;
  --pr-teal-hover: #088E89;

  /* The page runs edge to edge inside .app-content's 26px padding, as the comp
     draws it; width:auto lets the negative margins define both edges. */
  margin: -26px;
  width: auto;
  min-height: calc(100vh - 64px);
  padding: 0 0 24px;
  background: var(--pr-bg);
  color: var(--pr-ink);
  font-family: var(--pr-sans);
  font-variant-numeric: tabular-nums;
}
.db-pr *:focus-visible { outline: 2px solid var(--pr-live); outline-offset: 2px; border-radius: 5px; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.pr-hd {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 22px; background: var(--pr-surface); border-bottom: 1px solid var(--pr-line);
}
.pr-hd h1 { font-size: 15px; font-weight: 600; margin: 0 6px 0 0; letter-spacing: -.01em; white-space: nowrap; }

/* A card of pills, not a divided bar: the container carries the rounding and the
   selected view is a filled pill inside it, so which view you are in reads from
   across the room. 32px tall to sit level with .pr-chip and .pr-btn beside it. */
.pr-views {
  display: inline-flex; align-items: center; gap: 2px;
  height: 32px; padding: 3px; border: 1px solid var(--pr-line); border-radius: 9px;
  background: var(--pr-surface); box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.pr-views button {
  display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 10px;
  border: 0; border-radius: 6px; background: transparent;
  font-family: var(--pr-ctl); font-size: 13px; color: var(--pr-muted);
  cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.pr-views button:hover { background: var(--pr-hover); color: var(--pr-ink); }
.pr-views button.is-on,
.pr-views button.is-on:hover { background: var(--pr-deep); color: #fff; font-weight: 600; }
.pr-views i { font-size: 12px; }

.pr-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 10px;
  border: 1px solid rgba(15,58,58,.25); border-radius: 6px; background: var(--pr-surface);
  font-family: var(--pr-ctl); font-size: 13px; color: var(--pr-ink); cursor: pointer; white-space: nowrap;
  transition: border-color .15s ease, background .15s ease;
}
.pr-chip:hover { border-color: #CFD2D7; background: var(--pr-hover); }
.pr-chip small { color: var(--pr-muted); }
.pr-chip .bi { font-size: 11px; color: var(--pr-faint); }
.pr-chip--add { color: var(--pr-muted); border-style: dashed; }
.pr-chip--select { padding-right: 4px; cursor: default; }
.pr-chip--select select {
  border: 0; background: transparent; font-family: var(--pr-ctl); font-size: 13px; color: var(--pr-ink);
  padding: 4px 2px; cursor: pointer; outline: 0;
}

.pr-srch { position: relative; margin-left: auto; display: flex; align-items: center; }
.pr-srch .bi { position: absolute; left: 9px; font-size: 12px; color: var(--pr-faint); pointer-events: none; }
.pr-srch input {
  height: 32px; width: 200px; padding: 0 26px 0 28px; border: 1px solid rgba(15,58,58,.25); border-radius: 6px;
  background: var(--pr-surface); font-family: var(--pr-ctl); font-size: 13px; color: var(--pr-ink);
}
.pr-srch input::placeholder { color: var(--pr-faint); }
.pr-srch input:focus { outline: 0; border-color: var(--pr-live); box-shadow: 0 0 0 3px rgba(15,184,162,.15); }
.pr-srch button { position: absolute; right: 6px; border: 0; background: transparent; color: var(--pr-muted); cursor: pointer; padding: 2px; line-height: 1; border-radius: 4px; }
.pr-srch button:hover { background: var(--pr-line-2); color: var(--pr-ink); }

.pr-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border: 1px solid rgba(15,58,58,.25); border-radius: 6px; background: var(--pr-surface);
  font-family: var(--pr-ctl); font-size: 14px; font-weight: 400; color: #4A5E5E;
  cursor: pointer; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pr-btn:hover:not(:disabled) { background: var(--pr-hover); border-color: rgba(15,58,58,.4); color: var(--pr-ink); }
.pr-btn:disabled { opacity: .55; cursor: not-allowed; }
/* .btn-teal, verbatim: teal fill, white label, #088E89 on hover. */
.pr-btn--primary { background: var(--pr-live); border-color: var(--pr-live); color: #fff; }
.pr-btn--primary:hover:not(:disabled) { background: var(--pr-teal-hover); border-color: var(--pr-teal-hover); color: #fff; }
.pr-btn--primary:disabled { background: var(--pr-live); border-color: var(--pr-live); color: #fff; opacity: .55; }
.pr-btn .bi { font-size: 12px; }

/* ── Group heading ───────────────────────────────────────────────────────── */
.pr-grp {
  display: flex; align-items: center; gap: 8px; padding: 14px 22px 6px;
  font-size: 12px; font-weight: 600; color: var(--pr-muted);
  background: transparent; border: 0; width: 100%; text-align: left; cursor: pointer; font-family: inherit;
}
.pr-grp b { font-weight: 500; color: var(--pr-faint); }
.pr-grp .bi { font-size: 10px; color: var(--pr-faint); transition: transform .15s ease; }
.pr-grp.is-collapsed .bi { transform: rotate(-90deg); }

/* ── Rows ────────────────────────────────────────────────────────────────── */
.pr-th, .pr-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 116px 74px 108px 152px 84px 96px 92px;
  gap: 12px; align-items: center; padding: 0 22px;
}
.pr-th { padding-bottom: 6px; font-size: 11px; color: var(--pr-faint); }
.pr-th span:nth-child(6), .pr-th span:nth-child(7) { text-align: right; }
.pr-row {
  height: 46px; border-top: 1px solid var(--pr-line-2); font-size: 13px;
  background: transparent; border-left: 0; border-right: 0; border-bottom: 0;
  width: 100%; text-align: left; font-family: inherit; color: inherit; cursor: pointer;
  transition: background .12s ease;
}
.pr-row:hover { background: var(--pr-hover); }
.pr-row.is-on { background: var(--pr-sel); }

.pr-nm { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 500; }
.pr-nm > i { width: 8px; height: 8px; border-radius: 2px; flex: none; display: inline-block; background: var(--pr-ended); }
.pr-nm > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-nm > small { color: var(--pr-muted); font-weight: 400; flex: none; white-space: nowrap; }

.pr-st { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--pr-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The mark differs in shape as well as colour: filled for live, dashed ring for
   scheduled, filled red for held, hollow for ended. */
.pr-mark { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--pr-ended); flex: none; display: inline-block; }
.pr-mark--live  { background: var(--pr-live); border-color: var(--pr-live); }
.pr-mark--sched { background: transparent; border-color: var(--pr-sched); border-style: dashed; }
.pr-mark--held  { background: var(--pr-held); border-color: var(--pr-held); }
.pr-mark--ended { background: transparent; border-color: var(--pr-ended); }

.pr-ring { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--pr-muted); }
.pr-ring svg { width: 22px; height: 22px; transform: rotate(-90deg); flex: none; }
.pr-ring circle { transition: stroke-dasharray .3s ease; }

.pr-lead { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; min-width: 0; }
.pr-lead i { width: 20px; height: 20px; border-radius: 50%; background: #DCE9E6; color: var(--pr-ink); font-size: 10px; font-weight: 600; font-style: normal; display: flex; align-items: center; justify-content: center; flex: none; }
.pr-lead span { color: var(--pr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pr-dt { color: var(--pr-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-dt b { color: var(--pr-ink); font-weight: 500; }
.pr-n { text-align: right; color: #3E4148; }
.pr-n.is-zero { color: var(--pr-held); }

/* ── Archive / empty / error ─────────────────────────────────────────────── */
.pr-note {
  margin: 16px 22px 0; padding: 12px 14px; border: 1px solid var(--pr-line); border-radius: 8px;
  background: var(--pr-surface); display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 12.5px; color: var(--pr-muted); flex-wrap: wrap;
}
.pr-note b { color: var(--pr-ink); font-weight: 600; }
.pr-empty { margin: 16px 22px; border: 1px solid var(--pr-line); border-radius: 8px; background: var(--pr-surface); padding: 44px 24px; text-align: center; }
.pr-empty .bi { font-size: 24px; color: var(--pr-faint); }
.pr-empty h3 { font-size: 15px; font-weight: 600; margin: 12px 0 4px; }
.pr-empty p { font-size: 13px; color: var(--pr-muted); margin: 0 auto 14px; max-width: 54ch; }

.pr-skel { padding: 0 22px; }
.pr-skel div { height: 46px; border-top: 1px solid var(--pr-line-2); display: flex; align-items: center; }
.pr-skel span { display: block; height: 10px; width: 38%; border-radius: 5px;
  background: linear-gradient(90deg, var(--pr-line-2) 25%, #F5F6F8 37%, var(--pr-line-2) 63%);
  background-size: 400% 100%; animation: pr-shimmer 1.4s ease infinite; }
@keyframes pr-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pr-pgn { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px 0; font-size: 12.5px; color: var(--pr-muted); flex-wrap: wrap; }
.pr-pp { display: inline-flex; gap: 2px; }
.pr-pp button { min-width: 28px; height: 28px; padding: 0 7px; border: 1px solid transparent; background: transparent; border-radius: 6px; font: inherit; font-size: 12.5px; color: var(--pr-muted); cursor: pointer; transition: background .12s ease, color .12s ease; }
.pr-pp button:hover:not(:disabled):not(.is-on) { background: var(--pr-line-2); color: var(--pr-ink); }
.pr-pp button.is-on { background: var(--pr-ink); color: #fff; }
.pr-pp button:disabled { opacity: .4; cursor: not-allowed; }

/* ── Board view ──────────────────────────────────────────────────────────── */
.pr-board { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; padding: 14px 22px 0; align-items: start; }
.pr-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pr-col-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 6px; font-size: 12px; font-weight: 600; }
.pr-col-h span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.pr-col-h b { font-weight: 500; color: var(--pr-muted); background: var(--pr-surface); border: 1px solid var(--pr-line); border-radius: 10px; padding: 0 7px; font-size: 11px; }
.pr-card {
  background: var(--pr-surface); border: 1px solid var(--pr-line); border-radius: 9px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px; cursor: pointer; text-align: left; font-family: inherit; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pr-card:hover { border-color: #CFD2D7; box-shadow: 0 2px 8px -4px rgba(23,24,28,.2); }
.pr-card .t { font-size: 13px; font-weight: 600; line-height: 1.3; }
.pr-card .m { font-size: 11.5px; color: var(--pr-muted); }
.pr-card .k { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; color: var(--pr-muted); }
.pr-card .k b { color: var(--pr-ink); font-weight: 600; }
.pr-bar { height: 5px; border-radius: 3px; background: var(--pr-line-2); overflow: hidden; }
/* Scaled, not resized: animating width relayouts the bar on every frame, and a
   board can hold dozens of them. transform is composited. */
.pr-bar i { display: block; height: 100%; width: 100%; background: var(--pr-live);
  transform-origin: left center; transition: transform .3s ease; }
.pr-bar i.is-warn { background: var(--pr-held); }
.pr-bar i.is-sched { background: var(--pr-sched); }

/* ── Timeline view ───────────────────────────────────────────────────────── */
.pr-tl { padding: 14px 22px 0; --pr-tl-col: 240px; }
.pr-tl-wrap { position: relative; border: 1px solid var(--pr-line); border-radius: 8px; background: var(--pr-surface); overflow: hidden; }
.pr-tl-head { display: grid; grid-template-columns: var(--pr-tl-col) 1fr; border-bottom: 1px solid var(--pr-line); background: #FAFBFC; }
.pr-tl-head > span { font-size: 11px; color: var(--pr-faint); padding: 8px 12px; }
.pr-tl-months { display: grid; position: relative; }
.pr-tl-months span { font-size: 11px; color: var(--pr-faint); padding: 8px 6px; border-left: 1px solid var(--pr-line-2); white-space: nowrap; overflow: hidden; }
.pr-tl-row { display: grid; grid-template-columns: var(--pr-tl-col) 1fr; border-top: 1px solid var(--pr-line-2); align-items: center; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; font-family: inherit; color: inherit; cursor: pointer; }
.pr-tl-row:hover { background: var(--pr-hover); }
.pr-tl-nm { padding: 0 12px; height: 38px; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; font-weight: 500; }
.pr-tl-nm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-tl-track { position: relative; height: 38px; }
.pr-tl-bar { position: absolute; top: 10px; height: 18px; border-radius: 3px; font-size: 11px; line-height: 18px; padding: 0 8px; color: #05312C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--pr-live); }
.pr-tl-bar.is-sched { background: transparent; border: 1.5px dashed var(--pr-sched); color: #7A5709; line-height: 15px; }
.pr-tl-bar.is-ended { background: #D5D8DD; color: #3E4148; }
.pr-tl-bar.is-held  { background: #F7D9D6; color: #8A2A22; }
/* One rule across every row, not a marker inside the first one. */
.pr-tl-today { position: absolute; top: 33px; bottom: 0; width: 1.5px; background: var(--pr-held); z-index: 2; pointer-events: none; }
.pr-tl-today::before { content: "Today"; position: absolute; top: 2px; left: 4px; font-size: 9.5px; font-weight: 600; color: var(--pr-held); background: var(--pr-surface); padding: 0 3px; border-radius: 3px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .pr-th, .pr-row { grid-template-columns: minmax(0,1fr) 108px 66px 96px 132px 74px 84px; }
  .pr-th span:nth-child(8), .pr-row > :nth-child(8) { display: none; }
  .pr-board { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .pr-th { display: none; }
  .pr-row { grid-template-columns: minmax(0,1fr) 96px 66px; height: auto; padding: 10px 22px; }
  .pr-row > :nth-child(n+4) { display: none; }
  .pr-board { grid-template-columns: 1fr; }
  .pr-tl { --pr-tl-col: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  .db-pr *, .db-pr *::before, .db-pr *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
