/* Reports hub. Uses the shared tokens and the page header / empty state from admin-ui.css; light and dark follow them. */

.rh-ic{ width: 16px; height: 16px; flex: none; }
.rh-muted{ margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.rh-count{ display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--chip); color: var(--ink-muted); font-size: 12px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; vertical-align: 2px; }
.rh-banner{ margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--info-bg); color: var(--ink); font-size: 13px; line-height: 18px; }

/* pinned and recent */
.panel:has(> #rhShelf:empty){ display: none; }
.rh-shelf{ display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) var(--space-5); }
#rhShelf{ display: flex; flex-direction: column; gap: var(--space-3); }
.rh-shelf-row{ display: flex; align-items: flex-start; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.rh-shelf-label{ flex: 0 0 132px; padding-top: 6px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-muted); }
.rh-shelf-list{ display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; min-width: 0; flex: 1 1 260px; }
.rh-chiplink{ display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 32px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 500; text-decoration: none; }
.rh-chiplink span{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-chiplink:hover{ background: var(--hover); border-color: var(--edge); }
.rh-chiplink .rh-pin-ic{ color: var(--brand-dark); fill: currentColor; fill-opacity: .18; }
.rh-pin-ic{ width: 16px; height: 16px; flex: none; }

/* quick run */
.rh-quick{ padding: var(--space-5); }
.rh-quick-head{ margin-bottom: var(--space-3); }
.rh-quick-head h3{ margin: 0 0 2px; }
.rh-quick-grid{ display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: var(--space-2) var(--space-5); align-items: start; }
.rh-quick-grid .field{ margin-bottom: 0; }
.rh-presets{ margin: 0; padding: 0; border: 0; min-width: 0; }
.rh-presets legend{ padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
.rh-preset{ display: inline-block; margin: 0 6px 6px 0; cursor: pointer; }
.rh-preset input{ position: absolute; opacity: 0; width: 1px; height: 1px; }
.rh-preset span{ display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 500; transition: background 150ms, border-color 150ms; }
.rh-preset:hover span{ background: var(--hover); border-color: var(--edge); }
.rh-preset input:checked + span{ background: var(--cta); border-color: var(--cta); color: var(--cta-ink); }
.rh-preset input:focus-visible + span{ outline: 2px solid var(--focus); outline-offset: 2px; }
.rh-custom{ grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.rh-custom .field{ flex: 0 1 180px; }
.rh-quick-foot{ display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3) var(--space-5); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.rh-quick-sum{ display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 280px; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.rh-quick-sum strong{ color: var(--ink); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.rh-q-err{ color: var(--critical); font-weight: 500; }
.rh-quick .btn:disabled{ opacity: .5; cursor: not-allowed; }

/* search and filters */
.rh-find{ display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-6) 0 var(--space-4); }
.rh-search{ position: relative; max-width: 520px; }
.rh-search input{ width: 100%; padding-left: 42px !important; }
.rh-search-ic{ position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.rh-filters{ display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.rh-filter{ display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); min-width: 0; }
.rh-filter-label{ font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.rh-chips{ display: flex; flex-wrap: wrap; gap: 6px; }
.rh-fchip{ height: 32px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 150ms, border-color 150ms; }
.rh-fchip:hover{ background: var(--hover); border-color: var(--edge); }
.rh-fchip.on{ background: var(--cta); border-color: var(--cta); color: var(--cta-ink); }
.rh-count-line{ font-size: 13px; color: var(--ink-muted); min-height: 18px; }

/* groups and cards */
.rh-group{ margin-bottom: var(--space-6); }
.rh-group > summary{ cursor: pointer; list-style: none; }
.rh-group > summary::-webkit-details-marker{ display: none; }
.rh-group > summary > h3{ margin: 0 0 var(--space-3); font-size: 16px; line-height: 24px; font-weight: 500; }
.rh-group > summary > h3::before{ content: '\25B8'; display: inline-block; width: 18px; color: var(--ink-muted); }
.rh-group[open] > summary > h3::before{ content: '\25BE'; }
.rh-group > h3, .rh-locked > h3{ margin: 0 0 var(--space-3); font-size: 16px; line-height: 24px; font-weight: 500; }
.rh-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-4); }
.rh-card{ display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--elev-1); }
.rh-card-top{ display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.rh-card h4{ margin: 0; font-size: 15px; line-height: 22px; font-weight: 500; letter-spacing: -0.01em; }
.rh-pin{ flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -4px -8px 0 0; border: 0; border-radius: 999px; background: transparent; color: var(--ink-faint); cursor: pointer; }
.rh-pin:hover{ background: var(--hover); color: var(--ink); }
.rh-pin.on{ color: var(--brand-dark); }
.rh-pin.on .rh-pin-ic{ fill: currentColor; fill-opacity: .2; }
.rh-answers{ margin: 0; font-size: 14px; line-height: 20px; color: var(--text); }
.rh-badges{ display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rh-badges .ov-chip{ text-transform: none; }
.rh-locked-why .ov-chip{ text-transform: none; }
.rh-fmt{ display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.rh-fresh{ margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.rh-for{ display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rh-for-label{ margin-right: 2px; font-size: 12px; font-weight: 500; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.rh-role{ display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--chip); color: var(--ink-muted); font-size: 12px; font-weight: 500; }
.rh-actions{ display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; padding-top: var(--space-2); }
.rh-note{ margin: 0; font-size: 12px; line-height: 17px; color: var(--ink-faint); }
.rh-card-msg{ margin-top: var(--space-1); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--critical-bg); color: var(--critical); font-size: 13px; line-height: 18px; }
.rh-card-msg.hidden{ display: none; }
.rh-quick .rh-card-msg{ margin-top: var(--space-3); }

/* reports this role cannot use */
.rh-locked{ margin: var(--space-7) 0 var(--space-4); padding-top: var(--space-5); border-top: 1px dashed var(--line-2); }
.rh-locked .rh-muted{ margin-bottom: var(--space-3); }
.rh-locked-list{ display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); overflow: clip; }
.rh-locked-row{ display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-5); padding: var(--space-3) var(--space-5); opacity: .82; }
.rh-locked-row + .rh-locked-row{ border-top: 1px solid var(--line); }
.rh-locked-main{ display: flex; flex-direction: column; gap: 2px; flex: 1 1 320px; min-width: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.rh-locked-main strong{ font-size: 14px; font-weight: 500; color: var(--text); }
.rh-locked-why{ display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.rh-for-sm .rh-role{ height: 20px; }
.rh-none-line{ margin: var(--space-4) 0; }

@media (max-width: 760px){
  .rh-quick-grid{ grid-template-columns: 1fr; }
  .rh-custom{ grid-column: 1; }
  .rh-shelf{ padding: var(--space-4); }
  .rh-shelf-label{ flex-basis: 100%; padding-top: 0; }
  .rh-grid{ grid-template-columns: 1fr; }
  .rh-quick{ padding: var(--space-4); }
  .rh-quick-foot .btn{ width: 100%; }
  .rh-search{ max-width: none; }
  .rh-locked-row{ padding: var(--space-3) var(--space-4); }
}
@media (max-width: 760px){
  .rh-pin{ width: 44px; height: 44px; margin: -12px -14px 0 0; }
}
