﻿/*
 * Shared visual contract for page-level data tables.
 * Local table styles may define column widths, sticky behavior and row states,
 * but typography, spacing and base row geometry belong here.
 */
.fg-table.mud-table {
    --fg-table-body-color: #5d748a;
    --fg-table-body-font-size: 14px;
    --fg-table-cell-padding-inline: 6px;
    --fg-table-header-color: #542a80;
    --fg-table-header-font-size: 13px;
    --fg-table-row-background: #ffffff;
    --fg-table-row-gap: 5px;
    --fg-table-row-height: 30px;
    --fg-table-row-hover-background: #faf8fc;
    --fg-table-row-radius: 10px;
    background-color: var(--mud-palette-background);
    margin: 0;
    padding: 0;
}

.fg-table-host {
    min-width: 0;
    width: 100%;
}

.fg-table .mud-table-root {
    border-collapse: separate;
    border-spacing: 0 var(--fg-table-row-gap);
}

.fg-table.fg-table-resizable .mud-table-root {
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
}

.fg-table-resizable .mud-table-root {
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
}

.fg-table.mud-elevation-0 {
    box-shadow: none;
}

.fg-table .mud-table-head {
    background-color: var(--mud-palette-background);
}

.fg-table .mud-table-head th.mud-table-cell {
    font-family: 'Inter', sans-serif;
    color: var(--fg-table-header-color);
    font-weight: 600;
    font-size: var(--fg-table-header-font-size);
    line-height: 1;
    text-align: center !important;
    vertical-align: middle;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
}

.fg-table .mud-table-body .mud-table-cell {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: var(--fg-table-body-font-size);
    line-height: 1;
    color: var(--fg-table-body-color);
    min-height: var(--fg-table-row-height);
    text-align: center !important;
    vertical-align: middle;
}

.fg-table .mud-table-head .mud-table-cell,
.fg-table .mud-table-body .mud-table-cell,
.fg-table .mud-table-footer .mud-table-cell {
    text-align: center !important;
    vertical-align: middle !important;
}

.fg-table .fg-table-photo-strip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.fg-table .fg-table-photo-strip-nowrap {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.fg-table .fg-table-photo-strip .lazy-image-container {
    flex: 0 0 var(--fg-table-photo-size, 48px);
    width: var(--fg-table-photo-size, 48px);
    height: var(--fg-table-photo-size, 48px);
}

.fg-table .mud-table-head th.mud-table-cell:first-child {
    position: sticky;
    left: 0;
    z-index: 7;
    background: var(--mud-palette-background);
}

.fg-table .fg-table-header-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center !important;
    height: var(--fg-table-row-height);
    min-height: 100%;
    text-align: center !important;
}

.fg-table-resizable .mud-table-head th.mud-table-cell {
    position: relative;
}

.fg-table .fg-column-resizer {
    position: absolute;
    top: -8px;
    right: -12px;
    width: 24px;
    height: calc(100% + 16px);
    cursor: col-resize;
    z-index: 7;
    touch-action: none;
    user-select: none;
}

.fg-table-resizable .fg-column-resizer {
    position: absolute;
    top: -8px;
    right: -12px;
    width: 24px;
    height: calc(100% + 16px);
    cursor: col-resize;
    z-index: 7;
    touch-action: none;
    user-select: none;
}

.fg-table .mud-table-head th:last-child .fg-column-resizer,
.fg-table-resizable .mud-table-head th:last-child .fg-column-resizer {
    right: 0;
    width: 12px;
}

body.fg-table-is-resizing {
    cursor: col-resize;
    user-select: none;
}

.fg-table .fg-column-resizer::after {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background-color: transparent;
    transition: background-color .15s ease;
}

.fg-table-resizable .fg-column-resizer::after {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background-color: transparent;
    transition: background-color .15s ease;
}

.fg-table .mud-table-head th:last-child .fg-column-resizer::after,
.fg-table-resizable .mud-table-head th:last-child .fg-column-resizer::after {
    left: auto;
    right: 0;
    transform: none;
}

.fg-table .mud-table-cell:hover .fg-column-resizer::after,
body.fg-table-is-resizing .fg-column-resizer::after {
    background-color: var(--mud-palette-secondary);
}

.fg-table-resizable .mud-table-cell:hover .fg-column-resizer::after,
body.fg-table-is-resizing .fg-table-resizable .fg-column-resizer::after {
    background-color: var(--mud-palette-secondary);
}

.fg-table .mud-table-body .mud-table-row {
    --fg-table-row-bg: var(--fg-table-row-background);
    --fg-table-row-hover-bg: var(--fg-table-row-hover-background);
    background: var(--fg-table-row-bg) !important;
    background-color: var(--fg-table-row-bg) !important;
    height: var(--fg-table-row-height);
}

