.invoice-main-custom {
  max-width: 1260px;
  margin: 40px auto;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

.invoice-header-custom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: 10px;
  background-color: #f3f4f6;
  margin-bottom: 24px;
  align-items: center;
}

.invoice-number-custom {
    color: #00253a;
    font-weight: 300;
    font-size: 15px;
}

.invoice-status-custom {
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 14px;
  background-color: #e6f9f0;
  color: #22c55e;
}

.invoice-status-unpaid {
  background-color: #fef2f2;
  color: #ef4444;
}

.invoice-date-custom {
  font-size: 14px;
  color: #6b7280;
}

.invoice-row-flex {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 24px;
  gap: 16px;
}

.invoice-card-custom {
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 16px;
  border-radius: 10px;
  flex: 0 0 48%;
}

.invoice-card-title {
  font-weight: bold;
  color: #374151;
  margin-bottom: 8px;
}

.invoice-products-section-custom table,
.invoice-transactions-table-custom {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 10px;
}

.invoice-products-section-custom th,
.invoice-products-section-custom td,
.invoice-transactions-table-custom th,
.invoice-transactions-table-custom td {
  padding: 10px;
  border: 1px solid #e5e7eb;
  text-align: right;
}

.invoice-products-section-custom th,
.invoice-transactions-table-custom th {
  background-color: #f3f4f6;
  font-weight: bold;
}

.invoice-totals-area-custom {
  margin-top: 24px;
}

.invoice-totals-card-custom {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  background: #f9fafb;
}

.invoice-totals-title {
  font-weight: bold;
  margin-bottom: 10px;
  color: #374151;
}

.final-total-row-custom td {
  font-weight: bold;
  background-color: #e6f9f0;
  color: #059669;
}

.invoice-notes-card-custom,
.invoice-payment-method-card-custom,
.invoice-transactions-card-custom {
  border: 1px solid #e5e7eb;
  padding: 16px;
  border-radius: 10px;
  background: #fff;
  margin-top: 20px;
}

.invoice-section-title {
  font-weight: bold;
  display: block;
  margin-bottom: 8px;
  color: #374151;
      text-align: right;
}

.invoice-paynow-custom {
  text-align: center;
  margin-top: 24px;
}

.btn-custom-paynow {
  background-color: #F66B0E;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
}

.invoice-btn-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.invoice-btn-link {
  background-color: #F66B0E;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
}

.invoice-btn-link:hover {
    background-color: #00253a;
    text-decoration: unset;
    color: #fff;
}

.taxed-flag {
  color: #ef4444;
  font-size: 12px;
  font-weight: bold;
  margin-right: 6px;
}
.invoice-meta-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 13px;
    font-size: 1.06em;
    color: #7a83a5;
    margin-right: 18px;
    background: none;
}
.invoice-meta-bar span {
    font-weight: bold;
    color: #3955c4;
    margin-left: 7px;
}
.invoice-paid-date span {
    color: #00253a;
}
.invoice-details-row {
    display: flex;
    gap: 18px;
    margin-bottom: 20px;
    margin-top: 18px;
}
.invoice-details-box {
    background: #fff;
    border-radius: 13px;
    box-shadow: none;
    flex: 1;
    min-width: 0;
}
.invoice-details-header {
    background: #00253a;
    color: #ffffff;
    font-weight: 400;
    font-size: 16px;
    border-radius: 11px 11px 0 0;
    padding: 14px 0 8px 0;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}
.invoice-details-row-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 0 23px 6px 23px;
    color: #6a7184;
    font-size: 16px;
}
.invoice-details-row-content div {
    margin: 0 0 2px 0;
    white-space: pre;
}
.invoice-details-row-content span {
    color: #6a7184;
    margin-right: 4px;
}
@media (max-width:800px) {
    .invoice-details-row { flex-direction: column; gap: 12px;}
}
.invoice-details-address-separator {
    border-bottom: 1.2px dashed #cdd3e0;
    width: 98%;
    margin: 8px auto 8px auto;
}
.invoice-details-address {
    display: flex;
    flex-direction: row;
    padding: 0 23px 6px 23px;
        color: #000000;
    font-size: 15px;
}
.invoice-details-address span {
    margin-right: 2px;
    color: #2b3954;
        font-size: 14px;
            text-align: right;
}
.invoice-products-table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    margin-bottom: 22px;
}

