/* ==========================================================================
   Print stylesheet - A4 landscape government report layout.
   The Natural Green theme is replaced by grayscale-safe tones so the document
   stays legible on monochrome office printers.
   ========================================================================== */

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm 8mm 16mm 8mm;
    }

    html,
    body {
        background: #fff !important;
        height: auto !important;
    }

    body {
        font-family: 'Sarabun', 'Leelawadee UI', 'Tahoma', sans-serif;
        font-size: 9.5pt;
        color: #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ---------------------------------------------- Hide the whole live UI */

    .app-header,
    .app-footer,
    .filter-panel,
    .grid-toolbar,
    .grid-pager,
    .grid-shell,
    .summary-strip,
    .group-context,
    .busy-overlay,
    .be-datepicker,
    .no-print {
        display: none !important;
    }

    /* ------------------------------------------------ Show the print output */

    .print-only {
        display: block !important;
    }

    #print-area {
        display: block !important;
        width: 100%;
    }

    /* --------------------------------------------------- Document letterhead */

    .print-doc-header {
        display: flex;
        align-items: flex-start;
        gap: 8pt;
        border-bottom: 1.2pt solid #000;
        padding-bottom: 4pt;
        margin-bottom: 6pt;
    }

    .print-doc-header__logo {
        height: 42pt;
        width: auto;
        filter: grayscale(100%);
    }

    .print-doc-header__titles {
        flex: 1 1 auto;
        text-align: center;
    }

    .print-doc-header__title {
        font-size: 14pt;
        font-weight: 700;
        margin: 0;
    }

    .print-doc-header__report {
        font-size: 11pt;
        font-weight: 600;
        margin: 1pt 0 0;
    }

    .print-doc-header__org {
        font-size: 9pt;
        margin: 1pt 0 0;
    }

    .print-doc-header__stamp {
        flex: 0 0 auto;
        font-size: 8pt;
        text-align: right;
        line-height: 1.5;
        white-space: nowrap;
    }

    /* ------------------------------------------------------ Filter criteria */

    .print-criteria {
        border: 0.6pt solid #444;
        background: #f2f2f2;
        padding: 3pt 5pt;
        margin-bottom: 5pt;
        font-size: 8.5pt;
        line-height: 1.45;
    }

    .print-criteria__title {
        font-weight: 700;
        margin-right: 4pt;
    }

    .print-criteria__item {
        margin-right: 10pt;
        white-space: nowrap;
    }

    .print-criteria__item strong {
        font-weight: 600;
    }

    /* ---------------------------------------------------------- Summary line */

    .print-summary {
        border: 0.6pt solid #444;
        padding: 3pt 5pt;
        margin-bottom: 5pt;
        font-size: 8.5pt;
    }

    .print-summary__item {
        display: inline-block;
        margin-right: 12pt;
        white-space: nowrap;
    }

    .print-summary__value {
        font-weight: 700;
    }

    /* ------------------------------------------------------------- Data table */

    .print-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
    }

    .print-table thead {
        display: table-header-group;
    }

    .print-table tfoot {
        display: table-footer-group;
    }

    .print-table th {
        border: 0.6pt solid #000;
        background: #d9d9d9 !important;
        font-size: 8.5pt;
        font-weight: 700;
        padding: 2pt 3pt;
        text-align: center;
        vertical-align: middle;
        word-wrap: break-word;
    }

    .print-table td {
        border: 0.6pt solid #666;
        font-size: 8.5pt;
        padding: 1.5pt 3pt;
        vertical-align: top;
        word-wrap: break-word;
        overflow-wrap: anywhere;
    }

    .print-table tbody tr {
        page-break-inside: avoid;
    }

    /* Group rows: shade by depth, all grayscale-safe. */
    .print-group td {
        font-weight: 700;
        border: 0.6pt solid #000;
    }

    .print-group--1 td {
        background: #c9c9c9 !important;
        font-size: 9.5pt;
    }

    .print-group--2 td {
        background: #d8d8d8 !important;
    }

    .print-group--3 td {
        background: #e6e6e6 !important;
    }

    .print-group--4 td {
        background: #f0f0f0 !important;
    }

    .print-group--5 td {
        background: #f8f8f8 !important;
        font-weight: 600;
    }

    .print-group__caption {
        font-weight: 400;
        font-size: 8pt;
    }

    .print-group__count {
        font-weight: 600;
        font-size: 8pt;
    }

    .print-group__indent {
        display: inline-block;
    }

    .print-cell--amount {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .print-cell--date {
        text-align: center;
        white-space: nowrap;
    }

    .print-total-row td {
        background: #d9d9d9 !important;
        font-weight: 700;
        border-top: 1.2pt solid #000;
    }

    /* ------------------------------------------- Repeating page-bottom band */

    .print-page-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-top: 0.6pt solid #000;
        padding-top: 2pt;
        font-size: 7.5pt;
        display: flex;
        justify-content: space-between;
    }

    a[href]::after {
        content: none !important;
    }
}
