/*!
 *  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *   © 2026  رحاب أحمد أبوزحرة الطويرقي
 *   سمايا · جميع الحقوق محفوظة
 *  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 */
/* ════════════════════════════════════════════════════════════════════
   ورق الطباعة المختومة — يظهر فقط أثناء الطباعة من زر المنصة
   ════════════════════════════════════════════════════════════════════ */
#print-root { display: none; }

@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing { background: #fff !important; color: #111 !important; }
  body.printing #print-root { display: block; font-family: var(--font-body); font-size: 11.5pt; color: #1f2937; position: relative; }
  #print-root * { color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .pr-watermark { position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-size: 90pt; color: rgba(122,79,179,.05); transform: rotate(-28deg); pointer-events: none; z-index: 0; }
  .pr-head { display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: center; gap: 8px; font-size: 10pt; position: relative; z-index: 1; }
  .pr-gov { text-align: right; line-height: 1.6; }
  .pr-school { text-align: center; } .pr-school strong { font-family: var(--font-head); font-size: 15pt; color: #4a2a78; display: block; }
  .pr-date { text-align: left; line-height: 1.6; }
  .pr-rule { height: 2px; margin: 6px 0 10px; background: linear-gradient(90deg, transparent, #7a4fb3, #7a4fb3, transparent); }
  .pr-title { font-family: var(--font-head); font-size: 18pt; color: #4a2a78; text-align: center; margin: 4px 0; }
  .pr-sub { text-align: center; color: #4b5563; font-size: 10.5pt; margin-bottom: 8px; }
  .pr-body { position: relative; z-index: 1; }
  .pr-body h2, .pr-body h3 { font-family: var(--font-head); color: #7a4fb3; margin: 10px 0 6px; break-after: avoid; }
  .pr-table, .pr-body table { width: 100%; border-collapse: collapse; font-size: 9.5pt; margin: 6px 0 10px; }
  .pr-table th, .pr-body table th { background: #7a4fb3 !important; color: #fff !important; padding: 5px 6px; border: 1px solid #7a4fb3; font-weight: 600; }
  .pr-table td, .pr-body table td { padding: 4px 6px; border: 1px solid #e4d8f2; vertical-align: top; }
  .pr-table tr:nth-child(even) td, .pr-body table tr:nth-child(even) td { background: #f8f3fd; }
  .pr-table td.num, .pr-body td.num { text-align: center; }
  tr, .pr-avoid { break-inside: avoid; page-break-inside: avoid; }
  .pr-page { break-after: page; page-break-after: always; }
  .pr-page:last-child { break-after: auto; page-break-after: auto; }
  .pr-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 6px 0 10px; }
  .pr-kpis > div { border: 1px solid #e4d8f2; border-radius: 6px; padding: 4px 6px; text-align: center; background: #f6f0fc; }
  .pr-kpis strong { display: block; font-size: 13pt; color: #7a4fb3; }
  .pr-chip { display: inline-block; border: 1px solid #e4d8f2; border-radius: 99px; padding: 0 8px; margin: 2px; font-size: 9pt; }
  .pr-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 18px; break-inside: avoid; text-align: center; font-size: 10.5pt; }
  .pr-sign-role { font-weight: 700; color: #4a2a78; }
  .pr-sign-line { margin-top: 22px; border-top: 1px dashed #9ca3af; padding-top: 2px; color: #6b7280; font-size: 9pt; }
  .pr-end { margin-top: 12px; text-align: center; font-size: 8.5pt; color: #6b7280; }
  .pr-stamp { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; border-top: 1.5px solid #4b2e1c; padding-top: 6px; break-inside: avoid; font-size: 8.5pt; }
  .pr-serial { font-family: monospace; font-size: 11pt; font-weight: 700; direction: ltr; text-align: right; color: #2b211a; }
  .pr-hint { color: #6b7280; }
  .pr-brand { text-align: center; font-family: var(--font-head); color: #2b211a; }
  /* حين يُطبع التذييل في هامش كل صفحة (كروم/إيدج) لا حاجة لشريط الختم آخر المحتوى */
  body.printing.has-pagefoot .pr-stamp { display: none !important; }
  .cert { border: 6px double #7a4fb3; padding: 26px 34px; text-align: center; min-height: 170mm; display: grid; align-content: center; gap: 10px; }
  .cert h2 { font-size: 34pt !important; color: #7a4fb3 !important; margin: 0 !important; }
  .cert .cert-name { font-family: var(--font-head); font-size: 26pt; color: #2b211a; border-bottom: 1px solid #7a4fb3; display: inline-block; padding: 0 30px; }
}
@media print {
  .pr-cont-note { font-size: 9pt; color: #4b5563; margin: 0 0 4px; }
}
@media print {
  .pr-watermark { font-family: Amiri, "Traditional Arabic", serif !important; font-size: 96px !important; font-weight: 700; color: #4b2e1c !important; opacity: .045; transform: rotate(-28deg); white-space: nowrap; z-index: 2147483000 !important; }
  .zs-end { direction: rtl; display: grid !important; grid-template-columns: auto 1fr auto !important; gap: 12px; align-items: center; margin-top: 16px; padding: 8px 0 4px; font-family: Tajawal, Arial, sans-serif; color: #1f2937; border-top: 1.2px solid #4b2e1c !important; break-inside: avoid; page-break-inside: avoid; }
  .zs-end svg { display: block; }
  .zs-sn { font-family: ui-monospace, Menlo, Consolas, monospace; direction: ltr; text-align: right; font-size: 15px; font-weight: 700; letter-spacing: 1.3px; color: #2b211a; line-height: 1.3; }
  .zs-sn.zs-pn { font-family: Tajawal, Arial, sans-serif; direction: rtl; letter-spacing: 0; }
  .zs-mt { font-size: 10px; color: #5b6472; margin-top: 2px; line-height: 1.6; }
  .zs-ht { font-size: 9px; color: #8a93a1; line-height: 1.6; }
  .zs-br { display: flex; align-items: center; gap: 7px; }
  .zs-br b { display: block; font-family: Amiri, serif; font-size: 13px; color: #2b211a; line-height: 1.2; font-weight: 700; }
  .zs-br i { display: block; font-style: normal; font-family: ui-monospace, monospace; font-size: 9px; color: #4b2e1c; letter-spacing: 1px; direction: ltr; text-align: right; }
}

@media print {
  .cert { border: 7px double #7a4fb3; border-radius: 6mm; padding: 14mm 18mm; text-align: center; height: 168mm; display: grid; align-content: center; gap: 5mm; background: #fff; position: relative; }
  .cert .c-gov { font-size: 10pt; color: #4a2a78; line-height: 1.7; }
  .cert h2 { font-family: var(--font-head); font-size: 34pt !important; color: #7a4fb3 !important; margin: 0 !important; }
  .cert .c-lead { font-size: 14pt; color: #33204a; }
  .cert .cert-name { font-family: var(--font-head); font-size: 26pt; color: #33204a; border-bottom: 1.5px solid #a274d6; display: inline-block; padding: 0 30px 2mm; justify-self: center; }
  .cert .c-why { font-size: 13pt; color: #33204a; line-height: 1.9; }
  .cert .c-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20mm; margin-top: 6mm; font-size: 11pt; }
  .cert .c-sign b { display: block; color: #4a2a78; }
  .msg-print { border: 1px solid #e4d8f2; border-radius: 4mm; padding: 5mm 6mm; margin-bottom: 5mm; white-space: pre-line; line-height: 1.9; font-size: 11pt; break-inside: avoid; }
  .pr-chart svg { max-height: 80mm; }
}
