/*
|--------------------------------------------------------------------------
| SWCSS Supplier Settlement Statement
| A5 Digital Letterhead Layout - Priyalal & Sons
|--------------------------------------------------------------------------
*/


/*
|--------------------------------------------------------------------------
| Screen Preview
|--------------------------------------------------------------------------
*/

.swcss-settlement-print-page {
    width: 100%;
}


.swcss-settlement-print {
    position: relative;

    width: 148mm;
    min-height: 210mm;

    margin: 20px auto;
    padding: 4mm 5mm 53mm 5mm;

    box-sizing: border-box;

    background: #ffffff;
    border: 1px solid #d8d8d8;

    font-family: Arial, Helvetica, sans-serif;
    color: #111111;
}


/*
|--------------------------------------------------------------------------
| Digital Letterhead Images
|--------------------------------------------------------------------------
*/

.swcss-letterhead-header {
    width: 100%;
    margin: 0 0 2mm 0;
}


.swcss-letterhead-header img {
    display: block;
    width: 100%;
    height: auto;
}


.swcss-letterhead-footer {
    position: absolute;

    left: 5mm;
    right: 5mm;
    bottom: 4mm;

    width: auto;
}


.swcss-letterhead-footer img {
    display: block;
    width: 100%;
    height: auto;
}


/*
|--------------------------------------------------------------------------
| Document Title
|--------------------------------------------------------------------------
*/

.swcss-settlement-document-title {
    margin: 1.5mm 0 2mm 0;

    text-align: center;

    font-size: 14px;
    line-height: 1.1;
    font-weight: 800;

    letter-spacing: 0.2px;
}


/*
|--------------------------------------------------------------------------
| Settlement Information
|--------------------------------------------------------------------------
*/

.swcss-settlement-info-box {
    border: 1px solid #8e8e8e;

    padding: 2mm 2.5mm;

    margin-bottom: 2mm;
}


.swcss-settlement-info-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    column-gap: 5mm;
    row-gap: 1.1mm;
}


.swcss-info-row {
    display: grid;

    grid-template-columns:
        27mm
        3mm
        minmax(0, 1fr);

    align-items: start;

    font-size: 8.6px;
    line-height: 1.22;
}


.swcss-info-row-wide {
    grid-column: 1 / -1;
}


.swcss-info-label {
    font-weight: 700;
}


.swcss-info-colon {
    text-align: center;
}


.swcss-info-row strong {
    font-weight: 600;
    overflow-wrap: anywhere;
}


/*
|--------------------------------------------------------------------------
| Generic Settlement Blocks
|--------------------------------------------------------------------------
*/

.swcss-settlement-block {
    margin-top: 2mm;
}


.swcss-settlement-block-title {
    padding: 1mm 1.5mm;

    border: 1px solid #8e8e8e;
    border-bottom: none;

    background: #eeeeee;

    font-size: 9px;
    line-height: 1.12;
    font-weight: 800;

    text-transform: uppercase;
}


/*
|--------------------------------------------------------------------------
| Tables
|--------------------------------------------------------------------------
*/

.swcss-settlement-form-table {
    width: 100%;

    border-collapse: collapse;

    table-layout: fixed;

    font-size: 8px;
    line-height: 1.18;
}


.swcss-settlement-form-table th,
.swcss-settlement-form-table td {
    padding: 1mm 1.2mm;

    border: 1px solid #8e8e8e;

    vertical-align: middle;

    overflow-wrap: anywhere;
}


.swcss-settlement-form-table th {
    background: #f3f3f3;
    font-weight: 700;
}


.swcss-settlement-form-table tfoot th {
    background: #e9e9e9;
    font-weight: 800;
}


.swcss-settlement-number {
    text-align: right !important;
    white-space: nowrap;
}


.swcss-col-no {
    width: 8mm;
    text-align: center !important;
}


/*
|--------------------------------------------------------------------------
| Fruit Table Column Widths
|--------------------------------------------------------------------------
*/

.swcss-fruit-table th:nth-child(1),
.swcss-fruit-table td:nth-child(1) {
    width: 8mm;
}


.swcss-fruit-table th:nth-child(2),
.swcss-fruit-table td:nth-child(2) {
    width: auto;
}


.swcss-fruit-table th:nth-child(3),
.swcss-fruit-table td:nth-child(3) {
    width: 24mm;
}


.swcss-fruit-table th:nth-child(4),
.swcss-fruit-table td:nth-child(4) {
    width: 28mm;
}


.swcss-fruit-table th:nth-child(5),
.swcss-fruit-table td:nth-child(5) {
    width: 30mm;
}


