/* ===== КАСТОМНАЯ ПАЛИТРА (светлая тема) ===== */
:root {
    --primary-color: rgb(30, 136, 229);
    --primary-dark: #1565C0;
    --primary-light: #64B5F6;
    --primary-lighter: #BBDEFB;
    --link-color: #1976D2;
    --success-color: #43A047;
    --success-light: #66BB6A;
    --error-color: #E53935;
    --error-dark: #C62828;
    --warning-color: #FB8C00;
    --info-color: #039BE5;
    --drag-row-bg: rgba(0, 0, 0, 0.05);
    --drop-target-bg: rgba(89, 74, 226, 0.15);
    --drop-target-shadow: #594ae2;
    --error-boundary-bg: #b32121;
    --text-muted: rgba(0, 0, 0, 0.45);
    --surface-light: #f5f5f5;
    --surface-white: #fcfcfc;
    --border-default: #e0e0e0;
    --deleted-border: #ffcdd2;
    --deleted-bg: #ffebee;
    --warning-surface: #fff3e0;
    --warning-surface-text: #5d4037;
}


/* ===== ТЁМНАЯ ТЕМА: переопределение переменных ===== */
.mud-theme-dark {
    --primary-color: rgb(66, 165, 245);
    --primary-dark: #1E88E5;
    --primary-light: #90CAF9;
    --primary-lighter: #1a3a5c;
    --link-color: #64B5F6;
    --success-color: #66BB6A;
    --success-light: #81C784;
    --error-color: #EF5350;
    --error-dark: #E53935;
    --warning-color: #FFA726;
    --info-color: #4FC3F7;
    --drag-row-bg: rgba(255, 255, 255, 0.05);
    --drop-target-bg: rgba(89, 74, 226, 0.25);
    --drop-target-shadow: #7c6ef0;
    --error-boundary-bg: #7f1d1d;
    --text-muted: rgba(255, 255, 255, 0.45);
    --surface-light: #2a2a45;
    --surface-white: #212138;
    --border-default: rgba(255, 255, 255, 0.12);
    --deleted-border: #5c2a2a;
    --deleted-bg: #3d1f1f;
    --warning-surface: #3d2e1a;
    --warning-surface-text: rgba(255, 255, 255, 0.87);
}

/* ===== BLAZOR ERROR BOUNDARY ===== */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--error-boundary-bg);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ===== DETAIL CARD (кастомные классы) ===== */
.detail-field {
    margin-bottom: 0.75rem;
}

.detail-field-label {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.detail-field-value {
    font-size: 1rem;
    word-break: break-word;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

@media (max-width: 960px) {
    .detail-field {
        margin-bottom: 0.75rem;
    }

    .detail-section {
        margin-bottom: 1rem;
    }
}

/* ===== ССЫЛКИ В ТАБЛИЦАХ (UX улучшение) ===== */
.mud-table-cell a.mud-link {
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.mud-table-cell a.mud-link:hover {
    text-decoration: underline;
    transform: translateX(2px);
}



/* ===== КОМПАКТНЫЕ ТАБЫ (MudTabs не имеет Dense) ===== */
.mud-tabs .mud-tab {
    padding: 8px 24px 8px 16px;
    font-size: 14px;
}

/* ===== КОМПАКТНЫЕ КАРТОЧКИ (применять через Class) ===== */
.compact-card>.mud-card-header {
    padding: 12px 16px;
}

.compact-card>.mud-card-content {
    padding: 16px;
}

.entity-form--dialog {
    width: 100%;
}

.entity-form__content--dialog {
    padding: 0 8px 8px;
}

.entity-form__content--sticky-anchor {
    padding-bottom: 72px;
}

.entity-form__actions.entity-form__actions--sticky {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-divider);
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.06);
}

.erp-entity-dialog-content {
    min-width: 0;
}

.erp-entity-dialog-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--mud-palette-lines-default, rgba(0, 0, 0, 0.12));
}


/* ===== MUD INPUT OUTLINED LEGEND (label in fieldset) ===== */
.mud-input.mud-input-outlined>.mud-input-outlined-border>legend {
    font-size: var(--mud-typography-subtitle1-size);
}

.mud-input-control>.mud-input-control-input-container>.mud-input-label-inputcontrol {
    font-size: var(--mud-typography-subtitle1-size);
    line-height: 1rem;
}



