
.mud-typography-body2 {
    color: var(--mud-palette-text-secondary);
}
.mud-typography-subtitle2 {
    color: var(--mud-palette-text-secondary);
}
.mud-input {
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}
.mud-tabs {
    background-color: var(--mud-palette-drawer-background);
}
.mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol {
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}

.mud-simple-table table * tr > td, .mud-simple-table table * tr th {
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}

.mud-expand-panel .mud-expand-panel-header {
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}

.mud-button-year {
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}

.mud-table-cell {
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}

.mud-typography-body1 {
    font-size: var(--mud-typography-body1-size);
}

.mud-typography-body2 {
    font-size: var(--mud-typography-body2-size);
}

.mud-button-outlined-size-small {
    font-size: var(--mud-typography-body2-size);
}

/* Prevent button text wrapping */
.btn-nowrap,
.btn-nowrap .mud-button-label,
.btn-nowrap .mud-button-root {
    white-space: nowrap !important;
}

#blazor-error-ui {
    background: lightyellow;
    background-color: var(--mud-palette-error);
    color: var(--mud-palette-error-text);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    padding: 0.6rem 1.75rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
}

#reconnect-modal {
    background: lightyellow;
    background-color: var(--mud-palette-warning-hover);
    color: var(--mud-palette-warning-darken);
    top: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    padding: 0.6rem 1.75rem 0.7rem 1.25rem;
    margin: 0px;
    position: fixed;
    width: 100%;
    z-index: 9999;
}


.mud-nav-link {
    white-space: normal !important;
}

.user-button {
    text-transform: none;
    background: rgba(var(--mud-palette-primary-rgb), 0.1)
}

.side-menu .mud-chip.mud-chip-size-small {
    font-size: 0.625rem;
    height: 1.125rem;
}


.point {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background-color: gray;
}

.point-rawmaterials {
    background-color: #0ad2ff;
}

.point-processedmaterials {
    background-color: #2962ff;
}

.point-componentproducts {
    background-color: #9500ff;
}

.point-assembly {
    background-color: #ff0059;
}

.point-distribution {
    background-color: #ff8c00;
}

.point-marketplacement {
    background-color: #b4e600;
}

.point-use {
    background-color: #0fffdb;
}

.point-repairremanufactureorrecycle {
    background-color: #208b3a;
}

/* A touch of hardcoded WSolve-flair */

.mud-nav-link.mud-ripple.active {
    border-right-color: #30D4A1 !important;
}
.mud-nav-link.active:not(.mud-nav-link-disabled) {
    font-weight: 600 !important;
    color: #455A64 !important;
}

.mud-icon-root.mud-svg-icon.mud-icon-size-medium.mud-nav-link-expand-icon.mud-transform {
    fill: #455A64 !important;
}

.mud-navmenu.mud-navmenu-default.mud-nav-link.active:not(.mud-nav-link-disabled) {
    color: #455A64 !important;
}

.mud-nav-link-icon {
    color: #9997A8 !important;
}

a.active .mud-nav-link-icon {
    color: #455A64 !important;
}

.mud-drawer.side-menu {
    color: #455A64 !important;
}

.mud-drawer.side-menu {
    background-image: url("../img/subtle-menu-background.png") !important;
    background-repeat: no-repeat;
    background-position: right bottom;
}


/* Temporary dashboard placeholder */

/* Shared styles for list view select dropdowns */
.list-view-select .mud-input-label {
    color: rgba(0, 0, 0, 0.6) !important;
}

.list-view-select .mud-input-label.mud-input-label-inputcontrol {
    color: rgba(0, 0, 0, 0.6) !important;
}

.list-view-select.mud-input-helper-text {
    color: rgba(0, 0, 0, 0.6) !important;
}

/* Shared styles for MudDataGrid toolbars */
.mud-table-toolbar {
    min-height: 120px !important;
}

/* Shared styles for Fancybox image gallery */
.fancybox__container {
    --fancybox-bg: rgba(24, 24, 27, 0.85);
    z-index: 10000 !important;
}

/* Ensure close button is clickable and above everything */
.fancybox__button--close {
    z-index: 10001 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
}

