/* ═══ گزارش تلفات هفتگی دوره — نمایش + چاپ (الگوی Transfer/DBR) ═══ */

.pwm-page {
    direction: rtl;
}

.pwm-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;
}

.pwm-shell.no-shadow {
    box-shadow: none !important;
}

/* ─── هدر ─── */
.pwm-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;
}

.pwm-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;
}

.pwm-header .title-section {
    position: relative;
    z-index: 1;
}

.pwm-header-title,
.pwm-page .pwm-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);
}

.pwm-header-sub {
    color: color-mix(in srgb, var(--mud-palette-error-text, #fff) 88%, transparent) !important;
    position: relative;
    z-index: 1;
}

.pwm-header-icon {
    color: var(--mud-palette-error-text, #fff) !important;
    position: relative;
    z-index: 1;
}

.pwm-header-chip {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    position: relative;
    z-index: 1;
}

/* ─── فیلتر ─── */
.pwm-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));
}

.pwm-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));
}

.pwm-selection-label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.pwm-selection-value {
    font-weight: 700;
    color: var(--mud-palette-error);
}

.pwm-chart-actions {
    padding-top: 4px;
}

/* ─── کارت خلاصه ─── */
.pwm-summary-card {
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid var(--mud-palette-table-lines);
}

.pwm-page .pwm-summary-card .mud-typography-h6,
.pwm-page .pwm-summary-card .mud-typography.mud-typography-h6 {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums !important;
}

.pwm-sum-sex {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--mud-palette-secondary) 14%, var(--mud-palette-surface)) 0%,
        color-mix(in srgb, var(--mud-palette-secondary) 22%, var(--mud-palette-surface)) 100%
    );
}

.pwm-sum-mortality {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--mud-palette-error) 14%, var(--mud-palette-surface)) 0%,
        color-mix(in srgb, var(--mud-palette-error) 24%, var(--mud-palette-surface)) 100%
    );
}

.pwm-sum-pct {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, #6a1b9a 14%, var(--mud-palette-surface)) 0%,
        color-mix(in srgb, #6a1b9a 22%, var(--mud-palette-surface)) 100%
    );
}

.pwm-sum-opening {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, #5d4037 14%, var(--mud-palette-surface)) 0%,
        color-mix(in srgb, #5d4037 22%, var(--mud-palette-surface)) 100%
    );
}

.pwm-sum-closing {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, #455a64 14%, var(--mud-palette-surface)) 0%,
        color-mix(in srgb, #455a64 22%, var(--mud-palette-surface)) 100%
    );
}

.pwm-sum-weeks {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--mud-palette-info) 14%, var(--mud-palette-surface)) 0%,
        color-mix(in srgb, var(--mud-palette-info) 22%, var(--mud-palette-surface)) 100%
    );
}

/* ─── جدول ─── */
.pwm-grid-paper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    background: var(--mud-palette-surface) !important;
    border: 1px solid var(--mud-palette-table-lines);
    border-radius: 14px;
}

.pwm-table-toolbar {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--mud-palette-table-lines);
}

.pwm-table-toolbar-title {
    font-weight: 700 !important;
    color: var(--mud-palette-error) !important;
}

.pwm-grid-wrap {
    width: 100%;
    max-width: 100%;
    height: min(70dvh, calc(100dvh - 300px));
    min-height: 280px;
    overflow: auto;
    box-sizing: border-box;
    background: var(--mud-palette-surface);
    display: flex;
    flex-direction: column;
}

.pwm-grid-wrap > .pwm-datagrid,
.pwm-grid-wrap > .mud-data-grid {
    flex: 1 1 auto;
    min-height: 0;
}

.ps-app .pwm-page .pwm-datagrid.mud-data-grid,
.pwm-page .pwm-datagrid {
    border-radius: 0 !important;
    overflow: visible !important;
    border: none !important;
    box-shadow: none !important;
    background: var(--mud-palette-surface) !important;
}

.pwm-page .pwm-datagrid .mud-table-container,
.pwm-page .pwm-datagrid .mud-table-wrapper,
.pwm-page .pwm-datagrid .mud-data-grid-root,
.pwm-page .pwm-datagrid table.mud-table-root {
    border-radius: 0 !important;
    overflow: visible !important;
    background: var(--mud-palette-surface) !important;
}

.pwm-page .pwm-datagrid .mud-table-body .mud-table-row,
.pwm-page .pwm-datagrid .mud-table-body tr {
    background: var(--mud-palette-surface) !important;
}

