@font-face {
  font-family: Vazirmatn;
  src: url("/static/fonts/Vazirmatn-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: Vazirmatn;
  src: url("/static/fonts/Vazirmatn-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

.report-sheet {
  width: min(1120px, 100%);
  margin: 0 auto;
  background: #fff;
  color: #1c2b33;
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 8px 28px rgba(20, 40, 40, 0.06);
  border: 1px solid #e4eeec;
  border-radius: 10px;
  overflow: visible;
}
.report-sheet .rpt-top-band {
  background: linear-gradient(180deg, #f4faf9 0%, #fff 100%);
  border-bottom: 1px solid #e3eeec;
  border-radius: 10px 10px 0 0;
}
.report-sheet .rpt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 14px 18px 10px;
  gap: 12px;
}
.report-sheet .rpt-brand { font-size: 22px; font-weight: 700; color: #1a6f68; letter-spacing: -0.02em; }
.report-sheet .rpt-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
  color: #5d6e78;
  text-align: left;
}
.report-sheet .rpt-title {
  margin: 0 18px;
  padding: 12px 14px 10px 0;
  border-inline-end: 4px solid #2aa198;
  border-bottom: none;
  font-size: 21px;
  font-weight: 700;
  color: #16343a;
  line-height: 1.25;
}
.report-sheet .rpt-body { padding: 12px 18px 16px; }
.report-sheet .rpt-participant {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.report-sheet .rpt-participant > div {
  background: #f7fbfa;
  border: 1px solid #e3eeec;
  border-radius: 8px;
  padding: 6px 10px;
}
.report-sheet .rpt-participant span { display: block; color: #6a7c86; font-size: 11px; }
.report-sheet .rpt-participant strong { color: #1c2b33; font-size: 13px; font-weight: 700; }
.report-sheet .rpt-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.report-sheet .sum-chip {
  font-size: 12px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.report-sheet .sum-chip em { font-style: normal; font-weight: 700; }
.report-sheet .sum-normal { background: #e7f4ee; color: #1f5c45; }
.report-sheet .sum-low { background: #fbf4d8; color: #6b5610; }
.report-sheet .sum-medium { background: #fbe8d8; color: #7a3d14; }
.report-sheet .sum-high { background: #f8dfe2; color: #8a1f2c; }
.report-sheet .sum-severe { background: #f0e4dc; color: #4a2c1c; }
.report-sheet .sum-unknown { background: #eef1f3; color: #4a5560; }
.report-sheet .section-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 700;
  color: #1a6f68;
  font-size: 13px;
}
.report-sheet .section-label span { font-weight: 400; color: #6a7c86; font-size: 11px; }
.report-sheet .rpt-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.72fr);
  gap: 16px;
  align-items: start;
}
.report-sheet .rpt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-sheet .rpt-table thead tr {
  background: #f4faf9;
}
.report-sheet .rpt-table th {
  text-align: center;
  color: #1a6f68;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 6px;
  border-bottom: 2px solid #2aa198;
}
.report-sheet .rpt-table th:first-child { text-align: right; }
.report-sheet .rpt-table td {
  padding: 6px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #eef3f2;
}
.report-sheet .rpt-table tbody tr:nth-child(even) { background: #f8fbfa; }
.report-sheet .rpt-table td.t-name { text-align: right; font-weight: 600; }
.report-sheet .status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.report-sheet .sev-cell { width: 88px; }
.report-sheet .sev-grade-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.report-sheet .grade-num {
  display: inline-block;
  min-width: 1.2em;
  font-weight: 700;
  font-size: 15px;
  background: transparent;
  border: none;
  padding: 0;
}
.report-sheet .grade-editable { cursor: pointer; }
.report-sheet .grade-editable.is-override { text-decoration: underline; text-underline-offset: 3px; }
.report-sheet .rpt-views { display: flex; flex-direction: column; gap: 8px; }
.report-sheet .view-card {
  border: 1px solid #e3eeec;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.report-sheet .view-card .cap {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #1a6f68;
  padding: 4px 6px;
  background: #f4faf9;
  border-bottom: 1px solid #e3eeec;
}
.report-sheet .view-card .media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  min-height: 120px;
  padding: 4px;
}
.report-sheet .view-card img {
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.report-sheet .view-card .ph {
  color: #7b8b93;
  font-size: 12px;
  padding: 18px 8px;
  text-align: center;
}
@media (max-width: 860px) {
  .report-sheet .rpt-split { grid-template-columns: 1fr; }
  .report-sheet .rpt-participant { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-sheet .rpt-views { display: grid; grid-template-columns: 1fr; }
}

.report-sheet .rpt-note {
  margin-top: 10px;
  border: 1px solid #dcefe8;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafcf9;
  font-size: 12px;
  page-break-inside: avoid;
}
.report-sheet .rpt-note h3 { margin: 0 0 6px; font-size: 13px; color: #1a6f68; font-weight: 700; }

.report-sheet .rpt-footer {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 2px solid #2aa198;
  text-align: center;
  font-size: 11px;
  color: #6b7c89;
}

.operator-editor {
  margin: 14px auto;
  max-width: 210mm;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #dce4ec;
  border-radius: 8px;
  font-family: Vazirmatn, Tahoma, sans-serif;
}
.operator-editor textarea { width: 100%; font-family: inherit; padding: 8px; border-radius: 6px; border: 1px solid #ccc; }

.preview-toolbar {
  max-width: 210mm;
  margin: 14px auto 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.grade-picker {
  position: absolute;
  z-index: 30;
  background: #fff;
  border: 1px solid #2aa198;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.grade-picker button {
  border: none;
  border-radius: 12px;
  min-width: 30px;
  height: 26px;
  font-weight: 700;
  cursor: pointer;
  font-family: Vazirmatn, Tahoma, sans-serif;
}

.btn-mini {
  font-size: 9px;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid #c8d4de;
  background: #fff;
  cursor: pointer;
  color: #2c4a5e;
  font-family: Vazirmatn, Tahoma, sans-serif;
}

.unsaved { color: #e17a32; font-weight: bold; margin-inline-start: 8px; }
.save-status { font-size: 12px; min-height: 18px; margin-top: 6px; font-family: Vazirmatn, Tahoma, sans-serif; }
.save-status.ok { color: #2c8c67; font-weight: bold; }
.save-status.err { color: #d64554; font-weight: bold; }

.only-print { display: none; }
@media print {
  .only-print { display: inline-block !important; }
  body * { visibility: hidden; }
  #reportPrintRoot, #reportPrintRoot * { visibility: visible; }
  #reportPrintRoot {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .report-sheet {
    box-shadow: none;
    border: none;
    width: 100%;
    border-radius: 0;
  }
  .report-sheet .rpt-split { display: block; }
  .report-sheet .rpt-views {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 8px;
  }
  .report-sheet .view-card img { max-height: 48mm; }
  .no-print, .operator-editor, .preview-toolbar, .patient-form, .photo-grid, #loading, .footer, h1, .meta-line { display: none !important; }
  .grade-editable { display: none !important; pointer-events: none; border: none !important; }
  [data-grade-print] { display: inline-block !important; }
  .btn-mini { display: none !important; }
  .grade-picker { display: none !important; }
  @page { size: A4 portrait; margin: 8mm; }
}