/* =============================================================================
   Print Styles — ParentSystem
   فقط المان‌های .no-print مخفی می‌شوند؛ محتوای گزارش با .print-only نمایش داده می‌شود.
   ============================================================================= */
@media print {
    /* مخفی کردن رابط کاربری و فیلترها */
    .no-print,
    nav,
    .sidebar,
    .mud-drawer,
    .mud-drawer-content,
    .mud-appbar,
    .mud-navigation-menu,
    .mud-snackbar,
    .mud-snackbar-container,
    .mud-snackbar-provider,
    .mud-overlay,
    .mud-dialog-container,
    .mud-button,
    .mud-icon-button,
    button.btn,
  .chart-header-screen {
        display: none !important;
    }

    /* نمایش بلوک‌های مخصوص چاپ */
    .print-only {
        display: block !important;
        visibility: visible !important;
    }

    @page {
        size: A4 landscape;
        margin: 6mm;
    }

    html, body {
        margin: 0;
        padding: 0;
        width: 100%;
        height: auto;
        direction: rtl;
        font-family: 'IRANSans', 'B Nazanin', Tahoma, Arial, sans-serif;
        font-size: 9pt;
        line-height: 1.25;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
        background: #fff !important;
        color: #000 !important;
    }

    .mud-layout,
    .mud-main-content,
    .mud-container,
    .mud-paper {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .mb-4, .my-4, .mt-4, .pa-4, .p-4 {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    /* جداول */
    .mud-table,
    .mud-table-container,
    .mud-table-root {
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
        max-height: none !important;
    }

    .mud-table table {
        width: 100% !important;
        border-collapse: collapse !important;
        table-layout: auto !important;
        page-break-inside: auto;
    }

    .mud-table thead {
        display: table-header-group !important;
    }

    .mud-table tbody {
        display: table-row-group !important;
    }

    .mud-table tfoot {
        display: table-footer-group !important;
    }

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

    .mud-table th,
    .mud-table td,
    .mud-table .mud-th,
    .mud-table .mud-td,
    .mud-table-cell {
        border: 1px solid #333 !important;
        padding: 1px 3px !important;
        text-align: center !important;
        font-size: 7pt !important;
        line-height: 1.1 !important;
        font-weight: 500 !important;
        color: #000 !important;
        background: transparent !important;
        font-variant-numeric: tabular-nums !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
    }

    /* ماتریس سالن-هفته: transparent روی سلول = لایه تیره تم از پشت هدر/فوتر */
    body.print-report .swmm-page .swm-datagrid .mud-table-head .mud-table-cell,
    body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer .mud-table-cell,
    body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer td,
    body.print-report .swm-inventory-page .swm-datagrid .mud-table-head .mud-table-cell,
    body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer .mud-table-cell,
    body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer td {
        background: unset !important;
        background-color: unset !important;
    }

    .mud-table thead th,
    .mud-table .mud-table-head .mud-table-cell {
        background-color: #e8e8e8 !important;
        font-weight: 700 !important;
        font-size: 8.5pt !important;
    }

    .mud-table tbody tr:nth-of-type(even) td {
        background-color: #f5f5f5 !important;
    }

    .mud-table tfoot .mud-table-cell,
    .mud-table tfoot td,
    .mud-table tfoot th {
        background-color: #e0e0e0 !important;
        font-weight: 700 !important;
        font-size: 8.5pt !important;
    }

    /* ماتریس سالن-هفته: فوتر پررنگ چاپ */
    html body.print-report .swmm-page .mud-data-grid-footer td.swmm-col-salon,
    html body.print-report .swmm-page .mud-data-grid-footer td.swmm-col-salon .mud-table-cell,
    html body.print-report .swmm-page .mud-data-grid-footer td.swmm-col-salon *,
    html body.print-report .swmm-page .swm-footer-salon,
    html body.print-report .swmm-page .swm-footer-salon * {
        background-color: #263238 !important;
        background: #263238 !important;
        background-image: none !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        opacity: 1 !important;
        filter: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html body.print-report .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer td.swmm-col-week,
    html body.print-report .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html body.print-report .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html body.print-report .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer td.swmm-col-week *,
    html body.print-report .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer .swm-footer-num,
    html body.print-report .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer .swmm-footer-week {
        background-color: #8e0000 !important;
        background: #8e0000 !important;
        background-image: none !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        opacity: 1 !important;
        filter: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html body.print-report .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week,
    html body.print-report .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html body.print-report .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html body.print-report .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week *,
    html body.print-report .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer .swm-footer-num,
    html body.print-report .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer .swmm-footer-week {
        background-color: #4a148c !important;
        background: #4a148c !important;
        background-image: none !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        opacity: 1 !important;
        filter: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html body.print-report .swmm-page .mud-data-grid-footer td.swmm-col-week,
    html body.print-report .swmm-page .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html body.print-report .swmm-page .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html body.print-report .swmm-page .mud-data-grid-footer td.swmm-col-week *,
    html body.print-report .swmm-page .mud-data-grid-footer .swm-footer-num,
    html body.print-report .swmm-page .mud-data-grid-footer .swmm-footer-week {
        background-color: #8e0000 !important;
        background: #8e0000 !important;
        background-image: none !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        opacity: 1 !important;
        filter: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* گزارش روزانه پرورش */
    .dbr-page .mud-table tfoot .mud-table-cell,
    .dbr-page .mud-table tfoot .mud-typography {
        font-size: 7.5pt !important;
        font-weight: 700 !important;
        color: #000 !important;
    }

  html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-cell {
        border-bottom: 1px solid #000 !important;
        border-right: 1px solid #000 !important;
        border-color: #000 !important;
        background: #fff !important;
    }

    html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-cell.dbr-td-notes {
        border-top: none !important;
        border-bottom: none !important;
    }

    /*
     * گزارش تلفات هفتگی: در تم تاریک transparent + surface تیره = لایه مشکی در چاپ
     */
    html[data-theme="dark"] .pwm-page .mud-table .mud-table-cell,
    html[data-theme="dark"] .pwm-page .mud-table th,
    html[data-theme="dark"] .pwm-page .mud-table td,
    .mud-theme-dark .pwm-page .mud-table .mud-table-cell {
        background-color: #fff !important;
        background-image: none !important;
    }

    html[data-theme="dark"] .pwm-page .mud-table .mud-table-head .mud-table-cell,
    html[data-theme="dark"] .pwm-page .mud-table .mud-table-head th,
    .mud-theme-dark .pwm-page .mud-table .mud-table-head .mud-table-cell {
        background-color: #546e7a !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html[data-theme="dark"] .pwm-page .mud-data-grid-footer,
    html[data-theme="dark"] .pwm-page .mud-data-grid-footer tr,
    html[data-theme="dark"] .pwm-page .mud-data-grid-footer td,
    html[data-theme="dark"] .pwm-page .mud-data-grid-footer .mud-table-cell,
    .mud-theme-dark .pwm-page .mud-data-grid-footer,
    .mud-theme-dark .pwm-page .mud-data-grid-footer td,
    .mud-theme-dark .pwm-page .mud-data-grid-footer .mud-table-cell {
        background: #eceff1 !important;
        background-color: #eceff1 !important;
        background-image: none !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* ماتریس تلفات سالن-هفته — فقط بدنه/هدر؛ نه فوتر */
    html[data-theme="dark"] .swmm-page .mud-table-body .mud-table-cell,
    html[data-theme="dark"] .swmm-page .mud-table-body td,
    html[data-theme="dark"] .swmm-page .mud-table-head .mud-table-cell,
    html[data-theme="dark"] .swmm-page .mud-table-head th,
    .mud-theme-dark .swmm-page .mud-table-body .mud-table-cell,
    .mud-theme-dark .swmm-page .mud-table-body td {
        background-color: #fff !important;
        background-image: none !important;
    }

    html[data-theme="dark"] .swmm-page .mud-data-grid-footer td.swmm-col-salon,
    html[data-theme="dark"] .swmm-page .mud-data-grid-footer td.swmm-col-salon *,
    html[data-theme="dark"] .swmm-page .swm-footer-salon,
    html[data-theme="dark"] .swmm-page .swm-footer-salon *,
    .mud-theme-dark .swmm-page .mud-data-grid-footer td.swmm-col-salon,
    .mud-theme-dark .swmm-page .mud-data-grid-footer td.swmm-col-salon *,
    .mud-theme-dark .swmm-page .swm-footer-salon,
    .mud-theme-dark .swmm-page .swm-footer-salon * {
        background: #263238 !important;
        background-color: #263238 !important;
        background-image: none !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        opacity: 1 !important;
        filter: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html[data-theme="dark"] .swmm-page .mud-data-grid-footer td.swmm-col-week,
    html[data-theme="dark"] .swmm-page .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html[data-theme="dark"] .swmm-page .mud-data-grid-footer td.swmm-col-week *,
    html[data-theme="dark"] .swmm-page .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html[data-theme="dark"] .swmm-page .mud-data-grid-footer .swm-footer-num,
    html[data-theme="dark"] .swmm-page .mud-data-grid-footer .swmm-footer-week,
    .mud-theme-dark .swmm-page .mud-data-grid-footer td.swmm-col-week,
    .mud-theme-dark .swmm-page .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    .mud-theme-dark .swmm-page .mud-data-grid-footer td.swmm-col-week *,
    .mud-theme-dark .swmm-page .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    .mud-theme-dark .swmm-page .mud-data-grid-footer .swm-footer-num,
    .mud-theme-dark .swmm-page .mud-data-grid-footer .swmm-footer-week {
        background: #8e0000 !important;
        background-color: #8e0000 !important;
        background-image: none !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        opacity: 1 !important;
        filter: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html[data-theme="dark"] .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week,
    html[data-theme="dark"] .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html[data-theme="dark"] .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week *,
    html[data-theme="dark"] .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer .swm-footer-num,
    html[data-theme="dark"] .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer .swmm-footer-week,
    .mud-theme-dark .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week,
    .mud-theme-dark .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week *,
    .mud-theme-dark .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer .swm-footer-num,
    .mud-theme-dark .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer .swmm-footer-week {
        background: #4a148c !important;
        background-color: #4a148c !important;
        background-image: none !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        opacity: 1 !important;
        filter: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html[data-theme="dark"] .swmm-page .mud-table,
    html[data-theme="dark"] .swmm-page .mud-table-root,
    .mud-theme-dark .swmm-page .mud-table {
        border-radius: 0 !important;
        overflow: visible !important;
    }

    html[data-theme="dark"] .swmm-page .mud-table-head th,
    html[data-theme="dark"] .swmm-page .mud-table-head .mud-table-cell,
    .mud-theme-dark .swmm-page .mud-table-head th,
    .mud-theme-dark .swmm-page .mud-table-head .mud-table-cell {
        border-radius: 0 !important;
    }

    /*
     * ماتریس سالن-هفته (موجودی + تلفات): حذف لایه مشکی تم تاریک در چاپ
     * علت: transparent روی سلول + پس‌زمینه تیره MudTable/DataGrid
     */
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-root,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-container,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-wrapper,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-data-grid-root,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-head,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer tr,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-root,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-container,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-wrapper,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-root,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-head,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer tr,
    .mud-theme-dark body.print-report .swmm-page .swm-datagrid,
    .mud-theme-dark body.print-report .swmm-page .swm-datagrid .mud-table,
    .mud-theme-dark body.print-report .swmm-page .swm-datagrid .mud-table-root,
    .mud-theme-dark body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer,
    .mud-theme-dark body.print-report .swm-inventory-page .swm-datagrid,
    .mud-theme-dark body.print-report .swm-inventory-page .swm-datagrid .mud-table,
    .mud-theme-dark body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer {
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-body .mud-table-cell,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-body td,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-body .mud-table-cell,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-body td,
    .mud-theme-dark body.print-report .swmm-page .swm-datagrid .mud-table-body .mud-table-cell,
    .mud-theme-dark body.print-report .swm-inventory-page .swm-datagrid .mud-table-body .mud-table-cell {
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    /* فوتر/هدر: بدون لایه تیره پشت — ردیف سفید، سلول‌های رنگی مات */
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-head,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-head tr,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer tr,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-head,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-head tr,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer tr,
    .mud-theme-dark body.print-report .swmm-page .swm-datagrid .mud-table-head,
    .mud-theme-dark body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer,
    .mud-theme-dark body.print-report .swm-inventory-page .swm-datagrid .mud-table-head,
    .mud-theme-dark body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer {
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-head .mud-table-cell,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-head th,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-table-head th .mud-table-cell,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer .mud-table-cell,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer td,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer td .mud-table-cell,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-head .mud-table-cell,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-head th,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-table-head th .mud-table-cell,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer .mud-table-cell,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer td,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer td .mud-table-cell,
    .mud-theme-dark body.print-report .swmm-page .swm-datagrid .mud-table-head .mud-table-cell,
    .mud-theme-dark body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer .mud-table-cell,
    .mud-theme-dark body.print-report .swm-inventory-page .swm-datagrid .mud-table-head .mud-table-cell,
    .mud-theme-dark body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer .mud-table-cell {
        background-image: none !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer .swm-footer-num,
    html[data-theme="dark"] body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer .swmm-footer-week,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer .swm-footer-num,
    html[data-theme="dark"] body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer .swm-footer-week,
    .mud-theme-dark body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer .swm-footer-num,
    .mud-theme-dark body.print-report .swm-inventory-page .swm-datagrid .mud-data-grid-footer .swm-footer-num {
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* opt-in: نمایش تیترها هنگام چاپ */
    body.print-include-headers .report-print-title,
    body.print-include-headers .print-report-title {
        display: block !important;
        font-size: 12pt !important;
        font-weight: 700 !important;
        margin-bottom: 4mm !important;
        color: #000 !important;
    }
}

@media screen {
    .chart-header-print {
        display: none;
    }

    .print-only {
        display: none !important;
    }
}