.pwm-page .pwm-datagrid .mud-table-body .mud-table-row:hover .mud-table-cell,
.pwm-page .pwm-datagrid .mud-table-body tr:hover td {
    background: color-mix(in srgb, var(--mud-palette-error) 8%, var(--mud-palette-surface)) !important;
}

@media screen {
    .pwm-page .pwm-datagrid .mud-table-body .mud-table-cell,
    .pwm-page .pwm-datagrid .mud-table-body td {
        background: var(--mud-palette-surface) !important;
        color: var(--mud-palette-text-primary) !important;
    }

    .pwm-page .pwm-datagrid .mud-data-grid-footer,
    .pwm-page .pwm-datagrid .mud-data-grid-footer tr,
    .pwm-page .pwm-datagrid .mud-data-grid-footer td,
    .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    html[data-theme="dark"] .pwm-page .general-datagrid-class .mud-data-grid-footer,
    html[data-theme="dark"] .pwm-page .general-datagrid-class .mud-data-grid-footer tr,
    .mud-theme-dark .pwm-page .general-datagrid-class .mud-data-grid-footer {
        background: var(--mud-palette-surface) !important;
        background-color: var(--mud-palette-surface) !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    .pwm-page .pwm-datagrid .mud-data-grid-footer td,
    .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    .pwm-page .period-weekly-mortality-grid .mud-data-grid-footer td,
    .pwm-page .period-weekly-mortality-grid .mud-data-grid-footer .mud-table-cell,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-data-grid-footer td,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-data-grid-footer td,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-table-cell {
        background: color-mix(in srgb, var(--mud-palette-error) 8%, var(--mud-palette-surface)) !important;
        background-color: color-mix(in srgb, var(--mud-palette-error) 8%, var(--mud-palette-surface)) !important;
        color: var(--mud-palette-text-primary) !important;
    }

    .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-typography,
    .pwm-page .pwm-datagrid .mud-data-grid-footer .pwm-footer-num,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-typography,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-data-grid-footer .pwm-footer-num {
        color: var(--mud-palette-text-primary) !important;
    }
}

.pwm-th-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 6px 4px;
    box-sizing: border-box;
    text-align: center;
    background: transparent !important;
}

.pwm-th-stack--single .pwm-th-group {
    display: none;
}

.pwm-th-group {
    font-family: 'IRANSans', sans-serif;
    font-size: 0.58rem;
    font-weight: 600;
    line-height: 1.15;
    width: 100%;
    padding-bottom: 2px;
    margin-bottom: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.pwm-th-sub {
    font-family: 'IRANSans', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff !important;
}

/* ─── هدر رنگی ستون‌ها ─── */
.pwm-page .general-datagrid-class.pwm-datagrid-colored .mud-table-head,
.general-datagrid-class.pwm-datagrid-colored .mud-table-head {
    background: transparent !important;
    box-shadow: none !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table .mud-table-head th,
.general-datagrid-class.pwm-datagrid-colored .mud-table .mud-table-head .mud-th,
.general-datagrid-class.pwm-datagrid-colored .mud-table .mud-table-head .mud-table-cell,
.pwm-datagrid-colored .mud-table .mud-table-head th,
.pwm-datagrid-colored .mud-table .mud-table-head .mud-th,
.pwm-datagrid-colored .mud-table .mud-table-head .mud-table-cell {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    vertical-align: middle !important;
    color: #fff !important;
    background: #546e7a !important;
    background-color: #546e7a !important;
    background-image: none !important;
    border-radius: 0 !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head .pwm-th-group,
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .pwm-th-sub,
.pwm-datagrid-colored .mud-table-head .pwm-th-group,
.pwm-datagrid-colored .mud-table-head .pwm-th-sub,
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .pwm-th-stack *,
.pwm-datagrid-colored .mud-table-head .pwm-th-stack * {
    color: #fff !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--meta),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--meta),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--meta),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--meta) {
    background: #546e7a !important;
    background-color: #546e7a !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--opening),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--opening),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--opening),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--opening) {
    background: #5d4037 !important;
    background-color: #5d4037 !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--closing),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--closing),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--closing),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--closing) {
    background: #455a64 !important;
    background-color: #455a64 !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--input),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--input),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--input),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--input) {
    background: #00897b !important;
    background-color: #00897b !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--output),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--output),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--output),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--output) {
    background: #2e7d32 !important;
    background-color: #2e7d32 !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--mortality),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--mortality),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--mortality),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--mortality) {
    background: #c62828 !important;
    background-color: #c62828 !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--pct),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--pct),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--pct),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--pct) {
    background: #6a1b9a !important;
    background-color: #6a1b9a !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--cumulative),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--cumulative),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--cumulative),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--cumulative) {
    background: #b71c1c !important;
    background-color: #b71c1c !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--avg),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--avg),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--avg),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--avg) {
    background: #00796b !important;
    background-color: #00796b !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--max),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--max),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--max),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--max) {
    background: #1565c0 !important;
    background-color: #1565c0 !important;
}

.general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--change),
.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--change),
.general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--change),
.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--change) {
    background: #37474f !important;
    background-color: #37474f !important;
}

