/* ═══════════════════════════════════════════════════════════════════
   REPORTS — css/modules/reports.css
   ═══════════════════════════════════════════════════════════════════
   Report card / transcript screen presentation (the printable
   document itself is templated in html/templates/ + styled for print
   in css/print/report-cards-print.css — these are near-identical
   class names so the screen preview matches the printed output).
   Report generation must feel instant (Section 3.4) — no multi-step
   wizard, batch runs on a Web Worker with a determinate progress bar.
   ═══════════════════════════════════════════════════════════════════ */

.reports-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.reports-toolbar__spacer {
  flex: 1;
}

/* ── Report type picker (cards, shown before generating) ── */
.report-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.report-type-card {
  background: var(--card-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
  border-radius: var(--radius, 10px);
  padding: 18px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.report-type-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
}

.report-type-card.selected {
  border-color: var(--academics-accent, #8b5cf6);
  background: rgba(139, 92, 246, 0.08);
}

.report-type-card__icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--academics-accent, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-type-card__icon svg {
  width: 20px;
  height: 20px;
}

.report-type-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--card-text, #e2e8f0);
}

.report-type-card__desc {
  font-size: 0.7rem;
  color: var(--card-text-muted, #475569);
  margin-top: 4px;
}

/* ── Batch generation progress (Web Worker driven) ── */
.batch-progress-panel {
  background: var(--card-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
  border-radius: var(--radius, 10px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.batch-progress-panel__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.batch-progress-panel__label {
  font-size: 0.8rem;
  color: var(--card-text, #e2e8f0);
  flex: 1;
}

.batch-progress-panel__count {
  font-size: 0.75rem;
  color: var(--card-text-muted, #475569);
  font-variant-numeric: tabular-nums;
}

/* ── The report card document itself (screen preview, on light "paper") ── */
.report-card {
  background: #fdfcfb;
  color: #1e293b;
  border-radius: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.report-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 2px solid #ede9fe;
}

.report-logo {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a3a5c, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-logo svg {
  width: 34px;
  height: 34px;
  fill: var(--text-inverse, #f1f5f9);
}

.report-school-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
}

.report-school-meta {
  font-size: 0.7rem;
  color: #64748b;
}

.report-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #4c1d95;
  margin-top: 4px;
}

.report-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid #e2e8f0;
}

.report-info-item {
  padding: 8px 16px;
  border-right: 1px solid #e2e8f0;
}

.report-info-item:last-child {
  border-right: none;
}

.report-info-item .k {
  font-size: 0.62rem;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.4px;
}

.report-info-item .v {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.report-subjects {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.78rem;
}

.report-subjects th {
  background: #ede9fe;
  color: #4c1d95;
  padding: 6px 8px;
  text-align: center;
  font-size: 0.68rem;
}

.report-subjects td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid #eef2f6;
}

.report-subjects td.subj-name {
  text-align: left;
  font-weight: 600;
}

.report-subjects td.subj-comment {
  text-align: left;
  font-style: italic;
  color: #64748b;
  font-size: 0.7rem;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 16px;
  background: #f8f7fb;
  border-radius: 10px;
  margin-top: 12px;
}

.report-summary-item {
  text-align: center;
}

.summary-value {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #4c1d95;
}

.summary-label {
  font-size: 0.62rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.report-decision-banner {
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 12px;
}

.report-decision-banner.pass {
  background: #d1fae5;
  color: #065f46;
}

.report-decision-banner.fail {
  background: #fee2e2;
  color: #991b1b;
}

.report-decision-banner.remedial {
  background: #fef3c7;
  color: #92400e;
}

.report-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 14px 16px 4px;
  font-size: 0.7rem;
  color: #64748b;
}

.report-signature-line {
  border-top: 1px solid #94a3b8;
  width: 140px;
  text-align: center;
  padding-top: 4px;
  font-size: 0.65rem;
}

/* ── QR block — image-in-a-box, scans to qr-verify.html (Section 3.6) ── */
.report-qr-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.report-qr-block img {
  width: 72px;
  height: 72px;
  border-radius: 4px;
}

.report-qr-block__label {
  font-size: 0.62rem;
  color: #94a3b8;
  max-width: 120px;
}

/* ── Transcript layout ── */
.transcript-doc {
  background: #fdfcfb;
  color: #1e293b;
  border-radius: 12px;
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.transcript-year-block {
  margin-bottom: 18px;
}

.transcript-year-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #4c1d95;
  border-bottom: 2px solid #ede9fe;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .report-info {
    grid-template-columns: 1fr;
  }

  .report-info-item {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .report-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-card,
  .transcript-doc {
    padding: 12px;
  }
}