﻿/* ========================================================= */
/*                 PRINT ISOLATION                           */
/* ========================================================= */
@media print {

    /* Hide everything */
    body * {
        visibility: hidden !important;
    }

    /* Show only report */
    #print-report,
    #print-report * {
        visibility: visible !important;
    }

    #print-report {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* ===================================================== */
    /*                 PAGE SETUP                            */
    /* ===================================================== */
    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    html, body {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        line-height: 1.2;
        color: #000;
        background: #fff;
    }

    /* ===================================================== */
    /*                 REPORT HEADER                         */
    /* ===================================================== */
    .report-header {
        margin-bottom: 8px;
        padding-bottom: 5px;
        border-bottom: 2px solid #000;
    }

    /* ===================================================== */
    /*                 REPORT FOOTER                         */
    /* ===================================================== */
    .report-footer {
        margin-top: 12px;
        padding-top: 5px;
        border-top: 1px solid #000;
        font-size: 11px;
    }

    /* ===================================================== */
    /*                 CBC SECTIONS                          */
    /* ===================================================== */
    .cbc-section {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-bottom: 8px;
    }

    .cbc-section-title {
        font-size: 13px;
        font-weight: bold;
        text-transform: uppercase;
        margin: 6px 0 2px 0;
        padding-bottom: 2px;
        border-bottom: 1px solid #000;
    }

    /* ===================================================== */
    /*                 TABLE STYLING                         */
    /* ===================================================== */
    .cbc-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
        margin-top: 2px;
    }

        .cbc-table thead {
            display: table-header-group;
        }

        .cbc-table th {
            text-align: left;
            font-weight: bold;
            padding: 3px 4px;
            border-bottom: 1px solid #000;
        }

        .cbc-table td {
            padding: 2px 4px;
            vertical-align: top;
        }

        .cbc-table tr {
            page-break-inside: avoid !important;
            break-inside: avoid !important;
        }

        /* Column widths */
        .cbc-table th:nth-child(1),
        .cbc-table td:nth-child(1) {
            width: 38%;
        }

        .cbc-table th:nth-child(2),
        .cbc-table td:nth-child(2) {
            width: 14%;
        }

        .cbc-table th:nth-child(3),
        .cbc-table td:nth-child(3) {
            width: 25%;
        }

        .cbc-table th:nth-child(4),
        .cbc-table td:nth-child(4) {
            width: 13%;
        }

        .cbc-table th:nth-child(5),
        .cbc-table td:nth-child(5) {
            width: 10%;
            text-align: center;
        }

    /* ===================================================== */
    /*                 FLAGS                                 */
    /* ===================================================== */
    .abnormal {
        font-weight: bold;
    }

    .flag {
        font-weight: bold;
        font-size: 12px;
    }

        .flag.high {
            color: #b00000; /* Red */
        }

        .flag.low {
            color: #0033cc; /* Blue */
        }

        .flag.normal {
            color: #000;
        }

    /* ===================================================== */
    /*                 PAGE BREAK UTILITIES                  */
    /* ===================================================== */
    .page-break {
        page-break-before: always;
    }
}
