/* Print Styles for Invoice Pages */
@media print {
    /* Hide UI elements */
    .no-print,
    .mud-appbar,
    .mud-drawer,
    .mud-breadcrumbs,
    .mud-layout > aside,
    header,
    nav {
        display: none !important;
    }

    /* Page setup */
    @page {
        size: A4;
        margin: 1.5cm;
    }

    /* Reset body and main container */
    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    .mud-main {
        padding: 0 !important;
        margin: 0 !important;
    }

    .mud-container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Remove shadows and backgrounds for print */
    .mud-paper,
    .mud-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: white !important;
    }

    /* Ensure text is black */
    .mud-typography,
    .mud-text {
        color: #000 !important;
    }

    /* Adjust spacing for print */
    .pa-6 {
        padding: 8px !important;
    }

    .mb-4 {
        margin-bottom: 8px !important;
    }

    .mb-6 {
        margin-bottom: 12px !important;
    }

    /* Table styling for print */
    .mud-table,
    .mud-simple-table {
        page-break-inside: avoid;
        border-collapse: collapse;
    }

    .mud-table th,
    .mud-table td,
    .mud-simple-table th,
    .mud-simple-table td {
        border: 1px solid #ddd !important;
        padding: 4px !important;
    }

    /* Grid items should not break */
    .mud-grid-item {
        page-break-inside: avoid;
    }

    /* Chip styling for print */
    .mud-chip {
        border: 1px solid #000 !important;
        background: white !important;
        color: #000 !important;
    }

    /* Prevent orphans and widows */
    p,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        orphans: 3;
        widows: 3;
    }

    /* Avoid page breaks after headings */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid;
    }

    /* Ensure proper sizing */
    img {
        max-width: 100% !important;
    }
}
