/* گزارش روزانه پرورش — چیدمان صفحه + چاپ A4؛ جدول: general-datagrid-class (MainStyle) + الگوی PeriodWeeklyMortality */

.dbr-page {
    direction: rtl;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* عرض کامل در لایهٔ اصلی؛ جلوگیری از باریک ماندن گزارش وسط صفحه */
.dbr-page.mud-container {
    max-width: 100% !important;
    width: 100% !important;
}

/* تمام‌عرض بدون display:block روی لایه‌های داخلی — block روی wrapper جدول می‌تواند رندر thead/tbody/tfoot را از هم بشکند */
.dbr-page .dbr-datagrid.general-datagrid-class {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid,
.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-root,
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table-container,
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    background: var(--mud-palette-surface) !important;
}

.dbr-page .dbr-datagrid .mud-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    background-color: var(--mud-palette-surface) !important;
}

/*
 * خطوط جدول: مشکی پررنگ در تم روشن و تاریک.
 * غلبه بر MainStyle، premium-ui (--ps-border کم‌رنگ در دارک)، theme-variables و Mud.
 * ستون ملاحظات: فقط خطوط عمودی.
 */
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table,
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table,
html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table {
    border: none !important;
    box-shadow: none !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

/* خطوط بدنه — Mud Bordered فقط border-right می‌دهد؛ خط افقی با box-shadow */
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table tbody tr > td:not(:has(.dbr-notes-cell)),
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table tbody tr > .mud-table-cell:not(:has(.dbr-notes-cell)),
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body tr > td:not(:has(.dbr-notes-cell)),
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body tr > .mud-table-cell:not(:has(.dbr-notes-cell)),
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-table-row .mud-table-cell:not(:has(.dbr-notes-cell)),
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-table-row td:not(:has(.dbr-notes-cell)),
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table tbody td:not(:has(.dbr-notes-cell)),
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body td:not(:has(.dbr-notes-cell)),
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-table-cell:not(:has(.dbr-notes-cell)) {
    border: 1px solid #000 !important;
    border-color: #000 !important;
    box-shadow: inset 0 -1px 0 0 #000 !important;
}

/* theme-variables: border-color کم‌رنگ روی بدنه */
.ps-app .dbr-page .dbr-datagrid .mud-table .mud-table-body .mud-table-cell,
.ps-app .dbr-page .dbr-datagrid .mud-table .mud-table-body .mud-td,
.mud-theme-dark .ps-app .dbr-page .dbr-datagrid .mud-table .mud-table-body .mud-table-cell {
    border-color: #000 !important;
    border-bottom-color: #000 !important;
    border-top-color: #000 !important;
}

.dbr-page .dbr-datagrid.general-datagrid-class .mud-table th,
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table td,
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-cell,
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-td,
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table th,
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table td,
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body td,
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-table-cell,
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-td,
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table tbody td,
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td,
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-table-cell,
html[data-theme="dark"] .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table th,
html[data-theme="dark"] .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table td,
html[data-theme="dark"] .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body td,
html[data-theme="dark"] .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-table-cell,
html[data-theme="dark"] .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-td,
.mud-theme-dark .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table th,
.mud-theme-dark .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table td,
.mud-theme-dark .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-table-cell,
.mud-theme-dark .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-td {
    border: 1px solid #000 !important;
    border-color: #000 !important;
    border-top-color: #000 !important;
    border-bottom-color: #000 !important;
    border-left-color: #000 !important;
    border-right-color: #000 !important;
    border-bottom: 1px solid #000 !important;
    border-top: 1px solid #000 !important;
}

.dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body td:has(.dbr-notes-cell),
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body .mud-table-cell:has(.dbr-notes-cell),
.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td:has(.dbr-notes-cell),
.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-table-cell:has(.dbr-notes-cell),
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body td:has(.dbr-notes-cell),
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body .mud-table-cell:has(.dbr-notes-cell),
.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td:has(.dbr-notes-cell),
html[data-theme="dark"] .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body td:has(.dbr-notes-cell),
html[data-theme="dark"] .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body .mud-table-cell:has(.dbr-notes-cell),
html[data-theme="dark"] .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td:has(.dbr-notes-cell),
.mud-theme-dark .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body td:has(.dbr-notes-cell),
.mud-theme-dark .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body .mud-table-cell:has(.dbr-notes-cell),
.mud-theme-dark .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td:has(.dbr-notes-cell) {
    border-top: none !important;
    border-bottom: none !important;
    border-top-color: transparent !important;
    border-bottom-color: transparent !important;
    border-left: 1px solid #000 !important;
    border-right: 1px solid #000 !important;
    box-shadow: none !important;
}

/* هم‌ترازی ستون‌ها: هدر، بدنه و ردیف جمع هر سه گروه استاندارد یک جدول */
.dbr-page .dbr-datagrid .mud-table-head {
    display: table-header-group !important;
}

.dbr-page .dbr-datagrid .mud-table-body {
    display: table-row-group !important;
}

/* بدون راه‌راه؛ زمینه هماهنگ با تم (روشن/تاریک) */
.dbr-page .dbr-datagrid .mud-table-body .mud-table-row,
.dbr-page .dbr-datagrid .mud-table-body tr,
.dbr-page .dbr-datagrid tbody tr:nth-child(odd),
.dbr-page .dbr-datagrid tbody tr:nth-child(even) {
    background-color: var(--mud-palette-surface) !important;
    background: var(--mud-palette-surface) !important;
}

.dbr-page .dbr-datagrid .mud-table-body .mud-table-row:hover,
.dbr-page .dbr-datagrid .mud-table-body tr:hover,
.dbr-page .dbr-datagrid .mud-table-body .mud-table-row:hover .mud-table-cell,
.dbr-page .dbr-datagrid .mud-table-body tr:hover td {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-surface)) !important;
    background-color: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-surface)) !important;
}

.dbr-page .dbr-datagrid .mud-table-body .mud-table-cell,
.dbr-page .dbr-datagrid .mud-table-body td {
    background-color: var(--mud-palette-surface) !important;
    background: var(--mud-palette-surface) !important;
}

.dbr-page .dbr-datagrid .mud-data-grid-footer tr,
.dbr-page .dbr-datagrid .mud-data-grid-footer td {
    background-color: var(--mud-palette-surface) !important;
    background: var(--mud-palette-surface) !important;
}

@media screen {
    .dbr-page .dbr-datagrid .mud-table-body .mud-table-cell,
    .dbr-page .dbr-datagrid .mud-table-body td {
        color: var(--mud-palette-text-primary) !important;
    }

    .dbr-page .dbr-datagrid .mud-table-body .mud-typography,
    .dbr-page .dbr-datagrid .mud-data-grid-footer .mud-typography {
        color: var(--mud-palette-text-primary) !important;
    }

    .dbr-page .dbr-datagrid .dbr-salon-pen {
        color: var(--mud-palette-text-secondary) !important;
    }

    .dbr-page .dbr-datagrid .dbr-salon-age {
        color: var(--mud-palette-text-secondary) !important;
    }
}

