/* Print styles */
@media print {
    /* Hide non-printable elements */
    nav, footer, button, .no-print, a[href]:not(.print-logo) {
        display: none !important;
    }

    /* Reset body and container styles */
    body {
        margin: 0;
        padding: 0;
        line-height: 1.4;
        font-size: 12pt;
        background: none;
        color: #000;
    }

    .show-in-print {
        display: block;
    }

    .hide-in-print {
        display: none;
    }

    .sidebar, .header {
        display: none;
    }

    .main-content {
        margin: 1rem !important;
    }

    .container, main, article {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: none !important;
    }

    /* Invoice header styles */
    .invoice-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 0;
    }

    .invoice-header h1 {
        font-size: 24pt;
        margin-bottom: 0.5cm;
    }

    .invoice-header .company-info {
        font-size: 10pt;
        line-height: 1.2;
    }

    /* Customer and order information */
    .invoice-info {
        margin: 1cm 0;
        page-break-inside: avoid;
    }

    .grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1cm;
        page-break-inside: avoid;
    }

    /* Table styles */
    table {
        width: 100%;
        border-collapse: collapse;
        margin: 1cm 0;
        page-break-inside: avoid;
    }

    table th, table td {
        padding: 0.2cm;
        text-align: left;
        border-bottom: 0.5pt solid #000;
    }

    table thead {
        display: table-header-group;
    }

    table th {
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Totals section */
    .totals-section {
        margin-top: 1cm;
        page-break-inside: avoid;
    }

    .totals-table {
        width: auto;
        margin-left: auto;
    }

    .totals-table th, .totals-table td {
        padding: 0.2cm 0.5cm;
    }

    /* Status badge */
    .status-badge {
        padding: 0.1cm 0.3cm;
        border: 1pt solid #000;
        border-radius: 0.2cm;
    }

    /* Force page breaks */
    .page-break {
        page-break-before: always;
    }

    /* Additional print optimizations */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Print header and footer */
    @page {
        margin: 2cm;
    }

    /* Links */
    a {
        text-decoration: none;
        color: #000;
    }
}