.fg-table .mud-table-body .mud-table-row:hover {
    background: var(--fg-table-row-hover-bg) !important;
    background-color: var(--fg-table-row-hover-bg) !important;
}

.fg-table .mud-table-body .mud-table-row.fg-table-row-assigned {
    --fg-table-row-bg: #f1eef7;
    --fg-table-row-hover-bg: #f1eef7;
}

.fg-table .mud-table-body .mud-table-row.fg-table-row-selected {
    --fg-table-row-bg: #ede6f5;
    --fg-table-row-hover-bg: #ede6f5;
}

.fg-table .mud-table-body .mud-table-row .mud-table-cell {
    background: var(--fg-table-row-bg) !important;
    background-color: var(--fg-table-row-bg) !important;
    background-clip: padding-box;
}

.fg-table .mud-table-body .mud-table-row:hover .mud-table-cell {
    background: var(--fg-table-row-hover-bg) !important;
    background-color: var(--fg-table-row-hover-bg) !important;
}

.fg-table .mud-table-body .mud-table-cell:first-child {
    border-top-left-radius: var(--fg-table-row-radius);
    border-bottom-left-radius: var(--fg-table-row-radius);
    background: var(--fg-table-row-bg) !important;
    background-color: var(--fg-table-row-bg) !important;
}

