/* برگهٔ قرارداد — مشترک بین پیش‌نمایش سایت، PDF (WeasyPrint) و چاپ مستقیم */
.doc { font-family: "Vazirmatn", Tahoma, sans-serif; color: #15181d; line-height: 2.05; direction: rtl; text-align: justify; }
.doc * { box-sizing: border-box; }
.doc__notice { border: 1.2px solid #c9a227; background: #fff8e1; color: #6b4e00; border-radius: 6px; padding: .45em .8em;
               margin: 0 0 1.1em; font-size: .86em; line-height: 1.8; text-align: right; }
.doc__notice--danger { border-color: #c0392b; background: #fdecea; color: #7f1d1d; }
.doc__notice--info { border-color: #4a78b8; background: #eef4fc; color: #1e3a66; }
.doc__head { text-align: center; margin-bottom: 1.2em; padding-bottom: .7em; border-bottom: 1.5px solid #15181d; position: relative; }
.doc__head h1 { font-size: 1.55em; font-weight: 900; margin: 0; letter-spacing: -.01em; line-height: 1.6; }
.doc__meta { display: flex; justify-content: space-between; gap: 1em; font-size: .85em; margin-top: .35em; color: #333; }
.doc h2.art { font-size: 1.04em; font-weight: 800; margin: 1.05em 0 .3em; color: #0f2a52; break-after: avoid; page-break-after: avoid; }
.doc h3 { font-size: 1em; font-weight: 700; margin: .7em 0 .2em; break-after: avoid; }
.doc p { margin: 0 0 .32em; orphans: 2; widows: 2; }
.doc p.note { padding-inline-start: .9em; border-inline-start: 2px solid #c8ccd3; }
.doc ul, .doc ol { margin: .1em 0 .45em; padding-inline-start: 1.5em; }
.doc li { margin-bottom: .18em; }
.doc ol.terms { list-style: persian; }
.doc b { font-weight: 800; }
.doc .vv { font-weight: 700; }
.doc .blank { display: inline-block; min-width: 7.5em; border-bottom: 1px dotted #555; height: 1.1em; vertical-align: -.15em; }
.doc bdi { unicode-bidi: isolate; }
.doc table.grid { width: 100%; border-collapse: collapse; margin: .4em 0 .8em; font-size: .92em; break-inside: auto; }
.doc table.grid th, .doc table.grid td { border: 1px solid #9aa0a9; padding: .25em .5em; text-align: center; vertical-align: middle; }
.doc table.grid th { background: #eef1f5; font-weight: 800; }
.doc table.grid td.n, .doc table.grid th.n { width: 3em; }
.doc .pb { break-after: page; page-break-after: always; height: 0; }
.doc__close { margin-top: .8em; }
.sigs { width: 100%; border-collapse: separate; border-spacing: .6em; margin: 1.2em -.6em 0; break-inside: avoid; page-break-inside: avoid; table-layout: fixed; }
.sigs td { width: 50%; vertical-align: top; padding: 0; }
.sig--none { border: 0 !important; }
.sig { border: 1px solid #9aa0a9; border-radius: 6px; padding: .5em .7em .6em; break-inside: avoid; page-break-inside: avoid; text-align: center; }
.sig__t { font-weight: 900; color: #0f2a52; }
.sig__n { font-size: .9em; min-height: 1.6em; }
.sig__row { display: flex; gap: .6em; margin-top: .3em; }
.sig__s { flex: 1; height: 4.4em; border: 1px dashed #b6bcc4; border-radius: 4px; font-size: .75em; color: #6b7280; padding-top: .2em; }
.sig__fp { width: 6em; height: 6em; border: 1px dashed #b6bcc4; border-radius: 50%; font-size: .62em; color: #6b7280; flex: none;
           display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.3; }
.pdf-foot { position: running(pdffoot); text-align: center; font-family: "Vazirmatn", Tahoma, sans-serif; font-size: 7.5pt; color: #8a8f98; direction: rtl; }
.qr { float: left; display: flex; align-items: center; gap: .5em; margin: 0 0 .4em .6em; direction: rtl; }
.qr img { width: 5.2em; height: 5.2em; }
.qr__t { font-size: .62em; line-height: 1.6; color: #444; text-align: center; }
.qr__t b { font-size: 1.15em; letter-spacing: .05em; }

/* ── سربرگ‌ها (پنج طرح) — جدول/فلکس برای سازگاری راست‌به‌چپ با WeasyPrint ── */
.hd { margin-bottom: 1.15em; text-align: center; }
.hd h1 { margin: 0; line-height: 1.6; }
.hd__open { text-align: center; font-size: .92em; color: #333; line-height: 1.9; margin-bottom: .15em; }
.hd__ar { font-weight: 700; }
.hd__ref { display: block; font-size: .72em; color: #777; line-height: 1.4; }
.hd__id { border-collapse: collapse; margin: 0 0 .5em; }
.hd__id td { padding: 0; vertical-align: middle; text-align: right; }
.hd__lg { padding-inline-end: .7em !important; }
.hd__logo { height: 3.4em; width: auto; max-width: 8em; object-fit: contain; display: block; }
.hd__name { font-weight: 900; font-size: 1.18em; line-height: 1.5; }
.hd__sub { font-size: .78em; color: #555; line-height: 1.65; }
.hd__m { font-size: .82em; line-height: 2; white-space: nowrap; text-align: right; }
.hd__m span:first-child { color: #555; }
.doc .blank--s { min-width: 5.5em; }
.hd__orn { display: block; margin: .25em auto; width: 13em; height: auto; }
/* ساده */
.hd--simple .hd__id { margin-inline: 0 auto; }
/* رسمی: سه‌ستونه، خط دوتایی زیرین */
.hd--official { border-bottom: 3.5px double #0F766E; padding-bottom: .45em; }
.hd__t { width: 100%; border-collapse: collapse; table-layout: fixed; }
.hd__t td { vertical-align: middle; padding: 0; }
.hd--official .hd__c1 { width: 30%; text-align: right; }
.hd--official .hd__c2 { width: 40%; text-align: center; }
.hd--official .hd__c3 { width: 30%; }
.hd--official h1 { font-size: 1.5em; font-weight: 900; }
.hd__box { border: 1px solid #0F766E; border-radius: 6px; padding: .25em .7em; width: 11em; margin-inline-start: auto; }
/* کلاسیک: قاب صفحه + جداکنندهٔ تزئینی + قلم نمایشی */
.hd--classic h1 { font-family: "Lalezar", "Vazirmatn", sans-serif; font-weight: 400; font-size: 2em; line-height: 1.45; letter-spacing: 0; }
.hd--classic .hd__id { margin-inline: auto; }
.hd--classic .hd__id td { text-align: center; }
.hd__row { display: flex; justify-content: center; gap: 2.2em; margin-top: .1em; }
.hd__row .hd__m { font-size: .8em; }
/* مدرن: نوار رنگی بالا */
.hd--modern { text-align: right; }
.hd__band { width: 100%; border-collapse: collapse; border-radius: 8px; margin-bottom: .5em; }
.hd__band td { padding: .55em .9em; vertical-align: middle; color: #fff; }
.hd__band .hd__name, .hd__band .hd__sub, .hd__band .hd__m, .hd__band .hd__m span:first-child { color: #fff !important; }
.hd__band .hd__name { font-size: 1.25em; }
.hd__band .hd__id { margin: 0; }
.hd__band .blank { border-bottom-color: rgba(255,255,255,.8); }
.hd__br { width: 12em; }
.hd--modern h1 { font-family: "Lalezar", "Vazirmatn", sans-serif; font-weight: 400; font-size: 1.85em; text-align: right; margin-top: .2em; }
.hd__bar { display: inline-block; width: .32em; height: 1em; border-radius: 2px; margin-inline-end: .35em; vertical-align: -.1em; }
.hd--modern .hd__open { text-align: center; }
/* مینیمال */
.hd--minimal { border-bottom: 1px solid #0F766E; padding-bottom: .35em; text-align: right; }
.hd--minimal .hd__c2 { text-align: right; }
.hd--minimal .hd__c2 .hd__open { text-align: right; }
.hd--minimal .hd__c3 { width: 10em; }
.hd--minimal h1 { font-size: 1.6em; font-weight: 800; letter-spacing: -.01em; }
.hd--minimal .hd__m { color: #666; }
/* QR در طرح‌های ویژه: نوار پایانی سند */
.qrstrip { margin-top: 1em; padding-top: .5em; border-top: 1px dashed #c3c8cf; break-inside: avoid; page-break-inside: avoid; }
.qrstrip .qr { float: none; display: flex; justify-content: flex-start; margin: 0; }
.qrstrip .qr__t { text-align: right; font-size: .7em; }
.qrstrip .qr__t br { display: none; }
.qrstrip .qr__t b, .qrstrip .qr__t span { margin: 0 .5em; }
.qr__u { display: none; }
.qrstrip .qr__u { display: block; margin: .2em 0 0 !important; color: #666; }