.dbr-page .dbr-datagrid .mud-table-head .mud-table-cell,
.dbr-page .dbr-datagrid .mud-table-body .mud-table-cell,
.dbr-page .dbr-datagrid .mud-data-grid-footer .mud-table-cell {
    min-width: 0 !important;
    box-sizing: border-box !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.dbr-page .dbr-datagrid .mud-table-cell.sticky-right {
    width: 10% !important;
    min-width: 104px !important;
}

.dbr-page .dbr-datagrid .mud-table-cell.sticky-right,
.dbr-page .dbr-datagrid .mud-table-cell.sticky-right .mud-typography {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/*
 * بدنه: پیش‌فرض متوسط؛ سلول‌های عددی (+ ستون سن) بزرگ‌تر؛ فوتر کوچک و مجزا.
 */
.dbr-page .dbr-datagrid .mud-table-body .mud-typography {
    font-size: 0.95rem !important;
    line-height: 1.12 !important;
    font-variant-numeric: tabular-nums;
}

/* عددی‌ها و ستون سن — بدون سالن متنی و بدون ملاحظات خالی */
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body td:not(:has(.dbr-salon-cell)):not(:has(.dbr-notes-cell)) .mud-typography,
.dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body td:not(:has(.dbr-salon-cell)):not(:has(.dbr-notes-cell)) .mud-typography-body2 {
    font-size: 1.25rem !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums !important;
}

.dbr-page .dbr-datagrid .mud-table-body .dbr-age-cell .dbr-age-value {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
}

/* ستون سن: جمع‌وجورتر در نمایش */
.dbr-page .dbr-datagrid .mud-table-head th:has(.dbr-col-age),
.dbr-page .dbr-datagrid .mud-table-body td:has(.dbr-col-age),
.dbr-page .dbr-datagrid .mud-data-grid-footer td:has(.dbr-col-age) {
    width: 6.9% !important;
    min-width: 74px !important;
}

.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography,
.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography-caption {
    font-size: 1.2rem !important;
    line-height: 1.12 !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -0.02em !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--mud-palette-text-primary) !important;
}

/* ردیف داده: فشرده‌تر در نمایش */
.dbr-page .dbr-datagrid .mud-table-body .mud-table-cell,
.dbr-page .dbr-datagrid .mud-table-body td {
    padding: 3px 5px !important;
    line-height: 1.12 !important;
}

.dbr-salon-cell {
    text-align: center;
    width: 100%;
    line-height: 1.05;
}

.dbr-page .dbr-datagrid .mud-table-body .dbr-salon-cell .dbr-salon-name {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    display: block;
}

.dbr-page .dbr-datagrid .mud-table-body .dbr-salon-pen {
    font-size: 0.66rem !important;
    line-height: 1.05 !important;
    display: block;
    margin-top: 0;
}

.dbr-page .dbr-datagrid .mud-table-body .dbr-salon-cell .dbr-salon-age {
    font-size: 0.68rem !important;
    line-height: 1.05 !important;
    display: block;
    color: var(--mud-palette-text-secondary) !important;
    margin-top: 0;
}

.dbr-page .dbr-datagrid .mud-table-body .dbr-salon-cell .dbr-salon-name {
    color: var(--mud-palette-text-primary) !important;
}

/* ستون سن: نمایش به‌صورت مثلا "20W 156D" */
.dbr-age-cell {
    text-align: center;
    width: 100%;
    direction: ltr;
    unicode-bidi: embed;
}

.dbr-page .dbr-datagrid .mud-table-body .dbr-age-cell .dbr-age-value {
    line-height: 1.08 !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: 0;
    white-space: nowrap;
}

.dbr-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);
}

/* تم تاریک/روشن: بدون کادر و سایه premium-ui روی جدول — فقط خطوط سلول */
.ps-app .dbr-page .dbr-datagrid .mud-table,
.ps-app .dbr-page .dbr-datagrid .mud-table-container,
.ps-app .dbr-page .dbr-datagrid .mud-table-wrapper,
.ps-app .dbr-page .dbr-datagrid .mud-table-root,
html[data-theme="dark"] .ps-app .dbr-page .dbr-datagrid .mud-table,
.mud-theme-dark .ps-app .dbr-page .dbr-datagrid .mud-table {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    outline: none !important;
    background: var(--mud-palette-surface) !important;
    background-color: var(--mud-palette-surface) !important;
}

/* هدر: گوشه‌های تخت — Mud sticky-header و premium-ui گردی گوشه می‌دهند و زمینه سفید دیده می‌شود */
.dbr-page .dbr-grid-paper,
.dbr-page .dbr-grid-wrap,
.dbr-page .dbr-datagrid .mud-table,
.dbr-page .dbr-datagrid .mud-table-root,
.dbr-page .dbr-datagrid .mud-table-container,
.dbr-page .dbr-datagrid .mud-table-wrapper,
.ps-app .dbr-page .dbr-datagrid .mud-table,
.ps-app .dbr-page .dbr-datagrid.mud-table-sticky-header,
.ps-app .dbr-page .dbr-datagrid.mud-table-sticky-header .mud-table-root {
    border-radius: 0 !important;
    overflow: visible !important;
}

.dbr-page .dbr-datagrid .mud-table-head .mud-table-cell,
.dbr-page .dbr-datagrid .mud-table-head th,
.dbr-page .dbr-datagrid .mud-table-head .mud-th,
.dbr-page .dbr-datagrid.mud-table-sticky-header .mud-table-head .mud-table-cell,
.dbr-page .dbr-datagrid .mud-table-sticky-header .mud-table-head .mud-table-cell:first-child,
.dbr-page .dbr-datagrid .mud-table-sticky-header .mud-table-head .mud-table-cell:last-child,
.dbr-page .dbr-datagrid .mud-table-head .mud-table-cell:first-child,
.dbr-page .dbr-datagrid .mud-table-head .mud-table-cell:last-child,
.dbr-page .dbr-datagrid .mud-table-head th:first-child,
.dbr-page .dbr-datagrid .mud-table-head th:last-child,
html[dir="rtl"] .dbr-page .dbr-datagrid .mud-table-head .mud-table-cell:first-child,
html[dir="rtl"] .dbr-page .dbr-datagrid .mud-table-head .mud-table-cell:last-child,
.mud-application-layout-rtl .dbr-page .dbr-datagrid .mud-table-head .mud-table-cell:first-child,
.mud-application-layout-rtl .dbr-page .dbr-datagrid .mud-table-head .mud-table-cell:last-child,
.mud-application-layout-rtl .dbr-page .dbr-datagrid.mud-table-sticky-header .mud-table-head .mud-table-cell:first-child,
.mud-application-layout-rtl .dbr-page .dbr-datagrid.mud-table-sticky-header .mud-table-head .mud-table-cell:last-child {
    border-radius: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* تم تاریک: بدون کادر premium-ui — زمینه هماهنگ با تم */
[data-theme="dark"] .dbr-page .dbr-shell.no-shadow,
[data-theme="dark"] .dbr-page .dbr-grid-paper.no-shadow,
.mud-theme-dark .dbr-page .dbr-shell.no-shadow,
.mud-theme-dark .dbr-page .dbr-grid-paper.no-shadow {
    background: var(--mud-palette-surface) !important;
    background-color: var(--mud-palette-surface) !important;
    background-image: none !important;
    border: 1px solid var(--mud-palette-table-lines) !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: var(--mud-palette-text-primary) !important;
}

/* ارتفاع پایدار با dvh تا با نوار آدرس موبایل نپرد؛ نه وابسته به عدد ثابت فیلتر */
.dbr-grid-wrap {
    width: 100%;
    max-width: 100%;
    height: min(74dvh, calc(100dvh - 210px));
    min-height: 300px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-surface);
}

.dbr-grid-wrap > .dbr-datagrid {
    flex: 1 1 auto;
    min-height: 0;
}

@media (min-width: 960px) {
    .dbr-grid-wrap {
        height: min(78dvh, calc(100dvh - 190px));
    }
}

/* هدر دو سطحی — روشن، بدون زمینه تیره؛ تم تاریک روی سلول‌های هدر اثر نگذارد */
.dbr-th-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 36px;
    padding: 4px 2px;
    box-sizing: border-box;
    text-align: center;
}

.dbr-th-group {
    font-size: 0.58rem !important;
    font-weight: 600 !important;
    line-height: 1.15 !important;
    color: #424242 !important;
    width: 100%;
    padding-bottom: 2px;
    margin-bottom: 1px;
    border-bottom: 1px solid #e0e0e0;
}

.dbr-th-stack--single .dbr-th-group {
    display: none;
}

.dbr-th-sub {
    font-size: 0.64rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #212121 !important;
}

/* خاموش‌کردن گرادیان تم روی هدر این گزارش‌ها */
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table .mud-table-head .mud-th,
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table .mud-table-head .mud-table-cell,
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table .mud-table-head th {
    background: unset !important;
    background-color: unset !important;
}

/* پیش‌فرض هدر (ستون‌های بدون کلاس گروه) */
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th {
    background-color: #546e7a !important;
    background-image: none !important;
    color: #fff !important;
}

