@font-face {
    font-family: ERPXReportHeader;
    src: url("../fonts/NotoKufiArabic-Medium.ttf") format("truetype");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
}

.erpx-report-header {
    width: 100%;
    padding: 0;
    margin: 0 0 6px;
    color: inherit;
    font-family: ERPXReportHeader, Tahoma, Arial, sans-serif;
    break-inside: avoid;
}

.erpx-report-brand {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px minmax(0, 1fr);
    align-items: start;
    gap: 0;
}

.erpx-report-company {
    min-width: 0;
    font-size: 10px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.erpx-report-company strong {
    display: block;
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.erpx-report-company.company-ar { text-align: right; }
.erpx-report-company.company-en { text-align: left; }
.erpx-report-brand-logo { height: 48px; display: grid; place-items: center; padding: 0 15px; }
.erpx-report-brand-logo img { max-width: 56px; max-height: 48px; width: auto; height: auto; object-fit: contain; }
.erpx-report-title { margin-top: 6px; padding: 5px 8px; background: #f1f5f9; text-align: center; }
.erpx-report-header .erpx-report-title h1 { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; font-size: 14px !important; font-weight: 600; line-height: 1.5; color: #2e3370; text-align: center !important; }
.erpx-report-title-secondary { margin-top: 2px; font-size: 10px; line-height: 1.4; color: #71717a; }
.erpx-report-subtitle { margin: 3px 0; font-size: 10px; }
.accounting-report-header:has(.erpx-report-header),
.commercial-report-heading:has(.erpx-report-header),
.vat-desktop-header:has(.erpx-report-header),
.closing-header:has(.erpx-report-header),
.list-print-header:has(.erpx-report-header),
.zatca-report-print-heading:has(.erpx-report-header) { display: block; padding: 0; width: 100%; }
.sales-report-tax-qr { display: flex; justify-content: flex-end; margin: 4px 0; }
.sales-report-tax-qr img { width: 54px; height: 54px; object-fit: contain; }
html[data-theme="dark"] .erpx-report-title { background: #252d3a; }
html[data-theme="dark"] .erpx-report-header .erpx-report-title h1 { color: #e7e9f3; }
html[data-theme="dark"] .erpx-report-title-secondary { color: #b1b8c5; }

/* Keep printable markup available to PDF generation and the print media layout. */
@media screen {
    .erpx-report-header,
    .commercial-report-heading:has(.erpx-report-header),
    .accounting-report-header:has(.erpx-report-header),
    .vat-desktop-header:has(.erpx-report-header),
    .list-print-header:has(.erpx-report-header),
    .zatca-report-print-heading:has(.erpx-report-header),
    .summary-grid:not(.compact),
    .closing-card > .summary-grid,
    .report-summary-grid {
        display: none !important;
    }

    .inventory-report .erpx-report-header + hr {
        display: none;
    }
}

@media (max-width: 600px) {
    .erpx-report-brand { grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1fr); }
    .erpx-report-company { font-size: 8px; }
    .erpx-report-company strong { font-size: 11px; }
    .erpx-report-brand-logo { padding: 0 6px; }
    .erpx-report-brand-logo img { max-width: 48px; }
}

@media print {
    .erpx-report-header { color: #18181b !important; }
    html[data-theme] .erpx-report-title { background: #f1f5f9 !important; print-color-adjust: exact; }
    html[data-theme] .erpx-report-header .erpx-report-title h1 { color: #2e3370 !important; }
    html[data-theme] .erpx-report-title-secondary { color: #71717a !important; }
}

/* Column captions share the same alignment in screen reports and printed tables. */
thead th {
    text-align: center !important;
    vertical-align: middle !important;
}
