/* ============================================================
   الاستمارة المطبوعة — A4 أفقي بترويسة الوزارة
   ============================================================ */
.fd { --fs: 11px; --bd: #8ea25a; --bd2: #b9c3cc; --hd: #e6ebef; --lbl: #f4f7ee;
  width: 297mm; min-height: 210mm; padding: 9mm 10mm; margin: 0 auto; background: #fff; color: #111;
  font-family: var(--ui); font-size: var(--fs); line-height: 1.55; direction: rtl; box-sizing: border-box;
  box-shadow: 0 6px 30px rgba(13,34,51,.16);
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fd * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fd table { border-collapse: collapse; width: 100%; }
.fd-frame, .fd-frame > thead > tr > td, .fd-frame > tbody > tr > td { border: 0; padding: 0; }

/* الترويسة */
.fd-lh { position: relative; width: 196mm; margin: 0 auto 2.5mm; }
.fd-lh img { display: block; width: 100%; height: auto; }
.fd-lh .lv { position: absolute; left: 0.6%; width: 17%; height: 10.5%; display: flex; align-items: center; justify-content: flex-end;
  font-size: 10.5px; font-weight: 700; color: #1d6f63; white-space: nowrap; overflow: hidden; justify-content: flex-start; padding-inline-start: 2px; }
.fd-lh .lv.n { top: 6.5%; } .fd-lh .lv.t { top: 34%; } .fd-lh .lv.m { top: 61.5%; }
.fd-lh.custom .lv { display: none; }

.fd-title { text-align: center; font-size: calc(var(--fs) + 3px); font-weight: 700; margin: 1mm 0 .5mm; }
.fd-sub { text-align: center; font-size: calc(var(--fs) - .5px); color: #44525e; margin-bottom: 1mm; }
.fd-sec { font-size: calc(var(--fs) + 1px); font-weight: 700; margin: 2.2mm 0 1.4mm; }

/* البيانات الأساسية */
.fd-basic td { border: 1px solid var(--bd); padding: 1.3mm 2mm; height: 7.5mm; vertical-align: middle; }
.fd-basic td.l { width: 12%; white-space: nowrap; color: #222; }
.fd-basic td.v { font-weight: 700; text-align: center; }
.fd-basic td.v.o { font-weight: 500; text-align: right; }
.fd-perf { margin-top: 2.5mm; }
.fd-perf td { border: 1px solid #555; padding: 1.4mm 2mm; }
.fd-perf td.l { background: #c4d79b; width: 30%; }
.fd-perf td.v { text-align: center; font-weight: 700; width: 20%; }
.fd-perf td.v .mono { display: inline-block; min-width: 18mm; }

/* جدول الإجراءات */
.fd-main { margin-top: 1mm; }
.fd-main th, .fd-main td { border: 1px solid var(--bd2); padding: 1.6mm 2mm; vertical-align: middle; text-align: center; }
.fd-main thead th { background: var(--hd); font-weight: 700; font-size: calc(var(--fs) + .5px); }
.fd-main td { text-align: center; }
.fd-main td.dm { font-weight: 700; background: #fafbfc; }
.fd-main td.el { font-weight: 600; }
.fd-main td.tx { text-align: right; }
.fd-main tr { page-break-inside: avoid; break-inside: avoid; }
.fd-main thead { display: table-header-group; }
.fd.exec .fd-main td.sv { font-weight: 700; }
.fd.exec .fd-main tbody tr:nth-child(even) td:not(.dm) { background: #f6f7f8; }

/* التوصيات */
.fd-recs { margin: 0 0 1mm; padding-inline-start: 7mm; }
.fd-recs li { margin: .6mm 0; }

/* التواقيع */
.fd-signs { display: grid; grid-template-columns: 1fr 46mm 1fr; gap: 6mm; margin-top: 5mm; page-break-inside: avoid; break-inside: avoid; align-items: start; }
.fd-sg { text-align: center; }
.fd-sg .tt { font-weight: 700; }
.fd-sg .nm { margin-top: .8mm; font-weight: 600; }
.fd-sg .ink { height: 19mm; display: grid; place-items: center; }
.fd-sg .ink img { max-height: 19mm; max-width: 55mm; }
.fd-sg .ink .ln { width: 45mm; border-bottom: 1px dotted #888; height: 12mm; }
.fd-stamp { text-align: center; }
.fd-stamp .tt { font-weight: 700; }
.fd-stamp img { height: 27mm; max-width: 44mm; margin-top: 1mm; mix-blend-mode: multiply; transform: rotate(-4deg); }

.fd-ext { margin-top: 4mm; page-break-inside: avoid; break-inside: avoid; }
.fd-ext th, .fd-ext td { border: 1px solid var(--bd2); padding: 1mm 2mm; text-align: center; vertical-align: middle; }
.fd-ext thead th { background: var(--hd); font-weight: 700; }
.fd-ext td img { max-height: 11mm; max-width: 40mm; display: block; margin: 0 auto; }
.fd-ext td.nm { text-align: right; font-weight: 600; }
.fd-ext tr { height: 12mm; }

/* المعاينة على الشاشة */
.pv .fd { box-shadow: 0 4px 22px rgba(13,34,51,.18); }

@page { size: A4 landscape; margin: 8mm 9mm; }
@media print {
  .fd { width: auto; min-height: 0; box-shadow: none !important; margin: 0; padding: 0; page-break-after: always; break-after: page; }
  .fd:last-child { page-break-after: auto; break-after: auto; }
  .fd-main thead th, .fd-ext thead th { position: static; }
}
