/* Shared operational workspace language. Loaded last so legacy pages inherit the same rules. */
:root {
    --workspace-surface: #ffffff;
    --workspace-canvas: #f7f9fc;
    --workspace-soft: #f3f6fa;
    --workspace-line: #dfe5ec;
    --workspace-line-strong: #cbd5e1;
    --workspace-text: #172033;
    --workspace-muted: #667085;
    --workspace-radius: 6px;
    --workspace-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.legacy-overlay-body {
    width: 100% !important;
    max-width: none !important;
}

@media (max-width: 700px) {
    .mud-dialog.request-board-dialog { width: calc(100vw - 24px); max-width: none; margin: 12px; max-height: calc(100dvh - 24px); }
}

/* Dedicated document editors own the viewport; dialogs remain above them. */
body:has(.proposal-page--editing),
body:has(.sop-editor) {
    overflow: hidden;
}

.page:has(.proposal-page--editing) .mud-appbar,
.page:has(.proposal-page--editing) .legacy-overlay-drawer,
.page:has(.sop-editor) .mud-appbar,
.page:has(.sop-editor) .legacy-overlay-drawer {
    display: none !important;
}

.workspace-route-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding-bottom: 20px;
    color: var(--workspace-text);
    font-family: "Segoe UI", "Malgun Gothic", Roboto, sans-serif;
}

.workspace-route-shell,
.workspace-route-shell * {
    letter-spacing: 0;
}

.workspace-route-shell > *,
.workspace-route-shell .mud-grid-item,
.workspace-route-shell .mud-paper,
.workspace-route-shell .mud-card,
.workspace-route-shell .mud-table,
.workspace-route-shell .mud-tabs,
.workspace-route-shell .mud-tabs-panels,
.workspace-route-shell .mud-tab-panel {
    min-width: 0;
    max-width: 100%;
}

.workspace-route-shell h1,
.workspace-route-shell h2,
.workspace-route-shell h3,
.workspace-route-shell h4,
.workspace-route-shell h5,
.workspace-route-shell h6 {
    color: var(--workspace-text);
    letter-spacing: 0;
}

.workspace-route-shell h1,
.workspace-route-shell .mud-typography-h4 {
    font-size: 1.65rem;
    line-height: 1.25;
}

.workspace-route-shell h2,
.workspace-route-shell .mud-typography-h5 {
    font-size: 1.15rem;
    line-height: 1.3;
}

.workspace-route-shell h3,
.workspace-route-shell .mud-typography-h6 {
    font-size: .95rem;
    line-height: 1.35;
}

.workspace-route-shell--has-generated-header > h1:first-of-type,
.workspace-route-shell--has-generated-header > h4:first-of-type,
.workspace-route-shell--has-generated-header > .mud-typography-h4:first-of-type {
    display: none;
}

.workspace-route-shell--route-heater-external-results > .mud-typography-body2:first-of-type {
    display: none;
}

