/* Page setup is identical to Weasyprint */
@page {
  size: A4;
  margin: 2cm;
}

/* Slightly smaller, compact print text */
body {
  font-family: sans-serif;
  font-size: 11px;
  line-height: 1.2;
}

/* DEBUG: prove print CSS is loading can be removed after all of the testing
This comment was set/written on Feb. 15, 2026
*/

@media print {

/*======================================================================
   GLOBAL removal buttons, input, and bootstrap icons
======================================================================== */

/* Hide all <button> elements */
button {
    display: none !important;
}

/* Hide all Bootstrap-style buttons */
.btn {
    display: none !important;
}

/* Hide all submit inputs */
input[type="submit"],
input[type="button"],
input[type="reset"] {
    display: none !important;
}

/* hide all circled i-icons from bootstrap bi */
.bi-info-circle,
.bi-info-circle-fill {
    display: none !important;
}


/* -----------------------------------------------------------------------
   ATTRIBUTE SELECTOR FOR PRINT HIDING
--------------------------------------------------------------------------
   [data-print-hide] used as CSS *attribute selector*
       - It matches any HTML element that contains the attribute
         data-print-hide (with or without a value).
       
   This is to mark any element to be hidden in browser print/pdf output      
-------------------------------------------------------------------------- */

[data-print-hide] {
    display: none !important;
}

/* -----------------------------------------------------------------------
   HIDE ALLE <details> and <summary> elements in print
--------------------------------------------------------------------------*/

details,
details summary {
    display: none !important;
}

/* -----------------------------------------------------------------------
   Remove navbar elements and footer elements
--------------------------------------------------------------------------*/
.navbar-brand,
.navbar-logo-text {
    display: none !important;
}

#app-footer,
#app-footer * {
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

/* If you want even more spacing for these two specific headers: */
h4:contains("Reporting Period"),
h4:contains("Credit Ratios for reporting period chosen") {
    margin-bottom: 18px !important;
}

/*===========================================================================================
   Hide all dropzones in browser-generated PDF (not weasyprint, of course)
   Hides dropzones when click "Print / Save as PDF".

=============================================================================================*/
/* 
Hide entire dropzone UI in browser print.
Chrome refuses to hide file inputs directly, but WILL hide a wrapper
that contains them. This ensures the dropzone never appears in the
browser-generated PDF, while uploaded images (outside this wrapper)
still print normally.
*/

#financial-risk-dropzone * {
    pointer-events: none !important;
}
#financial-risk-dropzone {
    display: none !important;
}

.dropzone-wrapper {
    display: none !important;
}

/* Remove spacing above the textarea */
#financial_risk_text {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove spacing under the textarea counter */
#financial_risk_text + .text-muted.small {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Remove spacing from any mb-3 inside this section */
#financial-risk-form .mb-3 {
    margin: 0 !important;
    padding: 0 !important;
}

.print-hide {
    display: none !important;
}

.no-images-uploaded {
    display: none !important;
}

/* =============================================================================================
   Remove the counter of X of 3000 characters in the textareas
   of financial risk and business risk - overall 4 of them
   The text-muted.small for FRP/BRP counter and small.text-muted
   for override and ESG textareas
================================================================================================ */

.text-muted.small {
    display: none !important;
}

small.text-muted {
    display: none !important;
}

/* Hide ONLY the Related Party input form */
#relatedparty-section > form {
    display: none !important;
}

/* Hide ONLY the PE Sponsor input form */
#pesponsor-section > form {
    display: none !important;
}

/* ==========================================================================
   Loans section
============================================================================= */

/* 1. Hide instructions */
#existing-loans-section details {
    display: none !important;
}

/* 2. Hide the yellow warning banner */
#existing-loans-section #loan-warning-banner {
    display: none !important;
}

/* 3. HIDE ONLY the loan entry form (this removes all inputs + space) */
#existing-loans-section form[action*="create_loan"] {
    display: none !important;
}

/* 4. KEEP the summary form visible, but hide its UI */
#existing-loans-section form[action*="save_loan_summary"] textarea,
#existing-loans-section form[action*="save_loan_summary"] button,
#existing-loans-section form[action*="save_loan_summary"] .btn {
    display: none !important;
}

/* 5. KEEP summary heading visible */
#existing-loans-section h4 {
    display: block !important;
}

/* 6. KEEP summary text visible */
#existing-loans-section #loan_summary_text {
    display: block !important;
}

/* 7. KEEP existing loans table visible */
#existing-loans-section .loan-summary-table {
    display: table !important;
}

/* 8. KEEP totals visible */
#existing-loans-section .total-loan-box {
    display: block !important;
}

/* Remove  the loan entry form */
#existing-loans-section > div > form {
    display: none !important;
}

#existing-loans-section table.loan-summary-table th:last-child,
#existing-loans-section table.loan-summary-table td:last-child {
    display: none !important;
}

/*=========================================================================
                        REPORTING PERIOD
=========================================================================== */

.reporting-period-row {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 1rem !important;
    padding-top: 12px !important;
}

.reporting-period-row .cell {
    display: table-row !important;
}

.reporting-period-row .cell label,
.reporting-period-row .cell *:not(label) {
    display: table-cell !important;
    padding: 6px 8px !important;
    border: 1px solid #ccc !important;
    vertical-align: top !important;
}