.general-datagrid-class.pwm-datagrid-colored.pwm-sex-female .mud-table-head th:has(.pwm-th-sub--mortality),
.general-datagrid-class.pwm-datagrid-colored.pwm-sex-female .mud-table-head .mud-table-cell:has(.pwm-th-sub--mortality),
.general-datagrid-class.pwm-datagrid-colored.pwm-sex-female .mud-table-head th:has(.pwm-th-sub--pct),
.general-datagrid-class.pwm-datagrid-colored.pwm-sex-female .mud-table-head .mud-table-cell:has(.pwm-th-sub--pct),
.general-datagrid-class.pwm-datagrid-colored.pwm-sex-female .mud-table-head th:has(.pwm-th-sub--cumulative),
.general-datagrid-class.pwm-datagrid-colored.pwm-sex-female .mud-table-head .mud-table-cell:has(.pwm-th-sub--cumulative) {
    background: #00897b !important;
    background-color: #00897b !important;
}

.general-datagrid-class.pwm-datagrid-colored.pwm-sex-male .mud-table-head th:has(.pwm-th-sub--mortality),
.general-datagrid-class.pwm-datagrid-colored.pwm-sex-male .mud-table-head .mud-table-cell:has(.pwm-th-sub--mortality),
.general-datagrid-class.pwm-datagrid-colored.pwm-sex-male .mud-table-head th:has(.pwm-th-sub--pct),
.general-datagrid-class.pwm-datagrid-colored.pwm-sex-male .mud-table-head .mud-table-cell:has(.pwm-th-sub--pct),
.general-datagrid-class.pwm-datagrid-colored.pwm-sex-male .mud-table-head th:has(.pwm-th-sub--cumulative),
.general-datagrid-class.pwm-datagrid-colored.pwm-sex-male .mud-table-head .mud-table-cell:has(.pwm-th-sub--cumulative) {
    background: #1565c0 !important;
    background-color: #1565c0 !important;
}

[data-theme="dark"] .general-datagrid-class.pwm-datagrid-colored .mud-table-head th,
[data-theme="dark"] .general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell,
.mud-theme-dark .general-datagrid-class.pwm-datagrid-colored .mud-table-head th,
.mud-theme-dark .general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell {
    background-image: none !important;
}

/* ─── بدنه و فوتر ─── */
.pwm-cell {
    text-align: center !important;
    width: 100%;
    font-variant-numeric: tabular-nums;
}

.pwm-cell-num,
.pwm-cell-num.mud-typography {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
}

.pwm-cell-mortality {
    color: var(--mud-palette-error) !important;
    font-weight: 800 !important;
}

.pwm-datagrid-colored .mud-table-body .mud-table-cell {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 4px 5px !important;
}

.pwm-footer-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

.pwm-footer-num {
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
    font-size: 1.05rem !important;
}

.pwm-datagrid-colored .mud-data-grid-footer td,
.pwm-datagrid-colored .mud-data-grid-footer .mud-table-cell {
    text-align: center !important;
    vertical-align: middle !important;
    font-weight: 700 !important;
}

.pwm-page .pwm-datagrid .mud-table-head {
    display: table-header-group !important;
}

.pwm-page .pwm-datagrid .mud-table-body {
    display: table-row-group !important;
}

.pwm-page .pwm-datagrid .mud-data-grid-footer {
    display: table-footer-group !important;
}

/* ─── خطوط جدول ─── */
.pwm-page .general-datagrid-class.pwm-grid-lined,
.pwm-page .general-datagrid-class.pwm-grid-lined .mud-data-grid,
.pwm-page .general-datagrid-class.pwm-grid-lined .mud-data-grid-root,
.pwm-page .general-datagrid-class.pwm-grid-lined .mud-table-container,
.pwm-page .general-datagrid-class.pwm-grid-lined .mud-table-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

