@media print {

    /* Navigation chrome — hide all interactive UI */
    .navbar,
    .footer,
    .breadcrumb,
    [data-dismiss="alert"],
    .alert {
        display: none !important;
    }

    /* Hide print-action buttons and non-print controls.
       Use .no-print on any element the view wants hidden in print. */
    .no-print {
        display: none !important;
    }

    /* Bootstrap vendor override (public/bootstrap/css/bootstrap.css:205)
       Without this, every a[href] in print renders as "link text (https://...)"
       making the top-links table unreadable. !important wins over the vendor rule
       regardless of load order. */
    a[href]:after {
        content: none !important;
    }

    /* Canvas sizing — reliable chart sizing in PDF (Risk 2 mitigation).
       Applied to all Chart.js canvases sitewide: 250px is a safe print height for
       any dashboard chart canvas (list dashboard and campaign dashboard both benefit).
       This stylesheet is intentionally a shared base for all dashboard print output. */
    canvas {
        max-width: 100%;
        height: 250px !important;
        image-rendering: crisp-edges;
    }

    /* Suppress canvases that haven't rendered yet when print fires.
       Applied sitewide: an empty canvas on any dashboard page is correct to hide. */
    canvas:empty {
        display: none !important;
    }

    /* Page-break control — keep KPI cards and disclosure footnote together.
       display:block !important on .campaign-disclosure overrides the .alert { display:none }
       rule above, ensuring the footnote is visible in print/PDF (SC6). */
    .kpi-cards-row,
    .campaign-disclosure {
        display: block !important;
        page-break-inside: avoid;
    }

    /* Panel borders and backgrounds — force readable light colors */
    .panel {
        border: 1px solid #ccc !important;
    }

    .panel-heading {
        background: #f5f5f5 !important;
        color: #000 !important;
    }

}
