/* Reports hub and report view (owner 20.11.2026). Same tokens and parts as app.css: .btn, .card, .tbl, .seg.
   Logical properties only, so Hebrew (RTL) and English (LTR) both lay out right. */

.rh-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rh-caret { width: 14px; height: 14px; color: var(--muted); }
.rh-label { display: block; font-weight: 600; font-size: 13px; }

/* ---------------------------------------------------------------- hub */

.rh-hub { padding: 14px 16px; margin-bottom: 16px; }
.rh-cats { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.rh-pop { position: relative; }
.rh-cat { gap: 8px; padding-inline: 12px; font-weight: 600; }
.rh-cat .rh-ico { color: var(--accent); }
.rh-cat[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); }
.rh-count {
  min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; line-height: 18px;
}

.rh-menu {
  position: absolute; z-index: 20; top: calc(100% + 4px); inset-inline-start: 0;
  min-width: 260px; max-width: min(420px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 6px 20px var(--shadow-soft); padding: 4px 0;
}
.rh-menu ul { list-style: none; margin: 0; padding: 0; }
.rh-menu li + li { border-top: 1px solid var(--border); }
.rh-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 14px; min-height: 36px;
  background: none; border: 0; text-align: start; cursor: pointer; color: var(--text);
}
.rh-item:hover, .rh-item:focus-visible { background: var(--surface-2); }
.rh-item > span:first-child { flex: 1; }
.rh-item-fav { display: inline-flex; color: var(--ser-5); }
.rh-item-fav .rh-ico { width: 15px; height: 15px; fill: currentColor; }
.rh-menu-title { font-weight: 600; font-size: 13px; margin: 6px 14px 8px; }

.rh-quick { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; padding-top: 12px; }
.rh-block h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.rh-h-ico { width: 15px; height: 15px; color: var(--ser-5); fill: currentColor; }
.rh-empty { color: var(--muted); font-size: 13px; margin: 0; }

.rh-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rh-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; min-height: 76px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; text-align: start; color: var(--text);
}
.rh-tile:hover { background: var(--surface-2); border-color: var(--border-strong); }
.rh-tile .rh-ico { width: 20px; height: 20px; color: var(--accent); }
.rh-tile-name { font-weight: 600; line-height: 1.3; }
.rh-tile-cat { font-size: 12px; color: var(--muted); }

.rh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rh-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; min-height: 30px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 15px; cursor: pointer; color: var(--text); font-size: 13px;
}
.rh-chip:hover { background: var(--surface-2); border-color: var(--border-strong); }
.rh-chip .rh-ico { width: 15px; height: 15px; color: var(--muted); }

/* ---------------------------------------------------------------- filters */

.rh-filters { padding-top: 14px; }
.rh-cur-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rh-cur-ico { display: inline-flex; line-height: 0; color: var(--accent); }
.rh-cur-ico .rh-ico { width: 22px; height: 22px; }
.rh-cur { font-size: 18px; margin: 0; }
.rh-cur-cat { font-size: 13px; }

.rh-frow { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-start; }
.rh-frow .field { margin-bottom: 0; }
.rh-frow .field:first-child { flex: 1 1 240px; min-width: 200px; }
.rh-frow .field input[type="date"] { width: 160px; }
.rh-frow .field-btn { padding-top: 23px; }
.rh-presets { flex-direction: row; align-items: center; gap: 10px; margin: 10px 0 0; }
.rh-presets .rh-label { font-weight: 400; color: var(--muted); }
.rh-presets .seg { flex-wrap: wrap; }
.rh-presets .seg-btn { font-weight: 400; color: var(--text); }
.rh-presets .seg-btn[aria-pressed="true"] { color: var(--on-accent); font-weight: 600; }
.rh-qbtn { gap: 6px; min-width: 150px; justify-content: space-between; }
.rh-qpanel { padding: 10px 14px 12px; min-width: 320px; }
.rh-qlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; max-height: 260px; overflow-y: auto; margin-bottom: 8px; }
.rh-qlist .field { margin-bottom: 4px; }
.rh-hist { margin: 10px 0 0; }
.rpt-notbuilt summary { cursor: pointer; color: var(--muted); }