.pwm-page .general-datagrid-class.pwm-grid-lined .mud-table-root,
.pwm-page .general-datagrid-class.pwm-grid-lined table.mud-table {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

.pwm-page .general-datagrid-class.pwm-grid-lined .mud-table-head {
    display: table-header-group !important;
}

.pwm-page .general-datagrid-class.pwm-grid-lined .mud-table-body {
    display: table-row-group !important;
}

.pwm-page .general-datagrid-class.pwm-grid-lined .mud-data-grid-footer {
    display: table-footer-group !important;
}

.pwm-page .general-datagrid-class.pwm-grid-lined .mud-table-row {
    display: table-row !important;
}

html .pwm-page .pwm-datagrid.pwm-grid-lined .mud-table-head th,
html .pwm-page .pwm-datagrid.pwm-grid-lined .mud-table-cell,
html .pwm-page .pwm-datagrid.pwm-grid-lined .mud-table-body .mud-table-cell,
html .pwm-page .pwm-datagrid.pwm-grid-lined .mud-data-grid-footer .mud-table-cell {
    border: 1px solid #000 !important;
    border-color: #000 !important;
}

html .pwm-page .pwm-datagrid.pwm-grid-lined .mud-table-head th {
    border-radius: 0 !important;
}

@media screen {
    html .pwm-page .pwm-datagrid .pwm-cell-num,
    html .pwm-page .pwm-datagrid .pwm-footer-num,
    html .pwm-page .pwm-datagrid .pwm-cell .mud-typography {
        color: var(--mud-palette-text-primary) !important;
    }

    html .pwm-page .pwm-datagrid .pwm-cell-mortality {
        color: var(--mud-palette-error) !important;
    }
}

.print-only {
    display: none !important;
}

@media (max-width: 600px) {
    .pwm-page .pwm-summary-card .mud-typography-h6 {
        font-size: 1.1rem !important;
    }

    .pwm-grid-wrap {
        height: min(62dvh, calc(100dvh - 340px));
    }
}

/* ═══ چاپ A4 افقی ═══ */
@media print {
    @page {
        size: A4 landscape;
        margin: 5mm 6mm;
    }

    html,
    html[data-theme="dark"],
    body,
    body.ps-app,
    .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;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .no-print,
    .pwm-filter,
    .pwm-chart-actions,
    .mud-drawer,
    .mud-appbar,
    .mud-layout-appbar,
    .mud-layout-drawer,
    .mud-snackbar-container,
    .mud-overlay,
    .mud-scroll-to-top,
    nav,
    footer,
    #custom-loading,
    .loading-container-auth {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .mud-layout,
    .mud-layout-root,
    .mud-main-content,
    #app,
    .mobile-page-container,
    .pwm-page,
    .pwm-shell,
    .pwm-grid-paper,
    .pwm-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;
    }

    .pwm-page .pwm-datagrid.mud-data-grid,
    .pwm-page .pwm-datagrid .mud-data-grid,
    .pwm-page .pwm-datagrid .mud-data-grid-root {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .pwm-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;
    }

    .pwm-print-banner h1 {
        margin: 0 0 3px;
        font-size: 11pt;
        font-weight: 800;
        line-height: 1.15;
        color: #000 !important;
    }

    .pwm-print-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2px 10px;
        font-size: 7.5pt;
        line-height: 1.2;
        color: #000 !important;
    }

    html .pwm-page .pwm-print-banner,
    html .pwm-page .pwm-print-banner h1,
    html .pwm-page .pwm-print-banner .pwm-print-grid,
    html .pwm-page .pwm-print-banner .pwm-print-grid div,
    html[data-theme="dark"] .pwm-page .pwm-print-banner,
    html[data-theme="dark"] .pwm-page .pwm-print-banner *,
    .mud-theme-dark .pwm-page .pwm-print-banner,
    .mud-theme-dark .pwm-page .pwm-print-banner * {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        background: transparent !important;
    }

    .pwm-page .pwm-datagrid,
    .pwm-page .pwm-datagrid .mud-table-container,
    .pwm-page .pwm-datagrid .mud-table-wrapper,
    .pwm-page .pwm-datagrid .mud-data-grid-root {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
        background: #fff !important;
    }

    .pwm-page .pwm-datagrid .mud-table-body .mud-table-cell,
    .pwm-page .pwm-datagrid .mud-table-body td,
    .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    .pwm-page .pwm-datagrid .mud-data-grid-footer td {
        background: #fff !important;
        background-color: #fff !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        padding: 2px 3px !important;
        line-height: 1.2 !important;
        font-size: 8pt !important;
        vertical-align: middle !important;
    }

    .pwm-page .pwm-datagrid .pwm-cell-num,
    .pwm-page .pwm-datagrid .pwm-footer-num,
    .pwm-page .pwm-datagrid .pwm-cell .mud-typography,
    .pwm-page .pwm-datagrid .pwm-cell-mortality {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        font-size: 8.5pt !important;
        font-weight: 700 !important;
    }

    .pwm-th-stack {
        min-height: 0 !important;
        padding: 2px 1px !important;
    }

    .pwm-th-sub {
        font-size: 6pt !important;
        line-height: 1.1 !important;
        color: #fff !important;
    }

    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--meta),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--meta) { background: #546e7a !important; }
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--opening),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--opening) { background: #5d4037 !important; }
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--closing),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--closing) { background: #455a64 !important; }
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--input),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--input) { background: #00897b !important; }
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--output),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--output) { background: #2e7d32 !important; }
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--mortality),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--mortality) { background: #c62828 !important; }
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--pct),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--pct) { background: #6a1b9a !important; }
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--cumulative),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--cumulative) { background: #b71c1c !important; }
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--avg),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--avg) { background: #00796b !important; }
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--max),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--max) { background: #1565c0 !important; }
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--change),
    .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--change) { background: #37474f !important; }

    .general-datagrid-class.pwm-datagrid-colored.pwm-sex-female .mud-table-head th:has(.pwm-th-sub--mortality),
    .general-datagrid-class.pwm-datagrid-colored.pwm-sex-female .mud-table-head th:has(.pwm-th-sub--pct),
    .general-datagrid-class.pwm-datagrid-colored.pwm-sex-female .mud-table-head th:has(.pwm-th-sub--cumulative) {
        background: #00897b !important;
    }

    .general-datagrid-class.pwm-datagrid-colored.pwm-sex-male .mud-table-head th:has(.pwm-th-sub--mortality),
    .general-datagrid-class.pwm-datagrid-colored.pwm-sex-male .mud-table-head th:has(.pwm-th-sub--pct),
    .general-datagrid-class.pwm-datagrid-colored.pwm-sex-male .mud-table-head th:has(.pwm-th-sub--cumulative) {
        background: #1565c0 !important;
    }

    .general-datagrid-class.pwm-datagrid-colored .mud-table-head th,
    .pwm-datagrid-colored .mud-table-head th,
    .general-datagrid-class.pwm-datagrid-colored .mud-table-head .mud-table-cell,
    .pwm-datagrid-colored .mud-table-head .mud-table-cell {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color: #fff !important;
        border: 1px solid #000 !important;
    }

    html .pwm-page .pwm-datagrid.pwm-grid-lined .mud-table-head th,
    html .pwm-page .pwm-datagrid.pwm-grid-lined .mud-table-body .mud-table-cell,
    html .pwm-page .pwm-datagrid.pwm-grid-lined .mud-data-grid-footer .mud-table-cell {
        border: 1px solid #000 !important;
        border-color: #000 !important;
    }

    /* ردیف جمع: پس‌زمینه روشن + متن مشکی (غلبه بر تم تاریک / premium-ui) */
    html .pwm-page .pwm-datagrid .mud-data-grid-footer,
    html .pwm-page .pwm-datagrid .mud-data-grid-footer tr,
    html .pwm-page .pwm-datagrid .mud-data-grid-footer td,
    html .pwm-page .pwm-datagrid .mud-data-grid-footer th,
    html .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    html .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-typography,
    html .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-typography-body2,
    html .pwm-page .pwm-datagrid .mud-data-grid-footer .pwm-footer-wrap,
    html .pwm-page .pwm-datagrid .mud-data-grid-footer .pwm-footer-num,
    html .pwm-page .pwm-datagrid .mud-data-grid-footer td *,
    html .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-typography *,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-data-grid-footer,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-data-grid-footer tr,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-data-grid-footer td,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-typography,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-data-grid-footer .pwm-footer-num,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-data-grid-footer td *,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-data-grid-footer,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-data-grid-footer tr,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-data-grid-footer td,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-typography,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-data-grid-footer .pwm-footer-num,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-data-grid-footer td * {
        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"] .pwm-page .pwm-datagrid .mud-table-body .mud-table-cell,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-table-body .mud-typography,
    html[data-theme="dark"] .pwm-page .pwm-datagrid .mud-table-body td,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-table-body .mud-table-cell,
    .mud-theme-dark .pwm-page .pwm-datagrid .mud-table-body .mud-typography {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        background: #fff !important;
        background-color: #fff !important;
    }

    html .pwm-page,
    html .pwm-page .pwm-datagrid {
        --mud-palette-text-primary: rgba(0, 0, 0, 0.87) !important;
        --mud-palette-text-secondary: rgba(0, 0, 0, 0.6) !important;
        --mud-palette-surface: #fff !important;
        --mud-palette-background: #fff !important;
    }
}

/*
 * تم تاریک + چاپ: غلبه نهایی بر print-styles (background:transparent)
 * و theme-variables (background:unset) — هدر رنگی، فوتر روشن.
 */
@media print {
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-table th,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-table td,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-table .mud-table-cell,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-table th,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-table td,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-table .mud-table-cell {
        background-image: none !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-table-body .mud-table-cell,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-table-body td,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-table-body .mud-table-cell,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-table-body td {
        background: #fff !important;
        background-color: #fff !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer tr,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer td,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-typography,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer .pwm-footer-num,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer td *,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer tr,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer td,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer .mud-typography,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer .pwm-footer-num,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid .mud-data-grid-footer td * {
        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"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell {
        background-color: #546e7a !important;
        background-image: none !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--meta),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--meta),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--meta),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--meta) {
        background-color: #546e7a !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--opening),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--opening),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--opening),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--opening) {
        background-color: #5d4037 !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--closing),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--closing),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--closing),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--closing) {
        background-color: #455a64 !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--input),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--input),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--input),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--input) {
        background-color: #00897b !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--output),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--output),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--output),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--output) {
        background-color: #2e7d32 !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--mortality),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--mortality),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--mortality),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--mortality) {
        background-color: #c62828 !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--pct),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--pct),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--pct),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--pct) {
        background-color: #6a1b9a !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--cumulative),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--cumulative),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--cumulative),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--cumulative) {
        background-color: #b71c1c !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--avg),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--avg),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--avg),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--avg) {
        background-color: #00796b !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--max),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--max),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--max),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--max) {
        background-color: #1565c0 !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--change),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--change),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--change),
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--change) {
        background-color: #37474f !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-female .mud-table-head th:has(.pwm-th-sub--mortality),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-female .mud-table-head .mud-table-cell:has(.pwm-th-sub--mortality),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-female .mud-table-head th:has(.pwm-th-sub--pct),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-female .mud-table-head .mud-table-cell:has(.pwm-th-sub--pct),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-female .mud-table-head th:has(.pwm-th-sub--cumulative),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-female .mud-table-head .mud-table-cell:has(.pwm-th-sub--cumulative) {
        background-color: #00897b !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-male .mud-table-head th:has(.pwm-th-sub--mortality),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-male .mud-table-head .mud-table-cell:has(.pwm-th-sub--mortality),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-male .mud-table-head th:has(.pwm-th-sub--pct),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-male .mud-table-head .mud-table-cell:has(.pwm-th-sub--pct),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-male .mud-table-head th:has(.pwm-th-sub--cumulative),
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored.pwm-sex-male .mud-table-head .mud-table-cell:has(.pwm-th-sub--cumulative) {
        background-color: #1565c0 !important;
    }

    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .pwm-th-sub,
    html[data-theme="dark"] body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .pwm-th-stack *,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .pwm-th-sub,
    .mud-theme-dark body.print-report .pwm-page .pwm-datagrid-colored .mud-table-head .pwm-th-stack * {
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
    }
}

