/* ═══ گزارش ماتریس تلفات سالن-هفته — نمایش + چاپ ═══ */

.swmm-page {
    direction: rtl;
}

.swmm-shell {
    background: linear-gradient(
        180deg,
        var(--mud-palette-surface) 0%,
        color-mix(in srgb, var(--mud-palette-surface) 92%, var(--mud-palette-error) 8%) 100%
    );
    border-radius: 18px;
}

.swmm-shell.no-shadow {
    box-shadow: none !important;
}

/* ─── هدر ─── */
.swmm-header {
    padding: 18px 22px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--mud-palette-error) 72%, #000) 0%,
        var(--mud-palette-error) 45%,
        color-mix(in srgb, var(--mud-palette-error) 75%, var(--mud-palette-surface)) 100%
    );
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.swmm-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 70% 100% at 0% 0%,
        color-mix(in srgb, var(--mud-palette-error-text, #fff) 14%, transparent),
        transparent 50%
    );
    pointer-events: none;
    border-radius: 16px;
}

.swmm-header .title-section {
    position: relative;
    z-index: 1;
}

.swmm-header-title,
.swmm-page .swmm-header .page-title {
    color: var(--mud-palette-error-text, #fff) !important;
    font-weight: 800 !important;
    margin: 0 !important;
    text-shadow: 0 1px 2px color-mix(in srgb, #000 25%, transparent);
}

.swmm-header-sub {
    color: color-mix(in srgb, var(--mud-palette-error-text, #fff) 88%, transparent) !important;
    position: relative;
    z-index: 1;
}

.swmm-header-icon {
    color: var(--mud-palette-error-text, #fff) !important;
    position: relative;
    z-index: 1;
}

.swmm-header-chip {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    position: relative;
    z-index: 1;
}

/* ─── فیلتر ─── */
.swmm-filter {
    border-radius: 14px;
    background: color-mix(in srgb, var(--mud-palette-error) 8%, var(--mud-palette-surface));
    border: 1px solid color-mix(in srgb, var(--mud-palette-error) 16%, var(--mud-palette-lines-default));
}

.swmm-selection-box {
    border-radius: 12px;
    background: color-mix(in srgb, var(--mud-palette-error) 10%, var(--mud-palette-surface));
    border: 1px solid color-mix(in srgb, var(--mud-palette-error) 12%, var(--mud-palette-lines-default));
    height: 100%;
}

.swmm-selection-label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.swmm-selection-value {
    font-weight: 700;
    color: var(--mud-palette-error);
}

.swmm-chart-actions {
    padding-top: 4px;
}

.swmm-loading {
    background: var(--mud-palette-surface);
    border-radius: 12px;
}

/* ─── جدول ─── */
.swmm-grid-paper {
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--mud-palette-error) 14%, var(--mud-palette-lines-default));
    overflow: hidden;
    background: var(--mud-palette-surface);
}

.swmm-table-toolbar {
    padding: 0.5rem 0.75rem 0.75rem;
    border-bottom: 1px solid color-mix(in srgb, var(--mud-palette-error) 12%, var(--mud-palette-lines-default));
}

.swmm-table-toolbar-title {
    font-weight: 700 !important;
    color: var(--mud-palette-error) !important;
}

.swmm-grid-wrap {
    width: 100%;
    height: min(72dvh, calc(100dvh - 320px));
    min-height: 320px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* عرض ستون سالن = به اندازه نام */
.swmm-page .swmm-col-salon,
.swmm-page .swmm-col-salon.mud-table-cell {
    width: 1% !important;
    white-space: nowrap !important;
    max-width: 11rem;
}

.swmm-page .swm-salon-cell {
    min-width: unset !important;
    max-width: 11rem;
    width: max-content;
    padding: 2px 4px !important;
    gap: 2px;
}

.swmm-page .swm-salon-name {
    flex: 0 1 auto;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ستون‌های هفته جمع‌تر */
.swmm-page .swmm-col-week,
.swmm-page .swmm-col-week.mud-table-cell {
    width: 46px !important;
    min-width: 42px !important;
    max-width: 54px !important;
    padding: 2px 3px !important;
}

.swmm-page .swmm-week-head {
    min-height: 32px !important;
    padding: 4px 2px !important;
}

.swmm-page .swmm-week-head .swm-th-sub {
    font-size: 0.68rem !important;
}

.swmm-page .swmm-col-select,
.swmm-page .swmm-col-select.mud-table-cell {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    padding: 2px !important;
    z-index: 12 !important;
}

.swmm-page .swmm-select-cell,
.swmm-page .swmm-select-head {
    pointer-events: auto !important;
    position: relative;
    z-index: 13 !important;
}

.swmm-page.swmm-selection-mode .swm-datagrid .mud-table-cell {
    pointer-events: auto !important;
}

/* اعداد — نمایش بزرگ‌تر و پررنگ */
.swmm-page .swmm-cell-val {
    display: inline-block;
    min-width: 0;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums;
    font-size: 1rem !important;
    line-height: 1.25;
    text-align: center;
}

.swmm-page .swmm-cell-empty {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mud-palette-text-disabled);
}

.swmm-page .swm-datagrid .swm-footer-num,
.swmm-page .salon-week-mortality-matrix-grid .mud-data-grid-footer .swm-footer-num {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}

.swmm-page .swm-kpi-value {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
}

.swmm-page .swm-datagrid .mud-table-body .mud-table-cell,
.swmm-page .swm-datagrid .mud-table-body .mud-typography {
    font-size: 0.95rem;
    font-weight: 600;
}

.swmm-cell-val--low {
    background: color-mix(in srgb, #2e7d32 18%, var(--mud-palette-surface));
    color: #1b5e20;
}

.swmm-cell-val--medium {
    background: color-mix(in srgb, #0288d1 18%, var(--mud-palette-surface));
    color: #01579b;
}

.swmm-cell-val--high {
    background: color-mix(in srgb, #ef6c00 22%, var(--mud-palette-surface));
    color: #e65100;
}

.swmm-cell-val--critical {
    background: color-mix(in srgb, #c62828 22%, var(--mud-palette-surface));
    color: #b71c1c;
}

@media screen {
    html[data-theme="dark"] .swmm-page .swmm-cell-val--low,
    .mud-theme-dark .swmm-page .swmm-cell-val--low {
        color: #81c784;
        background: color-mix(in srgb, #2e7d32 35%, var(--mud-palette-surface));
    }

    html[data-theme="dark"] .swmm-page .swmm-cell-val--medium,
    .mud-theme-dark .swmm-page .swmm-cell-val--medium {
        color: #4fc3f7;
        background: color-mix(in srgb, #0288d1 30%, var(--mud-palette-surface));
    }

    html[data-theme="dark"] .swmm-page .swmm-cell-val--high,
    .mud-theme-dark .swmm-page .swmm-cell-val--high {
        color: #ffb74d;
        background: color-mix(in srgb, #ef6c00 30%, var(--mud-palette-surface));
    }

    html[data-theme="dark"] .swmm-page .swmm-cell-val--critical,
    .mud-theme-dark .swmm-page .swmm-cell-val--critical {
        color: #ef9a9a;
        background: color-mix(in srgb, #c62828 35%, var(--mud-palette-surface));
    }

    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-table-body .mud-table-cell,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-table-body td,
    .mud-theme-dark .swmm-page .swm-datagrid .mud-table-body .mud-table-cell {
        background: var(--mud-palette-surface) !important;
        color: var(--mud-palette-text-primary) !important;
    }

    html[data-theme="dark"] .swmm-page .salon-week-mortality-matrix-grid .mud-data-grid-footer,
    html[data-theme="dark"] .swmm-page .salon-week-mortality-matrix-grid .mud-data-grid-footer tr,
    .mud-theme-dark .swmm-page .salon-week-mortality-matrix-grid .mud-data-grid-footer {
        background: var(--mud-palette-surface) !important;
    }

    html[data-theme="dark"] .swmm-page .salon-week-mortality-matrix-grid .mud-data-grid-footer td,
    html[data-theme="dark"] .swmm-page .salon-week-mortality-matrix-grid .mud-data-grid-footer .mud-table-cell,
    .mud-theme-dark .swmm-page .salon-week-mortality-matrix-grid .mud-data-grid-footer td {
        background: color-mix(in srgb, var(--mud-palette-error) 8%, var(--mud-palette-surface)) !important;
        color: var(--mud-palette-text-primary) !important;
    }

    html[data-theme="dark"] .swmm-page .swm-salon-cell,
    .mud-theme-dark .swmm-page .swm-salon-cell {
        background: var(--mud-palette-surface) !important;
    }

    html[data-theme="dark"] .swmm-page .swm-salon-name,
    .mud-theme-dark .swmm-page .swm-salon-name {
        color: var(--mud-palette-text-primary) !important;
    }
}

/* بنر چاپ */
.swmm-print-banner {
    display: none;
}

.swmm-print-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 12px;
    font-size: 9pt;
    margin-top: 6px;
}

/* ═══ چاپ A4 افقی ═══ */
@media print {
    @page {
        size: A4 landscape;
        margin: 5mm 6mm;
    }

    html,
    html[data-theme="dark"],
    body,
    .ps-app,
    html[data-theme="dark"] .ps-app,
    .mud-theme-dark.ps-app {
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
        color: #000 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .no-print,
    .swmm-filter,
    .swmm-chart-actions,
    .swmm-table-toolbar,
    .swm-kpi-grid,
    .mud-drawer,
    .mud-appbar,
    .mud-layout-appbar,
    .mud-layout-drawer,
    .mud-snackbar-container,
    .mud-overlay,
    nav,
    footer,
    #custom-loading {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .swmm-print-banner {
        display: block !important;
        padding: 0 0 4px !important;
        margin: 0 0 5px !important;
        border-bottom: 2px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .swmm-print-banner h1 {
        font-size: 13pt !important;
        margin: 0 0 4px !important;
        color: #000 !important;
    }

    .swmm-print-banner .swmm-print-grid,
    .swmm-print-banner .swmm-print-grid div {
        color: #000 !important;
    }

    .mud-layout,
    .mud-main-content,
    .swmm-page,
    .swmm-shell,
    .swmm-grid-paper,
    .swmm-grid-wrap {
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        color: #000 !important;
    }

    .swmm-page .swm-datagrid.mud-data-grid,
    .swmm-page .swm-datagrid .mud-data-grid-root,
    .swmm-page .swm-datagrid .mud-table-container,
    .swmm-page .swm-datagrid .mud-table-wrapper {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    html[data-theme="dark"] .swmm-page .swm-datagrid,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-table,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-table-root,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-table-container,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-table-wrapper,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-data-grid-root,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-table-head,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-data-grid-footer,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-data-grid-footer tr,
    .mud-theme-dark .swmm-page .swm-datagrid,
    .mud-theme-dark .swmm-page .swm-datagrid .mud-table,
    .mud-theme-dark .swmm-page .swm-datagrid .mud-data-grid-footer {
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    .swmm-page .swm-datagrid .mud-table-body .mud-table-cell,
    .swmm-page .swm-datagrid .mud-table-body td,
    .swmm-page .swm-datagrid .swmm-cell-val,
    .swmm-page .swm-datagrid .swmm-cell-empty,
    .swmm-page .swm-datagrid .swm-salon-name {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .swmm-page .swm-datagrid .mud-data-grid-footer .swm-footer-num,
    .swmm-page .swm-datagrid .mud-data-grid-footer .swmm-footer-week {
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .swmm-page .swmm-cell-val--low,
    .swmm-page .swmm-cell-val--medium,
    .swmm-page .swmm-cell-val--high,
    .swmm-page .swmm-cell-val--critical {
        background: #fff !important;
        background-color: #fff !important;
        color: #000 !important;
        font-weight: 800 !important;
        border: none !important;
    }

    html .swmm-page .swm-datagrid.swmm-grid-lined .mud-table-head th,
    html .swmm-page .swm-datagrid.swmm-grid-lined .mud-table-body .mud-table-cell,
    html .swmm-page .swm-datagrid.swmm-grid-lined .mud-data-grid-footer .mud-table-cell {
        border: 1px solid #000 !important;
        border-color: #000 !important;
        padding: 1px 2px !important;
        line-height: 1.15 !important;
    }

    html .swmm-page .swm-datagrid.swmm-grid-lined .mud-table-head th,
    html .swmm-page .swm-datagrid.swmm-grid-lined .mud-table-head .mud-table-cell {
        font-size: 7pt !important;
        font-weight: 700 !important;
    }

    .swmm-page .swmm-col-week,
    .swmm-page .swmm-col-week.mud-table-cell {
        width: 32px !important;
        min-width: 28px !important;
        max-width: 36px !important;
        padding: 0 1px !important;
    }

    .swmm-page .swm-datagrid table.mud-table-root,
    .swmm-page .swm-datagrid .mud-table-root {
        table-layout: fixed !important;
        width: 100% !important;
    }

    .swmm-page .swmm-col-salon,
    .swmm-page .swmm-col-salon.mud-table-cell,
    html .swmm-page .swm-datagrid .mud-table-head th.swmm-col-salon,
    html .swmm-page .swm-datagrid .mud-table-body td.swmm-col-salon,
    html .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-salon {
        width: 4.2rem !important;
        min-width: 0 !important;
        max-width: 4.2rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        padding: 1px 2px !important;
        box-sizing: border-box !important;
    }

    .swmm-page .swm-salon-cell,
    .swmm-page .swm-footer-salon {
        width: 100% !important;
        max-width: 4.2rem !important;
        min-width: 0 !important;
        min-height: 0 !important;
        padding: 1px 2px !important;
        display: block !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .swmm-page .swm-salon-cell .mud-icon-button,
    .swmm-page .swm-footer-salon .mud-icon-button {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .swmm-page .swmm-col-select {
        display: none !important;
    }

    .swmm-page .swmm-cell-val,
    .swmm-page .swm-datagrid .swmm-cell-val {
        padding: 0 2px !important;
        font-size: 9pt !important;
        font-weight: 800 !important;
        min-width: 0 !important;
        line-height: 1.15 !important;
    }

    .swmm-page .swm-datagrid .swm-footer-num,
    html .swmm-page .swm-datagrid .mud-data-grid-footer .swm-footer-num,
    html .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-week .swm-footer-num {
        font-size: 9pt !important;
        font-weight: 800 !important;
        line-height: 1.15 !important;
    }

    html .swmm-page .swm-datagrid.swmm-grid-lined .mud-table-body .mud-table-cell,
    html .swmm-page .swm-datagrid.swmm-grid-lined .mud-data-grid-footer .mud-table-cell {
        font-size: 9pt !important;
        font-weight: 800 !important;
    }

    .swmm-page .swm-salon-name,
    .swmm-page .swm-footer-salon strong {
        display: block !important;
        width: 100% !important;
        max-width: 4.2rem !important;
        font-size: 7pt !important;
        font-weight: 700 !important;
        line-height: 1.1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .swmm-page .swmm-week-head {
        min-height: 0 !important;
        padding: 2px 1px !important;
    }

    .swmm-page .swmm-week-head .swm-th-sub {
        font-size: 7pt !important;
        font-weight: 700 !important;
    }

    .swmm-page .swm-datagrid .mud-table,
    .swmm-page .swm-datagrid .mud-table-root,
    .swmm-page .swm-datagrid .mud-table-container,
    .swmm-page .swm-datagrid .mud-table-wrapper,
    .swmm-page .swm-datagrid.mud-data-grid {
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .swmm-page .swm-datagrid .mud-table-head th,
    .swmm-page .swm-datagrid .mud-table-head .mud-table-cell,
    .swmm-page .swm-datagrid .mud-table-head th:first-child,
    .swmm-page .swm-datagrid .mud-table-head th:last-child,
    .swmm-page .swm-datagrid .mud-table-head .mud-table-cell:first-child,
    .swmm-page .swm-datagrid .mud-table-head .mud-table-cell:last-child,
    .swmm-page .swm-datagrid .swm-th-stack {
        border-radius: 0 !important;
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    .swmm-page .swm-datagrid .mud-data-grid-footer,
    .swmm-page .swm-datagrid .mud-data-grid-footer tr {
        --mud-palette-text-primary: #fff !important;
        --mud-palette-text-secondary: rgba(255, 255, 255, 0.87) !important;
    }

    /* فوتر چاپ — هم‌رنگ هدر، متن سفید */
    html .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-salon,
    html .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-salon .mud-table-cell,
    html .swmm-page .swm-footer-salon,
    html .swmm-page .swm-footer-salon strong,
    html .swmm-page .mud-data-grid-footer td.swmm-col-salon .swm-footer-salon,
    html .swmm-page .mud-data-grid-footer td.swmm-col-salon .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 .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer td.swmm-col-week,
    html .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer td.swmm-col-week *,
    html .swmm-page .swm-datagrid.swm-sex-female .mud-data-grid-footer .swm-footer-num,
    html .swmm-page .swm-datagrid.swm-sex-female .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 .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week,
    html .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer td.swmm-col-week *,
    html .swmm-page .swm-datagrid.swm-sex-male .mud-data-grid-footer .swm-footer-num,
    html .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 .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-week,
    html .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html .swmm-page .swm-datagrid .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-week *,
    html .swmm-page .swm-datagrid .mud-data-grid-footer .swm-footer-num,
    html .swmm-page .swm-datagrid .mud-data-grid-footer .swmm-footer-week,
    html .swmm-page .swm-datagrid .mud-data-grid-footer .mud-typography,
    html .swmm-page .swm-datagrid .mud-data-grid-footer .mud-typography-body2,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-week,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-data-grid-footer .swm-footer-num,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-data-grid-footer .swmm-footer-week,
    html[data-theme="dark"] .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-week *,
    .mud-theme-dark .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-week,
    .mud-theme-dark .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    .mud-theme-dark .swmm-page .swm-datagrid .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    .mud-theme-dark .swmm-page .swm-datagrid .mud-data-grid-footer .swm-footer-num,
    .mud-theme-dark .swmm-page .swm-datagrid .mud-data-grid-footer .swmm-footer-week,
    .mud-theme-dark .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-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-colored .mud-table-head th,
    html[data-theme="dark"] .swmm-page .swm-datagrid-colored .mud-table-head .mud-table-cell,
    .mud-theme-dark .swmm-page .swm-datagrid-colored .mud-table-head th,
    .mud-theme-dark .swmm-page .swm-datagrid-colored .mud-table-head .mud-table-cell {
        background-image: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color: #fff !important;
    }

    html[data-theme="dark"] .swmm-page .swm-datagrid-colored .mud-table-head th:has(.swm-th-sub--salon),
    html[data-theme="dark"] .swmm-page .swm-datagrid-colored .mud-table-head .mud-table-cell:has(.swm-th-sub--salon),
    .mud-theme-dark .swmm-page .swm-datagrid-colored .mud-table-head th:has(.swm-th-sub--salon) {
        background-color: #455a64 !important;
    }

    html[data-theme="dark"] .swmm-page .swm-datagrid-colored.swm-sex-female .mud-table-head th:has(.swm-th-sub--week),
    html[data-theme="dark"] .swmm-page .swm-datagrid-colored.swm-sex-female .mud-table-head .mud-table-cell:has(.swm-th-sub--week),
    .mud-theme-dark .swmm-page .swm-datagrid-colored.swm-sex-female .mud-table-head th:has(.swm-th-sub--week) {
        background-color: #c62828 !important;
    }

    html[data-theme="dark"] .swmm-page .swm-datagrid-colored.swm-sex-male .mud-table-head th:has(.swm-th-sub--week),
    html[data-theme="dark"] .swmm-page .swm-datagrid-colored.swm-sex-male .mud-table-head .mud-table-cell:has(.swm-th-sub--week),
    .mud-theme-dark .swmm-page .swm-datagrid-colored.swm-sex-male .mud-table-head th:has(.swm-th-sub--week) {
        background-color: #6a1b9a !important;
    }

    html[data-theme="dark"] .swmm-page .swm-datagrid-colored .mud-table-head th:has(.swm-th-sub--select),
    html[data-theme="dark"] .swmm-page .swm-datagrid-colored .mud-table-head .mud-table-cell:has(.swm-th-sub--select) {
        background-color: #37474f !important;
    }

    html[data-theme="dark"] .swmm-page,
    .mud-theme-dark .swmm-page {
        --mud-palette-background: #fff !important;
        --mud-palette-surface: #fff !important;
        --mud-palette-text-primary: rgba(0, 0, 0, 0.87) !important;
    }
}

/* غلبه نهایی چاپ — فوتر و گوشه‌های جدول */
@media print {
    body.print-report .swmm-page .swm-datagrid .mud-table,
    body.print-report .swmm-page .swm-datagrid .mud-table-root {
        border-radius: 0 !important;
        overflow: visible !important;
    }

    body.print-report .swmm-page .swm-datagrid .mud-table-head th,
    body.print-report .swmm-page .swm-datagrid .mud-table-head .mud-table-cell {
        border-radius: 0 !important;
    }

    body.print-report .swmm-page .swmm-cell-val,
    body.print-report .swmm-page .swm-datagrid .swm-footer-num,
    body.print-report .swmm-page .swm-datagrid .swmm-footer-week,
    body.print-report .swmm-page .swm-datagrid .mud-table-body .swmm-cell-val {
        font-size: 9pt !important;
        font-weight: 800 !important;
    }
}

/*
 * غلبه نهایی چاپ فوتر — بعد از bundle scoped؛ پس‌زمینه تیره مثل هدر
 */
@media print {
    html body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-salon,
    html body.print-report .swmm-page .swm-datagrid .mud-data-grid-footer td.swmm-col-salon .mud-table-cell,
    html body.print-report .swmm-page .swm-datagrid .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 strong,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-salon,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-salon *,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-salon,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-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 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,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-female .mud-data-grid-footer td.swmm-col-week,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-female .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-female .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-female .mud-data-grid-footer td.swmm-col-week *,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-female .mud-data-grid-footer .swm-footer-num,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-female .mud-data-grid-footer .swmm-footer-week,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-female .mud-data-grid-footer td.swmm-col-week,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-female .mud-data-grid-footer td.swmm-col-week *,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-female .mud-data-grid-footer .swm-footer-num,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-female .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 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,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-male .mud-data-grid-footer td.swmm-col-week,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-male .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-male .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-male .mud-data-grid-footer td.swmm-col-week *,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-male .mud-data-grid-footer .swm-footer-num,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-male .mud-data-grid-footer .swmm-footer-week,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-male .mud-data-grid-footer td.swmm-col-week,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-male .mud-data-grid-footer td.swmm-col-week *,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.swm-sex-male .mud-data-grid-footer .swm-footer-num,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid.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 body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-week,
    html body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-week *,
    html body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer .swm-footer-num,
    html body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer .swmm-footer-week,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-week,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-week .mud-table-cell,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer .mud-table-cell.swmm-col-week,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-week *,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer .swm-footer-num,
    html[data-theme="dark"] body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer .swmm-footer-week,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-week,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer td.swmm-col-week *,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .mud-data-grid-footer .swm-footer-num,
    .mud-theme-dark body.print-report .swmm-page .general-datagrid-class.salon-week-mortality-matrix-grid .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;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-shadow: none !important;
        filter: none !important;
    }
}
