/* =====================================================================
 * print.css — clean printable output for bids, RFQs, and quote pages.
 *
 * Goals:
 *   - Switch to white background + black text (most printers eat ink on
 *     full-bleed slate-900 pages).
 *   - Hide chrome that doesn't belong on paper: top headers, back-bars,
 *     sidebars, sign-out button, theme toggles, modals, toasts, save
 *     indicator, action buttons.
 *   - Keep section cards visible but flatten the slate background.
 *   - Use page-break-inside: avoid on cards so a single bid section
 *     doesn't split across two pages.
 *
 * Loaded after every other shared sheet so it overrides on print only.
 * =====================================================================*/

@media print {

    /* ---- baseline: white page, dark text -------------------------- */
    html, body,
    .mfr-view, .mfr-main {
        background: #ffffff !important;
        color: #0f172a !important;
    }

    body {
        font-size: 11pt;
        line-height: 1.4;
    }

    /* ---- hide app chrome ----------------------------------------- */
    .mfr-header,
    .mfr-back-bar,
    .ctr-tool-frame-bar,
    .ctr-bid-toc,
    aside.toc,
    nav.sidebar,
    .content-tabs,
    .lb-tab-layout > nav,
    .app-theme-toggle,
    .app-view-toggle,
    #btn-ctr-signout, #btn-mfr-signout,
    .mfr-list-controls,
    .pdf-overlay, .modal, .modal-overlay,
    .rtg-toast-stack,
    .rtg-save-indicator,
    button.btn-primary, button.mfr-btn-primary,
    [data-action="browse"],
    .ctr-enduser-actions,
    /* Suppress per-line interactive buttons but keep their value displays */
    button.mfr-link, button.mfr-fill-btn {
        display: none !important;
    }

    /* ---- flatten cards ------------------------------------------ */
    .card, .ctr-detail-card, .mfr-card, section.card, .lb-section,
    .ctr-bid-header, .ctr-bid-summary, .mfr-rfq-header,
    .ctr-project-card, .ctr-bid-row {
        background: #ffffff !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    .card-title, .lb-section-title,
    .ctr-bid-toc-label, .toc-label,
    h1, h2, h3, h4 { color: #0f172a !important; }

    /* Status badges: keep colors but tone down backgrounds for ink. */
    .badge, .mfr-status {
        background: #ffffff !important;
        border-color: #cbd5e1 !important;
    }

    /* ---- tables -------------------------------------------------- */
    table, .equipment-table, .equip-table {
        color: #0f172a !important;
        background: #ffffff !important;
    }
    table thead th, .equipment-table thead th, .equip-table th {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border-bottom: 1px solid #94a3b8 !important;
    }
    table td, table th { border-color: #cbd5e1 !important; }

    /* ---- links --------------------------------------------------- */
    a { color: #0f172a !important; text-decoration: underline; }
    /* Strip trailing href annotations browsers like to add for links
       inside cards — readable URLs on the bid wreck the layout. */
    a[href]::after { content: none !important; }

    /* ---- pagination --------------------------------------------- */
    h1, h2, h3 { page-break-after: avoid; }
    img, svg { page-break-inside: avoid; max-width: 100% !important; height: auto !important; }

    /* Default page margins (browsers honor this for headless print). */
    @page { margin: 0.5in 0.5in 0.6in; }
}