/* غلبه نهایی چاپ — بعد از bundle scoped (همان selectorها با html) */
@media print {
    html[data-theme="dark"] .pwm-page .general-datagrid-class.period-weekly-mortality-grid .mud-data-grid-footer,
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer,
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer tr,
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer td,
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer .mud-typography,
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer .pwm-footer-num,
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer *,
    .mud-theme-dark .pwm-page .general-datagrid-class.period-weekly-mortality-grid .mud-data-grid-footer,
    .mud-theme-dark .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer,
    .mud-theme-dark .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer tr,
    .mud-theme-dark .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer td,
    .mud-theme-dark .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    .mud-theme-dark .pwm-page .period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer * {
        background: #eceff1 !important;
        background-color: #eceff1 !important;
        background-image: none !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        box-shadow: none !important;
    }

    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid-colored .mud-table-head th,
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid-colored .mud-table-head .mud-table-cell,
    .mud-theme-dark .pwm-page .period-weekly-mortality-grid.pwm-datagrid-colored .mud-table-head th,
    .mud-theme-dark .pwm-page .period-weekly-mortality-grid.pwm-datagrid-colored .mud-table-head .mud-table-cell {
        background-image: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--meta),
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--meta) {
        background-color: #546e7a !important;
    }

    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--mortality),
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--mortality) {
        background-color: #c62828 !important;
    }

    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid-colored .mud-table-head th:has(.pwm-th-sub--pct),
    html[data-theme="dark"] .pwm-page .period-weekly-mortality-grid.pwm-datagrid-colored .mud-table-head .mud-table-cell:has(.pwm-th-sub--pct) {
        background-color: #6a1b9a !important;
    }
}