/*
|--------------------------------------------------------------------------
| Supplier Cost Table
|--------------------------------------------------------------------------
*/

.swcss-cost-table th:nth-child(1),
.swcss-cost-table td:nth-child(1) {
    width: 8mm;
}


.swcss-cost-table th:nth-child(3),
.swcss-cost-table td:nth-child(3) {
    width: 32mm;
}


/*
|--------------------------------------------------------------------------
| Financial Summary
|--------------------------------------------------------------------------
*/

.swcss-financial-table td:first-child,
.swcss-financial-table th:first-child {
    width: auto;
}


.swcss-financial-table td:last-child,
.swcss-financial-table th:last-child {
    width: 40mm;
}


.swcss-net-settlement-row th {
    padding-top: 1.4mm;
    padding-bottom: 1.4mm;

    border-top: 2px solid #222222;

    background: #e3e3e3;

    font-size: 8.5px;
}


/*
|--------------------------------------------------------------------------
| Notes
|--------------------------------------------------------------------------
*/

.swcss-settlement-notes-box {
    margin-top: 2mm;

    padding: 1.5mm 2mm;

    border: 1px solid #8e8e8e;

    font-size: 7.8px;
    line-height: 1.22;
}


.swcss-settlement-notes-box > strong {
    font-size: 8px;
}


.swcss-settlement-notes-box ol {
    margin: 1mm 0 0 4mm;
    padding-left: 3mm;
}


.swcss-settlement-notes-box li {
    margin: 0.5mm 0;
}


/*
|--------------------------------------------------------------------------
| Signatures
|--------------------------------------------------------------------------
*/

.swcss-settlement-signatures {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 16mm;

    margin: 6mm 8mm 0 8mm;

    text-align: center;

    font-size: 7.8px;
    line-height: 1.22;
}


.swcss-signature-box {
    width: 45%;
}


.swcss-signature-line {
    height: 7mm;

    border-bottom: 1px solid #222222;

    margin-bottom: 1mm;
}


.swcss-signature-date {
    margin-top: 1.5mm;
}


/*
|--------------------------------------------------------------------------
| Responsive Screen Preview
|--------------------------------------------------------------------------
*/

@media screen and (max-width: 760px) {

    .swcss-settlement-print {
        width: 100%;
        min-height: auto;

        padding:
            18px
            18px
            220px
            18px;
    }


    .swcss-letterhead-footer {
        left: 18px;
        right: 18px;
        bottom: 18px;
    }


    .swcss-settlement-info-grid {
        grid-template-columns: 1fr;
    }


    .swcss-info-row-wide {
        grid-column: auto;
    }

}

/*
|--------------------------------------------------------------------------
| PRINT - A5 PORTRAIT
|--------------------------------------------------------------------------
|
| Printing is performed from a dedicated window containing only
| #swcss-printable-settlement. This prevents Elementor / theme wrappers from
| creating an unwanted second page.
|
|--------------------------------------------------------------------------
*/

@media print {

    @page {
        size: A5 portrait;
        margin: 0;
    }


    html,
    body {
        width: 148mm !important;
        height: 209mm !important;

        min-width: 148mm !important;
        min-height: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        background: #ffffff !important;

        overflow: hidden !important;
    }


    #swcss-printable-settlement {
        position: relative !important;

        left: auto !important;
        top: auto !important;

        width: 148mm !important;
        min-width: 148mm !important;
        max-width: 148mm !important;

        height: 209mm !important;
        min-height: 209mm !important;
        max-height: 209mm !important;

        margin: 0 !important;

        padding:
            4mm
            5mm
            53mm
            5mm !important;

        box-sizing: border-box !important;

        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;

        background: #ffffff !important;
        color: #000000 !important;

        overflow: hidden !important;
    }


    .swcss-letterhead-header,
    .swcss-letterhead-footer,
    .swcss-settlement-info-box,
    .swcss-settlement-block,
    .swcss-settlement-notes-box,
    .swcss-settlement-signatures,
    .swcss-settlement-form-table tr {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }


    .swcss-settlement-document-title {
        font-size: 13.5px !important;
    }


    .swcss-settlement-form-table {
        font-size: 7.8px !important;
    }


    .swcss-settlement-form-table th,
    .swcss-settlement-form-table td {
        padding:
            0.8mm
            1mm !important;
    }


    .swcss-settlement-block-title {
        font-size: 8.8px !important;
    }


    .swcss-settlement-signatures {
        margin-top: 4mm !important;
    }


    /*
    |--------------------------------------------------------------------------
    | Footer Must Stay On The Same A5 Page
    |--------------------------------------------------------------------------
    */

    .swcss-letterhead-footer {
        bottom: 3mm !important;
    }

}
