/* رأس الورقة وتذييلها (البند 441): مكوّن الطباعة الواحد في القالب العام (Pages/Shared/_PrintHeader.cshtml).
   يظهر في الورق وحده، ومعاينته في «إعدادات الشركة» تستعمل الشكل نفسه على الشاشة.
   الرأس ثابت الاتجاه في اللغتين: العربي يميناً، والشعار في الوسط، والإنجليزي يساراً.
   والشعار في مربع ثابت يتسع له العريض والطويل دون تشويه: حتى 55 مم عرضاً و18 مم ارتفاعاً. */
.itqan-print-identity {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 6mm;
  direction: rtl;
  color: #111;
}

.itqan-print-identity--single {
  grid-template-columns: minmax(0, 1fr) auto;
}

.itqan-print-identity__name {
  font-family: "Tajawal", "Inter", sans-serif;
  font-size: 13pt;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.itqan-print-identity__name--ar {
  text-align: right;
}

.itqan-print-identity__name--en {
  font-family: "Inter", "Tajawal", sans-serif;
  text-align: left;
}

.itqan-print-identity__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.itqan-print-identity__logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 55mm;
  max-height: 18mm;
  object-fit: contain;
}

/* معاينة الرأس في «إعدادات الشركة» على الشاشة */
.itqan-print-identity--preview {
  display: grid;
}

.itqan-print-footer {
  display: none;
}

@media print {
  .itqan-print-identity {
    display: grid !important;
    margin: 0 0 5mm;
    padding-bottom: 3mm;
    border-bottom: 0.75pt solid #111;
    break-inside: avoid;
  }

  /* المعاينة نسخة الشاشة: لا تُطبع مع الرأس الحقيقي */
  .itqan-print-identity--preview {
    display: none !important;
  }

  /* اسم الشركة على الشاشة في صفحة طباعة: يحمله الرأس الواحد في الورق، فلا يتكرر */
  [data-print-company-name-duplicate] {
    display: none !important;
  }

  .itqan-print-footer {
    display: block !important;
    margin-top: 6mm;
    padding-top: 2mm;
    border-top: 0.5pt solid #bbb;
    font-family: "Tajawal", "Inter", sans-serif;
    font-size: 8pt;
    color: #666;
    text-align: center;
    break-inside: avoid;
  }

  /* الورقة تبدأ برأس الشركة لا بإطار التطبيق: الشريط العلوي والقائمة الجانبية لا يُطبعان في أي شاشة،
     كما كانت تفعل الشاشات التي تحمّل gl.css وحدها. */
  .itqan-navbar,
  .itqan-sidebar,
  .itqan-offcanvas {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
  }
}
