/* Admin · Cycle Reports — only what is specific to this page. The shell, cards, pills, tables,
   controls and modal all come from /shared/admin.css.

   Where this differs from the Health Check page is the longitudinal furniture: a cycle chip, a
   sample-verdict banner, a per-principle drift table and a findings-by-cycle sparkline. A cycle
   report is read as one point on a line, so the page has to show the line. */

/* ------------------------------- Reports table ------------------------------- */
/* Pure fr tracks, no minmax floors: proportional columns cannot sum past the container. */
.cr-reports { --adm-cols: 2.4fr 0.7fr 0.9fr 1fr 0.9fr 0.9fr 0.8fr; }

.cr-cycle-chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: #EEF2F8; border: 1px solid #DDE4EE; border-radius: 999px; padding: 3px 10px;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11.5px; color: #3B4757;
}
.cr-mode {
  font-family: "Lexend", sans-serif; font-weight: 600; font-size: 11.5px;
  color: var(--adm-muted); white-space: nowrap;
}
.cr-delta { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 13px; white-space: nowrap; }
.cr-delta--down { color: var(--adm-ok-fg); }
.cr-delta--up { color: var(--adm-bad-fg); }
.cr-delta--flat { color: var(--adm-muted); }

.cr-score {
  display: inline-flex; align-items: center; justify-content: center; min-width: 46px;
  border-radius: 999px; padding: 4px 10px;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12.5px;
}
.cr-score--none { background: var(--adm-idle-bg); border: 1px solid var(--adm-idle-bd); color: var(--adm-idle-fg); }
.cr-score--good { background: var(--adm-ok-bg); border: 1px solid var(--adm-ok-bd); color: var(--adm-ok-fg); }
.cr-score--fair { background: var(--adm-info-bg); border: 1px solid var(--adm-info-bd); color: var(--adm-info-fg); }
.cr-score--work { background: var(--adm-warn-bg); border: 1px solid var(--adm-warn-bd); color: var(--adm-warn-fg); }
.cr-score--risk { background: var(--adm-bad-bg); border: 1px solid var(--adm-bad-bd); color: var(--adm-bad-fg); }

.cr-row-actions { display: flex; justify-content: flex-end; }
.cr-empty-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px;
  border-radius: 16px; background: var(--adm-ok-bg); margin-bottom: 14px;
}
.cr-empty-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 18px; color: var(--adm-ink); margin-bottom: 6px; }
.cr-empty-body { font-size: 14.5px; color: var(--adm-muted); max-width: 460px; margin: 0 auto 18px; }

/* ------------------------------- Report view ------------------------------- */
.cr-back {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: none; padding: 0;
  cursor: pointer; font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13.5px; color: #5F6A79;
  align-self: flex-start;
}
.cr-back:hover { color: var(--adm-ink); }

.cr-context { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 24px 26px; }
.cr-context-eyebrow {
  font-family: "Lexend", sans-serif; font-weight: 800; font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--adm-muted); margin-bottom: 7px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.cr-context-org { font-family: "Lexend", sans-serif; font-weight: 800; font-size: 27px; line-height: 1.1; letter-spacing: -0.5px; color: var(--adm-ink); margin: 0 0 6px; }