/* ============================================
   DPP Styling Enhancements
   ============================================ */

/* Focus states for accessibility */
.mud-button:focus-visible,
.mud-icon-button:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Field value styling */
.field-value {
    color: var(--mud-palette-text-primary);
    font-weight: 500;
}

/* Field row hover effect */
.field-row:hover {
    background-color: var(--mud-palette-action-default-hover);
    transition: background-color 0.15s ease;
}

/* White tooltip for field info */
.field-info-tooltip.mud-tooltip {
    background-color: white !important;
    color: var(--mud-palette-text-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.field-info-tooltip.mud-tooltip .mud-tooltip-arrow {
    color: white !important;
}

.field-info-tooltip.mud-tooltip .mud-tooltip-arrow::before {
    background-color: white !important;
    border-color: white !important;
}

.field-info-tooltip.mud-tooltip .mud-tooltip-arrow svg {
    fill: white !important;
}

/* Global checkbox styling - use primary theme color when checked */
.mud-checkbox .mud-checkbox-input:checked + .mud-checkbox-checkmark,
.mud-checkbox-true .mud-checkbox-checkmark {
    color: var(--mud-palette-primary) !important;
}

.mud-checkbox .mud-checkbox-input:checked + .mud-checkbox-checkmark svg,
.mud-checkbox-true .mud-checkbox-checkmark svg {
    fill: var(--mud-palette-primary) !important;
}

/* Add field row - consistent heights */
.add-field-row .mud-input-control {
    margin-bottom: 0 !important;
}

.add-field-row .mud-input-control .mud-input-slot {
    height: 40px !important;
}

.add-field-row .mud-select,
.add-field-row .mud-input,
.add-field-row .mud-picker {
    height: 40px !important;
}

/* Print styles for DPP */
@media print {
    .mud-appbar,
    .mud-drawer,
    .mud-drawer-overlay,
    .no-print,
    .mud-icon-button {
        display: none !important;
    }

    .mud-card,
    .mud-paper {
        box-shadow: none !important;
        border: 1px solid #e0e0e0;
    }

    .mud-container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .mud-text-h5, .mud-typography-h5 {
        font-size: 14pt !important;
    }

    .mud-text-h6, .mud-typography-h6 {
        font-size: 12pt !important;
    }
}

/* Global tooltip max-width */
.mud-tooltip {
    max-width: 320px;
}

/* Tab badge overflow + spacing */
.mud-tabs-header .mud-tab {
    overflow: visible !important;
}

.mud-tabs-header .mud-tab-slider-container {
    overflow: visible !important;
}

.mud-tabs-header .mud-tabs-toolbar-content {
    gap: 4px;
}

/* Leaflet route map markers */
.leaflet-route-marker .route-marker-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1976D2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.leaflet-route-marker.route-marker-highlighted .route-marker-number,
.route-marker-highlighted .route-marker-number {
    background: #F57C00;
    transform: scale(1.3);
    transition: transform 0.2s ease;
}

.route-delete-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.mud-paper:hover .route-delete-btn {
    opacity: 1;
}

.route-card-highlighted {
    animation: route-card-pulse 2s ease-in-out;
}

@keyframes route-card-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.5); }
    15%  { box-shadow: 0 0 8px 3px rgba(25, 118, 210, 0.45); }
    50%  { box-shadow: 0 0 8px 3px rgba(25, 118, 210, 0.45); }
    100% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0); }
}

.route-drop-placeholder {
    height: 4px;
    transition: height 0.15s ease, opacity 0.15s ease;
}

.route-drop-placeholder--active {
    height: 48px;
    border: 2px dashed var(--mud-palette-text-secondary);
    border-radius: 8px;
    background: transparent;
    margin: 4px 0;
}

/* BIM viewer fullscreen */
.xbim-viewer-container:fullscreen {
    height: 100vh !important;
    width: 100vw !important;
    border: none !important;
    border-radius: 0 !important;
    background: #000;
}

/* Equal-width MudTabs (e.g. 50/50 split for two tabs) */
.mud-tabs-full-width .mud-tabs-tabbar-content {
    justify-content: center;
}

