/* Performance reviews and the parent report. Loaded after style.css, whose tokens (light and dark) it uses. No inline styles are
   used anywhere (the CSP blocks them); the Persian font is vendored because the CSP allows only this site's own files. */
@font-face { font-family: "Vazirmatn"; font-weight: 400; font-style: normal; font-display: swap; src: url("vendor/fonts/Vazirmatn-Regular.woff2") format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-weight: 700; font-style: normal; font-display: swap; src: url("vendor/fonts/Vazirmatn-Bold.woff2") format("woff2"); }

:root {
  --chip-ns-bg: #e7e2d9; --chip-ns-fg: #5a554b; --chip-dr-bg: #f9e9c4; --chip-dr-fg: #6d4b00;
  --chip-su-bg: #d4efe0; --chip-su-fg: #14522f; --chip-fi-bg: #0a5c5b; --chip-fi-fg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --chip-ns-bg: #2d3836; --chip-ns-fg: #b6c2c0; --chip-dr-bg: #4a3b12; --chip-dr-fg: #f3d58a;
    --chip-su-bg: #1d4630; --chip-su-fg: #a8e2c0; --chip-fi-bg: #3cb8b5; --chip-fi-fg: #08201f;
  }
}

.hint { color: var(--muted); font-size: .85rem; margin: 4px 0 10px; }
.sect { font-size: 1rem; margin: 20px 0 6px; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px; margin: 0 0 16px; }
.panel h2 { margin: 0; font-size: 1rem; }
.termpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0 12px; align-items: end; margin: 12px 0; max-width: 560px; }
.termpick select, .termpick input { min-width: 0; }
.termpick button { grid-column: 1 / -1; justify-self: start; min-width: 8rem; }

.classcard { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: start; padding: 14px; min-height: 56px; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.classcard:hover { border-color: var(--teal); }
.classcard strong { color: var(--link); }
.classcard .sub { color: var(--muted); font-size: .85rem; }

.chip { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.chip.ns { background: var(--chip-ns-bg); color: var(--chip-ns-fg); }
.chip.dr { background: var(--chip-dr-bg); color: var(--chip-dr-fg); }
.chip.su { background: var(--chip-su-bg); color: var(--chip-su-fg); }
.chip.fi { background: var(--chip-fi-bg); color: var(--chip-fi-fg); }

.fa-text { font-family: "Vazirmatn", "Tahoma", system-ui, sans-serif; font-size: 1.05rem; line-height: 1.9; }
.students li { padding: 0; }
.studenthead { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; margin: 0; border: 0; border-radius: 0; text-align: start; min-height: 52px; color: var(--fg); background: none; }
.studenthead[aria-expanded=true] { background: var(--teal-soft); }
.sname { font-weight: 600; }
li.dirty .sname::after { content: " \2022"; color: var(--late); }
.reviewform { padding: 8px 4px 16px; }
.reviewform h3 { font-size: .95rem; margin: 14px 0 4px; }
.count { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.grouptitle { font-size: .75rem; color: var(--muted); font-weight: 600; margin: 16px 0 2px; }
.crit { padding: 10px 0; border-bottom: 1px solid var(--line); }
.crit .en { font-weight: 600; display: block; text-align: right; font-family: "Vazirmatn", "Tahoma", system-ui, sans-serif; }
.crit .fa-l { display: block; color: var(--muted); font-size: .85rem; text-align: left; font-family: "Vazirmatn", "Tahoma", system-ui, sans-serif; }
.rate { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.rate button { margin: 0; border: 0; background: none; padding: 0; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.rate { flex-wrap: wrap; }
.rate button.word { width: auto; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; font-size: .9rem; font-weight: 600; color: var(--muted); background: var(--surface); }
.rate button.word[aria-pressed=true] { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--on-btn); }
.rate button:disabled { opacity: .7; }
.actions { display: flex; gap: 10px; margin-top: 14px; }
.actions button { flex: 0 0 auto; margin: 0; }   /* as wide as the label, not half the row */
.actions button.primary { width: auto; }

.reprow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; }
#repActions button { display: block; }   /* one under the other, each as wide as its label */

/* The parent report: one A4 page per student, right to left. It is paper, so it keeps its own white and teal in both themes. */
#printArea { margin-top: 16px; }
.sheet {
  --teal: #0e7c7b; --teal-dark: #0a5c5b; --teal-soft: #d9efee; --line: #cfd8d6; --muted: #627170;
  background: #fff; color: #1d2a29; font-family: "Vazirmatn", "Tahoma", system-ui, sans-serif; font-size: 14px; line-height: 1.7;
  border: 1px solid var(--line); border-radius: 4px; padding: 22px 20px; margin: 0 0 20px; display: flex; flex-direction: column; gap: 14px;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.sheet button.primary { background: #0a5c5b; color: #fff; border-color: #0a5c5b; }
.sh-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 3px solid var(--teal); padding-bottom: 10px; }
.sh-logo { display: flex; align-items: center; gap: 10px; }
.sh-logo img { height: 46px; }
.sh-logo b { display: block; color: var(--teal-dark); }
.sh-logo span { font-size: 12px; color: var(--muted); }
.sh-title { margin: 0; font-size: 19px; font-weight: 700; color: var(--teal-dark); text-align: left; line-height: 1.5; }
.sh-title small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); direction: ltr; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.meta div { border-bottom: 1px dotted var(--line); padding-bottom: 3px; }
.meta b { font-weight: 400; color: var(--muted); }
.sh-h { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--teal-dark); display: flex; align-items: center; gap: 8px; }
.sh-h::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.sh-p { margin: 0; white-space: pre-wrap; text-align: justify; line-height: 2; }
.att { display: grid; grid-template-columns: repeat(4, 1fr) 1.3fr; gap: 6px; }
.att .cell { border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; text-align: center; }
.att .cell strong { display: block; font-size: 20px; line-height: 1.3; color: var(--teal-dark); }
.att .cell span { font-size: 12px; color: #4a5958; }
.att .cell.sum { background: var(--teal-soft); border-color: var(--teal); }
.att-note { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.cr { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid #e6ecea; }
.cr .n { color: #8a9897; font-size: 12px; }
.cr .dots { display: flex; gap: 4px; }
.cr .dots i { width: 16px; height: 16px; border-radius: 50%; border: 1.8px solid var(--teal); display: block; }
.cr .dots i.on { background: var(--teal); }
.sh-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; }
.sheet-actions { width: 100%; margin: 0; }

@media (max-width: 480px) {
  .att { grid-template-columns: repeat(2, 1fr); }
  .meta { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  header, #side, #foot, #msg, #reports > *:not(#printArea) { display: none !important; }
  .shell { display: block; }
  body, main { background: #fff; padding: 0; max-width: none; margin: 0; }
  #printArea { margin: 0; }
  .sheet { border: 0; border-radius: 0; padding: 0; margin: 0; min-height: 270mm; page-break-after: always; break-after: page; }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
  .crit-table, .att { break-inside: avoid; }
  .sheet-actions { display: none !important; }
  /* One student's report: hide the other sheets (set by reports.js while the print dialog is open). */
  #printArea.printing-one .sheet:not(.print-this) { display: none !important; }
  #printArea.printing-one .print-this { page-break-after: auto; break-after: auto; }
}

@media (hover: hover) {
  .classcard:hover { background: var(--surface-2); }
  .studenthead:hover { background: var(--surface-2); }
  .studenthead[aria-expanded=true]:hover { background: var(--teal-soft); filter: brightness(1.08); }
}
.repmissing { display: block; margin-top: 4px; }