/*=====================================================================
                    CREDIT RATIOS
=======================================================================*/

.ratio-grid {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    padding-top: 12px !important;
}

.ratio-grid .ratio-item {
    display: table-row !important;
}

.ratio-grid .ratio-item label,
.ratio-grid .ratio-item *:not(label) {
    display: table-cell !important;
    padding: 6px 8px !important;
    border: 1px solid #ccc !important;
    vertical-align: top !important;
}

/* Add spacing BELOW the header by adding margin ABOVE the table */
.reporting-period-row {
    margin-top: 16px !important;
}

.ratio-grid {
    margin-top: 16px !important;
}

/* Force black text for rating elements in browser print */

.rating-badge-unified,
#final-rating,
.rating-table td span {
    font-size: 14px !important;      
    font-weight: 400 !important;     
    color: #000 !important;         
    background: #fff !important;    
    border: none !important;         
    box-shadow: none !important;     
    padding: 0 !important;           
}

/* ==================================================================
        Reducing font-size of financial_model upload in table
=================================================================== */

.absolute-table td,
.absolute-table th,
.ratios-table td,
.ratios-table th {
    font-size: 0.85rem;
    padding: 2px 4px;
}

/*=============================================================================
        Override and ESG = NO PDF css here as textarea
        small/muted text wiped out above in general styles
===============================================================================*/

/*=============================================================================
    COVENANT PERIOD TABLE
===============================================================================*/

/* Remove the input field for upload of file */
#id_file,
label[for="id_file"],
.col-md-12.mb-1 {
    display: none !important;
}

/* Row 1: 3 columns */
.covenant-row-1 {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 16px !important; /* spacing below textarea */
}

.covenant-row-1 > div {
    display: table-row !important;
}

.covenant-row-1 > div label,
.covenant-row-1 > div *:not(label) {
    display: table-cell !important;
    padding: 6px 8px !important;
    border: 1px solid #ccc !important;
    vertical-align: top !important;
}

/* Row 2: 2 columns */
.covenant-row-2 {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 12px !important;
}

.covenant-row-2 > div {
    display: table-row !important;
}

.covenant-row-2 > div label,
.covenant-row-2 > div *:not(label) {
    display: table-cell !important;
    padding: 6px 8px !important;
    border: 1px solid #ccc !important;
    vertical-align: top !important;
}

/* Center covenant tables and give them breathing room */
.covenant-row-1,
.covenant-row-2 {
    width: 98% !important;              /* shrink to content */
    margin-left: auto !important;        /* center horizontally */
    margin-right: auto !important;
}

.covenant-row-1,
.covenant-row-2,
.covenant-row-1 label,
.covenant-row-2 label,
.covenant-row-1 select,
.covenant-row-2 select,
.covenant-row-1 option,
.covenant-row-2 option {
    font-size: 11px !important;
    line-height: 1.2 !important;
}

/* ================================================================
                COLLATERAL SECTION
=================================================================== */


/* ================================================================
                COLLATERAL LIQUIDATION SECTION
=================================================================== */

.table-responsive {
    overflow: visible !important;
    display: block !important;
    max-width: 100% !important;
}

/* Remove column explaining "typical haircuts" */
#collateral-liquidation-section table.collateral-table th:nth-child(5),
#collateral-liquidation-section table.collateral-table td:nth-child(5) {
    display: none !important;
}

/* Force Chrome to respect widths */
#collateral-liquidation-section table.collateral-table {
    table-layout: fixed !important;
    width: 100% !important;
}

/* Column 1: 40% */
#collateral-liquidation-section table.collateral-table th:nth-child(1),
#collateral-liquidation-section table.collateral-table td:nth-child(1) {
    width: 40% !important;
}

/* Column 2: 20% */
#collateral-liquidation-section table.collateral-table th:nth-child(2),
#collateral-liquidation-section table.collateral-table td:nth-child(2) {
    width: 20% !important;
}

/* Column 3: 20% */
#collateral-liquidation-section table.collateral-table th:nth-child(3),
#collateral-liquidation-section table.collateral-table td:nth-child(3) {
    width: 20% !important;
}

/* Column 4: 20% */
#collateral-liquidation-section table.collateral-table th:nth-child(4),
#collateral-liquidation-section table.collateral-table td:nth-child(4) {
    width: 20% !important;
}

#collateral-liquidation-section table.collateral-table,
#collateral-liquidation-section table.collateral-table th,
#collateral-liquidation-section table.collateral-table td {
    font-size: 11px !important;
    line-height: 1.25 !important;
}

/* ================================================================
                WATERFALL SECTION
=================================================================== */

#waterfall-section .bi-info-circle {
    display: none !important;
}

#waterfall-section table.other-lender-claim-table th:last-child,
#waterfall-section table.other-lender-claim-table td:last-child {
    display: none !important;
}

/* ================================================================
   APPROVER CHECKLIST — PAGE BREAK FOR BROWSER PRINT/PDF
=================================================================== */

/* Force the checklist to start on a new page */
#reviewer-checklist {
    page-break-before: always !important;
    break-before: page !important;
}

/* Keep each checklist row together */
.checklist-row {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

/* ================================================================
    HIDE THE SUBMIT FOR APPROVAL FORM in BROWEER PRINT/PDF
=================================================================== */

.hide-in-print {
    display: none !important;
}

} /* END @media print */