.container-block-link {
    border-top-left-radius: var(--fg-table-row-radius, 10px);
    border-bottom-left-radius: var(--fg-table-row-radius, 10px);
    background: var(--fg-table-row-bg, #fff);
    background-color: var(--fg-table-row-bg, #fff);
    width: 100%;
    height: var(--fg-table-row-height, 30px);
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.fg-table .mud-table-body tr:hover .container-block-link {
    background: var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
    background-color: var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
}

.fg-table .mud-table-body .mud-table-cell:last-child {
    border-top-right-radius: var(--fg-table-row-radius);
    border-bottom-right-radius: var(--fg-table-row-radius);
    background: var(--fg-table-row-bg) !important;
    background-color: var(--fg-table-row-bg) !important;
}

.fg-table .mud-table-body .mud-table-row:hover .mud-table-cell:first-child,
.fg-table .mud-table-body .mud-table-row:hover .mud-table-cell:last-child {
    background: var(--fg-table-row-hover-bg) !important;
    background-color: var(--fg-table-row-hover-bg) !important;
}

.container-block-link-right {
    border-top-right-radius: var(--fg-table-row-radius, 10px);
    border-bottom-right-radius: var(--fg-table-row-radius, 10px);
    background: var(--fg-table-row-bg, #fff);
    background-color: var(--fg-table-row-bg, #fff);
    width: 100%;
    height: var(--fg-table-row-height, 30px);
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.fg-table .mud-table-body tr:hover .container-block-link-right {
    background: var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
    background-color: var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
}

.fg-table .mud-table-cell {
    border-bottom: none;
    padding: 0;
}

.fg-table .mud-table-head .mud-table-cell {
    height: var(--fg-table-row-height);
    padding-block: 0 !important;
    padding-inline: var(--fg-table-cell-padding-inline) !important;
}

.fg-table .mud-table-body .mud-table-cell {
    height: var(--fg-table-row-height);
    padding-block: 0 !important;
    padding-inline: var(--fg-table-cell-padding-inline) !important;
}

.mud-table-dense * .mud-table-row .mud-table-cell {
    padding: 0;
}

.fg-table .mud-table-body .mud-table-cell:not(:has(button.mud-icon-button)) {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.fg-table .mud-table-body .mud-table-cell:not(:has(button.mud-icon-button)) > * {
    max-width: 100%;
    /*overflow: hidden;*/
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1;
    align-items: center;
    text-align: center !important;
}

.fg-table .mud-table-cell > *,
.fg-table .mud-table-cell .mud-typography,
.fg-table .mud-table-cell .mud-link {
    text-align: center !important;
}

.fg-table .mud-table-head .mud-table-sort-label,
.fg-table .mud-table-head .mud-table-sort-label-container {
    justify-content: center !important;
    text-align: center !important;
}

.fg-table .mud-pagination-item.mud-pagination-item-selected button {
    background-color: var(--mud-palette-background);
}

.fg-table .mud-pagination-item.mud-pagination-item-selected button,
.fg-table .mud-pagination-item button:not(:disabled),
.fg-table .mud-table-body button:not(.mud-button-filled):hover,
.fg-table .mud-table-head button:not(.mud-button-filled):hover {
    color: var(--mud-palette-secondary);
    fill: var(--mud-palette-secondary);
}

.fg-table .mud-table-body button:not(.mud-button-filled):hover,
.fg-table .mud-table-head button:not(.mud-button-filled):hover {
    background-color: initial;
}

.fg-table .mud-table-body button:not(.mud-button-filled),
.fg-table .mud-table-head button:not(.mud-button-filled) {
    color: var(--mud-palette-text-primary);
}

.fg-table .mud-pagination-item:not(.mud-pagination-item-selected):not(:last-child):not(:first-child) button {
    color: var(--mud-palette-action-disabled);
}

/* UIAUDIT-6: !important обоснован — скрытие MudBlazor underline pseudo-elements */
.fg-table .mud-table-pagination .mud-select .mud-input.mud-input-underline:before,
.fg-table .mud-table-pagination .mud-select .mud-input.mud-input-underline:after {
    display: none !important;
}

.fg-table .mud-table-pagination .mud-select .mud-input-slot {
    color: var(--mud-palette-text-secondary);
    padding-left: 16px;
}

.fg-pagi-select {
    box-shadow: none !important;
    border: 1px solid var(--mud-palette-text-secondary);
}

.fg-pagi-select .mud-list-item:hover {
    color: var(--mud-palette-secondary);
}

.fg-pagi-select .mud-selected-item:not(:hover) {
    background-color: var(--mud-palette-surface) !important;
}

.fg-table .mud-table-row {
    /* height: 60px; */
}

.fg-table .mud-table-head .mud-table-row:has(div[role="progressbar"].mud-table-loading-progress) {
    display: none;
}

.fg-table .mud-table-cell:has(button.mud-icon-button) {
    justify-items: end;
}

.fg-table .mud-table-head .mud-table-cell:first-child .mud-checkbox,
.fg-table .mud-table-body .mud-table-cell:first-child .mud-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.fg-table .mud-checkbox .mud-button-root,
.fg-table .mud-checkbox .mud-icon-button {
    width: 23px;
    min-width: 23px;
    height: 23px;
    min-height: 23px;
    padding: 0;
}

.fg-table .mud-checkbox .mud-icon-root,
.fg-table .mud-checkbox svg {
    width: 23px;
    height: 23px;
}

.fg-table .fg-table-actions-cell {
    text-align: center;
}

.fg-table .mud-table-body .fg-table-actions-cell {
    pointer-events: none;
}

.fg-table .fg-table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: var(--fg-table-row-height);
    height: var(--fg-table-row-height);
    width: 100%;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: visible;
    pointer-events: auto;
}

.fg-table .fg-table-actions button.mud-button-root:not(.mud-icon-button) {
    flex: 0 0 auto;
    white-space: nowrap;
    word-break: keep-all;
}

.fg-table .fg-table-status-button {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    height: var(--fg-table-row-height);
    min-height: var(--fg-table-row-height);
    padding: 0 12px;
    white-space: nowrap;
}

.fg-table-link-button,
.loading-schedule-details-link {
    width: fit-content;
    border: 0;
    background: transparent;
    color: #a879dd;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
    text-decoration: underline;
    white-space: nowrap;
}

.fg-table-link-button:hover,
.fg-table-link-button:focus-visible,
.loading-schedule-details-link:hover,
.loading-schedule-details-link:focus-visible {
    color: #5a2d83;
    outline: none;
}

.fg-table-oc-number-button {
    color: #5a2d83;
    font-weight: 700;
    text-decoration: none;
}

.fg-table-oc-number-button:not(:disabled):hover,
.fg-table-oc-number-button:not(:disabled):focus-visible {
    color: #a879dd;
    text-decoration: underline;
}

.loading-schedule-id {
    color: #5a2d83;
    font-weight: 700;
}

.loading-schedule-color-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--route-color);
    vertical-align: middle;
}

.fg-table .fg-table-actions .mud-icon-button {
    flex: 0 0 auto;
    width: var(--fg-table-row-height);
    height: var(--fg-table-row-height);
    min-width: var(--fg-table-row-height);
    min-height: var(--fg-table-row-height);
    padding: 4px;
    color: var(--mud-palette-dark) !important;
}

/* Overrides enforced icon color when Mud disables the button (e.g. Task Box QR). */
.fg-table .fg-table-actions .mud-icon-button:disabled,
.fg-table .fg-table-actions .mud-icon-button.mud-disabled {
    color: var(--mud-palette-action-disabled) !important;
}

.mud-table .mud-table-body .mud-icon-button {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 4px;
    color: var(--mud-palette-dark) !important;
}

.mud-table .mud-table-body .mud-icon-button:disabled,
.mud-table .mud-table-body .mud-icon-button.mud-disabled {
    color: var(--mud-palette-action-disabled) !important;
}

.fg-table .fg-table-pager {
    gap: 12px;
    min-height: 40px;
}

.fg-table .fg-table-pager .mud-pagination {
    min-height: 40px;
}

.fg-table .fg-table-pager .mud-input-control {
    margin-top: 0;
}

.fg-table .fg-table-pager .mud-select {
    min-width: 132px;
}

.fg-table.mud-table-sticky-header * .mud-table-root .mud-table-head * .mud-table-cell {
    background-color: var(--mud-palette-background);
}

.fg-table .mud-table-container {
    max-height: unset;
    overflow-y: unset;
    overflow-x: hidden;
    scrollbar-width: none;
}

.fg-table.fg-table-has-overflow-x .mud-table-container {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(84, 42, 128, 0.35) transparent;
}

.fg-table.fg-table-has-overflow-x .mud-table-root {
    width: max-content;
    min-width: 100%;
}

.fg-overflow-x-managed {
    overflow-x: hidden !important;
    scrollbar-width: none !important;
}

.fg-overflow-x-managed.fg-overflow-x-active {
    overflow-x: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(84, 42, 128, 0.35) transparent !important;
}

.fg-table .mud-table-container::-webkit-scrollbar {
    width: 4px;
    height: 0;
}

.fg-table.fg-table-has-overflow-x .mud-table-container::-webkit-scrollbar {
    height: 4px;
}

.fg-overflow-x-managed::-webkit-scrollbar {
    width: 4px;
    height: 0;
}

.fg-overflow-x-managed.fg-overflow-x-active::-webkit-scrollbar {
    height: 4px;
}

.fg-table .mud-table-container::-webkit-scrollbar-track {
    background: transparent;
}

.fg-overflow-x-managed::-webkit-scrollbar-track {
    background: transparent;
}

.fg-table .mud-table-container::-webkit-scrollbar-thumb {
    background-color: rgba(84, 42, 128, 0.35);
    border-radius: 999px;
}

.fg-overflow-x-managed::-webkit-scrollbar-thumb {
    background-color: rgba(84, 42, 128, 0.35);
    border-radius: 999px;
}

.fg-table .mud-table-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(84, 42, 128, 0.5);
}

.fg-overflow-x-managed::-webkit-scrollbar-thumb:hover {
    background-color: rgba(84, 42, 128, 0.5);
}

.fg-table td:last-child,
.fg-table th:last-child,
.fg-table th.fg-table-actions-header {
    position: sticky !important;
    right: 0 !important;
    z-index: 5;
}

.fg-table.mud-table-dense * .mud-table-row .mud-table-cell:last-child {
    padding-right: 0 !important;
    padding-inline-end: 0 !important;
}
.fg-table td:last-child {
    background: var(--fg-table-row-bg, var(--mud-palette-surface));
    background-color: var(--fg-table-row-bg, var(--mud-palette-surface));
}

.fg-table th:last-child,
.fg-table th.fg-table-actions-header {
    background: var(--mud-palette-background) !important;
    background-color: var(--mud-palette-background) !important;
    box-shadow: -12px 0 0 var(--mud-palette-background);
    z-index: 7;
    text-align: center;
}

.fg-table.fg-table-no-sticky-last td:last-child,
.fg-table.fg-table-no-sticky-last th:last-child,
.fg-table.fg-table-no-sticky-last th.fg-table-actions-header {
    position: static !important;
    right: auto !important;
    z-index: auto;
    box-shadow: none;
}

.fg-table.fg-table-no-sticky-last.fg-table-resizable th:last-child,
.fg-table.fg-table-no-sticky-last.fg-table-resizable th.fg-table-actions-header {
    position: relative !important;
}

.fg-table.fg-table-no-sticky-first td:first-child,
.fg-table.fg-table-no-sticky-first th:first-child {
    position: static !important;
    left: auto !important;
    z-index: auto;
    box-shadow: none;
}

.fg-table.fg-table-no-sticky-first.fg-table-resizable th:first-child {
    position: relative !important;
}

.fg-table.fg-table-no-sticky-last .container-block-link-right {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.fg-table tr:hover td, .fg-table.fg-mockup-table .mud-table-body tr:hover .mud-table-cell {
    background: var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
    background-color: var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
}

.fg-table .mud-table-body tr:hover {
    background: var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
    background-color: var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
}

.fg-table td:first-child,
.fg-table th:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 6;
}

.fg-table td:first-child {
    background: var(--fg-table-row-bg, var(--mud-palette-surface));
    background-color: var(--fg-table-row-bg, var(--mud-palette-surface));
}

.fg-table th:first-child {
    background: var(--mud-palette-background) !important;
    background-color: var(--mud-palette-background) !important;
    box-shadow: 12px 0 0 var(--mud-palette-background);
    z-index: 7;
    text-align: center;
}

.fg-table tr:hover td:first-child {
    background: var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
    background-color: var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
}

.fg-table .mud-table-body tr.fg-table-row-assigned > td,
.fg-table .mud-table-body tr.raw-stock-row-assigned > td,
.fg-table .mud-table-body tr.bunch-row-assigned > td,
.fg-table .mud-table-body tr.fg-table-row-assigned:hover > td,
.fg-table .mud-table-body tr.raw-stock-row-assigned:hover > td,
.fg-table .mud-table-body tr.bunch-row-assigned:hover > td {
    --fg-table-row-bg: #f1eef7;
    --fg-table-row-hover-bg: #f1eef7;
    background: #f1eef7 !important;
    background-color: #f1eef7 !important;
}

.fg-table .mud-table-body tr.fg-table-row-selected > td,
.fg-table .mud-table-body tr.raw-stock-row-selected > td,
.fg-table .mud-table-body tr.fg-table-row-selected:hover > td,
.fg-table .mud-table-body tr.raw-stock-row-selected:hover > td {
    --fg-table-row-bg: #ede6f5;
    --fg-table-row-hover-bg: #ede6f5;
    background: #ede6f5 !important;
    background-color: #ede6f5 !important;
}

.fg-table .mud-table-body tr > td:first-child,
.fg-table .mud-table-body tr > td:last-child {
    background: var(--fg-table-row-bg, var(--mud-palette-surface)) !important;
    background-color: var(--fg-table-row-bg, var(--mud-palette-surface)) !important;
    background-clip: padding-box;
}

.fg-table .mud-table-body tr > td:first-child {
    box-shadow: 10px 0 0 var(--fg-table-row-bg, var(--mud-palette-surface));
}

.fg-table .mud-table-body tr > td:last-child {
    box-shadow: -10px 0 0 var(--fg-table-row-bg, var(--mud-palette-surface));
}

.fg-table .mud-table-body tr:hover > td:first-child,
.fg-table .mud-table-body tr:hover > td:last-child {
    background: var(--fg-table-row-hover-bg, var(--fg-color-hover-row)) !important;
    background-color: var(--fg-table-row-hover-bg, var(--fg-color-hover-row)) !important;
}

.fg-table .mud-table-body tr:hover > td:first-child {
    box-shadow: 10px 0 0 var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
}

.fg-table .mud-table-body tr:hover > td:last-child {
    box-shadow: -10px 0 0 var(--fg-table-row-hover-bg, var(--fg-color-hover-row));
}

.fg-table .mud-table-body tr.fg-table-row-assigned > td:first-child,
.fg-table .mud-table-body tr.raw-stock-row-assigned > td:first-child,
.fg-table .mud-table-body tr.bunch-row-assigned > td:first-child,
.fg-table .mud-table-body tr.fg-table-row-assigned > td:last-child,
.fg-table .mud-table-body tr.raw-stock-row-assigned > td:last-child,
.fg-table .mud-table-body tr.bunch-row-assigned > td:last-child,
.fg-table .mud-table-body tr.fg-table-row-assigned:hover > td:first-child,
.fg-table .mud-table-body tr.raw-stock-row-assigned:hover > td:first-child,
.fg-table .mud-table-body tr.bunch-row-assigned:hover > td:first-child,
.fg-table .mud-table-body tr.fg-table-row-assigned:hover > td:last-child,
.fg-table .mud-table-body tr.raw-stock-row-assigned:hover > td:last-child,
.fg-table .mud-table-body tr.bunch-row-assigned:hover > td:last-child {
    background: #f1eef7 !important;
    background-color: #f1eef7 !important;
}

.fg-table .mud-table-body tr.fg-table-row-assigned > td:first-child,
.fg-table .mud-table-body tr.raw-stock-row-assigned > td:first-child,
.fg-table .mud-table-body tr.bunch-row-assigned > td:first-child,
.fg-table .mud-table-body tr.fg-table-row-assigned:hover > td:first-child,
.fg-table .mud-table-body tr.raw-stock-row-assigned:hover > td:first-child,
.fg-table .mud-table-body tr.bunch-row-assigned:hover > td:first-child {
    box-shadow: 10px 0 0 #f1eef7;
}

.fg-table .mud-table-body tr.fg-table-row-assigned > td:last-child,
.fg-table .mud-table-body tr.raw-stock-row-assigned > td:last-child,
.fg-table .mud-table-body tr.bunch-row-assigned > td:last-child,
.fg-table .mud-table-body tr.fg-table-row-assigned:hover > td:last-child,
.fg-table .mud-table-body tr.raw-stock-row-assigned:hover > td:last-child,
.fg-table .mud-table-body tr.bunch-row-assigned:hover > td:last-child {
    box-shadow: -10px 0 0 #f1eef7;
}

.fg-table .mud-table-body tr.fg-table-row-selected > td:first-child,
.fg-table .mud-table-body tr.raw-stock-row-selected > td:first-child,
.fg-table .mud-table-body tr.fg-table-row-selected > td:last-child,
.fg-table .mud-table-body tr.raw-stock-row-selected > td:last-child,
.fg-table .mud-table-body tr.fg-table-row-selected:hover > td:first-child,
.fg-table .mud-table-body tr.raw-stock-row-selected:hover > td:first-child,
.fg-table .mud-table-body tr.fg-table-row-selected:hover > td:last-child,
.fg-table .mud-table-body tr.raw-stock-row-selected:hover > td:last-child {
    background: #ede6f5 !important;
    background-color: #ede6f5 !important;
}

.fg-table .mud-table-body tr.fg-table-row-selected > td:first-child,
.fg-table .mud-table-body tr.raw-stock-row-selected > td:first-child,
.fg-table .mud-table-body tr.fg-table-row-selected:hover > td:first-child,
.fg-table .mud-table-body tr.raw-stock-row-selected:hover > td:first-child {
    box-shadow: 10px 0 0 #ede6f5;
}

.fg-table .mud-table-body tr.fg-table-row-selected > td:last-child,
.fg-table .mud-table-body tr.raw-stock-row-selected > td:last-child,
.fg-table .mud-table-body tr.fg-table-row-selected:hover > td:last-child,
.fg-table .mud-table-body tr.raw-stock-row-selected:hover > td:last-child {
    box-shadow: -10px 0 0 #ede6f5;
}

.fg-table.fg-table-no-sticky-first .mud-table-body tr > td:first-child,
.fg-table.fg-table-no-sticky-first .mud-table-body tr:hover > td:first-child,
.fg-table.fg-table-no-sticky-first .mud-table-body tr.fg-table-row-assigned > td:first-child,
.fg-table.fg-table-no-sticky-first .mud-table-body tr.raw-stock-row-assigned > td:first-child,
.fg-table.fg-table-no-sticky-first .mud-table-body tr.bunch-row-assigned > td:first-child,
.fg-table.fg-table-no-sticky-first .mud-table-body tr.fg-table-row-selected > td:first-child,
.fg-table.fg-table-no-sticky-first .mud-table-body tr.raw-stock-row-selected > td:first-child {
    box-shadow: none !important;
}

.fg-table.fg-table-no-sticky-last .mud-table-body tr > td:last-child,
.fg-table.fg-table-no-sticky-last .mud-table-body tr:hover > td:last-child,
.fg-table.fg-table-no-sticky-last .mud-table-body tr.fg-table-row-assigned > td:last-child,
.fg-table.fg-table-no-sticky-last .mud-table-body tr.raw-stock-row-assigned > td:last-child,
.fg-table.fg-table-no-sticky-last .mud-table-body tr.bunch-row-assigned > td:last-child,
.fg-table.fg-table-no-sticky-last .mud-table-body tr.fg-table-row-selected > td:last-child,
.fg-table.fg-table-no-sticky-last .mud-table-body tr.raw-stock-row-selected > td:last-child {
    box-shadow: none !important;
}

.fg-table.fg-mockup-table.mud-table {
    background-color: var(--mud-palette-background);
}

.fg-table.fg-mockup-table .mud-table-container {
    overflow-y: visible;
}

.fg-table.fg-mockup-table .mud-table-root {
    border-collapse: separate;
    border-spacing: 0 var(--fg-table-row-gap);
    width: max-content;
    min-width: 100%;
}

.fg-table.fg-mockup-table .mud-table-head .mud-table-cell {
    background: var(--mud-palette-background);
    border-bottom: none;
    color: var(--fg-table-header-color);
    font-size: var(--fg-table-header-font-size);
    font-weight: 600;
    line-height: 1;
    padding: 0 var(--fg-table-cell-padding-inline);
    vertical-align: bottom;
    white-space: nowrap;
    text-align: center;
}

.fg-table.fg-mockup-table .mud-table-body .mud-table-row {
    background: var(--mud-palette-surface);
}

.fg-table.fg-mockup-table .mud-table-body .mud-table-cell {
    background: var(--fg-mockup-cell-bg, var(--mud-palette-surface));
    border-bottom: none;
    color: var(--fg-table-body-color);
    height: var(--fg-table-row-height);
    font-family: 'Inter', sans-serif;
    font-size: var(--fg-table-body-font-size);
    font-weight: 500;
    line-height: 1;
    padding: 0 var(--fg-table-cell-padding-inline);
    vertical-align: middle;
    white-space: nowrap;
    text-align: center;
}

.fg-table.fg-mockup-table .mud-table-body .fg-mockup-row {
    --fg-mockup-cell-bg: var(--mud-palette-surface);
}

.fg-table.fg-mockup-table .mud-table-body .fg-mockup-row-alt {
    --fg-mockup-cell-bg: #f4edf9;
}

.fg-table.fg-mockup-table .mud-table-body .mud-table-cell:first-child,
.fg-table.fg-mockup-table .mud-table-body .mud-table-cell:last-child {
    z-index: 6;
}

.fg-table.fg-mockup-table .mud-table-body .mud-table-cell:first-child {
    background: var(--fg-mockup-cell-bg, var(--mud-palette-surface));
}

.fg-table.fg-mockup-table .mud-table-body .mud-table-cell:last-child {
    background: var(--fg-mockup-cell-bg, var(--mud-palette-surface));
}

.fg-table.fg-mockup-table tr:hover td:first-child,
.fg-table.fg-mockup-table tr:hover td:last-child {
    background-color: var(--fg-color-hover-row);
}

.fg-table.fg-mockup-table.price-settings-table .mud-table-body .mud-table-cell {
    text-align: center;
}

.fg-table.fg-mockup-table.price-settings-table .mud-table-head .mud-table-cell {
    text-align: center;
}

.fg-table.fg-mockup-table.price-settings-table .mud-table-head .mud-table-cell:first-child,
.fg-table.fg-mockup-table.price-settings-table .mud-table-body .mud-table-cell:first-child {
    text-align: center;
}

.fg-table.fg-mockup-table.price-settings-table .mud-table-head .mud-table-cell:first-child .mud-checkbox,
.fg-table.fg-mockup-table.price-settings-table .mud-table-body .mud-table-cell:first-child .mud-checkbox {
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

.fg-table.fg-mockup-table.price-settings-table .price-cell {
    color: #5D748A;
    font-weight: 500;
}

.fg-table.fg-mockup-table.price-settings-table .price-row.price-cell {
    border-top: none;
    border-bottom: none;
}

.fg-table.fg-mockup-table.price-settings-table .mud-icon-button,
.fg-table.fg-mockup-table.price-settings-table .mud-checkbox .mud-button-root {
    color: var(--mud-palette-secondary);
}

.fg-table.fg-mockup-table.stock-input-table .mud-table-head .mud-table-cell,
.fg-table.fg-mockup-table.stock-input-table .mud-table-body .mud-table-cell {
    text-align: center;
}

.fg-table.fg-mockup-table.stock-input-table .mud-table-body .mud-table-cell {
    height: 74px;
    font-size: 13px;
}

.fg-table.fg-mockup-table.stock-input-table .mud-table-body .mud-table-cell:first-child,
.fg-table.fg-mockup-table.stock-input-table .mud-table-body .mud-table-cell:last-child {
    background: var(--fg-mockup-cell-bg, var(--mud-palette-surface));
}

.fg-table.fg-mockup-table.stock-input-table .stock-input-stack {
    padding: 6px 0;
    white-space: normal;
    overflow: visible;
    align-items: center;
}

.fg-table.fg-mockup-table.stock-input-table .stock-input-current {
    color: #7d8da1;
}

.fg-table.fg-mockup-table.stock-input-table .stock-input-total {
    color: #5D748A;
    font-weight: 600;
}

.fg-table.fg-mockup-table.stock-input-table .stock-input-field {
    min-width: 72px;
}

.fg-table.fg-mockup-table.stock-input-table .stock-input-field .mud-input-control {
    margin-top: 0;
    background: transparent;
}

.fg-table.fg-mockup-table.stock-input-table .stock-input-field .mud-input.mud-input-outlined {
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
}

.fg-table.fg-mockup-table.stock-input-table .stock-input-field fieldset.mud-input-outlined-border {
    border-radius: 14px;
    border-color: #d7d2de;
}

.fg-table.fg-mockup-table.stock-input-table .stock-input-field:hover fieldset.mud-input-outlined-border,
.fg-table.fg-mockup-table.stock-input-table .stock-input-field:focus-within fieldset.mud-input-outlined-border {
    border-color: #d7d2de;
}

.fg-table.fg-mockup-table.stock-input-table .stock-input-field .mud-input-slot {
    background: transparent;
    border-radius: inherit;
    background-clip: padding-box;
}

.fg-table.fg-mockup-table.stock-input-table-plain .stock-input-field .mud-input-slot {
    background: #ffffff;
}

.loading-schedule-filter-popover {
    width: 224px !important;
    min-width: 224px !important;
    max-width: 224px !important;
}

.loading-schedule-filter-popover .mud-list {
    width: 224px;
}

.fg-table.fg-table-simple-dialog .mud-table-root {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
}

.fg-table.fg-table-simple-dialog td:first-child,
.fg-table.fg-table-simple-dialog th:first-child,
.fg-table.fg-table-simple-dialog td:last-child,
.fg-table.fg-table-simple-dialog th:last-child,
.fg-table.fg-table-simple-dialog .mud-table-body tr > td:first-child,
.fg-table.fg-table-simple-dialog .mud-table-body tr > td:last-child,
.fg-table.fg-table-simple-dialog .mud-table-body tr:hover > td:first-child,
.fg-table.fg-table-simple-dialog .mud-table-body tr:hover > td:last-child {
    position: static !important;
    box-shadow: none !important;
    z-index: auto !important;
}

/* ── Затемнение краёв горизонтальной прокрутки ─────────────────────────────
   Вертикальная тень на границе закреплённых колонок: слева — когда таблицу
   уже прокрутили, справа — пока есть куда прокручивать. Классы
   fg-scrolled-x-start / fg-scrolled-x-end навешивает crud-table-resize.js
   на .mud-table-container.

   Тень добавляется вторым слоем к существующей «шторке» (сплошной box-shadow
   цвета фона), поэтому правила ниже дублируют шторку целиком — box-shadow
   не суммируется между правилами. Селекторы включают .mud-table-container,
   что даёт специфичность выше базовых правил и вариантов assigned/selected.
   Отключение sticky (fg-table-no-sticky-*, fg-table-simple-dialog) идёт
   через !important и перебивает эти тени. */

/* Смещение (20px) больше ширины шторки (10–12px), иначе шторка закрасит собой
   почти весь градиент. Отрицательный растяг гасит расплыв тени по вертикали. */
.fg-table {
    --fg-table-edge-shadow-start: 20px 0 12px -6px rgba(36, 57, 77, 0.38);
    --fg-table-edge-shadow-end: -20px 0 12px -6px rgba(36, 57, 77, 0.38);
}

.fg-table .mud-table-container.fg-scrolled-x-start .mud-table-head tr > th:first-child {
    box-shadow: 12px 0 0 var(--mud-palette-background), var(--fg-table-edge-shadow-start);
}

.fg-table .mud-table-container.fg-scrolled-x-end .mud-table-head tr > th:last-child {
    box-shadow: -12px 0 0 var(--mud-palette-background), var(--fg-table-edge-shadow-end);
}

.fg-table .mud-table-container.fg-scrolled-x-start .mud-table-body tr > td:first-child {
    box-shadow: 10px 0 0 var(--fg-table-row-bg, var(--mud-palette-surface)),
                var(--fg-table-edge-shadow-start);
}

.fg-table .mud-table-container.fg-scrolled-x-end .mud-table-body tr > td:last-child {
    box-shadow: -10px 0 0 var(--fg-table-row-bg, var(--mud-palette-surface)),
                var(--fg-table-edge-shadow-end);
}

.fg-table .mud-table-container.fg-scrolled-x-start .mud-table-body tr:hover > td:first-child {
    box-shadow: 10px 0 0 var(--fg-table-row-hover-bg, var(--fg-color-hover-row)),
                var(--fg-table-edge-shadow-start);
}

.fg-table .mud-table-container.fg-scrolled-x-end .mud-table-body tr:hover > td:last-child {
    box-shadow: -10px 0 0 var(--fg-table-row-hover-bg, var(--fg-color-hover-row)),
                var(--fg-table-edge-shadow-end);
}

/* Page tables remain tables on phones; scroll the table, not the whole page. */
@media (max-width: 959.98px) {
    .fg-table .mud-table-container {
        max-width: 100%;
        overflow-x: auto !important;
        scrollbar-width: thin !important;
        -webkit-overflow-scrolling: touch;
    }
    .fg-table .mud-table-container::-webkit-scrollbar { height: 4px; }
}
@media (max-width: 599.98px) {
    .fg-table-pager {
        flex-direction: column !important;
        gap: 8px;
        min-width: 0;
        max-width: 100%;
    }

    .fg-table-pager .mud-pagination {
        flex: 0 1 auto !important;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }

    .fg-table-pager > .mud-select {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 100%;
        margin: 0 !important;
    }

    .fg-table-pager .mud-input-control {
        min-width: 0;
        max-width: 100%;
        margin: 0 !important;
    }

    /* On phones, pinned edge columns can cover the entire scrollable viewport. */
    .fg-table td:first-child,
    .fg-table th:first-child,
    .fg-table td:last-child,
    .fg-table th:last-child,
    .fg-table th.fg-table-actions-header {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        z-index: auto !important;
        box-shadow: none !important;
    }

    .fg-table.truck-logistics-routes .mud-table-root tr > :first-child {
        width: 240px !important;
        min-width: 240px !important;
        max-width: 240px !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
        text-align: left !important;
    }

    .fg-table.truck-logistics-routes .mud-table-root th:first-child .fg-table-header-cell {
        justify-content: flex-start !important;
    }

    .fg-table.truck-logistics-routes td:first-child .container-block-link {
        justify-content: flex-start !important;
        height: auto;
        min-height: 30px;
        padding-block: 6px;
        white-space: normal !important;
        text-align: left !important;
        overflow-wrap: anywhere;
    }
}
