/* التقارير and one report (sheikh/reports.js), in the navy design canvas. The table, filters, number cards and bars come
   from sheikh.css; cards from interview.css; the level chips (.pp-grade-*), gold positions and counts from people.css.
   A report prints on its own: the menu, the page buttons and the way back are left off paper. */
.rs-chip { height: 24px; gap: 4px; font-weight: 700; }
.rs-untested { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.rs-dot { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-mark); }
.rs-dots { position: absolute; top: 16px; left: 18px; width: 46px; height: 30px; opacity: .28; color: #fff; pointer-events: none;
  background-image: radial-gradient(currentColor 1.3px, transparent 1.6px); background-size: 8px 8px; }
.rs-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.rs-card-head h2 { margin: 0; font-size: var(--text-lg); font-weight: 700; }
.rs-card-head small { font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); }
.rs-score { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rs-score b { font-size: var(--text-input); font-weight: 800; }
.rs-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.rs-fit { align-self: flex-start; }

/* ---------- the list ---------- */
/* the top row: the waiting report in navy, the period in two figures, the weekly average */
.rs-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; align-items: stretch; }
.rs-col { display: grid; gap: 16px; }
.rs-col .kpi { row-gap: 12px; }
.rs-stat.rs-stopped .kpi-ic { background: var(--danger-bg); color: var(--danger); }

.rs-hero { position: relative; overflow: hidden; gap: 16px; padding: 20px 24px 22px; background: var(--grad); color: var(--on-accent); box-shadow: var(--shadow-navy); }
.rs-hero h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: var(--text-base); font-weight: 700; color: rgba(255, 255, 255, .88); }
.rs-hero-who { display: flex; align-items: center; gap: 14px; }
.rs-hero-who .small-avatar { width: 60px; height: 60px; background: rgba(255, 255, 255, .16); box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); }
.rs-hero-id { flex: 1; min-width: 0; }
.rs-hero-id p { margin: 0; }
.rs-hero-name { font-size: var(--text-2xl); font-weight: 800; line-height: 1.3; }
.rs-hero-meta { margin-top: 2px !important; font-size: var(--text-md); color: rgba(255, 255, 255, .78); }
.rs-hero-score { margin: 0; display: grid; justify-items: end; gap: 6px; }
.rs-hero-score b { font-size: 36px; font-weight: 800; line-height: 1; }
.rs-hero-facts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); border-radius: 14px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.rs-hero-facts > div { display: grid; align-content: start; gap: 7px; padding: 12px 16px; }
.rs-hero-facts > div + div { box-shadow: inset -1px 0 0 rgba(255, 255, 255, .12); }
.rs-hero-facts dt { font-size: var(--text-sm); color: rgba(255, 255, 255, .72); }
.rs-hero-facts dd { margin: 0; display: flex; align-items: center; gap: 6px; font-size: var(--text-xl); font-weight: 800; line-height: 24px; white-space: nowrap; }
.rs-hero-facts dd small { font-size: var(--text-sm); font-weight: 500; color: rgba(255, 255, 255, .72); }
.rs-hero .pp-arrow { color: rgba(255, 255, 255, .7); }
.rs-hero-acts { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rs-hero-acts .btn { height: 52px; padding: 0 22px; white-space: nowrap; border: 0; font-size: var(--text-input); font-weight: 700; }
.btn.rs-white { background: var(--surface); color: var(--brand-hover); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .45); }
.btn.rs-glass { background: rgba(255, 255, 255, .12); color: var(--on-accent); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24); }
.rs-hero-note { margin-inline-start: auto; font-size: var(--text-sm); color: rgba(255, 255, 255, .75); }
@media (hover: hover) and (pointer: fine) {
  .btn.rs-white:hover { background: var(--navy-wash); }
  .btn.rs-glass:hover { background: rgba(255, 255, 255, .2); }
}

/* the weekly average: one line, the newest week in gold, the week under the pointer in a tip */
.rs-trend { gap: 4px; padding: 18px 22px 16px; }
.rs-trend .rs-card-head { margin-bottom: 10px; }
.rs-trend-n { margin: 0; display: flex; align-items: center; gap: 10px; }
.rs-trend-n b { font-size: 34px; font-weight: 800; line-height: 1.1; }
.rs-chart { position: relative; flex: 1; min-height: 92px; margin: 16px 8px 0; }
.rs-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rs-line { fill: none; stroke: var(--navy-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rs-ref { position: absolute; inset-inline: 0; height: 1px; background: var(--line); }
.rs-ref span { position: absolute; inset-inline-start: 0; bottom: 4px; font-size: var(--text-2xs); font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.rs-ref.end span { inset-inline: auto 0; }
.rs-pt { position: absolute; width: 26px; height: 26px; margin: 0 0 -13px -13px; display: grid; place-items: center; border-radius: 50%; }
.rs-pt::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--navy-2); box-shadow: 0 0 0 2px var(--surface); }
.rs-pt.now::before { width: 12px; height: 12px; background: var(--gold-mark); }
.rs-tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translate(-50%, 4px); padding: 6px 9px; border-radius: 9px; background: var(--ink); color: var(--on-accent);
  font-size: var(--text-xs); font-weight: 700; line-height: 1.3; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 150ms ease-out, transform 200ms cubic-bezier(.23, 1, .32, 1); }