.workspace-route-shell :where(
    .fail-board__hero,
    .fail-photo-board__hero,
    .fail-create-hero,
    .ssq-hero,
    .drawing-header,
    .repair-hero,
    .member-hero,
    .readcardused-hero,
    .missing-hero,
    .update-board-hero,
    .request-board-hero,
    .itemmovement-hero,
    .visit-manage-hero,
    .org-hero,
    .partner-admin-hero,
    .mail-subscription-header,
    .company-access-header,
    .trs-board__hero,
    .trs-page__hero,
    .trs-update-hero) {
    border: 0 !important;
    border-bottom: 1px solid var(--workspace-line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.workspace-route-shell :where(
    .fail-board__hero,
    .fail-photo-board__hero,
    .fail-create-hero,
    .ssq-hero,
    .drawing-header,
    .repair-hero,
    .member-hero,
    .readcardused-hero,
    .missing-hero,
    .update-board-hero,
    .request-board-hero,
    .itemmovement-hero,
    .visit-manage-hero,
    .org-hero,
    .partner-admin-hero,
    .mail-subscription-header,
    .company-access-header) {
    padding: 4px 0 10px !important;
    margin: 0 !important;
}

.workspace-route-shell :where(
    .fail-board__eyebrow,
    .fail-photo-board__eyebrow,
    .fail-create-eyebrow,
    .ssq-eyebrow,
    .drawing-eyebrow,
    .repair-eyebrow,
    .member-eyebrow,
    .readcardused-eyebrow,
    .missing-eyebrow,
    .update-board-eyebrow,
    .request-board-eyebrow,
    .itemmovement-eyebrow,
    .visit-manage-eyebrow,
    .org-hero__eyebrow,
    .partner-admin-eyebrow) {
    color: var(--mud-palette-primary) !important;
    font-size: .68rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
}

.workspace-route-shell :where(
    .fail-board__hero,
    .fail-photo-board__hero,
    .fail-create-hero,
    .ssq-hero,
    .drawing-header,
    .repair-hero,
    .member-hero,
    .readcardused-hero,
    .missing-hero,
    .update-board-hero,
    .request-board-hero,
    .itemmovement-hero,
    .visit-manage-hero,
    .org-hero,
    .partner-admin-hero) :where(h1, .mud-typography-h4) {
    margin: 0 !important;
    font-size: 1.65rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
}

.workspace-route-shell :where(
    .fail-board__hero,
    .fail-photo-board__hero,
    .fail-create-hero,
    .ssq-hero,
    .drawing-header,
    .repair-hero,
    .member-hero,
    .readcardused-hero,
    .missing-hero,
    .update-board-hero,
    .request-board-hero,
    .itemmovement-hero,
    .visit-manage-hero,
    .org-hero,
    .partner-admin-hero) :where(p, .mud-typography-body1, .mud-typography-body2) {
    color: var(--workspace-muted) !important;
    font-size: .78rem !important;
    line-height: 1.45 !important;
}

.workspace-route-shell .mud-button-root:not(.mud-icon-button) {
    min-height: 34px;
    border-radius: 4px !important;
    font-weight: 700;
    text-transform: none;
}

.workspace-route-shell .mud-icon-button {
    flex: 0 0 auto;
}

.workspace-route-shell .mud-input-outlined-border,
.workspace-route-shell .mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol,
.workspace-route-shell .mud-input-root {
    border-radius: 4px !important;
}

.workspace-route-shell .mud-alert {
    border-radius: 4px !important;
}

.workspace-route-shell .mud-tabs {
    overflow: hidden;
    border: 1px solid var(--workspace-line);
    border-radius: var(--workspace-radius);
    background: var(--workspace-surface);
    box-shadow: none !important;
}

.workspace-route-shell .mud-tabs-toolbar {
    min-height: 42px;
    border-bottom: 1px solid var(--workspace-line);
    background: var(--workspace-surface);
}

.workspace-route-shell .mud-tabs-toolbar .mud-tab {
    min-height: 42px;
    padding: 0 16px;
    font-size: .76rem;
    font-weight: 800;
}

.workspace-route-shell .mud-tabs-panels {
    background: var(--workspace-surface);
}

.workspace-route-shell--workspace .mud-paper,
.workspace-route-shell--form .mud-paper,
.workspace-route-shell--board .mud-paper,
.workspace-route-shell--cards .mud-paper,
.workspace-route-shell--workspace .mud-card,
.workspace-route-shell--form .mud-card,
.workspace-route-shell--board .mud-card,
.workspace-route-shell--cards .mud-card {
    border-radius: var(--workspace-radius) !important;
}

.workspace-route-shell--workspace .mud-paper:not(.mud-popover),
.workspace-route-shell--form .mud-paper:not(.mud-popover),
.workspace-route-shell--board .mud-paper:not(.mud-popover) {
    box-shadow: none !important;
}

.workspace-route-shell .mud-table,
.workspace-route-shell .mud-data-grid {
    width: 100% !important;
    overflow: hidden;
    border: 1px solid var(--workspace-line) !important;
    border-radius: 4px !important;
    background: var(--workspace-surface);
    box-shadow: none !important;
}

.workspace-route-shell .mud-table-container,
.workspace-route-shell .mud-table-root {
    width: 100% !important;
    min-width: 100% !important;
}

.workspace-route-shell .mud-table-container {
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
}

.workspace-route-shell .mud-table-head .mud-table-cell,
.workspace-route-shell .mud-data-grid .mud-table-head .mud-table-cell {
    min-height: 38px;
    color: #475467;
    border-bottom: 1px solid var(--workspace-line-strong);
    background: var(--workspace-soft) !important;
    font-size: .7rem;
    font-weight: 800;
    white-space: nowrap;
}

.workspace-route-shell .mud-table-body .mud-table-row {
    transition: background-color 120ms ease;
}

.workspace-route-shell .mud-table-body .mud-table-row:hover {
    background: #f8fbff !important;
}

.workspace-route-shell .mud-table-cell {
    padding-top: 7px;
    padding-bottom: 7px;
    border-color: var(--workspace-line);
    font-size: .73rem;
}

.workspace-route-shell .mud-table-pagination {
    min-height: 42px;
    border-top: 1px solid var(--workspace-line);
    background: var(--workspace-surface);
}

.workspace-route-shell .mud-expansion-panels {
    border: 1px solid var(--workspace-line);
    border-radius: var(--workspace-radius);
    overflow: hidden;
}

.workspace-route-shell .mud-expansion-panel {
    border-bottom: 1px solid var(--workspace-line);
    border-radius: 0 !important;
    box-shadow: none !important;
}

.workspace-route-shell .mud-expansion-panel:last-child {
    border-bottom: 0;
}

.workspace-route-shell .card {
    border: 1px solid var(--workspace-line);
    border-radius: var(--workspace-radius);
    box-shadow: none;
}

.workspace-route-shell .card-header {
    color: var(--workspace-text);
    border-bottom: 1px solid var(--workspace-line);
    background: var(--workspace-soft);
    font-weight: 800;
}

.mud-dialog-container {
    padding: 56px 16px 16px;
}

.mud-dialog-container .mud-dialog {
    max-width: min(calc(100vw - 32px), var(--mud-dialog-width, 1200px));
    max-height: calc(100dvh - 72px);
    overflow: hidden;
    border: 1px solid var(--workspace-line);
    border-radius: var(--workspace-radius) !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18) !important;
}

.mud-dialog-container .mud-dialog-title {
    border-bottom: 1px solid var(--workspace-line);
}

.mud-dialog-container .mud-dialog-content {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.mud-dialog-container .mud-dialog-actions {
    z-index: 1;
    flex: 0 0 auto;
    border-top: 1px solid var(--workspace-line);
    background: var(--workspace-surface);
}

.workspace-route-shell--form > .col-sm-10,
.workspace-route-shell--form > .row,
.workspace-route-shell--form > form,
.workspace-route-shell--form > .mud-paper {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

.workspace-route-shell--form > .mud-paper {
    padding: 20px !important;
    border: 1px solid var(--workspace-line);
    box-shadow: var(--workspace-shadow) !important;
}

.workspace-route-shell--route-readcommute > div:first-of-type {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: -58px;
    margin-bottom: 18px;
    pointer-events: none;
}

.workspace-route-shell--route-readcommute > div:first-of-type > * {
    pointer-events: auto;
}

.workspace-route-shell--route-infra-particle-read > h5,
.workspace-route-shell--route-infra-diw-read > h5,
.workspace-route-shell--route-infra-cda-read > h5 {
    display: inline-flex;
    margin: 0 6px 6px 0;
    padding: 5px 8px;
    border: 1px solid var(--workspace-line);
    border-radius: 4px;
    color: var(--workspace-muted);
    background: var(--workspace-soft);
    font-size: .72rem;
    font-weight: 500;
}

@media (min-width: 1280px) {
    .legacy-overlay-body {
        padding-right: 20px !important;
        padding-left: 20px !important;
    }
}

@media (max-width: 959.98px) {
    .workspace-route-shell {
        gap: 10px;
    }

    .workspace-route-shell .mud-tabs-toolbar .mud-tab {
        padding: 0 12px;
    }

    .workspace-route-shell--route-readcommute > div:first-of-type {
        justify-content: flex-start;
        margin: 0;
    }
}

@media (max-width: 600px) {
    .workspace-route-shell h1,
    .workspace-route-shell .mud-typography-h4 {
        font-size: 1.35rem;
    }

    .workspace-route-shell .mud-table-cell {
        padding: 7px 8px;
    }

    .workspace-route-shell--form > .mud-paper {
        padding: 12px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .workspace-route-shell *,
    .workspace-route-shell *::before,
    .workspace-route-shell *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
