/* Print Styles */
@media print {
    /* Force backgrounds to print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide sidebar and non-printable elements */
    #sidebar,
    .no-print,
    .btn,
    .dropdown,
    .user-info,
    .alert,
    .footer,
    .sidebar-toggle,
    .list-group-item-action,
    button:not(.print-keep) {
        display: none !important;
    }

    /* Full width for content */
    body {
        background: white !important;
        font-size: 12pt !important;
        line-height: 1.4 !important;
        color: #000 !important;
    }

    #content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Clean cards for printing */
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        margin-bottom: 15px !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .card-header {
        background: #f8f9fa !important;
        color: black !important;
        font-weight: bold !important;
        border-bottom: 2px solid #ddd !important;
    }

    /* Better tables for printing */
    .table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 11pt !important;
    }

    .table th,
    .table td {
        border: 1px solid #ddd !important;
        padding: 6px !important;
        text-align: left !important;
    }

    .table th {
        background-color: #f8f9fa !important;
        font-weight: bold !important;
    }

    /* Repeat table header on every page */
    thead {
        display: table-header-group;
    }
    tfoot {
        display: table-footer-group;
    }

    /* Page title */
    .page-title {
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    .page-title h2 {
        color: black !important;
        font-size: 20pt !important;
        margin: 0 0 5px 0 !important;
    }

    .page-title p {
        color: #666 !important;
        font-size: 11pt !important;
        margin: 0 !important;
    }

    /* Prevent orphaned headings */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        break-after: avoid;
        color: #000 !important;
    }

    /* Remove padding/margins for print */
    .row {
        margin: 0 !important;
    }

    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
        padding: 0 !important;
    }

    /* Tailwind grid → stack on print */
    .grid {
        display: block !important;
    }
    .grid > * {
        width: 100% !important;
        margin-bottom: 12px !important;
    }

    /* Let tables expand (no horizontal scroll on paper) */
    .overflow-x-auto,
    .overflow-hidden {
        overflow: visible !important;
    }

    /* Page setup */
    @page {
        margin: 1cm;
    }
}