.rs-pt:hover .rs-tip, .rs-pt:focus-visible .rs-tip { opacity: 1; transform: translate(-50%, 0); }
.rs-pt.edge-r .rs-tip { left: auto; right: -6px; transform: translateY(4px); }
.rs-pt.edge-l .rs-tip { left: -6px; transform: translateY(4px); }
.rs-pt:is(.edge-r, .edge-l):is(:hover, :focus-visible) .rs-tip { transform: none; }
.rs-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: var(--text-sm); color: var(--ink-2); }

/* every report: one white card, the filters on top, a heading row per day */
.rs-list { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.rs-list > .rs-card-head { padding: 18px 22px 6px; }
.rs-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 22px 16px; }
/* «تحديد»: picking drafts to merge or drop; the bar stays in sight while the list scrolls */
.rs-card-head .rs-select { height: 36px; padding: 0 14px; margin-inline-start: auto; }
.rs-card-head .rs-select.on { background: var(--navy-wash); border-color: var(--navy-2); color: var(--navy-2); }
.rs-sel { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.rs-tbl tr.rs-picked > td { background: var(--navy-wash); }
.rs-selbar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 0 22px 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--navy-2); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-navy); }
.rs-selbar.ask { border-color: var(--amber); background: var(--amber-bg); }
.rs-selbar p { flex: 1 1 auto; min-width: min(220px, 100%); display: grid; align-content: start; gap: 2px; margin: 0; font-size: var(--text-md); }
.rs-selbar p span { color: var(--ink-2); font-size: var(--text-sm); }
.rs-selbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-selbar-actions .btn { height: 40px; padding: 0 14px; }
.rs-selbar-actions .btn:disabled { opacity: .45; }
.btn.rs-del { color: var(--danger); border-color: var(--danger-bg); }
.btn.rs-danger { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.rs-filters .seg-tabs { background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); }
.rs-pick { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding-inline: 14px 6px; border-radius: var(--radius-pill); background: var(--fill); box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--text-md); font-weight: 500; color: var(--ink-2); transition: box-shadow 150ms ease-out; }
.rs-pick select { min-width: 150px; min-height: 40px; border: 0; outline: 0; background: transparent; padding-inline: 2px 8px; font-size: var(--text-base); font-weight: 700; color: var(--ink); cursor: pointer; }
.rs-pick:focus-within { box-shadow: inset 0 0 0 2px var(--navy-2); }
.rs-list .tbl-box { border-radius: 0; box-shadow: none; }
.rs-tbl th, .rs-tbl td { padding-inline: 12px; }
.rs-tbl th:first-child, .rs-tbl td:first-child { padding-inline-start: 22px; }
.rs-tbl th:last-child, .rs-tbl td:last-child { padding-inline-end: 22px; text-align: end; }
.rs-tbl .rs-day th { padding: 11px 22px; background: var(--fill); border-top: 1px solid var(--line); font-size: var(--text-md); font-weight: 700; color: var(--ink); text-align: start; }
.rs-tbl .rs-day th span { font-weight: 500; color: var(--ink-2); }
.rs-tbl .rs-day-wait th { background: var(--gold); color: var(--gold-ink); }
.rs-tbl .rs-day-wait .rs-dot { margin-inline-end: 8px; vertical-align: middle; }
.rs-tbl tr.rs-draft td { background: #FFFCF5; }
.rs-tbl tbody tr:hover td { background: var(--navy-wash); }
.rs-who { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.rs-who .small-avatar { width: 34px; height: 34px; }
.rs-who small { display: block; font-size: var(--text-sm); color: var(--ink-2); }
.rs-sec { min-width: 110px; color: var(--ink-2); font-size: var(--text-md); line-height: 1.45; }   /* a long section name takes two lines */
.rs-mis { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 700; white-space: nowrap; }
.rs-mis.rs-none { font-weight: 500; color: var(--ink-2); }
.rs-tbl .btn.rs-open { height: 36px; padding: 0 12px; border: 0; background: none; color: var(--ink); font-size: var(--text-md); font-weight: 700; white-space: nowrap; }
.rs-tbl .btn.rs-open:hover { color: var(--brand); background: var(--brand-soft); }
.rs-tbl .btn.rs-review { padding: 0 16px; background: var(--brand-soft); color: var(--brand); }
.rs-tbl .btn.rs-review:hover { background: #DDE3F4; }
.rs-empty { padding: 32px 14px; text-align: center; color: var(--ink-2); }
.rs-foot { margin: 0; padding: 14px 22px 18px; border-top: 1px solid var(--line); font-size: var(--text-sm); color: var(--ink-2); }

@media (max-width: 1100px) {
  .rs-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rs-hero { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .rs-top { grid-template-columns: minmax(0, 1fr); }
  .rs-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .rs-col .kpi { padding: 16px; }
  .rs-hero { padding: 18px 18px 20px; }
  .rs-hero-who { flex-wrap: wrap; }
  .rs-hero-name { font-size: var(--text-xl); }
  .rs-hero-score { flex: 1 1 100%; grid-auto-flow: column; justify-content: start; align-items: center; }
  .rs-hero-facts { grid-template-columns: minmax(0, 1fr); }
  .rs-hero-facts > div + div { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
  .rs-hero-acts .btn { flex: 1; padding: 0 14px; }
  .rs-hero-note { margin-inline-start: 0; }
  .rs-filters { padding-inline: 16px; }
  .rs-filters .seg-tabs { max-width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-mask-image: linear-gradient(to right, transparent, #000 28px); mask-image: linear-gradient(to right, transparent, #000 28px); }
  .rs-pick { flex: 1 1 100%; }
  .rs-pick select { flex: 1; min-width: 0; }
  /* each report a row as in an iPhone list: the student and the day, the score; the passage and «راجع واعتمد» / «افتح»
     (the day's heading says which wait for him) */
  .rs-tbl thead { display: none; }
  .rs-tbl, .rs-tbl tbody, .rs-tbl .rs-day, .rs-tbl .rs-day th { display: block; }
  .rs-tbl tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who score" "pos go"; align-items: center; gap: 10px 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
  .rs-tbl tbody td { display: none; padding: 0 !important; border: 0; background: none !important; }
  .rs-tbl td:nth-child(1) { display: block; grid-area: who; min-width: 0; }
  .rs-tbl td:nth-child(3) { display: block; grid-area: pos; min-width: 0; }
  .rs-tbl td:nth-child(5) { display: block; grid-area: score; }
  .rs-tbl td:nth-child(7) { display: block; grid-area: go; }
  .rs-tbl td.rs-empty { display: block; grid-column: 1 / -1; }
  .rs-tbl tr.rs-draft { background: #FFFCF5; }
  .rs-tbl .btn.rs-open { height: 44px; }
}

/* ---------- one report ---------- */
.rs-report { display: flex; flex-direction: column; gap: 20px; }
.rs-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: -8px; font-weight: 700; text-decoration: none; }
.rs-missing { align-items: flex-start; }
/* the draft: a soft gold card (not yet sent), and the way to approve it */
.rs-draft-note { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px 16px; padding: 16px 20px; background: #FFFBF1; box-shadow: 0 0 0 1px var(--gold-edge), 0 8px 22px -14px rgba(138, 100, 32, .25); }
.rs-draft-note .rs-ic { background: var(--gold); color: var(--gold-ink); }
.rs-draft-text { flex: 1 1 360px; min-width: 0; }
.rs-draft-text h2 { margin: 0; font-size: var(--text-input); font-weight: 700; }
.rs-draft-text p { margin: 2px 0 0; font-size: var(--text-md); line-height: 1.55; color: var(--ink-2); }
.rs-draft-note .btn { height: 52px; padding: 0 22px; font-weight: 700; }

.rs-top2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; align-items: stretch; }
.rs-head { padding: 8px; }
.rs-dl { height: 100%; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; }
.rs-dl > div { display: grid; align-content: center; gap: 9px; padding: 14px 16px; }
.rs-dl > div:nth-child(n + 4) { border-top: 1px solid var(--line); }
.rs-dl > div:not(:nth-child(3n + 1)) { box-shadow: inset -1px 0 0 var(--line); }
.rs-dl dt { font-size: var(--text-sm); color: var(--ink-2); }
.rs-dl dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--text-input); font-weight: 700; line-height: 1.4; }
.rs-dl .rs-who { color: var(--ink); text-decoration: none; }
.rs-dl .rs-who:hover b { color: var(--brand); }
/* the navy total, with the ممتاز line on its bar */
.rs-total { position: relative; overflow: hidden; gap: 12px; padding: 20px 24px 22px; background: var(--grad); color: var(--on-accent); box-shadow: var(--shadow-navy); }
.rs-total h2 { margin: 0; font-size: var(--text-base); font-weight: 700; color: rgba(255, 255, 255, .86); }
.rs-total-n { margin: 0; display: flex; align-items: center; gap: 12px; }
.rs-total-n b { font-size: 52px; font-weight: 800; line-height: 1; }
.rs-scale { position: relative; margin-top: 6px; }
.rs-scale .bar { height: 8px; background: rgba(255, 255, 255, .18); }
.rs-scale .bar i { background: #E9C77D; }
.rs-tick { position: absolute; top: -4px; width: 2px; height: 16px; border-radius: 1px; background: #fff; opacity: .85; }
.rs-scale small { display: block; margin-top: 8px; text-align: end; font-size: var(--text-sm); color: rgba(255, 255, 255, .78); }
.rs-total-sub { margin: auto 0 0; font-size: var(--text-md); line-height: 1.6; color: rgba(255, 255, 255, .82); }

.rs-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.rs-side { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.rs-report .i-card { padding: 18px 22px 20px; }
.rs-report .i-card.rs-head { padding: 8px; }
.rs-report .i-card > h2 { margin: 0; font-size: var(--text-lg); font-weight: 700; }
/* each category in a soft tile: its percent, its bar, its items with their level */
.rs-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rs-cat { padding: 16px 16px 10px; border-radius: var(--radius-lg); background: var(--fill); }
.rs-cat > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rs-cat h3 { margin: 0; font-size: var(--text-input); font-weight: 700; }
.rs-cat .rs-score b { font-size: var(--text-lg); }
.rs-cat .bar { height: 6px; margin: 12px 0 6px; background: var(--fill-2); }
.rs-cat ul { list-style: none; margin: 0; padding: 0; }
.rs-cat li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 6px 0; font-size: var(--text-base); line-height: 1.45; }
.rs-cat li + li { border-top: 1px solid var(--line); }
.rs-cat li .chip { flex: none; }
.rs-legend { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--ink-2); }
.rs-legend .chip { height: 22px; }
/* the memorisation mistakes: three marks, the third stops the reading */
.rs-count { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.rs-count b { font-size: 40px; font-weight: 800; line-height: 1; }
.rs-count span { font-size: var(--text-input); font-weight: 700; color: var(--ink-2); }
.rs-count.stop b, .rs-count.stop span { color: var(--danger); }
.rs-pips { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rs-pips li { display: grid; gap: 6px; font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); }
.rs-pips li::before { content: ""; height: 8px; border-radius: 4px; background: var(--fill-2); }
.rs-pips li.on { color: var(--gold-ink); font-weight: 700; }
.rs-pips li.on::before { background: var(--gold-mark); }
.rs-pips li.stop { color: var(--danger); }
.rs-pips li.stop::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--danger); }
.rs-pips li.stop.on::before { background: var(--danger); }
.rs-stop { margin: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--danger-bg); color: var(--danger); font-size: var(--text-md); line-height: 1.6; }
.rs-next { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 14px 16px; border-radius: 14px; background: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-edge); color: var(--gold-ink); font-size: var(--text-md); font-weight: 700; }
.rs-next .pp-pos { height: 28px; padding: 0 11px; background: var(--surface); font-size: var(--text-base); }
/* his notes, each on its ayah */
.rs-notes { list-style: none; margin: 0; padding: 0; }
.rs-notes li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 10px 0; }
.rs-notes li + li { border-top: 1px solid var(--line); }
.rs-notes .pp-pos { margin-top: 1px; }
.rs-notes p { margin: 0; font-size: var(--text-base); line-height: 1.55; }

@media (max-width: 1100px) { .rs-top2, .rs-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .rs-dl { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .rs-dl > div { grid-template-columns: 72px minmax(0, 1fr); align-items: center; padding: 12px; border-top: 1px solid var(--line); box-shadow: none !important; }
  .rs-dl > div:first-child { border-top: 0; }
  .rs-cats { grid-template-columns: minmax(0, 1fr); }
  .rs-report .i-card { padding: 16px; }
  .rs-draft-note .btn { flex: 1; }
}

@media print {
  html:has(.rs-report), body:has(.rs-report) { height: auto; overflow: visible; display: block; background: var(--surface); }
  body:has(.rs-report) .room-bar, body:has(.rs-report) .small-screen, body:has(.rs-report) .page-actions, body:has(.rs-report) .app-side,
  body:has(.rs-report) .page-head + .result, .rs-back, .rs-draft-note .btn { display: none !important; }
  body:has(.rs-report) .i-page { overflow: visible; padding: 0; }
  body:has(.rs-report) .i-wrap { max-width: none; }
  .rs-report .i-card { break-inside: avoid; box-shadow: 0 0 0 1px var(--line); }
  .rs-report .rs-top2, .rs-report .rs-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .rs-report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