.mud-tabs-full-width .mud-tabs-tabbar-content .mud-tab {
    flex: 1 1 0;
    max-width: none;
    justify-content: center;
}

/* Fieldset template drag handles — visible only on row hover, grab cursor on icon only */
.fieldset-drop-container .mud-drop-item {
    cursor: default !important;
}

.fieldset-drag-handle {
    opacity: 0;
    cursor: grab !important;
    transition: opacity 0.15s ease;
}

.fieldset-section-row:hover .fieldset-drag-handle,
.fieldset-field-row:hover .fieldset-drag-handle {
    opacity: 1;
}

/* SidePanel: constrain drawer so the body area scrolls independently */
aside.side-panel-drawer {
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    overflow: hidden;
}

aside.side-panel-drawer .mud-drawer-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

/* MudBlazor 8.x renders .mud-drawer-overlay as a sibling of the <aside>
   with a z-index that can match or exceed the inline z-index we set on
   the drawer. Pin the scrim above the appbar (1300) but below the
   side-panel drawer (1311+, set in SidePanel.razor) so the backdrop
   dims the whole page including the app bar while leaving the side
   panel rendered in full color on top. */
.mud-overlay.mud-drawer-overlay.mud-drawer-overlay-temporary {
    z-index: 1305;
}

/* ===== LCA reports page ===== */

.lca-kpi-tile {
    border-radius: 12px;
    border: 1px solid var(--mud-palette-lines-default);
}

/* Tone backgrounds scoped to .lca-kpi-tile only — never combine with `.lca-kpi-tooltip-icon`,
   otherwise the tooltip info glyph accidentally picks up the info gradient (mud-info blue box). */
.lca-kpi-tile.lca-kpi-default { background: var(--mud-palette-surface); }
.lca-kpi-tile.lca-kpi-positive { background: linear-gradient(135deg, var(--mud-palette-success-lighten) 0%, var(--mud-palette-surface) 100%); }
.lca-kpi-tile.lca-kpi-warning { background: linear-gradient(135deg, var(--mud-palette-warning-lighten) 0%, var(--mud-palette-surface) 100%); }
.lca-kpi-tile.lca-kpi-info { background: linear-gradient(135deg, var(--mud-palette-info-lighten) 0%, var(--mud-palette-surface) 100%); }

.lca-kpi-label {
    color: var(--mud-palette-text-secondary);
    margin-bottom: 4px;
}

.lca-kpi-tooltip-icon {
    margin-left: 4px;
    vertical-align: middle;
    color: var(--mud-palette-text-secondary);
    background: transparent !important;
}

/* MudTooltip wraps the trigger in inline elements that sometimes carry a tinted surface — keep clear on KPI tiles */
.lca-kpi-tile .mud-tooltip-root,
.lca-kpi-tile .mud-tooltip-inline {
    background: transparent !important;
}

/* Carbon Heroes stacked horizontal band */
.lca-heroes-band {
    display: flex;
    width: 100%;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--mud-palette-action-disabled-background);
}

.lca-heroes-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.15s ease;
    overflow: hidden;
    white-space: nowrap;
}

.lca-heroes-segment:hover {
    filter: brightness(1.1);
}

.lca-heroes-segment-label {
    padding: 0 6px;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* CSS treemap (per-stage / per-material) */
.lca-treemap {
    display: flex;
    width: 100%;
    height: 360px;
    gap: 4px;
}

.lca-treemap-group {
    display: flex;
    flex-direction: column;
    min-width: 80px;
}

.lca-treemap-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-action-disabled-background);
    border-radius: 4px 4px 0 0;
}

.lca-treemap-group-share {
    color: var(--mud-palette-text-secondary);
    font-weight: 400;
}

.lca-treemap-cells {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
}

.lca-treemap-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 24px;
    padding: 2px 4px;
    color: #fff;
    font-size: 0.7rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    overflow: hidden;
    text-align: center;
    transition: filter 0.15s ease;
}

.lca-treemap-cell:hover {
    filter: brightness(1.1);
}

.lca-treemap-cell-label {
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
}

.lca-treemap-cell-value {
    opacity: 0.85;
    font-size: 0.65rem;
}