.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th .dbr-th-group,
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th .dbr-th-sub {
    color: #fff !important;
}

.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th .dbr-th-group {
    border-bottom-color: rgba(255, 255, 255, 0.35) !important;
}

/* مرغ — فیروزه‌ای */
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--female) {
    background-color: #00897b !important;
}

/* خروس — آبی */
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--male) {
    background-color: #1565c0 !important;
}

/* متادیتا: سالن، سن، ملاحظات */
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--meta),
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-header-notes) {
    background-color: #546e7a !important;
}

/* تخم‌مرغ — گزارش تولید */
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-hatch) {
    background-color: #2e7d32 !important;
}

.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-cons) {
    background-color: #ef6c00 !important;
}

.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-waste) {
    background-color: #c62828 !important;
}

.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-total),
.dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-pct) {
    background-color: #455a64 !important;
}

[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--female) {
    background-color: #00796b !important;
}

[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--male) {
    background-color: #1976d2 !important;
}

[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--meta),
[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-header-notes) {
    background-color: #455a64 !important;
}

[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-hatch) {
    background-color: #388e3c !important;
}

[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-cons) {
    background-color: #f57c00 !important;
}

[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-waste) {
    background-color: #d32f2f !important;
}

[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-total),
[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-pct) {
    background-color: #37474f !important;
}

[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th .dbr-th-group,
[data-theme="dark"] .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th .dbr-th-sub,
.mud-theme-dark .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th .dbr-th-group,
.mud-theme-dark .dbr-page .dbr-datagrid.dbr-datagrid-colored .mud-table-head th .dbr-th-sub {
    color: #fff !important;
    border-bottom-color: rgba(255, 255, 255, 0.35) !important;
}

/* فوتر: غیر چسبان تا ردیف جمع با ستون‌ها هم‌تراز بماند */
.dbr-page .dbr-datagrid .mud-data-grid-footer {
    position: static !important;
    bottom: auto !important;
    z-index: auto !important;
    background-color: var(--mud-palette-surface) !important;
    display: table-footer-group !important;
    width: 100% !important;
}

.dbr-page .dbr-datagrid .mud-data-grid-footer td {
    background-color: var(--mud-palette-surface) !important;
}

/*
 * ردیف جمع: غلبه بر MainStyle؛ اندازهٔ نزدیک به اعداد بدنه، متن مشکی.
 */
.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-table-cell,
.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td {
    font-size: 1.18rem !important;
    line-height: 1.12 !important;
    font-weight: 700 !important;
    padding: 3px 4px !important;
    margin: 0 !important;
    vertical-align: middle !important;
    overflow: hidden !important;
    color: var(--mud-palette-text-primary) !important;
}

.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td:has(.dbr-footer-transfer-stack) {
    overflow: visible !important;
    vertical-align: middle !important;
}

.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 auto;
    line-height: 1 !important;
}

/* سلول جمع: محتوا از مرز سلول بیرون نزند؛ نقشهٔ ستون = thead/tbody */
.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td.mud-table-cell {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-wrap--ltr {
    direction: ltr !important;
    unicode-bidi: embed !important;
}

.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-num,
.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography-caption.dbr-footer-num {
    font-size: 1.22rem !important;
    line-height: 1.12 !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--mud-palette-text-primary) !important;
}

.dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-wrap--label .dbr-footer-num {
    font-weight: 700 !important;
    color: var(--mud-palette-text-primary) !important;
}

/* جمع انتقال وقتی هر دو جهت غیرصفر: دو خط تا پهنا کم شود */
.dbr-footer-transfer-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    line-height: 1;
}

.dbr-footer-transfer-stack .dbr-ft-line {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.12 !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    color: var(--mud-palette-text-primary) !important;
}

/* ستون ملاحظات: باریک‌تر از قبل؛ هنوز جای نوشتن دستی */
.dbr-page .dbr-datagrid .mud-table-head th:has(.dbr-header-notes),
.dbr-page .dbr-datagrid .mud-table-body td:has(.dbr-notes-cell),
.dbr-page .dbr-datagrid .mud-data-grid-footer td:has(.dbr-notes-cell) {
    width: 17% !important;
    min-width: 140px !important;
    vertical-align: top !important;
}

.dbr-notes-cell {
    box-sizing: border-box;
    width: 100%;
    min-height: 3rem;
    padding: 4px 5px;
}

.dbr-vaccine-line {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px dashed color-mix(in srgb, var(--mud-palette-divider) 70%, transparent);
    line-height: 1.35;
    text-align: right;
}

.dbr-vaccine-line:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dbr-vaccine-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

.dbr-vaccine-qty {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.dbr-page .dbr-datagrid .mud-data-grid-footer td:has(.dbr-notes-cell) .dbr-notes-cell {
    min-height: 1.75rem;
}

.dbr-shell {
    background: linear-gradient(
        180deg,
        var(--mud-palette-surface) 0%,
        color-mix(in srgb, var(--mud-palette-surface) 92%, var(--mud-palette-primary) 8%) 100%
    );
    border-radius: 18px;
}

.dbr-header {
    padding: 18px 22px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--mud-palette-primary) 72%, #000) 0%,
        var(--mud-palette-primary) 45%,
        color-mix(in srgb, var(--mud-palette-primary) 75%, var(--mud-palette-surface)) 100%
    );
    border-radius: 16px;
    position: relative;
}

.dbr-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 70% 100% at 0% 0%,
        color-mix(in srgb, var(--mud-palette-primary-text) 14%, transparent),
        transparent 50%
    );
    pointer-events: none;
    border-radius: 16px;
}

.dbr-header-title {
    color: var(--mud-palette-primary-text);
    font-weight: 800;
    text-shadow: 0 1px 2px color-mix(in srgb, var(--mud-palette-text-primary) 35%, transparent);
}

.dbr-header-icon {
    color: var(--mud-palette-primary-text);
}

.dbr-filter {
    border-radius: 14px;
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-surface));
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 16%, var(--mud-palette-lines-default));
}

.dbr-selection-box {
    border-radius: 12px;
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, var(--mud-palette-surface));
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 12%, var(--mud-palette-lines-default));
}

.dbr-selection-label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.dbr-selection-value {
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.dbr-summary-card {
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid var(--mud-palette-table-lines);
}

/* کارت‌های خلاصه: اعداد بزرگ و پررنگ */
.dbr-page .dbr-summary-card .mud-typography-h6,
.dbr-page .dbr-summary-card .mud-typography.mud-typography-h6 {
    font-size: 1.85rem !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -0.02em !important;
}

.dbr-sum-opening {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--mud-palette-success) 14%, var(--mud-palette-surface)) 0%,
        color-mix(in srgb, var(--mud-palette-success) 22%, var(--mud-palette-surface)) 100%
    );
}

.dbr-sum-mortal {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--mud-palette-warning) 18%, var(--mud-palette-surface)) 0%,
        color-mix(in srgb, var(--mud-palette-warning) 28%, var(--mud-palette-surface)) 100%
    );
}

.dbr-sum-feed {
    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%
    );
}

.dbr-sum-close {
    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%
    );
}

.dbr-meta {
    background: color-mix(in srgb, var(--mud-palette-primary) 6%, var(--mud-palette-surface));
    border-radius: 12px;
    border: 1px dashed color-mix(in srgb, var(--mud-palette-primary) 35%, var(--mud-palette-lines-default));
}

/* DataGrid: ستون چسبان سالن — فقط بدنه/فوتر؛ هدر رنگی جداگانه */
.dbr-page .dbr-datagrid .mud-table-body .mud-table-cell.sticky-right,
.dbr-page .dbr-datagrid .mud-data-grid-footer .mud-table-cell.sticky-right,
.dbr-datagrid td.mud-table-cell.sticky-right {
    position: sticky !important;
    z-index: 5;
    background: var(--mud-palette-surface) !important;
    box-shadow: -2px 0 6px color-mix(in srgb, var(--mud-palette-text-primary) 8%, transparent);
}