.cr-context-meta { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; font-size: 13.5px; color: var(--adm-muted); }
/* The separator lives inside the span it precedes, so it is never orphaned at a wrap. */
.cr-context-rest { display: inline-flex; align-items: center; gap: 11px; }
.cr-context-sep { width: 3px; height: 3px; border-radius: 50%; background: #C2CBD8; flex: 0 0 auto; }
.cr-facts { flex: 0 0 auto; display: flex; gap: 24px; flex-wrap: wrap; }
.cr-fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cr-fact-value { font-family: "Lexend", sans-serif; font-weight: 800; font-size: 17px; color: var(--adm-ink); line-height: 1; }
.cr-fact-label { font-size: 11.5px; color: var(--adm-muted); white-space: nowrap; }

.cr-rep-tabs { display: flex; gap: 28px; padding: 0 26px; border-bottom: 1px solid #E7EBF1; flex-wrap: wrap; }
.cr-rep-tab {
  appearance: none; background: none; border: none; cursor: pointer; padding: 16px 2px;
  font-family: "Lexend", sans-serif; font-size: 14.5px; font-weight: 600; color: var(--adm-muted);
  border-bottom: 3px solid transparent;
}
.cr-rep-tab[aria-selected="true"] { font-weight: 700; color: var(--adm-ink); border-bottom-color: var(--adm-red); }
.cr-rep-body { padding: 26px; position: relative; }

/* ------------------------------- Generation panel ------------------------------- */
.cr-gen { padding: 24px 26px; background: #F7F9FC; border: 1px solid var(--adm-line-soft); border-radius: 16px; }
.cr-gen-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.cr-gen-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 16px; color: var(--adm-ink); }
.cr-gen-note { font-size: 13.5px; color: var(--adm-muted); padding-left: 30px; }
.cr-gen-rule { height: 1px; background: #E4E9F1; margin: 20px 0 6px; }
.cr-gen-steps { display: flex; flex-direction: column; gap: 2px; }
.cr-gen-step { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 9px; }
.cr-gen-step[data-state="current"] { background: rgba(31, 169, 122, 0.08); }
.cr-gen-mark { flex: 0 0 auto; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.cr-gen-label { flex: 1; min-width: 0; font-family: "Lexend", sans-serif; font-weight: 600; font-size: 14px; color: var(--adm-body); }
.cr-gen-step[data-state="pending"] .cr-gen-label { color: var(--adm-muted); font-weight: 500; }
.cr-gen-elapsed { flex: 0 0 auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--adm-muted); }
.cr-spin {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid #CDEDE1; border-top-color: #1FA97A; animation: crSpin .9s linear infinite;
}
.cr-spin--lg { width: 18px; height: 18px; }
.cr-dot-pending { width: 9px; height: 9px; border-radius: 50%; background: #D8DEE8; }
@keyframes crSpin { to { transform: rotate(360deg); } }

/* ------------------------------- Documents ------------------------------- */
.cr-doc { max-width: 68rem; font-size: 14px; line-height: 1.7; color: var(--adm-body); }
.cr-doc h1 {
  font-family: "Lexend", sans-serif; font-weight: 800; font-size: 24px; letter-spacing: -0.4px;
  color: var(--adm-ink); margin: 0 0 10px;
}
.cr-doc h2 { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 19px; color: var(--adm-ink); margin: 30px 0 4px; }
.cr-doc h2::after { content: ""; display: block; height: 2px; background: var(--adm-red); margin-top: 6px; margin-bottom: 14px; }
.cr-doc h3 { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 15px; color: var(--adm-ink); margin: 24px 0 10px; }
.cr-doc h1:first-child, .cr-doc h2:first-child, .cr-doc h3:first-child { margin-top: 0; }
.cr-doc p { margin: 0 0 12px; }
.cr-doc ul, .cr-doc ol { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.cr-doc li { line-height: 1.65; }
.cr-doc strong { font-family: "Lexend", sans-serif; font-weight: 700; color: var(--adm-ink); }
.cr-doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: #F2F5FA; border-radius: 4px; padding: 1px 5px; }
.cr-doc pre {
  margin: 0 0 14px; background: #F7F9FC; border: 1px solid var(--adm-line-soft); border-radius: 9px;
  padding: 13px 15px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.6;
}
.cr-doc blockquote {
  margin: 0 0 18px; padding: 14px 16px; background: #FBFCFE;
  border: 1px solid var(--adm-line-soft); border-left: 3px solid var(--adm-red); border-radius: 0 10px 10px 0;
  color: var(--adm-muted); font-size: 13.5px;
}
.cr-doc table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 13px; }
.cr-doc thead th {
  text-align: left; background: #F7F9FC; border-bottom: 1px solid var(--adm-line);
  padding: 10px 12px; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--adm-muted);
}
.cr-doc tbody td { padding: 10px 12px; border-bottom: 1px solid var(--adm-line-soft); vertical-align: top; overflow-wrap: anywhere; }
.cr-doc tbody tr:last-child td { border-bottom: none; }
.cr-doc em { color: var(--adm-muted); }

.cr-doc-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.cr-doc-actions .adm-note { margin-left: auto; }

/* ------------------------------- Sample verdict ------------------------------- */
.cr-verdict { border-radius: 16px; padding: 18px 20px; margin-bottom: 22px; border: 1px solid; }
.cr-verdict--holds { background: var(--adm-ok-bg); border-color: var(--adm-ok-bd); }
.cr-verdict--tune { background: var(--adm-warn-bg); border-color: var(--adm-warn-bd); }
.cr-verdict--recompose { background: var(--adm-bad-bg); border-color: var(--adm-bad-bd); }
.cr-verdict-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cr-verdict-title { font-family: "Lexend", sans-serif; font-weight: 800; font-size: 17px; }
.cr-verdict--holds .cr-verdict-title { color: var(--adm-ok-fg); }
.cr-verdict--tune .cr-verdict-title { color: var(--adm-warn-fg); }
.cr-verdict--recompose .cr-verdict-title { color: var(--adm-bad-fg); }
.cr-verdict-peak { font-size: 13px; color: var(--adm-body); }
.cr-verdict-body { font-size: 13.5px; line-height: 1.6; color: var(--adm-body); }

/* Per-principle drift. The bar is a magnitude cue only; every row states its number as text. */
.cr-drift { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.cr-drift-row { display: grid; grid-template-columns: 8rem minmax(0, 1fr) 5.5rem; gap: 12px; align-items: center; }
.cr-drift-name { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13px; color: var(--adm-ink); }
.cr-drift-track { position: relative; height: 10px; border-radius: 999px; background: #EEF1F6; overflow: hidden; }
.cr-drift-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.cr-drift-fill--over { background: var(--adm-bad-dot); }
.cr-drift-fill--under { background: var(--adm-ok-dot); }
.cr-drift-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--adm-body); text-align: right; }
.cr-drift-legend { font-size: 12px; color: var(--adm-muted); margin-top: 12px; line-height: 1.5; }

/* ------------------------------- Trend ------------------------------- */
.cr-trend-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.cr-trend-card { background: #fff; border: 1px solid var(--adm-line); border-radius: 14px; padding: 14px 16px; }
.cr-trend-value { font-family: "Lexend", sans-serif; font-weight: 800; font-size: 22px; line-height: 1; color: var(--adm-ink); }
.cr-trend-label { font-size: 12px; color: var(--adm-muted); margin-top: 6px; }

/* The findings-by-cycle curve. An SVG polyline with a text table beneath it, so the shape is a
   convenience and the numbers remain readable without it. */
.cr-spark { background: #fff; border: 1px solid var(--adm-line); border-radius: 14px; padding: 18px 20px; margin-bottom: 20px; }
/* The plot is zero-based, so the axis is labelled: a nearly-flat line is the honest picture of a
   small change, and the 0-to-max labels stop it reading as a rendering fault. */
.cr-spark-plot { position: relative; padding-left: 44px; }
.cr-spark svg { display: block; width: 100%; height: 120px; overflow: visible; }
.cr-spark-max, .cr-spark-zero {
  position: absolute; left: 0; width: 38px; text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--adm-muted);
}
.cr-spark-max { top: 8px; }
.cr-spark-zero { bottom: -2px; }
.cr-spark-caption { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12.5px; color: var(--adm-muted); margin-bottom: 12px; }
.cr-spark-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--adm-muted); }

.cr-movers { display: flex; flex-direction: column; gap: 18px; }
.cr-mover-group-title { display: flex; align-items: center; gap: 9px; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 14px; color: var(--adm-ink); margin-bottom: 8px; }

/* ------------------------------- CS note ------------------------------- */
.cr-notes { display: flex; flex-direction: column; gap: 26px; max-width: 68rem; }
.cr-notes-lead {
  background: #FEF4F2; border: 1px solid #F3B9AE; border-radius: 14px; padding: 14px 16px;
  font-size: 13.5px; line-height: 1.6; color: var(--adm-body);
}
.cr-notes-lead strong { color: #B03024; }
.cr-notes-h { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 20px; color: var(--adm-ink); margin: 0 0 4px; }
.cr-notes-rule { height: 2px; background: var(--adm-red); margin-bottom: 16px; }
.cr-check { font-size: 14px; line-height: 1.7; margin: 0; }
.cr-check strong { font-family: "Lexend", sans-serif; font-weight: 700; color: var(--adm-warn-fg); }
.cr-swap { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cr-swap-box { background: #FBFCFE; border: 1px solid var(--adm-line-soft); border-radius: 14px; padding: 16px 18px; }
.cr-swap-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 13px; color: var(--adm-ink); margin-bottom: 4px; }
.cr-swap-note { font-size: 12.5px; color: var(--adm-muted); margin-bottom: 12px; line-height: 1.5; }
.cr-swap-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; overflow-wrap: anywhere; }
.cr-patterns { --adm-cols: 0.7fr 2.6fr 0.5fr; border: 1px solid #E4E9F1; border-radius: 10px; overflow: hidden; }
.cr-patterns .adm-thead { background: var(--adm-ink); border-bottom: none; }
.cr-patterns .adm-th { color: #fff; }

/* ------------------------------- Wizard ------------------------------- */
.cr-wizard { width: 640px; }
.cr-steps { display: flex; gap: 5px; padding: 0 28px; margin-top: 16px; }
.cr-step-seg { flex: 1; height: 4px; border-radius: 999px; background: #E7EBF1; }
.cr-step-seg[data-on="true"] { background: var(--adm-red); }
.cr-wizard-body { padding: 22px 28px 26px; }
.cr-wizard-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px 28px; border-top: 1px solid #EFF1F6; background: #FBFCFE; border-radius: 0 0 22px 22px;
}
/* The hint takes the leftover width and wraps inside it, so the buttons stay on the footer row. */
.cr-wizard-hint { flex: 1 1 0; min-width: 0; font-size: 12.5px; line-height: 1.45; color: var(--adm-muted); }
.cr-eyebrow {
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--adm-muted); margin-bottom: 10px;
}
.cr-acct { border: 1px solid var(--adm-line-soft); border-radius: 14px; overflow: hidden; margin-bottom: 22px; }
.cr-acct-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--adm-line-soft); }
.cr-acct-row:last-child { border-bottom: none; }
.cr-acct-mark { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cr-acct-mark--held { background: var(--adm-ok-bg); }
.cr-acct-mark--needs { background: var(--adm-warn-bg); }
.cr-acct-label { flex: 0 0 158px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-acct-name { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--adm-ink); }
.cr-acct-hint { font-size: 11.5px; color: var(--adm-muted); }
.cr-acct-value { flex: 1; min-width: 0; font-size: 13.5px; color: var(--adm-body); }

.cr-sample-opt {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1.6px solid var(--adm-field); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
}
.cr-sample-opt[aria-pressed="true"] { border-color: var(--adm-red); background: #FEF7F5; }
.cr-sample-radio {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #C9D3E0;
  display: flex; align-items: center; justify-content: center;
}
.cr-sample-opt[aria-pressed="true"] .cr-sample-radio { border-color: var(--adm-red); background: var(--adm-red); }
.cr-sample-radio span { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.cr-sample-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cr-sample-label { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 14.5px; color: var(--adm-ink); }
.cr-sample-note { font-size: 12.5px; color: var(--adm-muted); line-height: 1.45; }
.cr-sample-tag {
  flex: 0 0 auto; background: var(--adm-info-bg); border: 1px solid var(--adm-info-bd); color: var(--adm-info-fg);
  border-radius: 999px; padding: 3px 10px; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11px;
}

.cr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cr-recap { background: #FBFCFE; border: 1px solid var(--adm-line-soft); border-radius: 14px; padding: 15px 17px; }
.cr-recap-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 4px 0; }
.cr-recap-key { flex: 0 0 auto; font-size: 12.5px; color: var(--adm-muted); }
.cr-recap-val { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 12.5px; color: var(--adm-ink); text-align: right; min-width: 0; }
.cr-recap-val--unset { color: var(--adm-bad-fg); }

.cr-textarea {
  width: 100%; min-height: 96px; resize: vertical; padding: 13px 15px;
  border: 1.6px solid var(--adm-field); border-radius: 12px;
  font-family: "Mulish", sans-serif; font-size: 14px; line-height: 1.6; color: var(--adm-body); outline: none;
}
.cr-textarea:focus { border-color: #2F6FE0; box-shadow: 0 0 0 4px rgba(47, 111, 224, 0.12); }

/* ------------------------------- Combo box ------------------------------- */
/* Its own component rather than the shared RMSelect: the panel is `position: fixed` and placed
   from the trigger's rect, because an absolute panel inside the modal's scrolling body is clipped
   by the scroll box and the list becomes unreachable. */
.cr-combo { position: relative; width: 100%; }
.cr-combo-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  background: #fff; border: 1.6px solid var(--adm-field); border-radius: 11px; padding: 10px 13px;
  cursor: pointer; font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--adm-ink);
  text-align: left;
}
.cr-combo-trigger:disabled { cursor: not-allowed; background: #F7F9FC; color: var(--adm-muted); }
.cr-combo-trigger[data-empty="true"] { color: var(--adm-muted); font-weight: 500; }
.cr-combo-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-combo-chev { flex: 0 0 auto; color: var(--adm-muted); transition: transform .15s ease; }
.cr-combo-trigger[aria-expanded="true"] .cr-combo-chev { transform: rotate(180deg); }
.cr-combo-panel {
  position: fixed; z-index: 90; background: #fff; border: 1px solid #D8DEE8; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(16, 26, 40, 0.18); overflow: hidden;
}
.cr-combo-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--adm-line-soft); }
.cr-combo-search input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-family: "Mulish", sans-serif; font-size: 14px; color: var(--adm-ink); }
.cr-combo-list { max-height: 216px; overflow-y: auto; }
.cr-combo-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; padding: 10px 13px; border-bottom: 1px solid var(--adm-line-soft);
}
.cr-combo-opt:last-child { border-bottom: none; }
.cr-combo-opt:hover, .cr-combo-opt:focus-visible { background: #F7F9FC; }
.cr-combo-opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-combo-opt-label { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--adm-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-combo-opt-note { font-size: 12px; color: var(--adm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-combo-none { padding: 18px 14px; text-align: center; font-size: 13px; color: var(--adm-muted); }

.cr-error { background: var(--adm-bad-bg); border: 1px solid var(--adm-bad-bd); color: var(--adm-bad-fg); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; }

@media (max-width: 1200px) {
  .cr-reports { --adm-cols: minmax(0, 1fr); }
  .cr-grid2 { grid-template-columns: 1fr; }
  .cr-drift-row { grid-template-columns: 6.5rem minmax(0, 1fr) 4.5rem; }
}
