@font-face { font-family: 'Vazirmatn'; {{-- .ttf نه .woff2 — DomPDF (بدون ext-brotli) نمی‌تواند woff2 را decompress کند و بی‌صدا به فونت پیش‌فرض بدون گلیف فارسی سقوط می‌کند. مسیر با str_replace یک‌دست می‌شود چون روی ویندوز public_path() بک‌اسلش برمی‌گرداند که داخل url() سی‌اس‌اس escape خوانده می‌شود. --}} src: url('{{ str_replace('\\', '/', public_path('assets/fonts/vazirmatn/Vazirmatn-Regular.ttf')) }}') format('truetype'); font-weight: 400; } @font-face { font-family: 'Vazirmatn'; src: url('{{ str_replace('\\', '/', public_path('assets/fonts/vazirmatn/Vazirmatn-Bold.ttf')) }}') format('truetype'); font-weight: 700; } @page { size: A4 portrait; margin: 16mm 15mm; } * { box-sizing: border-box; margin: 0; padding: 0; } body { background: #fff; color: #1E293B; direction: rtl; font-family: 'Vazirmatn', 'Tahoma', sans-serif; font-size: 11.5px; line-height: 1.6; } .sheet { page-break-inside: avoid; } /* ── سربرگ ── توجه مهم: DomPDF (v3.1.6 بدون افزونه‌های اضافی) پشتیبانی flexbox ناقص و غیرقابل‌اعتمادی دارد — کانتینرهای چندستونی با display:flex گاهی روی هم می‌افتند یا بدون دلیل باعث شکستن صفحه می‌شوند. به همین دلیل کل قالب کارنامه با display:table/table-cell (نقطه‌قوت واقعی DomPDF) و inline-block ساخته شده، نه flex. */ .header { border-bottom: 2.5px solid #0EA678; display: table; margin-bottom: 14px; padding-bottom: 12px; width: 100%; } .header-brand, .header-meta { display: table-cell; vertical-align: middle; } .header-brand { width: 60%; } .header-meta { text-align: left; vertical-align: top; } .logo-box { background: #DFF8EF; border: 1px solid #BBEFDA; border-radius: 10px; display: inline-block; height: 46px; line-height: 46px; overflow: hidden; text-align: center; vertical-align: middle; width: 46px; } .logo-box img { height: 46px; object-fit: cover; width: 46px; } .logo-box span { color: #0EA678; font-size: 20px; font-weight: 700; } .header-text { display: inline-block; margin-right: 10px; vertical-align: middle; } .school-name { color: #0F172A; font-size: 16px; font-weight: 700; } .report-title { color: #64748B; font-size: 10.5px; margin-top: 2px; } .header-meta div { color: #334155; font-size: 10.5px; margin-bottom: 2px; } .header-meta strong { color: #0EA678; } /* ── اطلاعات دانش‌آموز — تگ‌های عریض‌شونده، inline-block به‌جای flex-wrap ── */ .info-grid { border: 1px solid #E2E8F0; border-radius: 8px; margin-bottom: 12px; padding: 10px 16px; } .info-item { display: inline-block; margin-left: 22px; margin-bottom: 4px; min-width: 140px; vertical-align: top; } .info-label { color: #64748B; font-size: 9px; } .info-value { font-size: 11.5px; font-weight: 700; } /* ── ردیف آمار خلاصه ── */ .stat-row { display: table; margin-bottom: 12px; table-layout: fixed; width: 100%; } .stat-box { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px; display: table-cell; padding: 7px 10px; text-align: center; } .stat-row .stat-box + .stat-box { border-right: none; } .stat-spacer { width: 6px; } .stat-box span { color: #64748B; display: block; font-size: 8.5px; } .stat-box strong { display: block; font-size: 14px; margin-top: 2px; } .stat-box.accent { background: #DFF8EF; border-color: #BBEFDA; } .stat-box.accent strong { color: #0B8C66; } .status-pass strong { color: #16A34A; } .status-fail strong { color: #DC2626; } .status-pending strong { color: #64748B; } /* ── جدول دروس ── */ /* table-layout:fixed تضمین می‌کند ستون‌ها هیچ‌وقت از عرض A4 بیرون نزنند — حتی با نام درس یا برچسب طولانی؛ عرض ستون نام درس صریح و بقیه مساوی تقسیم می‌شوند. */ table.subjects { border: 1px solid #E2E8F0; border-collapse: collapse; margin-bottom: 12px; table-layout: fixed; width: 100%; } table.subjects th { background: #0EA678; color: #fff; font-size: 10px; font-weight: 700; overflow: hidden; padding: 7px 6px; text-align: center; text-overflow: ellipsis; white-space: nowrap; } table.subjects th.subject-col, table.subjects td.subject-col { text-align: right; width: 30%; } table.subjects td { border-bottom: 1px solid #EEF2F7; font-size: 11px; overflow: hidden; padding: 6px 6px; text-align: center; word-wrap: break-word; } table.subjects tr:nth-child(even) td { background: #FAFBFC; } .score-strong { font-weight: 700; } .pill { border-radius: 5px; display: inline-block; font-size: 9.5px; font-weight: 700; padding: 2px 8px; } .result-pass { color: #16A34A; font-weight: 700; } .result-fail { color: #DC2626; font-weight: 700; } /* ── ردیف پایین: حضور + توضیحات ── */ .lower-row { display: table; margin-bottom: 12px; table-layout: fixed; width: 100%; } .lower-col { display: table-cell; padding-left: 6px; vertical-align: top; width: 40%; } .lower-col.wide { padding-left: 0; padding-right: 6px; width: 60%; } .box { border: 1px solid #E2E8F0; border-radius: 8px; padding: 10px 14px; } .box-title { color: #0F172A; font-size: 10.5px; font-weight: 700; margin-bottom: 8px; } .attendance-line { display: table; font-size: 10.5px; margin-bottom: 5px; width: 100%; } .attendance-line span { display: table-cell; } .attendance-line span:last-child { font-weight: 700; text-align: left; } .comment-text { color: #334155; font-size: 10.5px; line-height: 1.8; } /* ── امضاها ── */ .signatures { display: table; margin-top: 6px; table-layout: fixed; width: 100%; } .signature-box { display: table-cell; text-align: center; } .signature-line { border-bottom: 1px solid #CBD5E1; height: 34px; margin-bottom: 6px; } .stamp-circle { border: 1.5px dashed #94A3B8; border-radius: 50%; color: #94A3B8; display: inline-block; font-size: 8px; height: 40px; line-height: 40px; margin-bottom: -20px; position: relative; top: -18px; width: 40px; } .signature-label { color: #64748B; font-size: 10px; } .footer { border-top: 1px solid #E2E8F0; color: #94A3B8; font-size: 9px; margin-top: 16px; padding-top: 8px; text-align: center; } /* ── چاپ دسته‌جمعی — یک برگه‌ی کامل به ازای هر دانش‌آموز ── */ .bulk-page { page-break-after: always; } .bulk-page:last-child { page-break-after: auto; } .bulk-page.stacked { border-bottom: 1px dashed #CBD5E1; margin-bottom: 18px; padding-bottom: 18px; page-break-after: auto; } .bulk-cover { page-break-after: always; padding-top: 25%; text-align: center; } .bulk-cover h1 { color: #0F172A; font-size: 22px; margin-bottom: 10px; } .bulk-cover p { color: #64748B; font-size: 13px; }