.dbr-page .dbr-datagrid .mud-table-head .mud-table-cell.sticky-right,
.dbr-datagrid th.mud-table-cell.sticky-right {
    position: sticky !important;
    z-index: 5;
    box-shadow: -2px 0 6px color-mix(in srgb, var(--mud-palette-text-primary) 8%, transparent);
}

/* هدر ثابت عمودی — فقط موقعیت؛ رنگ از dbr-datagrid-colored / report-datagrid-colored */
.dbr-page .dbr-datagrid.mud-table-sticky-header .mud-table-head .mud-table-cell,
.dbr-page .dbr-datagrid.mud-table-sticky-header .mud-table-head th {
    position: sticky !important;
    top: 0 !important;
    z-index: 4 !important;
}

.dbr-page .dbr-datagrid.mud-table-sticky-header .mud-table-head .mud-table-cell.sticky-right {
    top: 0 !important;
    z-index: 8 !important;
}

/* هدر رنگی + sticky: رنگ ستون‌ها حفظ شود (تم روشن) */
.dbr-page .dbr-datagrid.dbr-datagrid-colored.mud-table-sticky-header .mud-table-head th,
.dbr-page .dbr-datagrid.report-datagrid-colored.mud-table-sticky-header .mud-table-head th {
    color: #fff !important;
}

.dbr-page .dbr-datagrid.dbr-datagrid-colored.mud-table-sticky-header .mud-table-head th:has(.dbr-th-sub--female),
.dbr-page .dbr-datagrid.report-datagrid-colored.mud-table-sticky-header .mud-table-head th:has(.rpt-th-female),
.dbr-page .dbr-datagrid.report-datagrid-colored.mud-table-sticky-header .mud-table-head th:has(.swr-th-female) {
    background-color: #00897b !important;
}

.dbr-page .dbr-datagrid.dbr-datagrid-colored.mud-table-sticky-header .mud-table-head th:has(.dbr-th-sub--male),
.dbr-page .dbr-datagrid.report-datagrid-colored.mud-table-sticky-header .mud-table-head th:has(.rpt-th-male),
.dbr-page .dbr-datagrid.report-datagrid-colored.mud-table-sticky-header .mud-table-head th:has(.swr-th-male) {
    background-color: #1565c0 !important;
}

.dbr-page .dbr-datagrid.dbr-datagrid-colored.mud-table-sticky-header .mud-table-head th:has(.dbr-th-sub--meta),
.dbr-page .dbr-datagrid.dbr-datagrid-colored.mud-table-sticky-header .mud-table-head th:has(.dbr-header-notes),
.dbr-page .dbr-datagrid.dbr-datagrid-colored.mud-table-sticky-header .mud-table-head .mud-table-cell.sticky-right,
.dbr-page .dbr-datagrid.report-datagrid-colored.mud-table-sticky-header .mud-table-head th:has(.rpt-th-meta),
.dbr-page .dbr-datagrid.report-datagrid-colored.mud-table-sticky-header .mud-table-head th:has(.swr-th-meta) {
    background-color: #546e7a !important;
}

.dbr-page .dbr-datagrid.dbr-datagrid-colored.mud-table-sticky-header .mud-table-head th .dbr-th-group,
.dbr-page .dbr-datagrid.dbr-datagrid-colored.mud-table-sticky-header .mud-table-head th .dbr-th-sub,
.dbr-page .dbr-datagrid.report-datagrid-colored.mud-table-sticky-header .mud-table-head th .col-header-cell,
.dbr-page .dbr-datagrid.report-datagrid-colored.mud-table-sticky-header .mud-table-head th .col-header-cell strong {
    color: #fff !important;
}

