.bid-manager-page,
.scope-snippet-page,
.bid-overview-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 0.5rem;
}

.bid-search-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem 0;
}

.bid-search-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.bid-search-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.35rem 0.75rem;
}

.bid-search-fields > :not(.bid-search-active) {
    flex: 1 1 8rem;
    min-width: 8rem;
    max-width: 18rem;
}

.bid-search-fields > .bid-search-active {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
}

.bid-search-fields > .bid-search-range {
    flex: 2 1 16rem;
    min-width: 14rem;
    max-width: 24rem;
}

.bid-date-overdue {
    color: #f00;
}

.bid-date-upcoming {
    color: #00f;
}

.bid-date-hold {
    color: #800000;
}

.bid-date-normal {
    color: #000;
}

/* Dark Mode uses the Mud PaletteDark surface (#373740). The light-mode hex
   values above sit near black, so they disappear on that surface. Palette
   error (#f64e62, 3.47:1) and info (#3299ff, 4.00:1) also miss WCAG AA.
   These keep the same red / blue / maroon / neutral roles at 4.5:1 or better
   on #373740 and on the #3d3d46 row hover. The selected row stays the light
   orange highlight, so it keeps the light-mode colors. */
.sc-dark .bid-date-overdue {
    color: #ff8a80;
}

.sc-dark .bid-date-upcoming {
    color: #90caf9;
}

.sc-dark .bid-date-hold {
    color: #ffccbc;
}

.sc-dark .bid-date-normal {
    color: var(--mud-palette-text-primary);
}

.sc-dark .sc-datagrid-row-selected .bid-date-overdue {
    color: #f00;
}

.sc-dark .sc-datagrid-row-selected .bid-date-upcoming {
    color: #00f;
}

.sc-dark .sc-datagrid-row-selected .bid-date-hold {
    color: #800000;
}

.sc-dark .sc-datagrid-row-selected .bid-date-normal {
    color: #000;
}

.bid-date-time {
    font-size: 0.85rem;
}

.bid-notes {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.bid-notes-line {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.bid-notes-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bid-notes-line > .tckrd-grid-cell-host {
    min-width: 0;
    flex: 1 1 auto;
}

.bid-notes-history {
    flex: 0 0 auto;
    opacity: 0;
}

.mud-table-row:hover .bid-notes-history,
.mud-table-row:focus-within .bid-notes-history,
.mud-table-row.sc-datagrid-row-selected .bid-notes-history {
    opacity: 1;
}

.bid-manager-grid,
.bid-overview-grid,
.scope-snippet-editor {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* The shared grid paints body cells white. In Dark Mode that white sheet
   hides the palette surface, so the date colors above would be checked
   against the wrong background. Unselected Bid Manager rows use the surface.
   Hover stays one step lighter (#3d3d46) and still clears AA with those colors.
   The selected row keeps its orange fill; its text stays dark so it reads. */
.sc-dark .bid-manager-grid .mud-data-grid .mud-table-body .mud-table-row:not(.sc-datagrid-row-selected) > .mud-table-cell {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}

.sc-dark .bid-manager-grid .mud-data-grid .mud-table-body .mud-table-row:not(.sc-datagrid-row-selected):hover > .mud-table-cell {
    background: #3d3d46;
    color: var(--mud-palette-text-primary);
}

.sc-dark .bid-manager-grid .mud-data-grid .mud-table-body .mud-table-row.sc-datagrid-row-selected > .mud-table-cell {
    color: #000;
}

.bid-job-name {
    font-weight: 600;
}

.bid-sub {
    color: #4a4a4a;
    font-size: 0.85rem;
}

.sc-dark .bid-manager-grid .bid-sub {
    color: #adadb2;
}

.sc-dark .bid-manager-grid .sc-datagrid-row-selected .bid-sub {
    color: #4a4a4a;
}

.bid-price {
    text-align: right;
}

.bid-row-actions {
    display: flex;
    gap: 0.15rem;
    opacity: 0;
}

.mud-table-row:hover .bid-row-actions,
.mud-table-row:focus-within .bid-row-actions,
.mud-table-row.sc-datagrid-row-selected .bid-row-actions {
    opacity: 1;
}

.po-tool-folder {
    color: #c4a035;
}

.po-tool-folder:disabled {
    opacity: 0.85;
}

.scope-snippet-body {
    display: flex;
    gap: 1rem;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 0.75rem 0.75rem;
}

.scope-snippet-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    min-width: 12rem;
    background: #424242;
    border-radius: 0.25rem;
    overflow: auto;
}

.scope-snippet-name {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: #f0f0f0;
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.2rem;
    cursor: pointer;
}

.scope-snippet-name:hover {
    background: #5a5a5a;
}

.scope-snippet-name.selected {
    background: #f7f7f7;
    color: #1a1a1a;
}

.scope-snippet-editor {
    gap: 0.35rem;
}

.scope-snippet-editor > * {
    flex: 0 0 auto;
}

.scope-snippet-editor > :last-child {
    flex: 1 1 auto;
    min-height: 12rem;
}

.scope-snippet-title {
    max-width: 24rem;
}

.bid-overview-range {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem 0;
}

.bid-overview-tabs {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.bid-overview-bars {
    padding: 1rem 1.25rem;
}

.bid-overview-bars h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.bid-overview-bars ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.bid-overview-bars li {
    display: grid;
    grid-template-columns: 10rem 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
}

.bid-overview-track {
    display: block;
    height: 0.85rem;
    background: #e6e6e6;
    border-radius: 0.2rem;
}

.bid-overview-fill {
    display: block;
    height: 100%;
    background: #2828da;
    border-radius: 0.2rem;
}

@media (max-width: 40rem) {
    .scope-snippet-body {
        flex-direction: column;
    }

    .bid-overview-bars li {
        grid-template-columns: 1fr;
    }
}