.invoice-products-table-custom th {
    background: #F66B0E;
    font-weight: bold;
    color: #fdfdfd;
    font-size: 15px;
    padding: 13px 10px 10px 0px;
    text-align: right;
    border: 0px;
}

.invoice-products-table-custom td {
    padding: 20px 25px;
    color: #49557a;
    font-size: 1.04em;
    border: none;
    background: #fff;
    vertical-align: middle;
    text-align: right;
}

.invoice-products-table-custom tr:not(:last-child) td {
    border-bottom: 1px solid #f0f0f0;
}

.invoice-products-table-custom .invoice-summary-row {
    background: #fff;
    font-weight: 500;
    border-top: none;
}

.invoice-products-table-custom .final-total-row-custom {
    background: #eafbee !important;
    font-weight: bold;
}

.invoice-products-table-custom .final-total-row-custom .final-label {
    color: #09904a;
    font-weight: 700;
}

.invoice-products-table-custom .final-amount {
    color: #09904a;
    font-weight: bold;
    font-size: 1.08em;
}
.bg-success {
    background-color: #F66B0E !important;
}
.credit-inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* ریسپانسیو برای موبایل */
    background: #e9f7ef;
    padding: 16px 10px;
    border-radius: 7px;
    margin-top: 16px;
}
.credit-form-label {
font-size: 14px;
    white-space: nowrap;
    flex: 1 1 auto;
    text-align: right;
}
.credit-form-amount {
    max-width: 140px;
    min-width: 80px;
    margin: 0 5px;
}
#btnInvoiceAddCreditApply {
    min-width: 120px;
}
@media (max-width: 700px) {
    .credit-inline-form {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .credit-form-label {
        white-space: normal;
        margin-bottom: 4px;
    }
}
.invoice-header-custom {
    display: flex;
    flex-direction: row-reverse; /* برای چینش RTL */
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    direction: ltr;
}

.invoice-header-col {
    flex: 1 1 0;
    min-width: 180px;
    box-sizing: border-box;
    /* در صورت نیاز، padding یا border برای هر ستون جداگانه بزنین */
}

.invoice-header-col-number {
    /* راست، مثلا متن راست‌چین‌تر بشه */
    text-align: right;
}

.invoice-header-col-status {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.invoice-header-col-dates {
    /* چپ */
    text-align: left;
}

@media (max-width: 800px) {
    .invoice-header-custom {
        flex-direction: column;
        gap: 12px;
    }
    .invoice-header-col {
        min-width: 0;
        width: 100%;
        text-align: right !important;
    }
    .invoice-header-col-status {
        text-align: right;
        align-items: flex-start;
    }
}
.invoice-status-img-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.invoice-status-img {
    width: 75px;
    height: 75px;;
    object-fit: contain;
    margin-bottom: 6px;
}
.invoice-status-label {
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    display: block;
}
.invoice-products-section-custom th, .invoice-transactions-table-custom th {
    background-color: #00253a;
    font-weight: bold;
    color: #fff;
    text-align: center;
}
.btn-success {
    color: #fff;
    background-color: #00253a;
        border-color: #28a74500;
}
.btn-success:hover {
    color: #fff;
    background-color: #f66b0e;
    border-color: #28a74500;
}

.invoiceir-modal-content {
    padding: 24px 18px;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
}
.invir-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1.5px solid #39647b;
    padding-bottom: 8px;
}
.invir-serial {
    font-size: 14px;
    color: #555;
}
.invir-title {
    flex: 1;
    text-align: center;
    font-size: 21px;
    color: #214956;
    margin-right: -100px;
}
.invir-parties {
    width: 100%;
    margin: 12px 0 15px 0;
    border-collapse: collapse;
    font-size: 14px;
}
.invir-parties td {
    border: 1px solid #a2a2a2;
    vertical-align: top;
    padding: 8px;
    width: 100%;
}
.invir-items {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
    font-size: 14px;
    background: #fafbff;
}
.invir-items th, .invir-items td {
    border: 1px solid #667681;
    padding: 6px 5px;
    text-align: center;
}
.invir-items th {
    background: #e9eee5;
    color: #284157;
    font-weight: 700;
    font-size: 15px;
}
.invir-items tr:nth-child(even) {
    background: #f6fafb;
}
.invir-sum {
    width: 350px;
    margin: 18px 0 0 auto;
    border: 1px solid #bdbbbb;
    border-radius: 4px;
    font-size: 15px;
    background: #f7f9f5;
}
.invir-sum td {
    padding: 5px 8px;
    border-bottom: 1px dashed #cfd2d4;
}
.invir-sum tr:last-child td {
    border: none !important;
}
.invir-sum td:first-child {
    color: #444;
}
.invir-sum td:last-child {
    color: #154551;
    font-weight: 600;
    text-align: left;
    letter-spacing: 1px;
}
.invir-note {
    margin-top: 15px;
    font-size: 14.5px;
    color: #3c274d;
    background: #fffbe7;
    border: 1.5px dashed #edd192;
    border-radius: 4px;
    padding: 7px 12px;
}
.invir-footer {
    margin-top: 30px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.invir-sign {
    width: 36%;
    text-align: center;
    border-top: 1.5px solid #888;
    font-size: 13px;
    margin-top: 6px;
    color: #7a8b9e;
    padding-top: 9px;
}
@media (max-width: 700px) {
    .invoiceir-modal-content, .invir-sum {max-width:100%; width:98%;}
    .invir-header, .invir-footer {flex-direction:column; align-items:flex-start;}
    .invir-sign {width:90%; margin-top:18px;}
    .invir-parties td {font-size:12.5px; padding:6px;}
}
.Sabin-modal-2 {
    max-width: 1100px !important;
}
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.fw-bold { font-weight: bold; }
.invoice {
  width: 100%;
  max-width: 1200px;
  margin: auto;
  border: 1px solid #000;
  padding: 10px;
}
.invoice-header {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}
.invoice-header td {
  border: none;
  padding: 2px 5px;
  font-size: 12px;
      text-align: center;
}
.invoice-header .title {
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 8px 0;
  font-size: 16px;
  font-weight: bold;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

th {
  background: #f0f0f0;
  font-weight: normal;
}
.signature-row td {
  height: 60px;
  text-align: center;
  font-size: 12px;
}
.invoice-footer {
  font-size: 11px;
  line-height: 1.3;
  margin-top: 15px;
  text-align: right;
}
.invoice-footer div {
  margin-bottom: 3px;
}
.sabin-td-100 td {
    text-align: right;
}
#invoiceToPrint, .invoice {
  width: 28cm !important; /* بروی حالت landscape */
  min-height: 18cm;
  background: #fff;
  padding: 1cm;
  font-size: 13px;
  box-sizing: border-box;
  direction: rtl;
}
table { width: 100% !important; border-collapse: collapse; }
table, tr, td, th { page-break-inside: avoid !important;    text-align: right; }

.issuer-sign-stamp {
    position: relative;
    height: 90px;
    margin-top: 10px;
    display: inline-block;
}
.issuer-sign-stamp img:first-child {
    max-width: 90px;
    filter: brightness(0.95);
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 1;
}
.issuer-sign-stamp img:last-child {
    max-width: 78px;
    position: absolute;
    left: 6px;
    bottom: 8px;
    opacity: 0.92;
    z-index: 2;
}
