/* ============================================================
   ProjectTelemetry — Common Data Environment
   assets/cde.css   ·   patch 172

   Builds on .co-* (change-orders.css), .cd-* (curves-dash.css /
   production.css) and the drawer/tree families in issues.css.
   Only what the document register adds lives here.
   ============================================================ */

/* Panel head with a caption beside the title. Scoped with .cde-hd so it does
   not restyle the other dashboards that share .cd-list-hd. */
.cd-list-hd.cde-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cd-list-hd.cde-hd h4 { margin: 0; font: inherit; letter-spacing: inherit; }
.cd-list-hd.cde-hd .cd-soft { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; }

/* ── the split: folder tree beside the register ──────────── */
.cde-split { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.cde-main  { min-width: 0; }

.cde-tree {
  border: 1px solid var(--bd); border-radius: 12px; background: var(--white);
  box-shadow: var(--shadow); padding: 8px 6px; display: flex; flex-direction: column; gap: 1px;
}
.cde-fnode {
  display: flex; align-items: center; gap: 7px; padding: 6px 6px 6px 8px;
  border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--ink); min-height: 30px;
}
.cde-fnode:hover { background: var(--bg2); }
.cde-fnode.on { background: var(--accent-bg); color: var(--accent); font-weight: 650; }
.cde-fnode > i:first-child { font-size: 15px; color: var(--ink-faint); flex: none; }
.cde-fnode.on > i:first-child { color: var(--accent); }
.cde-fnode > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cde-flock { font-size: 12px; color: var(--ink-faint); flex: none; }

/* The folder controls only appear on the row you are pointing at, so the tree
   reads as a tree rather than as a wall of buttons. */
.cde-fnode .co-ico { opacity: 0; width: 22px; height: 22px; flex: none; }
.cde-fnode:hover .co-ico, .cde-fnode.on .co-ico { opacity: 1; }
.cde-fnode .co-ico i { font-size: 13px; }

.cde-newroot { margin: 8px 4px 4px; justify-content: center; }

/* ── documents ───────────────────────────────────────────── */
.cde-lockico { color: #B45309; font-size: 13px; margin-left: 3px; }
.cde-cur td { background: var(--accent-bg); }
.cde-curtag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); margin-left: 4px;
}
.co-pill.cde-vpill { background: var(--bg2); color: var(--ink-soft); border-color: var(--bd); font-variant-numeric: tabular-nums; }
.co-pill.accent    { background: var(--accent-bg); color: var(--accent); border-color: transparent; }

/* ── document status ─────────────────────────────────────── */
.co-pill.cde-s-draft             { background: var(--bg2); color: var(--ink-faint); border-color: var(--bd); }
.co-pill.cde-s-in_review         { background: rgba(99,102,241,.12); color: #4F46E5; }
.co-pill.cde-s-approved          { background: rgba(22,163,74,.12); color: #15803D; }
.co-pill.cde-s-approved_as_noted { background: rgba(13,148,136,.12); color: #0F766E; }
.co-pill.cde-s-revise            { background: rgba(217,119,6,.12); color: #B45309; }
.co-pill.cde-s-rejected          { background: rgba(220,38,38,.10); color: #B91C1C; }
.co-pill.cde-s-void              { background: var(--bg2); color: var(--ink-faint); border-color: var(--bd); text-decoration: line-through; }

/* ── review status ───────────────────────────────────────── */
.co-pill.cde-r-draft             { background: var(--bg2); color: var(--ink-faint); border-color: var(--bd); }
.co-pill.cde-r-open              { background: rgba(14,165,233,.11); color: #0284C7; }
.co-pill.cde-r-approved          { background: rgba(22,163,74,.12); color: #15803D; }
.co-pill.cde-r-approved_as_noted { background: rgba(13,148,136,.12); color: #0F766E; }
.co-pill.cde-r-revise            { background: rgba(217,119,6,.12); color: #B45309; }
.co-pill.cde-r-rejected          { background: rgba(220,38,38,.10); color: #B91C1C; }
.co-pill.cde-r-void              { background: var(--bg2); color: var(--ink-faint); border-color: var(--bd); text-decoration: line-through; }

/* ── package status. Issued is solid, because it is final. ── */
.co-pill.cde-p-draft  { background: var(--bg2); color: var(--ink-faint); border-color: var(--bd); }
.co-pill.cde-p-issued { background: #16A34A; color: #fff; border-color: transparent; }
.co-pill.cde-p-void   { background: var(--bg2); color: var(--ink-faint); border-color: var(--bd); text-decoration: line-through; }

/* ── a reviewer's decision ───────────────────────────────── */
.co-pill.cde-d-pending           { background: transparent; color: var(--ink-faint); border-color: var(--bd); }
.co-pill.cde-d-approved          { background: rgba(22,163,74,.12); color: #15803D; }
.co-pill.cde-d-approved_as_noted { background: rgba(13,148,136,.12); color: #0F766E; }
.co-pill.cde-d-revise            { background: rgba(217,119,6,.12); color: #B45309; }
.co-pill.cde-d-rejected          { background: rgba(220,38,38,.10); color: #B91C1C; }

/* ── review steps: the shape of who signs, and in what order ── */
.cde-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.cde-step {
  border: 1px solid var(--bd); border-left: 3px solid var(--bd);
  border-radius: 9px; padding: 10px 12px; background: var(--white);
}
.cde-step.open { border-left-color: var(--accent); background: var(--accent-bg); }
.cde-step.pass { border-left-color: #16A34A; }
.cde-step.fail { border-left-color: #DC2626; }
.cde-step-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cde-step-h strong { font-size: 12.5px; color: var(--ink); }
.cde-step-h .cd-soft { font-size: 11px; }

.cde-rvr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 4px 0; }
.cde-rvr > span:first-child { font-size: 12.5px; color: var(--ink); }
.cde-rvr p {
  grid-column: 1 / -1; margin: 2px 0 6px; font-size: 12px; line-height: 1.5;
  color: var(--ink-soft); white-space: pre-wrap;
}

/* ── portfolio: where the documents stand ────────────────── */
.cde-srow { display: grid; grid-template-columns: 120px 1fr 40px; align-items: center; gap: 10px; padding: 5px 2px; }
.cde-sl { font-size: 12.5px; color: var(--ink-soft); }
.cde-st { height: 8px; border-radius: 5px; background: var(--bg2); overflow: hidden; }
.cde-st i { display: block; height: 100%; border-radius: 5px; }
.cde-sn { text-align: right; font-size: 12.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.cde-b-draft             { background: var(--ink-faint); opacity: .45; }
.cde-b-in_review         { background: #4F46E5; }
.cde-b-approved          { background: #16A34A; }
.cde-b-approved_as_noted { background: #0F766E; }
.cde-b-revise            { background: #D97706; }
.cde-b-rejected          { background: #DC2626; }
.cde-b-void              { background: var(--bd); }

/* ── narrow ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cde-split { grid-template-columns: 1fr; }
  .cde-tree  { max-height: 240px; overflow-y: auto; }
  .cde-fnode .co-ico { opacity: 1; }
  .cde-srow  { grid-template-columns: 100px 1fr 34px; }
}