.dbr-salon-name {
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

.dbr-h-short {
    display: none;
}

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

.dbr-print-footer {
    margin-top: 8px;
    padding-top: 6px;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    text-align: center;
    border-top: 1px solid var(--mud-palette-table-lines);
}

@media print {
    @page {
        size: A4 landscape;
        /* حاشیه‌های کم‌تر تا فضای محتوایی A4 بازتر و سطرهای بیشتری جا شود */
        margin: 5mm 6mm;
    }

    html,
    body {
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        /* جلوگیری از صفحهٔ خالی دوم: 100vh/100% روی لایهٔ روت باعث ارتفاع اضافه در چاپ می‌شود */
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #custom-loading,
    .loading-container-auth {
        display: none !important;
    }

    .mud-layout,
    .mud-layout-root,
    .mud-main-content,
    .mud-main-drawer,
    .mud-drawer-content,
    .mud-drawer-main,
    #app,
    .mobile-page-container,
    .dbr-page,
    .dbr-shell,
    .dbr-grid-paper,
    .dbr-page .dbr-grid-wrap,
    .ps-app .dbr-page,
    .ps-app .dbr-page .dbr-grid-paper,
    .ps-app .dbr-page .dbr-grid-wrap,
    html[data-theme="dark"] .ps-app .dbr-page .dbr-grid-paper,
    html[data-theme="dark"] .ps-app .dbr-page .dbr-grid-wrap {
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
    }

    .dbr-page.mobile-page-container {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Height="100%" روی DataGrid در چاپ نباید به ارتفاع اسکرین قفل شود */
    .dbr-page .dbr-datagrid.mud-data-grid,
    .dbr-page .dbr-datagrid .mud-data-grid,
    .dbr-page .dbr-datagrid .mud-data-grid-root {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

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

    .no-print,
    .dbr-filter,
    .mud-drawer,
    .mud-appbar,
    .mud-layout-appbar,
    .mud-layout-drawer,
    .mud-snackbar-container,
    .mud-overlay,
    .mud-scroll-to-top,
    nav,
    footer {
        display: none !important;
    }

    /* تم تاریک: premium-ui با .ps-app min-height:100vh و --ps-bg مشکی زیر جدول چاپ می‌دهد */
    html,
    html[data-theme="dark"],
    body,
    body.ps-app,
    .ps-app,
    .mud-theme-dark,
    .mud-theme-dark.ps-app,
    html[data-theme="dark"] .ps-app,
    html[data-theme="dark"] body,
    .mud-theme-dark .ps-app {
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }

    .ps-app .mud-main-content,
    html[data-theme="dark"] .ps-app .mud-main-content,
    .mud-theme-dark .ps-app .mud-main-content,
    .mud-main-content {
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
        flex: none !important;
        flex-grow: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }

    .mud-layout {
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
        background: #fff !important;
        background-color: #fff !important;
    }

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

    /* غلبه بر premium-ui (.ps-app .mud-paper / .mud-table — کادر و زمینه تیره) */
    html body.ps-app .dbr-page,
    html body.ps-app .dbr-page .mud-container,
    html body.ps-app .dbr-page .mud-paper.dbr-shell,
    html body.ps-app .dbr-page .mud-paper.dbr-grid-paper,
    html body.ps-app .dbr-page .mud-paper:not(.dbr-header):not(.dbr-filter),
    html[data-theme="dark"] body.ps-app .dbr-page .mud-paper.dbr-shell,
    html[data-theme="dark"] body.ps-app .dbr-page .mud-paper.dbr-grid-paper,
    .mud-theme-dark body.ps-app .dbr-page .mud-paper.dbr-shell,
    .mud-theme-dark body.ps-app .dbr-page .mud-paper.dbr-grid-paper,
    .dbr-page,
    .dbr-shell,
    .dbr-page .mud-paper,
    html[data-theme="dark"] .dbr-page,
    html[data-theme="dark"] .dbr-page .dbr-shell,
    html[data-theme="dark"] .dbr-page .mud-paper,
    .mud-theme-dark .dbr-page,
    .mud-theme-dark .dbr-page .dbr-shell,
    .mud-theme-dark .dbr-page .mud-paper {
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
        border: none !important;
        border-color: transparent !important;
        outline: none !important;
        box-shadow: none !important;
        filter: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        color: #000 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        break-after: auto !important;
        page-break-after: auto !important;
        --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;
        --ps-surface: #fff !important;
        --ps-bg: #fff !important;
        --ps-border: transparent !important;
    }

    html body.ps-app .dbr-page .dbr-datagrid .mud-table,
    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table,
    html[data-theme="dark"] body.ps-app .dbr-page .dbr-datagrid .mud-table,
    .mud-theme-dark body.ps-app .dbr-page .dbr-datagrid .mud-table {
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        outline: none !important;
        overflow: visible !important;
    }

    html body.ps-app .dbr-page [class*="mud-elevation"],
    html body.ps-app .dbr-page .mud-elevation-2,
    html body.ps-app .dbr-page .mud-elevation-3 {
        box-shadow: none !important;
    }

    .dbr-header {
        display: none !important;
    }

    .dbr-print-banner {
        padding-bottom: 4px !important;
        margin-bottom: 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;
    }

    .dbr-print-banner h1 {
        color: #000 !important;
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        margin-bottom: 4px !important;
    }

    .dbr-print-grid {
        color: #000 !important;
        font-size: 0.75rem !important;
    }

    .dbr-print-grid strong {
        font-weight: 700 !important;
    }

    .dbr-page .dbr-grid-paper,
    html body.ps-app .dbr-page .dbr-grid-paper {
        overflow: visible !important;
    }

    .dbr-grid-wrap {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        background: #fff !important;
        background-color: #fff !important;
        overflow: visible !important;
    }

    .dbr-page .dbr-datagrid,
    .dbr-page .dbr-datagrid.general-datagrid-class,
    .dbr-datagrid,
    .dbr-datagrid .mud-data-grid,
    .dbr-datagrid .mud-data-grid-root,
    .dbr-datagrid .mud-table-container,
    .dbr-datagrid .mud-table-wrapper,
    .dbr-datagrid .mud-table-root,
    html[data-theme="dark"] .dbr-page .dbr-datagrid .mud-table-container,
    html[data-theme="dark"] .dbr-page .dbr-datagrid .mud-table-wrapper,
    html[data-theme="dark"] .dbr-page .dbr-datagrid .mud-data-grid-root {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
        min-height: 0 !important;
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table,
    .dbr-datagrid .mud-table {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        border-spacing: 0 !important;
        font-size: 9pt;
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* خطوط جدول مشکی پررنگ — غلبه بر MainStyle / premium-ui / theme-variables */
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table th,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table td,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-cell,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-td,
    html body .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body td,
    html body .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-table-cell,
    html body .ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-td,
    .dbr-datagrid .mud-table th,
    .dbr-datagrid .mud-table td,
    .dbr-datagrid .mud-table-cell,
    .dbr-datagrid .mud-td {
        border: 1px solid #000 !important;
        border-color: #000 !important;
        border-top-color: #000 !important;
        border-bottom-color: #000 !important;
        border-bottom: 1px solid #000 !important;
        border-top: 1px solid #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* جلوگیری از شکست در وسط یک ردیف داده/فوتر/هدر */
    .dbr-datagrid .mud-table-body tr,
    .dbr-datagrid .mud-table-body .mud-table-row,
    .dbr-datagrid .mud-data-grid-footer tr,
    .dbr-datagrid .mud-table-head tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: auto !important;
        break-after: auto !important;
    }

    /* تکرار هدر در صورت شکست صفحه */
    .dbr-datagrid .mud-table-head {
        display: table-header-group !important;
    }

    .dbr-datagrid .mud-table-body {
        display: table-row-group !important;
    }

    .dbr-datagrid .mud-data-grid-footer {
        display: table-footer-group !important;
        position: static !important;
        bottom: auto !important;
    }

    .dbr-datagrid .mud-table-head th:has(.dbr-col-age),
    .dbr-datagrid .mud-table-body td:has(.dbr-col-age),
    .dbr-datagrid .mud-data-grid-footer td:has(.dbr-col-age) {
        min-width: 28mm !important;
        width: 9% !important;
    }

    .dbr-datagrid .mud-table-head th:has(.dbr-header-notes),
    .dbr-datagrid .mud-table-body td:has(.dbr-notes-cell),
    .dbr-datagrid .mud-data-grid-footer td:has(.dbr-notes-cell) {
        min-width: 14mm !important;
        width: 8.5% !important;
    }

    .dbr-datagrid .dbr-notes-cell {
        min-height: 6mm !important;
        padding: 2px 1px !important;
    }

    .dbr-datagrid .mud-data-grid-footer td:has(.dbr-notes-cell) .dbr-notes-cell {
        min-height: 5mm !important;
    }

    /* پایه: همه سلول‌ها — فاصله عمودی بیشتر در چاپ برای خوانایی */
    .dbr-datagrid .mud-table-head .mud-table-cell,
    .dbr-datagrid .mud-table-body .mud-table-cell,
    .dbr-datagrid .mud-data-grid-footer .mud-table-cell,
    .dbr-datagrid .mud-data-grid-footer td {
        padding: 3px 2px !important;
        white-space: normal !important;
        line-height: 1.2 !important;
        background: #fff !important;
        background-color: #fff !important;
        color: #000 !important;
        height: auto !important;
    }

    /* خطوط افقی بدنه چاپ — بعد از padding؛ collapse اجباری */
    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table {
        border-collapse: collapse !important;
        border-spacing: 0 !important;
    }

    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table tbody td:not(:has(.dbr-notes-cell)),
    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table tbody .mud-table-cell:not(:has(.dbr-notes-cell)),
    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body td:not(:has(.dbr-notes-cell)),
    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body .mud-table-cell:not(:has(.dbr-notes-cell)),
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table th,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table td:not(:has(.dbr-notes-cell)),
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-cell:not(:has(.dbr-notes-cell)) {
        border-style: solid !important;
        border-width: 1px !important;
        border-color: #000 !important;
        border-top: 1px solid #000 !important;
        border-bottom: 1px solid #000 !important;
        border-left: 1px solid #000 !important;
        border-right: 1px solid #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* ستون ملاحظات: فقط خطوط عمودی — بدون خط افقی در بدنه و فوتر */
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body td:has(.dbr-notes-cell),
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body .mud-table-cell:has(.dbr-notes-cell),
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td:has(.dbr-notes-cell),
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-table-cell:has(.dbr-notes-cell),
    .dbr-datagrid .mud-table-body td:has(.dbr-notes-cell),
    .dbr-datagrid .mud-table-body .mud-table-cell:has(.dbr-notes-cell),
    .dbr-datagrid .mud-data-grid-footer td:has(.dbr-notes-cell) {
        border-top: none !important;
        border-bottom: none !important;
        box-shadow: none !important;
        border-left: 1px solid #000 !important;
        border-right: 1px solid #000 !important;
    }

    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table tbody tr > td:not(:has(.dbr-notes-cell)),
    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-table .mud-table-body tr > td:not(:has(.dbr-notes-cell)) {
        border: 1px solid #000 !important;
        box-shadow: inset 0 -1px 0 0 #000 !important;
    }

    /* سطرهای داده: ارتفاع و فاصله عمودی بیشتر تا ردیف‌ها تو هم نخورند */
    .dbr-page .dbr-datagrid .mud-table-body .mud-table-cell,
    .dbr-page .dbr-datagrid .mud-table-body td {
        padding: 4px 2px !important;
        line-height: 1.35 !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        vertical-align: middle !important;
        height: auto !important;
        min-height: 8.5mm !important;
    }

    .dbr-page .dbr-datagrid .mud-table-body tr {
        height: auto !important;
        min-height: 8.5mm !important;
    }

    /* بدنه: فقط سلول‌های عددی (+ ستون سن) بزرگ‌تر از سالن/ملاحظات */
    .dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body td:not(:has(.dbr-salon-cell)):not(:has(.dbr-notes-cell)) .mud-typography,
    .dbr-page .dbr-datagrid.general-datagrid-class .mud-table-body td:not(:has(.dbr-salon-cell)):not(:has(.dbr-notes-cell)) .mud-typography-body2 {
        font-size: 10.5pt !important;
        line-height: 1.35 !important;
        margin: 0 !important;
        font-weight: 700 !important;
        font-variant-numeric: tabular-nums !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    .dbr-page .dbr-datagrid .mud-table-body td:has(.dbr-notes-cell) .mud-typography {
        font-size: 6pt !important;
        line-height: 1 !important;
        margin: 0 !important;
        font-variant-numeric: tabular-nums !important;
    }

    .dbr-datagrid .mud-table-body .dbr-salon-cell {
        line-height: 1 !important;
    }

    .dbr-datagrid .mud-table-body .dbr-salon-cell .dbr-salon-name {
        font-size: 7.5pt !important;
        line-height: 1.1 !important;
        margin: 0 !important;
    }

    .dbr-datagrid .mud-table-body .dbr-salon-cell .dbr-salon-pen {
        font-size: 4.6pt !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    .dbr-datagrid .mud-table-body .dbr-salon-cell .dbr-salon-age {
        font-size: 4.6pt !important;
        line-height: 1 !important;
        color: #000 !important;
        margin: 0 !important;
    }

    .dbr-page .dbr-datagrid .mud-table-body .dbr-age-cell .dbr-age-value {
        font-size: 9.5pt !important;
        line-height: 1.2 !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        color: #000 !important;
        margin: 0 !important;
    }

    .dbr-datagrid .mud-table-head .dbr-th-stack {
        min-height: 0 !important;
        padding: 0 1px !important;
        gap: 0 !important;
    }

    .dbr-datagrid .mud-table-head tr,
    .dbr-datagrid .mud-table-head .mud-table-row {
        height: auto !important;
        min-height: 8mm !important;
    }

    /* چاپ: حفظ رنگ گروه هدر */
    .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--female) {
        background-color: #00897b !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--male) {
        background-color: #1565c0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--meta),
    .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-header-notes) {
        background-color: #546e7a !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-hatch) {
        background-color: #2e7d32 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-cons) {
        background-color: #ef6c00 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-waste) {
        background-color: #c62828 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-total),
    .dbr-datagrid.dbr-datagrid-colored .mud-table-head th:has(.dbr-th-sub--egg-pct) {
        background-color: #455a64 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .dbr-datagrid.dbr-datagrid-colored .mud-table-head .dbr-th-group {
        border-bottom: 1px solid rgba(255, 255, 255, 0.4) !important;
        color: #fff !important;
        font-size: 4.8pt !important;
        padding-bottom: 1px !important;
        margin-bottom: 0 !important;
        line-height: 1.18 !important;
    }

    .dbr-datagrid.dbr-datagrid-colored .mud-table-head .dbr-th-sub {
        color: #fff !important;
        font-size: 5.4pt !important;
        line-height: 1.18 !important;
    }

    .dbr-datagrid.dbr-datagrid-colored .mud-table-head .mud-table-cell,
    .dbr-datagrid.dbr-datagrid-colored .mud-table-head .mud-table-cell * {
        color: #fff !important;
    }

    .dbr-datagrid:not(.dbr-datagrid-colored) .mud-table-head .dbr-th-group {
        border-bottom: 1px solid #000 !important;
        color: #000 !important;
        font-size: 4.8pt !important;
        padding-bottom: 1px !important;
        margin-bottom: 0 !important;
        line-height: 1.18 !important;
    }

    .dbr-datagrid:not(.dbr-datagrid-colored) .mud-table-head .dbr-th-sub {
        color: #000 !important;
        font-size: 5.4pt !important;
        line-height: 1.18 !important;
    }

    .dbr-datagrid .dbr-salon-cell .dbr-salon-pen {
        margin-top: 0 !important;
        line-height: 1.1 !important;
    }

    .dbr-datagrid .mud-table-body .mud-table-row,
    .dbr-datagrid .mud-table-body tr {
        background: #fff !important;
        background-color: #fff !important;
    }

    .dbr-datagrid .mud-data-grid-footer,
    .dbr-datagrid .mud-data-grid-footer tr,
    .dbr-datagrid .mud-data-grid-footer td {
        background: #fff !important;
        background-color: #fff !important;
        color: #000 !important;
    }

    .dbr-datagrid .mud-table-cell.sticky-right,
    .dbr-datagrid th.mud-table-cell.sticky-right,
    .dbr-datagrid td.mud-table-cell.sticky-right {
        position: static !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    .dbr-datagrid .mud-table-body .mud-typography {
        color: #000 !important;
    }

    /*
     * ردیف جمع چاپ: همان اندازهٔ اعداد بدنه (۱۰٫۵pt)، متن مشکی، ارتفاع سطر مانند داده.
     */
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer tr {
        height: auto !important;
        min-height: 8mm !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-table-cell,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td {
        font-size: 10.5pt !important;
        line-height: 1.25 !important;
        padding: 4px 2px !important;
        vertical-align: middle !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        height: auto !important;
        min-height: 8mm !important;
        font-weight: 700 !important;
        color: #000 !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td:has(.dbr-footer-transfer-stack) {
        overflow: visible !important;
        height: auto !important;
        min-height: 12mm !important;
        vertical-align: middle !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-wrap {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
        line-height: 1 !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td:not(:has(.dbr-footer-transfer-stack)) .dbr-footer-wrap {
        white-space: nowrap !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-wrap--ltr {
        white-space: nowrap !important;
        direction: ltr !important;
        unicode-bidi: embed !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-transfer-stack {
        gap: 0 !important;
        line-height: 1 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: normal !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-transfer-stack .dbr-ft-line {
        font-size: 10.5pt !important;
        line-height: 1.1 !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        color: #000 !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography-caption,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td .mud-typography,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td .mud-typography-caption,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-num {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        font-size: 10.5pt !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: -0.02em !important;
        font-variant-numeric: tabular-nums !important;
        max-width: 100% !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-wrap--label .dbr-footer-num {
        color: #000 !important;
        font-weight: 700 !important;
    }

    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td *,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography *,
    html body .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography-caption * {
        font-size: inherit !important;
        line-height: inherit !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    /*
     * چاپ tfoot: همان ۱۰٫۵pt و مشکی هم‌راستا با بدنهٔ جدول.
     */
    html body .dbr-page .mud-table > tfoot > tr {
        height: auto !important;
        min-height: 8mm !important;
    }

    html body .dbr-page .mud-table > tfoot > tr > th,
    html body .dbr-page .mud-table > tfoot > tr > td,
    html body .dbr-page .mud-table tfoot .mud-table-cell {
        font-size: 10.5pt !important;
        line-height: 1.25 !important;
        padding: 4px 2px !important;
        margin: 0 !important;
        vertical-align: middle !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        height: auto !important;
        min-height: 8mm !important;
        font-weight: 700 !important;
        color: #000 !important;
    }

    html body .dbr-page .mud-table > tfoot > tr > td:has(.dbr-footer-transfer-stack) {
        overflow: visible !important;
        height: auto !important;
        min-height: 12mm !important;
        vertical-align: middle !important;
    }

    html body .dbr-page .mud-table tfoot .dbr-footer-wrap {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
        line-height: 1 !important;
    }

    html body .dbr-page .mud-table tfoot td:not(:has(.dbr-footer-transfer-stack)) .dbr-footer-wrap {
        white-space: nowrap !important;
    }

    html body .dbr-page .mud-table tfoot .dbr-footer-wrap--ltr {
        white-space: nowrap !important;
        direction: ltr !important;
        unicode-bidi: embed !important;
    }

    html body .dbr-page .mud-table tfoot .dbr-footer-transfer-stack {
        gap: 0 !important;
        line-height: 1 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: normal !important;
    }

    html body .dbr-page .mud-table tfoot .dbr-footer-transfer-stack .dbr-ft-line {
        font-size: 10.5pt !important;
        line-height: 1.1 !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        color: #000 !important;
    }

    html body .dbr-page .mud-table tfoot .mud-typography,
    html body .dbr-page .mud-table tfoot .mud-typography-caption,
    html body .dbr-page .mud-table tfoot .mud-typography-body2,
    html body .dbr-page .mud-table tfoot .dbr-footer-num {
        color: #000 !important;
        font-size: 10.5pt !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: -0.02em !important;
        font-variant-numeric: tabular-nums !important;
        max-width: 100% !important;
    }

    html body .dbr-page .mud-table tfoot .dbr-footer-wrap--label .dbr-footer-num {
        color: #000 !important;
        font-weight: 700 !important;
    }

    /*
     * تم تاریک: در چاپ، ردیف جمع نباید رنگ روشن پالت Mud بگیرد (غلبه بر سلکتورهای .mud-theme-dark / تم).
     */
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer tr,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer th,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-table-cell,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography-caption,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography-body2,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-num,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-wrap,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td *,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography *,
    html[data-theme="dark"] .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography-caption * {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    html[data-theme="dark"] .dbr-page .mud-table > tfoot > tr > th,
    html[data-theme="dark"] .dbr-page .mud-table > tfoot > tr > td,
    html[data-theme="dark"] .dbr-page .mud-table tfoot .mud-table-cell,
    html[data-theme="dark"] .dbr-page .mud-table tfoot .mud-typography,
    html[data-theme="dark"] .dbr-page .mud-table tfoot .mud-typography-caption,
    html[data-theme="dark"] .dbr-page .mud-table tfoot .mud-typography-body2,
    html[data-theme="dark"] .dbr-page .mud-table tfoot .dbr-footer-num,
    html[data-theme="dark"] .dbr-page .mud-table tfoot * {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    .mud-theme-dark .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer,
    .mud-theme-dark .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer tr,
    .mud-theme-dark .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td,
    .mud-theme-dark .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-table-cell,
    .mud-theme-dark .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography,
    .mud-theme-dark .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography-caption,
    .mud-theme-dark .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography-body2,
    .mud-theme-dark .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .dbr-footer-num,
    .mud-theme-dark .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td *,
    .mud-theme-dark .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-typography * {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    .mud-theme-dark .dbr-page .mud-table > tfoot > tr > th,
    .mud-theme-dark .dbr-page .mud-table > tfoot > tr > td,
    .mud-theme-dark .dbr-page .mud-table tfoot .mud-table-cell,
    .mud-theme-dark .dbr-page .mud-table tfoot .mud-typography,
    .mud-theme-dark .dbr-page .mud-table tfoot * {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    .dbr-h-full {
        display: none !important;
    }

    .dbr-h-short {
        display: inline !important;
    }

    .dbr-meta {
        display: none !important;
    }

    .dbr-summary-card .mud-icon-root {
        display: none !important;
    }

    .dbr-print-footer {
        display: none !important;
    }
}

/*
 * شبکه خطوط DBR — Mud خودش خط افقی را با border-bottom روی .mud-table-cell می‌دهد.
 * MainStyle (border-collapse:separate + spacing) و premium-ui باید override شوند.
 */
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined.general-datagrid-class .mud-table,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-root,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-cell,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-head th,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-head .mud-table-cell,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-body td,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-body .mud-table-cell,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-data-grid-footer td,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-data-grid-footer .mud-table-cell,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-root > .mud-table-body:last-child > .mud-table-row:last-child > .mud-table-cell {
    border-bottom: 1px solid #000 !important;
    border-right: 1px solid #000 !important;
    border-left: 1px solid #000 !important;
    border-top: 1px solid #000 !important;
    border-color: #000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

/* MainStyle: border:none روی th هدر */
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined.general-datagrid-class .mud-table-head th {
    border: 1px solid #000 !important;
    border-color: #000 !important;
}

/* premium-ui: border-bottom کم‌رنگ روی tbody */
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table tbody td,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table .mud-table-body .mud-table-cell {
    border-bottom: 1px solid #000 !important;
    border-color: #000 !important;
}

/* ستون ملاحظات: بدون خط افقی */
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-cell.dbr-td-notes,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-cell.dbr-th-notes,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined th.dbr-th-notes,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined td.dbr-td-notes {
    border-top: none !important;
    border-bottom: none !important;
    border-left: 1px solid #000 !important;
    border-right: 1px solid #000 !important;
}

/* مدل جدول واقعی روی table.mud-table-root + خطوط با box-shadow (قطعی) */
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined.general-datagrid-class,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined.general-datagrid-class .mud-data-grid,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined.general-datagrid-class .mud-data-grid-root,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined.general-datagrid-class .mud-table-container,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined.general-datagrid-class .mud-table-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined table.mud-table-root {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-head {
    display: table-header-group !important;
}

html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-body {
    display: table-row-group !important;
}

html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-data-grid-footer {
    display: table-footer-group !important;
}

html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-row {
    display: table-row !important;
}

html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-cell,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined .mud-table-head th {
    display: table-cell !important;
}

html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined table.mud-table-root .mud-table-body .mud-table-cell:not(.dbr-td-notes),
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined table.mud-table-root .mud-data-grid-footer .mud-table-cell:not(.dbr-td-notes) {
    border-bottom: 1px solid #000 !important;
    border-right: 1px solid #000 !important;
    box-shadow: inset 0 -1px 0 0 #000 !important;
}

html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined table.mud-table-root .mud-table-cell.dbr-td-notes,
html body.ps-app .dbr-page .dbr-datagrid.dbr-grid-lined table.mud-table-root th.dbr-th-notes {
    border-top: none !important;
    border-bottom: none !important;
    border-right: 1px solid #000 !important;
    border-left: 1px solid #000 !important;
    box-shadow: none !important;
}

.dbr-print-banner {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--mud-palette-primary);
}

.dbr-print-banner h1 {
    margin: 0 0 6px 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--mud-palette-primary);
}

.dbr-print-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px 12px;
    font-size: 0.82rem;
}

/* ═══ اعداد بزرگ — غلبه نهایی بر premium-ui / Mud (فقط نمایش) ═══ */
@media screen {
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body td:not(:has(.dbr-salon-cell)):not(:has(.dbr-notes-cell)) .mud-typography,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body td:not(:has(.dbr-salon-cell)):not(:has(.dbr-notes-cell)) .mud-typography-body2,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .dbr-age-cell .dbr-age-value,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .dbr-footer-num,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .mud-typography-caption.dbr-footer-num,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .dbr-footer-transfer-stack .dbr-ft-line {
        font-size: 1.25rem !important;
        font-weight: 700 !important;
        font-variant-numeric: tabular-nums !important;
        color: var(--mud-palette-text-primary) !important;
    }

    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .dbr-age-cell .dbr-age-value {
        font-size: 1.15rem !important;
    }
}

/* ═══ چاپ: اعداد و متن بدنه/فوتر همیشه مشکی (تم تاریک) ═══ */
@media print {
    html body.ps-app .dbr-page .dbr-datagrid,
    html[data-theme="dark"] body.ps-app .dbr-page .dbr-datagrid,
    .mud-theme-dark body.ps-app .dbr-page .dbr-datagrid {
        --mud-palette-text-primary: rgba(0, 0, 0, 0.87) !important;
        --mud-palette-text-secondary: rgba(0, 0, 0, 0.6) !important;
    }

    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .mud-table-cell,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body td,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .mud-typography,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .mud-typography *,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body td:not(:has(.dbr-salon-cell)):not(:has(.dbr-notes-cell)) .mud-typography,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body td:not(:has(.dbr-salon-cell)):not(:has(.dbr-notes-cell)) .mud-typography-body2,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .dbr-age-cell .dbr-age-value,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .dbr-salon-cell .dbr-salon-name,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .dbr-salon-pen,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .dbr-salon-age,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .mud-table-cell,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer td,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .mud-typography,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .mud-typography *,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .dbr-footer-num,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .mud-typography-caption,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .mud-typography-caption.dbr-footer-num,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .dbr-footer-transfer-stack .dbr-ft-line,
    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td,
    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-table-cell,
    html[data-theme="dark"] body.ps-app .dbr-page .dbr-datagrid .mud-table-body .mud-table-cell,
    html[data-theme="dark"] body.ps-app .dbr-page .dbr-datagrid .mud-table-body td,
    html[data-theme="dark"] body.ps-app .dbr-page .dbr-datagrid .mud-table-body .mud-typography,
    html[data-theme="dark"] body.ps-app .dbr-page .dbr-datagrid .mud-table-body .mud-typography *,
    .mud-theme-dark body.ps-app .dbr-page .dbr-datagrid .mud-table-body .mud-table-cell,
    .mud-theme-dark body.ps-app .dbr-page .dbr-datagrid .mud-table-body .mud-typography,
    .mud-theme-dark body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .mud-typography,
    .mud-theme-dark body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .dbr-footer-num {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body td:not(:has(.dbr-salon-cell)):not(:has(.dbr-notes-cell)) .mud-typography,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body td:not(:has(.dbr-salon-cell)):not(:has(.dbr-notes-cell)) .mud-typography-body2,
    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .dbr-age-cell .dbr-age-value,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .dbr-footer-num,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .mud-typography-caption,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .mud-typography-caption.dbr-footer-num,
    html body.ps-app .dbr-page .dbr-datagrid .mud-data-grid-footer .dbr-footer-transfer-stack .dbr-ft-line,
    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer td,
    html body.ps-app .dbr-page .dbr-datagrid.general-datagrid-class .mud-data-grid-footer .mud-table-cell {
        font-size: 10.5pt !important;
        font-weight: 700 !important;
        font-variant-numeric: tabular-nums !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    html body.ps-app .dbr-page .dbr-datagrid .mud-table-body .dbr-age-cell .dbr-age-value {
        font-size: 9.5pt !important;
    }
}

/* ═══ UI فشرده + راهنمای هفته (فاز پرورش) ═══ */
.dbr-page .dbr-header-compact.rpt-header {
    padding: 10px 14px !important;
    margin-bottom: 8px !important;
    border-radius: 12px !important;
}

.dbr-page .dbr-header-compact .page-title,
.dbr-page .dbr-header-compact .rpt-header-title {
    font-size: 1rem !important;
    font-weight: 800 !important;
}

.dbr-page .dbr-header-compact .rpt-header-sub {
    font-size: 0.72rem !important;
    opacity: 0.9;
}

.dbr-filter-compact {
    border-radius: 12px !important;
    background: color-mix(in srgb, var(--mud-palette-success) 7%, var(--mud-palette-surface)) !important;
    border: 1px solid color-mix(in srgb, var(--mud-palette-success) 18%, var(--mud-palette-lines-default)) !important;
}

.dbr-selection-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 0.78rem;
    line-height: 1.4;
}

.dbr-selection-inline__label {
    color: var(--mud-palette-text-secondary);
    font-weight: 600;
}

.dbr-selection-inline__value {
    color: var(--mud-palette-primary);
    font-weight: 700;
}

.dbr-selection-inline__sep {
    color: var(--mud-palette-text-disabled);
    opacity: 0.7;
}

.dbr-page .swr-week-date-panel {
    padding: 4px 6px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--mud-palette-primary) 5%, var(--mud-palette-surface));
    border: 1px dashed color-mix(in srgb, var(--mud-palette-primary) 20%, var(--mud-palette-lines-default));
}

.dbr-age-guide-label {
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
}

.dbr-kpi-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--mud-palette-lines-default) 65%, transparent);
    background: color-mix(in srgb, var(--mud-palette-surface) 94%, var(--mud-palette-success) 6%);
}

.dbr-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    white-space: nowrap;
    background: var(--mud-palette-surface);
    border-inline-start: 3px solid var(--mud-palette-lines-default);
}

.dbr-kpi-chip--meta {
    border-inline-start-color: var(--mud-palette-primary);
    font-weight: 600;
    font-size: 0.74rem;
}

.dbr-kpi-chip.dbr-kpi--opening { border-inline-start-color: var(--mud-palette-success); }
.dbr-kpi-chip.dbr-kpi--mortal { border-inline-start-color: var(--mud-palette-warning); }
.dbr-kpi-chip.dbr-kpi--feed { border-inline-start-color: var(--mud-palette-info); }
.dbr-kpi-chip.dbr-kpi--close { border-inline-start-color: var(--mud-palette-secondary); }

.dbr-page .dbr-table-scroll-host {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-height: min(62vh, calc(100dvh - 13rem));
    height: calc(100dvh - 13rem);
    max-height: calc(100dvh - 13rem);
    border-radius: 12px;
}

.dbr-page .dbr-table-scroll-host .dbr-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: 100% !important;
    max-height: 100% !important;
}

.dbr-page .dbr-table-scroll-host .dbr-datagrid .mud-table-container,
.dbr-page .dbr-table-scroll-host .dbr-datagrid .mud-table-wrapper {
    max-height: 100% !important;
}

@media (max-width: 768px) {
    .dbr-page .dbr-table-scroll-host {
        display: block !important;
        overflow: auto !important;
        overflow-x: scroll !important;
        -webkit-overflow-scrolling: touch;
        min-height: min(50vh, calc(100dvh - 16rem));
        height: calc(100dvh - 16rem);
        max-height: calc(100dvh - 16rem);
    }

    .dbr-page .dbr-table-scroll-host .dbr-grid-wrap {
        display: block !important;
        overflow: visible !important;
        height: auto !important;
        min-height: 0 !important;
        width: max-content !important;
        min-width: 100% !important;
    }

    .dbr-page .dbr-datagrid .mud-table-cell.sticky-right,
    .dbr-page .dbr-datagrid .mud-table-head .mud-table-cell.sticky-right,
    .dbr-page .dbr-datagrid .mud-table-body .mud-table-cell.sticky-right,
    .dbr-page .dbr-datagrid .mud-table-foot .mud-table-cell.sticky-right {
        position: sticky !important;
        right: 0 !important;
        z-index: 3 !important;
        background: var(--mud-palette-surface) !important;
        box-shadow: -2px 0 4px color-mix(in srgb, var(--mud-palette-text-primary) 8%, transparent);
    }

    .dbr-page .dbr-datagrid .mud-table-head .mud-table-cell.sticky-right {
        top: 0 !important;
        z-index: 8 !important;
        background: color-mix(in srgb, var(--mud-palette-primary) 12%, var(--mud-palette-surface)) !important;
    }
}

@media (min-width: 769px) {
    .dbr-page .dbr-table-scroll-host .dbr-grid-wrap {
        overflow: hidden;
    }

    .dbr-page .dbr-table-scroll-host .dbr-datagrid .mud-table-container {
        overflow: auto !important;
        max-height: 100% !important;
    }
}

.dbr-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

/* رویدادهای فارم — نمایش صفحه (زیر جدول، جدا از چاپ) */
.dbr-page .dbr-farm-events {
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 22%, var(--mud-palette-lines-default));
    border-radius: 12px;
    background: var(--mud-palette-surface);
}

.dbr-page .dbr-farm-events__count {
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.dbr-page .dbr-farm-events__empty {
    color: var(--mud-palette-text-secondary);
    padding: 8px 4px 4px;
}

.dbr-page .dbr-farm-events__list {
    max-width: 100%;
}

.dbr-page .dbr-farm-events__item {
    border-radius: 10px !important;
    background: color-mix(in srgb, var(--mud-palette-background) 35%, var(--mud-palette-surface)) !important;
}

.dbr-page .dbr-farm-events__item--urgent {
    border-color: color-mix(in srgb, var(--mud-palette-error) 55%, var(--mud-palette-lines-default)) !important;
    background: color-mix(in srgb, var(--mud-palette-error) 6%, var(--mud-palette-surface)) !important;
}

.dbr-page .dbr-farm-events__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 6px;
}

.dbr-page .dbr-farm-events__meta strong {
    color: var(--mud-palette-text-primary);
}

.dbr-page .dbr-farm-events__block {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed color-mix(in srgb, var(--mud-palette-lines-default) 80%, transparent);
}

.dbr-page .dbr-farm-events__followup {
    background: color-mix(in srgb, var(--mud-palette-info) 8%, transparent);
    border-radius: 8px;
    padding: 8px;
    border-top: none;
}

.dbr-page .dbr-farm-events__text {
    white-space: pre-wrap;
    line-height: 1.55;
    text-align: justify;
}

.dbr-page .dbr-farm-events__date {
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

