/* =========================================================
   6. IACUC COMPLIANCE REPORT (Surgical Print Fix)
   ========================================================= */

@page iacuc-portrait {
    size: letter portrait;
    margin: 0.15in !important; /* <--- Hardcodes your perfect margin */
}

@media print {
    body.print-iacuc {
        page: iacuc-portrait;
    }

    body.print-iacuc #iacuc-report-header {
        text-align: center;
        border-bottom: 2px solid #333;
        margin-bottom: 20px;
    }

    /* Redaction effect: Hide specific PI names if requested for anonymity */
    body.print-iacuc .redacted {
        background-color: #000;
        color: #000;
    }
}

/* =========================================================
   7. COMPLIANCE HQ - UI COLORS (SCREEN ONLY)
   ========================================================= */
.status-pending { background-color: #fff3cd !important; border-left: 5px solid #ffc107; }
.status-critical { background-color: #f8d7da !important; border-left: 5px solid #dc3545; }

@media print {
    /* Remove row colors for the official IACUC report to save ink/keep professional */
    body.print-iacuc tr {
        background-color: transparent !important;
        border-bottom: 1px solid #ccc !important;
    }

    /* =========================================================
       8. IACUC OFFICIAL REPORT (Portrait & Redacted)
       ========================================================= */
    
    /* Hide everything else */
    body.print-iacuc .navbar,
    body.print-iacuc .sidebar,
    body.print-iacuc .btn,
    body.print-iacuc #sidebar-col-mgmt,
    body.print-iacuc .nav-tabs,
    body.print-iacuc .d-print-none,
    body.print-iacuc .dash-debug-menu,
    body.print-iacuc .dash-debug-alert,
    body.print-iacuc #glp-master-wrapper { /* <--- NUKE THE ENTIRE GLP SECTION */
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    /* Show the hidden report */
    body.print-iacuc #iacuc-printable-report {
        display: block !important;
        visibility: visible !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background-color: white !important;
        z-index: 9999 !important;
        /* THE FIX: The 5000px box-shadow has been deleted from here! */
    }

    /* Clean Table for the Committee */
    body.print-iacuc table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 11pt !important;
    }

    body.print-iacuc th {
        background-color: #f2f2f2 !important;
        border: 1px solid #333 !important;
        padding: 8px;
    }

    body.print-iacuc td {
        border: 1px solid #ccc !important;
        padding: 8px;
        vertical-align: top;
    }
}

/* =========================================================
   9. OFFICIAL IACUC LETTERHEAD (Surgical)
   ========================================================= */
@media print {
    body.print-iacuc #iacuc-letterhead-container {
        display: block !important;
        width: 100% !important;
        border-bottom: 2px solid #000;
        margin-bottom: 30px;
    }

    /* Ensure the logo prints in high fidelity */
    body.print-iacuc img {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        max-width: 200px;
    }
}

/* =========================================================
   10. VET PATIENT HISTORY (THE CLINICAL FLOW)
   ========================================================= */

@page vet-portrait {
    size: letter portrait;
    margin: 0.5in;
}

@media print {
    /* Set to Portrait for clinical reading */
    body.print-vet {
        page: vet-portrait;
    }

    /* THE FLOW: Allows the history to span as many pages as needed */
    body.print-vet #patient-history-output {
        display: block !important;
        position: relative !important; /* NOT absolute */
        width: 100% !important;
        visibility: visible !important;
    }

    /* Keep individual clinical notes together (No splitting a note across pages) */
    body.print-vet .clinical-entry-row {
        page-break-inside: avoid !important;
        border-bottom: 1px solid #eee;
        padding: 10px 0;
    }

    /* Ensure the Animal ID Header stays at the top of the first page */
    body.print-vet #vet-patient-header {
        border-bottom: 2px solid #000;
        margin-bottom: 20px;
    }
}