/* ===== MUD INPUT LINE-HEIGHT OVERRIDE ===== */
.compact-items-grid.mud-table .mud-input.mud-typography-subtitle1,
.compact-bom-grid.mud-table .mud-input.mud-typography-subtitle1 {
    line-height: var(--mud-typography-subtitle1-lineheight) !important;
}

.compact-items-grid.mud-table .mud-input,
.compact-bom-grid.mud-table .mud-input {
    line-height: var(--mud-typography-subtitle1-lineheight);
}

/* ===== КОМПАКТНЫЙ DATAGRID (классы compact-items-grid, compact-bom-grid) ===== */
/* Для Dense режима с высотой строки ~50px */

/* Кнопка HierarchyColumn (expand/collapse) */
.compact-items-grid.mud-table .mud-table-cell>.mud-icon-button,
.compact-bom-grid.mud-table .mud-table-cell>.mud-icon-button {
    padding: 0 !important;
    margin: 0 !important;
}

.compact-items-grid.mud-table .mud-table-cell>.mud-icon-button .mud-icon-size-medium,
.compact-bom-grid.mud-table .mud-table-cell>.mud-icon-button .mud-icon-size-medium {
    width: 18px;
    height: 18px;
}

/* ===== СЕРЫЕ ИКОНКИ ДЕЙСТВИЙ С ЦВЕТОМ ПРИ HOVER ===== */
/* Применяется к MudStack с классом row-actions-cell в action-колонках Orders → Позиции и BOM. */
/* Семантические цвета (Primary/Error/Success/Info) остаются на разметке — приглушаются */
/* серым по умолчанию и восстанавливаются при наведении на конкретную иконку. */
/* Использует MudBlazor-переменную text-secondary, которая адаптируется к светлой/тёмной теме. */
.row-actions-cell .mud-icon-button:not(:hover):not(:focus-visible):not(:disabled) {
    color: var(--mud-palette-text-secondary) !important;
    opacity: 0.72;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.row-actions-cell .mud-icon-button:hover,
.row-actions-cell .mud-icon-button:focus-visible {
    opacity: 1;
}

/* Компактный чип */
.compact-items-grid.mud-table .mud-table-cell .mud-chip,
.compact-bom-grid.mud-table .mud-table-cell .mud-chip {
    height: 18px;
    font-size: 0.7rem;
    padding: 0 5px;
    margin: 0 !important;
}

.compact-items-grid.mud-table .mud-table-cell .mud-chip .mud-chip-content,
.compact-bom-grid.mud-table .mud-table-cell .mud-chip .mud-chip-content {
    padding: 0;
}

/* Компактные inline-поля ввода */
.compact-items-grid.mud-table .mud-table-cell .mud-input-control,
.compact-bom-grid.mud-table .mud-table-cell .mud-input-control {
    margin: 0;
}

.compact-items-grid.mud-table .mud-table-cell .mud-input,
.compact-bom-grid.mud-table .mud-table-cell .mud-input {
    padding: 0;
    margin: 0;
    font-size: 0.8125rem;
}

.compact-items-grid.mud-table .mud-table-cell .mud-input-slot,
.compact-bom-grid.mud-table .mud-table-cell .mud-input-slot {
    padding: 0;
}

.compact-items-grid.mud-table .mud-table-cell .mud-input-adornment,
.compact-bom-grid.mud-table .mud-table-cell .mud-input-adornment {
    margin: 0;
    padding: 0 2px;
}

.compact-items-grid.mud-table-dense * .mud-table-row .mud-table-cell,
.compact-bom-grid.mud-table-dense * .mud-table-row .mud-table-cell,
.compact-product-bom-grid.mud-table-dense * .mud-table-row .mud-table-cell,
.compact-grid.mud-table-dense * .mud-table-row .mud-table-cell {
    padding-inline-start: 12px;
    padding-inline-end: 6px
}

/* Фиксированная высота строки для единообразия (оптимально для 2-строчного текста) */
.compact-items-grid.mud-table .mud-table-row,
.compact-bom-grid.mud-table .mud-table-row {
    height: 50px;
}

.compact-items-grid.mud-table .mud-table-row .mud-table-cell,
.compact-bom-grid.mud-table .mud-table-row .mud-table-cell {
    height: 50px;
    padding-top: 4px;
    padding-bottom: 4px;
    vertical-align: middle;
}

/* ===== ФИКСАЦИЯ ШИРИНЫ СТОЛБЦОВ ===== */

/* Обрезка переполнения в ячейках */
.compact-items-grid.mud-table .mud-table-cell,
.compact-bom-grid.mud-table .mud-table-cell {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== ПРЕВЬЮ ТОВАРА В КОЛОНКЕ "ТИП" ДЛЯ КОМПОНЕНТОВ ===== */

.order-component-thumb {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid #e6e6e6;
    background: #fff;
    overflow: hidden;
    vertical-align: middle;
    line-height: 0;
}

.order-component-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Слот 40×40 для иконки типа в колонке «Тип» — выравнивает иконки
   (на уровне Шкафа, группы, и компонентов без фото) по центру
   занимаемого превью-слота, чтобы строки визуально совпадали со
   строками, где есть фотография 40×40. */
.order-row-icon-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    vertical-align: middle;
}

/* ===== DRAG-AND-DROP STYLES (OrderItemsTable) ===== */

/* Drag handle icon */
.drag-handle {
    cursor: grab;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.drag-handle:hover {
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle[draggable="false"] {
    cursor: default;
    opacity: 0.3;
}

/* Row being dragged */
tr.dragging {
    opacity: 0.4 !important;
    background-color: var(--drag-row-bg) !important;
}

/* Drop target - подсветка строки при наведении */
tr.drop-target {
    background-color: var(--drop-target-bg) !important;
    box-shadow: inset 0 2px 0 var(--drop-target-shadow);
}

/* Group header drop states */
tr.drop-target-before-group {
    background-color: rgba(0, 0, 0, 0.02) !important;
    box-shadow: inset 0 3px 0 var(--drop-target-shadow);
}

tr.drop-target-into-group {
    background-color: var(--drop-target-bg) !important;
    box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.04);
}

/* Prevent text selection during drag */
.compact-items-grid,
.compact-bom-grid {
    user-select: none;
}

/* ===== STICKY HEADER — CSS-only ===== */
/* MudTabs имеет overflow:hidden, что блокирует position:sticky.
   Снимаем overflow на MudTabs, содержащем нашу таблицу */
.mud-tabs:has(.compact-items-grid),
.mud-tabs:has(.compact-bom-grid) {
    overflow: visible !important;
}

/* Снимаем overflow с контейнера таблицы (MudBlazor ставит overflow-y:auto) */
.compact-items-grid .mud-table-container,
.compact-bom-grid .mud-table-container,
.compact-grid .mud-table-container {
    overflow: visible !important;
}

/* Фиксируем заголовок при скролле (body-level scroll, AppBar fixed сверху) */
.compact-items-grid .mud-table-head .mud-table-cell,
.compact-bom-grid .mud-table-head .mud-table-cell {
    position: sticky !important;
    top: var(--mud-appbar-height) !important;
    z-index: 3;
    background: var(--mud-palette-surface);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* === Color Mark Indicator === */
.color-mark-wrapper {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.color-mark-circle {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid #bdbdbd;
    transition: box-shadow 0.15s ease;
}

.color-mark-wrapper:hover .color-mark-circle {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

.color-mark-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--mud-zindex-popover);
}

/* Компактная палитра цветовых меток (7 колонок × 2 ряда) */
.color-mark-picker .mud-picker-paper {
    box-shadow: none;
}

.color-mark-picker .mud-picker-color-picker,
.color-mark-picker .mud-picker-color-controls {
    display: none;
}

.color-mark-picker .mud-picker-color-content {
    min-height: unset;
}

.color-mark-picker .mud-picker-color-view {
    position: relative;
    width: auto;
    height: auto;
    overflow: visible;
}

.color-mark-picker .mud-picker-color-view .mud-picker-color-view-collection {
    display: grid;
    grid-template-columns: repeat(7, 26px);
    gap: 4px;
    padding: 4px;
}

.color-mark-picker .mud-picker-color-view .mud-picker-color-view-collection .mud-picker-color-dot {
    width: 26px;
    height: 26px;
    min-width: 26px;
    max-width: 26px;
    margin: 0;
    border-radius: 4px;
}

.compact-bom-grid .bom-summary-group-row .mud-icon-button,
.compact-bom-grid .bom-summary-group-row .mud-button-root,
.compact-bom-grid .bom-summary-group-row .mud-icon-button:hover,
.compact-bom-grid .bom-summary-group-row .mud-icon-button:focus-visible,
.compact-bom-grid .bom-summary-group-row .mud-icon-button:active,
.compact-bom-grid .bom-summary-group-row .mud-button-root:hover,
.compact-bom-grid .bom-summary-group-row .mud-button-root:focus-visible,
.compact-bom-grid .bom-summary-group-row .mud-button-root:active {
    background-color: transparent !important;
    box-shadow: none !important;
}

.compact-bom-grid .mud-table-foot .mud-table-cell {
    height: auto;
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 8px;
    vertical-align: middle;
    background: rgba(0, 0, 0, 0.02);
}

.compact-bom-grid .mud-table-foot .mud-table-cell:empty {
    padding-top: 4px;
    padding-bottom: 4px;
}

.bom-summary-group-footer-text {
    display: block;
    color: rgba(0, 0, 0, 0.65);
    font-weight: 600;
}

.bom-summary-grid-footer-hidden {
    display: none;
}

.mud-theme-dark .compact-bom-grid .mud-table-foot .mud-table-cell {
    background: rgba(255, 255, 255, 0.04);
}

.mud-theme-dark .bom-summary-group-footer-text {
    color: rgba(255, 255, 255, 0.72);
}

/* ===== BOM GROUP HEADER STYLES ===== */

/* Строка-заголовок группы: более тонкая, отдельный фон */
.compact-bom-grid .bom-group-header-row,
.compact-items-grid .bom-group-header-row {
    height: 40px !important;
    background-color: var(--surface-light) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.compact-bom-grid .bom-group-header-row .mud-table-cell,
.compact-items-grid .bom-group-header-row .mud-table-cell {
    height: 40px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

/* Чип источника группы — компактный */
.bom-group-source-chip {
    height: 18px !important;
    font-size: 0.65rem !important;
}

/* Визуальный отступ для компонентов внутри группы */
.compact-bom-grid .bom-grouped-component,
.compact-product-bom-grid .bom-grouped-component,
.compact-items-grid .bom-grouped-component {
    background-color: rgba(0, 0, 0, 0.005);
}

.compact-bom-grid .bom-grouped-component .mud-table-cell,
.compact-product-bom-grid .bom-grouped-component .mud-table-cell,
.compact-items-grid .bom-grouped-component .mud-table-cell {
    border-top: 1px solid rgba(0, 0, 0, 0.035);
    border-bottom: 1px solid rgba(0, 0, 0, 0.035);
}

.compact-bom-grid .bom-group-end .mud-table-cell,
.compact-product-bom-grid .bom-group-end .mud-table-cell,
.compact-items-grid .bom-group-end .mud-table-cell {
    border-bottom: 2px solid rgba(0, 0, 0, 0.14);
}

/* Phase 7 (Bridge DirectInsert): inline indication anchor row на вкладке Позиции.
   Левая полоса акцентного цвета и подсвеченный фон. Класс выставляется в GetRowClass()
   через IsBridgeAnchorRow() и автоматически сбрасывается, когда якорь сбрасывается. */
.compact-items-grid .order-items-bridge-anchor-row .mud-table-cell:first-child {
    border-left: 3px solid var(--mud-palette-primary) !important;
}

.compact-items-grid .order-items-bridge-anchor-row {
    background-color: rgba(94, 53, 177, 0.06) !important;
}

.mud-theme-dark .compact-items-grid .order-items-bridge-anchor-row {
    background-color: rgba(149, 117, 205, 0.10) !important;
}

.order-items-bridge-target-chip {
    max-width: min(560px, 42vw);
}

.order-items-bridge-target-chip-label {
    display: inline-block;
    max-width: min(500px, 36vw);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.compact-bom-grid .bom-bridge-anchor-row .mud-table-cell:first-child {
    border-left: 3px solid var(--mud-palette-primary) !important;
}

.compact-bom-grid .bom-bridge-anchor-row {
    background-color: rgba(94, 53, 177, 0.06) !important;
}

.mud-theme-dark .compact-bom-grid .bom-bridge-anchor-row {
    background-color: rgba(149, 117, 205, 0.10) !important;
}

/* Phase 8 (Bridge DirectInsert): подсветка строк, только что созданных через Bridge.
   Класс выставляется на 3 секунды после успешного BridgeProductAppliedEvent с
   CreatedComponentIds, затем снимается fire-and-forget timer'ом и StateHasChanged.
   Цвет — мягкий зелёный, чтобы не конфликтовать с anchor (фиолетовый) и dirty (оранжевый). */
.compact-items-grid .order-items-bridge-newly-created-row {
    background-color: rgba(76, 175, 80, 0.12) !important;
    transition: background-color 1.5s ease-out;
}

.mud-theme-dark .compact-items-grid .order-items-bridge-newly-created-row {
    background-color: rgba(129, 199, 132, 0.16) !important;
}

/* Вкладка BOM: дополнительный уровень только у содержимого группы */
.compact-bom-grid .bom-offset-level-1,
.compact-product-bom-grid .bom-offset-level-1 {
    padding-left: 8px;
}

.compact-bom-grid .bom-group-scope-row .mud-table-cell:first-child,
.compact-product-bom-grid .bom-group-scope-row .mud-table-cell:first-child {
    border-left: 2px solid rgba(0, 0, 0, 0.16);
}

.compact-bom-grid .bom-group-scope-row .mud-table-cell,
.compact-product-bom-grid .bom-group-scope-row .mud-table-cell {
    position: relative;
}

/* Вкладка Позиции: группа читается как дочерний блок внутри изделия */
.compact-items-grid .items-group-scope-row .mud-table-cell:first-child {
    border-left: 2px solid rgba(0, 0, 0, 0.16);
}

.compact-items-grid .items-group-toggle-offset {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 6px;
}

.compact-items-grid .items-offset-level-1 {
    padding-left: 6px;
}

.compact-items-grid .items-offset-level-2 {
    padding-left: 12px;
}

.compact-items-grid .items-group-scope-row .mud-table-cell {
    position: relative;
}

/* Dark theme: group header */
.mud-theme-dark .compact-bom-grid .bom-group-header-row,
.mud-theme-dark .compact-items-grid .bom-group-header-row {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mud-theme-dark .compact-bom-grid .bom-grouped-component,
.mud-theme-dark .compact-product-bom-grid .bom-grouped-component,
.mud-theme-dark .compact-items-grid .bom-grouped-component {
    background-color: rgba(255, 255, 255, 0.04);
}

.mud-theme-dark .compact-bom-grid .bom-grouped-component .mud-table-cell,
.mud-theme-dark .compact-product-bom-grid .bom-grouped-component .mud-table-cell,
.mud-theme-dark .compact-items-grid .bom-grouped-component .mud-table-cell {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mud-theme-dark .compact-bom-grid .bom-group-end .mud-table-cell,
.mud-theme-dark .compact-product-bom-grid .bom-group-end .mud-table-cell,
.mud-theme-dark .compact-items-grid .bom-group-end .mud-table-cell {
    border-bottom: 2px solid rgba(255, 255, 255, 0.14);
}

.mud-theme-dark .compact-items-grid .items-group-scope-row .mud-table-cell:first-child {
    border-left-color: rgba(255, 255, 255, 0.18);
}

.mud-theme-dark .compact-bom-grid .bom-group-scope-row .mud-table-cell:first-child,
.mud-theme-dark .compact-product-bom-grid .bom-group-scope-row .mud-table-cell:first-child {
    border-left-color: rgba(255, 255, 255, 0.18);
}

.mud-theme-dark .compact-product-bom-grid .bom-group-header-row {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.erp-segmented-select-group {
    display: flex;
    width: 100%;
}

.erp-segmented-select-group .erp-segmented-select-item {
    flex: 1 1 0;
    min-width: 0;
}

.erp-segmented-select-group .mud-button-root {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.erp-segmented-select-field {
    width: 100%;
}

.erp-stack-buttons-select-field {
    width: 100%;
}

.erp-presentation-field-label {
    display: block;
    position: static;
    inset: auto;
    transform: none;
    margin-bottom: 4px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
    line-height: 1.25rem;
}
