/* Print-only styles.
 *
 * Rules:
 *  - White background, black text everywhere (saves ink, predictable).
 *  - Chrome (sidebar/topbar/footer) hidden so the visible page = content.
 *  - Brand color preserved on logo + section headings (printers handle hex).
 *  - Anchor URLs printed after the text so paper readers can find them.
 */
@media print {
    @page {
        margin: 1.5cm;
    }
    html, body {
        background: #fff !important;
        color: #000 !important;
        font-family: "Inter", system-ui, sans-serif;
        font-size: 11pt;
        line-height: 1.4;
    }
    /* Hide app chrome and any UI element explicitly marked .no-print. */
    aside#sidebar,
    header.app-topbar,
    .app-footer,
    .no-print,
    button {
        display: none !important;
    }
    /* Force full-width main content when sidebar is hidden. */
    main {
        padding: 0 !important;
        margin: 0 !important;
    }
    /* Headings stay branded; printers handle the hex fine. */
    h1, h2, h3, h4 {
        font-family: "Poppins", "Inter", system-ui, sans-serif;
        color: #1e303e;
        page-break-after: avoid;
    }
    h1 {
        border-bottom: 2px solid #1c685e;
        padding-bottom: 0.25rem;
    }
    /* Print URL of external links so paper readers can navigate. */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #555;
    }
    /* Tables — sober, single-line borders, repeat header on each page. */
    table {
        border-collapse: collapse;
        width: 100%;
    }
    thead {
        display: table-header-group;
    }
    table th, table td {
        border: 1px solid #cbd5e1;
        padding: 4pt 6pt;
        font-size: 10pt;
    }
    /* Avoid orphan rows / page breaks inside cards. */
    .card, tr, .avoid-break {
        page-break-inside: avoid;
    }
    /* Visit/report header band: keep brand-colored. */
    .print-brand-band {
        background: #1c685e !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
