@font-face {
  font-family: "IRANSans";
  src: url("./fonts/IRANSansWeb(FaNum)_Bold.eot"); /* IE */
  src:
    url("./fonts/IRANSansWeb(FaNum)_Bold.eot?#iefix") format("embedded-opentype"),
    url("./fonts/IRANSansWeb(FaNum)_Bold.woff") format("woff"),
    url("./fonts/IRANSansWeb(FaNum)_Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@page {
  size: A4 landscape;
  margin: 0;
}

    * {
      box-sizing: border-box;
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
    }

    html, body {
      margin: 0;
      padding: 0;
      width: 297mm;
      height: 210mm;
      font-family: "IRANSans", sans-serif;
      font-variant-numeric: normal;
      background: #fff;
      direction: rtl;
      color: #000;
      font-weight: bold;
    }

    .page {
      /* position: relative; */
      width: 100%;
      height: 100%;
      padding: 4mm 8mm;
      box-sizing: border-box;
    }

    /* ===== HEADER ===== */
    .header {
      height: 20mm;
      position: relative;
      display: flex;
      text-align: center;
      justify-content: center;
      margin-bottom: 10px;
    }

    .header h1 {
      display: flex;
      justify-content: center;
      align-items: center;
      margin: 0;
      font-size: 15px;
    }

    .logo {
      position: absolute;
      right: 0;
      top: 0;
      height: 20mm;
    }

    /* ===== TABLE ===== */

    .invoice {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
    }

    /* خریدار و فروشنده */
    .info-row{
      font-size: 11px;
    }
    .info-cell {
      padding: 1mm;
      text-align: right;
    }
    .info-line {
      display: flex;
      flex-wrap: wrap;
      column-gap: 20mm;
      row-gap: 10px;
      align-items: center;
      margin: 5px;
    }
    .factor-box {
      text-align: right;
      vertical-align: top;
      padding: 6mm;
      line-height: 3.5;
      font-size: 11px;
    }


    .invoice th,
    .invoice td {
      border: 1px solid #c6c6c6;
      padding: 6px;
      text-align: center;
      vertical-align: middle;
    }

    /* ردیف عنوان ستون‌ها */
    .table-head th {
      background: #e1e4e8;
      font-size: 8px;
      font-weight: bold;
      line-height: 1.4;
      padding: 4px 2px;
      word-break: break-word;
      white-space: normal;
    }

    /* ردیف محصولات */
    .invoice tr {
      height: 10mm;
    }
    .product {
      font-size: 12px;
    }

    /* جمع کل */
    .summary td {
      height: 10mm;
      font-size: 12px;
    }
    .invoice td.t-right {
      text-align: right !important;
      /* padding-right: 1mm; */
    }
    .invoice td.t-left {
      text-align: left !important;
      /* padding-left: 1mm; */
    }
    .t-des {
      color: #4d4d4d;
      font-size: 10px;
    }

    .summary-flex {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      padding: 0 1mm;
      box-sizing: border-box;
      font-size: 11px;
    }

    /* اعتبار */
    .invoice td.validity {
      text-align: right !important;
      padding-right: 3mm !important;
      padding-left: 0;
      font-size: 10px;
    }

    /* توضیحات */
    .description-cell {
      padding: 0;
      /* height: 45mm; */
    }

    /* باکس داخلی */
    .description-box {
      height: 100%;
      padding: 1mm;
      box-sizing: border-box;
      position: relative;
      text-align: right;
      font-size: 12px;
    }

    /* عنوان توضیحات */
    .description-title {
      position: absolute;
      top: 1mm;
      right: 1mm;
      font-size: 12px;
      font-weight: bold;
      background: #fff;
      padding: 0 2px;
    }

    /* متن توضیحات */
    .description-text {
      margin-top: 6mm;
      line-height: 2;
      font-size: 12px;
      text-align: justify;
    }

    /* امضا */
    /* سلول امضا */
    .sign-row td {
      height: 20mm;
      padding: 0;
    }

    /* باکس امضا */
    .sign-box {
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 1rem;
    }

    /* فضای مهر یا امضا */
    .stamp {
      width: 15mm;
      height: 15mm;
      /* border: 1px solid #c6c6c6; */
      /* background: #fff; */
    }

    /* متن */
    .sign-text {
      font-size: 10px;
      white-space: nowrap;
    }

    /* خط وسط */
    .sign-row td:first-child {
      border-left: none;
    }
    .sign-row td:last-child {
      border-right: none;
    }