/* print.css - Print stylesheet for SalesPal v2 */

@media print {
    /* ============================================================
       Hide non-essential UI elements
       ============================================================ */
    .sp-navbar,
    .navbar,
    .sp-flash-container,
    .btn,
    .form-control,
    .form-select,
    .nav-tabs,
    .dropdown-menu,
    .sp-nav-icon,
    #flashContainer,
    .pagination,
    .modal,
    .modal-backdrop,
    .toast,
    [role="alert"],
    .d-print-none {
        display: none !important;
    }

    /* ============================================================
       Reset page layout
       ============================================================ */
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
        line-height: 1.4;
    }

    .sp-main,
    .container-fluid,
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ============================================================
       Cards: remove shadows and borders for clean print
       ============================================================ */
    .card,
    .sp-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
        margin-bottom: 1rem;
    }

    .card-header {
        background: #f8f8f8 !important;
        border-bottom: 1px solid #ddd !important;
        font-weight: bold;
    }

    /* ============================================================
       Tables: ensure readability
       ============================================================ */
    table {
        width: 100% !important;
        border-collapse: collapse;
    }

    th, td {
        border: 1px solid #ccc !important;
        padding: 0.4rem 0.6rem !important;
        font-size: 10pt;
    }

    thead {
        display: table-header-group;
    }

    tr {
        break-inside: avoid;
    }

    /* ============================================================
       Badges and status indicators
       ============================================================ */
    .badge,
    .sp-status,
    .sp-tier {
        border: 1px solid #999 !important;
        color: #000 !important;
        background: #fff !important;
        padding: 0.15rem 0.4rem;
    }

    .sp-status::before {
        display: none;
    }

    /* ============================================================
       Progress bars: show as text
       ============================================================ */
    .progress,
    .sp-progress-bar {
        border: 1px solid #999;
        background: #fff !important;
    }

    .progress-bar,
    .sp-progress-fill {
        background: #999 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ============================================================
       Links: show URL
       ============================================================ */
    a[href]::after {
        content: none;
    }

    /* ============================================================
       Page breaks
       ============================================================ */
    h1, h2, h3, h4, h5, h6 {
        break-after: avoid;
    }

    .row {
        break-inside: avoid;
    }

    /* ============================================================
       Charts and images
       ============================================================ */
    canvas {
        max-width: 100% !important;
        break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    /* ============================================================
       Header for print
       ============================================================ */
    @page {
        margin: 1.5cm;
        size: auto;
    }
}
