/* Shared styles for Reference Data grid pages */

.ref-data-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.ref-data-grid-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Constrain grid root to fill flex container so internal scroll works */
.ref-data-grid {
    height: 100%;
}

/* Fix: MudBlazor applies overflow:clip when StickyRight + HorizontalScrollbar combine,
   which kills vertical scrolling (open bug #7237). Override to restore scroll. */
.ref-data-grid .mud-table-container {
    overflow: auto !important;
}

/* Sticky column background — match grid colors instead of MudBlazor's gray default.
   Uses !important to override MudBlazor's inline/high-specificity sticky backgrounds. */
.ref-data-grid .mud-table-cell.sticky-right,
.ref-data-grid .sticky-right,
.ref-data-grid th.sticky-right,
.ref-data-grid td.sticky-right {
    background: white !important;
}

.ref-data-grid .mud-table-body .mud-table-row:hover .mud-table-cell.sticky-right,
.ref-data-grid .mud-table-body .mud-table-row:hover td.sticky-right {
    background: var(--mud-palette-table-hover, #f5f5f5) !important;
}

/*
 * Use table-layout: fixed for stable column widths during virtualized scroll.
 * With Virtualize="true", only ~20 rows are in the DOM — table-layout: auto would
 * recalculate column widths on every scroll, causing columns to jump. Fixed layout
 * uses ColGroup/header widths instead, so columns never shift.
 * Each grid defines a <ColGroup> with proportional widths for its columns.
 * See: https://github.com/MudBlazor/MudBlazor/issues/11460
 */
.ref-data-grid .mud-table-root {
    table-layout: fixed;
}

/* Grid header — uppercase, never wrap/truncate */
.ref-data-grid .mud-table-head .mud-table-cell {
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

/* Grid cells — truncate with ellipsis when content overflows column width */
.ref-data-grid .mud-table-body .mud-table-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Filter row inputs — reset header uppercase so typed text stays normal case */
.ref-data-grid .mud-table-head .mud-input input,
.ref-data-grid .mud-table-head .mud-select .mud-input input {
    text-transform: none;
    font-weight: 400;
    letter-spacing: normal;
}