/* ---------------------------------------------------------------- one report */

.rh-rhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.rh-rtitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.rh-rtitle h2 { font-size: 17px; margin: 0; }
.rh-rt-ico { width: 20px; height: 20px; color: var(--accent); align-self: center; }
.rh-ractions { display: flex; flex-wrap: wrap; gap: 6px; }
.rh-ractions .btn .rh-ico, .rh-tools .btn .rh-ico { width: 16px; height: 16px; }
.rh-fav[aria-pressed="true"] { border-color: var(--ser-5); }
.rh-fav[aria-pressed="true"] .rh-ico { color: var(--ser-5); fill: currentColor; }

.rh-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.rh-views .seg-btn { display: inline-flex; align-items: center; gap: 6px; }
.rh-views .rh-ico { width: 16px; height: 16px; }
.rh-colbtn { gap: 6px; }
.rh-colpanel { padding: 4px 14px 12px; min-width: 280px; }
.rh-collist { max-height: 320px; overflow-y: auto; }
.rh-collist .field { margin-bottom: 4px; }
.rh-colmsg { margin: 4px 0 8px; }
.rh-searchf { flex: 0 1 220px; }
.rh-search {
  width: 100%; min-height: 28px; padding: 3px 8px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
}
.rh-search:focus { border-color: var(--accent); }
.rh-exports { display: flex; flex-wrap: wrap; gap: 6px; }
.rh-status { font-size: 13px; color: var(--ok); }
.rh-status:empty { display: none; }
.rh-charts:empty { display: none; }
.rh-tbl { max-width: 100%; }
.rh-foot { font-size: 12px; margin: 6px 0 0; }
.rh-nomatch { padding: 8px 2px; }

/* ---------------------------------------------------------------- print: only the report (built into #rh-print) */

#rh-print { display: none; }
@media print {
  body.rh-printing { background: #fff; }
  body.rh-printing > *:not(#rh-print) { display: none !important; }
  body.rh-printing #rh-print { display: block; color: #000; font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #rh-print h1 { font-size: 16px; margin: 0 0 4px; }
  #rh-print > p { margin: 0 0 10px; color: #333; }
  #rh-print .tbl-wrap { overflow: visible; border: 0; }
  #rh-print .tbl { table-layout: auto; width: 100%; }
  #rh-print .tbl th, #rh-print .tbl td { padding: 2px 4px; border-bottom: 1px solid #bbb; font-size: 9.5px; }
  #rh-print .tbl thead th, #rh-print .tbl .n, #rh-print .nowrap { white-space: normal; }
  #rh-print .tbl thead th { background: #eee; color: #000; }
  #rh-print .tbl thead { display: table-header-group; }
  #rh-print tr { break-inside: avoid; }
  #rh-print .rc-list { display: block; }
  #rh-print .rc { border: 0; padding: 0; margin-bottom: 10px; break-inside: avoid; }
  #rh-print .rpt-summary { margin-bottom: 8px; }
  #rh-print .rpt-summary .bignum { padding: 6px 10px; }
  #rh-print .bignum-value { font-size: 20px; }
  #rh-print .col-note { display: none; }
}

@media (max-width: 900px) {
  .rh-quick { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

/* charts inside the report view keep their own block layout */
.rh-charts .rc, #rh-print .rc { display: block; }
.rh-charts .rc-list { grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); }

/* q36: sortable headings that stay in view; heat map legend */
.rh-tbl { max-height: 70vh; overflow: auto; }
.rpt-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); box-shadow: 0 1px 0 var(--border-strong); }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.th-sort:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 2px; }
th[aria-sort="ascending"] .th-sort::after { content: '\25B2'; font-size: .7em; }
th[aria-sort="descending"] .th-sort::after { content: '\25BC'; font-size: .7em; }
.rc-hm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.rc-hm-key { display: inline-flex; align-items: center; gap: 5px; }
.rc-hm-sw { width: 16px; height: 12px; border: 1px solid var(--border); display: inline-block; }
/* owner 22.11: what a report is for and how to read it */
.rh-help { margin: 0 0 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.rh-help summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.rh-help p { margin: 8px 0 0; line-height: 1.6; max-width: 110ch; }