/*
 * چاپ مستقل از تم (فقط @media print — بدون تغییر data-theme روی صفحه)
 */
@media print {
    html[data-theme="dark"] .pwm-page,
    .mud-theme-dark .pwm-page,
    .ps-app.mud-theme-dark .pwm-page {
        --mud-palette-background: #fff !important;
        --mud-palette-surface: #fff !important;
        --mud-palette-text-primary: rgba(0, 0, 0, 0.87) !important;
        --mud-palette-text-secondary: rgba(0, 0, 0, 0.6) !important;
        --mud-palette-table-lines: rgba(0, 0, 0, 0.12) !important;
        --mud-palette-divider: rgba(0, 0, 0, 0.12) !important;
        color-scheme: light !important;
    }

    html[data-theme="dark"] .pwm-page .general-datagrid-class.period-weekly-mortality-grid .mud-data-grid-footer,
    html[data-theme="dark"] .pwm-page .general-datagrid-class.period-weekly-mortality-grid .mud-data-grid-footer tr,
    html[data-theme="dark"] .pwm-page .general-datagrid-class.period-weekly-mortality-grid .mud-data-grid-footer td,
    html[data-theme="dark"] .pwm-page .general-datagrid-class.period-weekly-mortality-grid .mud-data-grid-footer .mud-table-cell,
    html[data-theme="dark"] .pwm-page .general-datagrid-class.period-weekly-mortality-grid .mud-data-grid-footer .mud-typography,
    html[data-theme="dark"] .pwm-page .general-datagrid-class.period-weekly-mortality-grid .mud-data-grid-footer .pwm-footer-wrap,
    html[data-theme="dark"] .pwm-page .general-datagrid-class.period-weekly-mortality-grid .mud-data-grid-footer .pwm-footer-num,
    html[data-theme="dark"] .pwm-page .general-datagrid-class.period-weekly-mortality-grid .mud-data-grid-footer *,
    .mud-theme-dark .pwm-page .general-datagrid-class.period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer,
    .mud-theme-dark .pwm-page .general-datagrid-class.period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer tr,
    .mud-theme-dark .pwm-page .general-datagrid-class.period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer td,
    .mud-theme-dark .pwm-page .general-datagrid-class.period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer .mud-table-cell,
    .mud-theme-dark .pwm-page .general-datagrid-class.period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer .mud-typography,
    .mud-theme-dark .pwm-page .general-datagrid-class.period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer .pwm-footer-num,
    .mud-theme-dark .pwm-page .general-datagrid-class.period-weekly-mortality-grid.pwm-datagrid .mud-data-grid-footer * {
        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;
        box-shadow: none !important;
        filter: none !important;
    }

    html[data-theme="dark"] .pwm-page .mud-table tfoot .mud-table-cell,
    html[data-theme="dark"] .pwm-page .mud-table tfoot td,
    html[data-theme="dark"] .pwm-page .mud-table-foot .mud-table-cell,
    .mud-theme-dark .pwm-page .mud-table tfoot .mud-table-cell,
    .mud-theme-dark .pwm-page .mud-table tfoot td,
    .mud-theme-dark .pwm-page .mud-table-foot .mud-table-cell {
        background: #eceff1 !important;
        background-color: #eceff1 !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }
}
