
@media print {
    /* Hide non-printable elements */
    .mud-button-group,
    .mud-icon-button,
    .mud-button,
    .mud-tabs,
    .mud-pagination,
    .no-print {
        display: none !important;
    }

    /* Remove dialog backdrop so the page doesn't print dark gray */
    .mud-overlay {
        background: transparent !important;
        backdrop-filter: none !important;
    }

    /* Remove dialog chrome (title bar, action bar) when printing content */
    .mud-dialog-title,
    .mud-dialog-actions {
        display: none !important;
    }

    /* Ensure dialog fills the page cleanly */
    .mud-dialog {
        box-shadow: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    /* Allow dialog content to expand fully — prevents top-of-page clipping */
    .mud-dialog-content {
        overflow: visible !important;
        max-height: none !important;
        padding-top: 0 !important;
    }

    /* Reset page margins */
    @page {
        margin: 1cm;
        size: A4;
    }

    body {
        margin: 0;
        padding: 1cm;
        font-family: Arial, sans-serif;
        font-size: 11pt;
        color: #000 !important;
        background: #fff !important;
    }

    /* Remove shadows and elevations */
    .mud-paper,
    .mud-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background-color: #fff !important;
    }

    /* Page break controls */
    .mud-grid {
        page-break-inside: avoid;
    }

    .mud-card {
        page-break-inside: avoid;
    }

    .mud-table {
        page-break-inside: avoid;
    }

    .mud-table-row {
        page-break-inside: avoid;
    }

    /* Force single column layout for bill details */
    .mud-grid-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 15px;
    }

    /* Typography */
    .mud-typography {
        color: #000 !important;
    }

    .mud-typography-h4 {
        font-size: 20pt !important;
        margin-bottom: 15px !important;
    }

    .mud-typography-h5,
    .mud-typography-h6 {
        font-weight: bold !important;
    }

    /* Status badges */
    .mud-chip {
        border: 1px solid #000 !important;
        background-color: #fff !important;
        color: #000 !important;
        padding: 2px 8px !important;
    }

    /* Table styling */
    .mud-table-container {
        border: 1px solid #000;
        overflow: visible !important;
    }

    .mud-table-head .mud-table-cell {
        background-color: #f0f0f0 !important;
        color: #000 !important;
        font-weight: bold !important;
        border-bottom: 2px solid #000 !important;
        padding: 8px !important;
    }

    .mud-table-cell {
        border-bottom: 1px solid #ccc !important;
        padding: 6px 8px !important;
        color: #000 !important;
    }

    .mud-table-foot .mud-table-cell {
        border-top: 2px solid #000 !important;
        font-weight: bold !important;
        font-size: 12pt !important;
        background-color: #f5f5f5 !important;
    }

    /* Summary card */
    .bill-summary {
        border: 2px solid #000 !important;
        padding: 15px !important;
    }

    /* Dividers */
    .mud-divider {
        border-color: #000 !important;
        margin: 10px 0 !important;
    }

    /* Payment info highlight */
    .payment-info {
        border: 2px solid #000 !important;
        padding: 10px !important;
        margin-top: 10px !important;
        background-color: #f9f9f9 !important;
    }

    /* Balance due - make it stand out */
    .balance-due {
        font-weight: bold !important;
        text-decoration: underline !important;
    }

    /* Expand all collapsed sections */
    .mud-collapse-container {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Card headers */
    .mud-card-header {
        border-bottom: 1px solid #000 !important;
        padding: 10px 15px !important;
        background-color: #f5f5f5 !important;
    }

    .mud-card-content {
        padding: 15px !important;
    }

    /* Remove colored backgrounds */
    [class*="mud-theme-"],
    [class*="mud-primary"],
    [class*="mud-secondary"] {
        background-color: #fff !important;
        color: #000 !important;
    }

    /* Print header - facility name */
    .print-header {
        display: block !important;
        text-align: center;
        font-size: 18pt;
        font-weight: bold;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    /* Print footer */
    .print-footer {
        display: block !important;
        text-align: center;
        font-size: 9pt;
        margin-top: 20px;
        padding-top: 10px;
        border-top: 1px solid #ccc;
    }

    /* Hide scrollbars */
    * {
        overflow: visible !important;
    }

    /* Ensure links don't show URLs */
    a[href]:after {
        content: none !important;
    }
}

/* NOTE: Screen-only hiding of .print-only / .print-header / .print-footer
   lives in site.css. This stylesheet is loaded with media="print" so an
   @media screen block here would never activate. */

