:root {
    /* Single source of truth for the brand indigo: it comes from the MudTheme
       primary (see Theme/SodexoTheme.cs). The literal fallback preserves the value
       if the theme variable is ever unavailable.
       (--mud-zindex-popover moved to the theme's ZIndex; the old
        --mud-palette-top-appbar-background was a dead/misspelled variable.) */
    --base-color: var(--mud-palette-primary, #283897);
}

.position-input {
    min-width: 0 !important;
    margin: 0 !important;
}

/* Day card – actions group: always a flex row so it works as a single toolbar item */
.day-card-actions-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
}

/*  Mobile (≤ 599 px) */
@media (max-width: 599px) {
    /* Toolbar wraps: type label stays on row 1, actions group drops to row 2 */
    .day-card-toolbar {
        flex-wrap: wrap !important;
        row-gap: 4px;
    }
    .day-card-actions-group {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 4px;
    }
    /* Bigger tap targets for icon buttons inside the actions group */
    .day-card-actions-group .mud-icon-button {
        padding: 10px !important;
    }
    /* Position input: give it a bit more room */
    .day-card-actions-group .position-input .mud-input-slot {
        min-width: 2rem !important;
    }
    /* Field rows (address, dates): stack vertically instead of side by side */
    .day-card-fields-row {
        flex-direction: column !important;
    }
    .day-card-fields-row .mud-divider-vertical {
        display: none !important;
    }
}

/*  Small tablets / landscape phones (600–959 px): the toolbar and the three-column
    field row still do not fit on one line here, so the action buttons used to overflow
    the card and labels like "Postområde" broke mid-word. Wrap both instead. */
@media (min-width: 600px) and (max-width: 959.98px) {
    .day-card-toolbar {
        flex-wrap: wrap !important;
        row-gap: 4px;
    }
    .day-card-actions-group {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 4px;
    }
    /* Reflow the fields into as many columns as fit at a readable width. */
    .day-card-fields-row {
        flex-wrap: wrap !important;
    }
    .day-card-fields-row > .mud-grid-item {
        flex: 1 1 16rem;
        min-width: 0;
    }
    .day-card-fields-row .mud-divider-vertical {
        display: none !important;
    }
}

/*  Desktop (≥ 600 px): bump field label and value text up one size tier  */
@media (min-width: 600px) {
    .day-card-body .mud-typography-caption {
        font-size: 0.875rem; /* caption → body2 size */
    }
    .day-card-body .mud-typography-body2 {
        font-size: 1rem;     /* body2 → body1 size */
    }
}

.position-input .mud-input-root {
    padding: 0 !important;
    font-size: 0.9rem !important;
}

.position-input .mud-input-slot {
    padding: 0 !important;
    text-align: center !important;
    font-size: 0.9rem !important;
    height: 1.5rem !important;
}

.base-color {
    color: var(--base-color) !important;
}

.base-color-background {
    background-color: var(--base-color) !important;
    color: #fff !important;
}

.base-color-background-alpha {
    background-color: #3d4ca7dd !important;
    color: #fff !important;
}

.bg-green {
    background-color: rgba(32,128,32,0.2) !important;
}

.bg-red {
    background-color: rgba(128,32,32,0.2) !important;
}

.bg-blue {
    background-color: rgba(32, 32, 128, 0.2) !important;
}

.bg-purple {
    background-color: rgba(128, 32, 128, 0.2) !important;
}

.bg-yellow {
    background-color: rgba(255, 228, 138, 0.2) !important;
}

.has-spare-parts {
    --spare-parts-outline: rgba(0, 0, 0, 0.35);
    --spare-parts-outline-width: 1.5px;
}

.has-spare-parts.bg-green {
    --spare-parts-outline: rgba(32, 128, 32, 0.6);
}

.has-spare-parts.bg-red {
    --spare-parts-outline: rgba(128, 32, 32, 0.6);
}

.has-spare-parts.bg-blue {
    --spare-parts-outline: rgba(32, 32, 128, 0.6);
}

.has-spare-parts.bg-purple {
    --spare-parts-outline: rgba(128, 32, 128, 0.6);
}

.has-spare-parts.bg-yellow {
    --spare-parts-outline: rgba(196, 150, 30, 0.7);
}

.has-spare-parts > td {
    border-top: var(--spare-parts-outline-width) dashed var(--spare-parts-outline) !important;
    border-bottom: var(--spare-parts-outline-width) dashed var(--spare-parts-outline) !important;
}

.has-spare-parts > td:first-child {
    border-left: var(--spare-parts-outline-width) dashed var(--spare-parts-outline) !important;
}

.has-spare-parts > td:last-child {
    border-right: var(--spare-parts-outline-width) dashed var(--spare-parts-outline) !important;
}

.has-spare-parts-on-dark {
    --spare-parts-outline: rgba(255, 255, 255, 0.85);
}

.mud-card.has-spare-parts {
    border: var(--spare-parts-outline-width) dashed var(--spare-parts-outline) !important;
}

.mobile-table-cell {
    box-shadow: inset 0 0 10px 4px #ddd;
}

.sodexo-top-appbar {
    color: var(--base-color) !important;
    background-color: #fff !important;
    border-bottom: 1px solid var(--base-color) !important;
    border-top: 10px solid var(--base-color) !important;
}

.sodexo-top-appbar .mud-nav-item {
    width: unset !important;
}

.sodexo-top-appbar .mud-nav-item .mud-nav-link {
    padding: 8px !important;
}

.sodexo-top-appbar .mud-nav-item .mud-nav-link-text {
    margin-left: unset !important;
}

.sodexo-top-appbar .nav-strip {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    overflow: hidden;
    min-width: 0;
    flex: 1 1 auto;
    column-gap: 4px;
}

.sodexo-top-appbar .nav-strip [data-nav-item] {
    flex: 0 0 auto;
    white-space: nowrap;
}

.sodexo-top-appbar .nav-strip [data-nav-item][data-overflow="true"] {
    display: none;
}

.sodexo-top-appbar .nav-more {
    flex: 0 0 auto;
    display: none;
    align-items: center;
}

.sodexo-top-appbar .nav-more[data-show="true"] {
    display: inline-flex;
}

/* MudPopover is portaled outside .nav-more, so target by the popover's own class. */
.nav-more-popover [data-nav-menu-item]:not([data-overflow="true"]) {
    display: none;
}

/* Make the "more" trigger a comfortable tap target on touch devices. */
.sodexo-top-appbar .nav-more .nav-more-trigger,
.sodexo-top-appbar .nav-more .mud-menu .mud-button-root {
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
}

.sodexo-top-appbar .nav-more .mud-icon-button {
    min-width: 48px;
    min-height: 48px;
}

.sodexo-top-appbar .nav-more .mud-icon-button .mud-icon-root {
    font-size: 1.75rem;
}

/* Overflow nav menu */
.nav-more-popover {
    min-width: 240px;
    max-width: min(360px, calc(100vw - 32px));
    max-height: min(70vh, calc(100vh - 120px));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.nav-more-popover .nav-more-list {
    padding: 4px 0;
}

.nav-more-popover .nav-more-item {
    min-height: 44px;
    padding: 8px 20px;
    font-size: 0.95rem;
    color: var(--base-color, inherit);
    text-decoration: none;
    transition: background-color 120ms ease;
}

.nav-more-popover .nav-more-item:hover,
.nav-more-popover .nav-more-item:focus-visible {
    background-color: rgba(0, 0, 0, 0.04);
}

.nav-more-popover .nav-more-item.active,
.nav-more-popover .nav-more-item[aria-current="page"] {
    background-color: rgba(42, 41, 92, 0.08);
    font-weight: 600;
}

.nav-more-popover .nav-more-item .mud-nav-link-text,
.nav-more-popover .nav-more-item .mud-menu-item-content {
    margin: 0;
}

.sodexo-bottom-appbar {
    background-color: #2a295c !important;
    color: #6c757d !important
}

#osm-container {
    height: 100%;
}

.header-column {
    background-color: var(--base-color);
    color: #fff !important;
}

.header-column .mud-icon-button {
    color: #fff !important;
}

.header-column .mud-text-disabled {
    color: #ddd !important;
}

.header-column .mud-icon-button-label {
    color: #fff !important;
}

.header-column th {
    color: #fff !important;
}
.header-column th:hover {
    color: #fff !important;
}
.header-column .column-header {
    color: #fff !important;
}
.header-column .column-header:hover {
    color: #fff !important;
}

.header-column .mud-table-sort-label:hover {
    color: #fff !important;
}

.dense-popover .mud-list-item-icon {
    min-width: 32px;
}

tr.mud-table-row .show-on-hover .mud-icon-button {
    opacity: 0;
}

tr.mud-table-row:hover .show-on-hover .mud-icon-button {
    opacity: 1;
}

.mud-nav-link:hover, .mud-nav-link:focus {
    background-color: unset !important;
}

.mud-cal-week-drop-item {
    min-height: 20px;
}

.button-opacity-hover button {
    opacity: 0.4;
}

.button-opacity-hover:hover button {
    opacity: 1;
}

.opacity-hover {
    opacity: 0.7;
    transition: opacity 0.4s;
}

.opacity-hover:hover {
    opacity: 1;
}

div.mud-table.toolbar-12 .mud-table-toolbar {
    height: 12px !important;
}

.mud-toolbar {
    min-height: unset !important;
    height: unset !important;
}

div.mud-dialog-title button.mud-button-close {
    color: white !important;
}

.mud-snackbar-position {
    right: 24px;
    bottom: 80px;
}

.item-completed > .mud-treeview-item-content {
    background-color: #d4edda;
    border-radius: 4px;
    margin-bottom: 2px;
    margin-top: 2px;
}

.item-completed > .mud-treeview-item-selected {
    background-color: #acdcb8 !important;
}

.item-not-accessible > .mud-treeview-item-content {
    background-color: #fff3cd;
    border-radius: 4px;
    margin-bottom: 2px;
    margin-top: 2px;
}

.item-not-accessible > .mud-treeview-item-selected {
    background-color: #ffe48a !important;
}

.item-not-completed > .mud-treeview-item-content {
    background-color: #f8d7da;
    border-radius: 4px;
    margin-bottom: 2px;
    margin-top: 2px;
}

.item-not-completed > .mud-treeview-item-selected {
    background-color: #ed9ba2 !important;
}

.mud-treeview.mud-treeview-selected-primary .mud-treeview-item-content.mud-treeview-item-selected {
    color: unset !important;
    --mud-ripple-color: unset !important;
}

/* Branded dialog title bars. These must stay global (not scoped .razor.css):
   MudDialog teleports its content into MudDialogProvider, outside the owning
   component's DOM, so scoped styles never reach .mud-dialog-title. */
.edit-dialog .mud-dialog-title,
.confirmation-dialog .mud-dialog-title,
.mud-message-box .mud-dialog-title {
    background-color: var(--base-color) !important;
    color: #fff !important;
    padding-top: 8px;
    padding-bottom: 8px;
}

.edit-dialog .mud-ripple-icon,
.confirmation-dialog .mud-ripple-icon,
.mud-message-box .mud-ripple-icon {
    padding-top: 6px;
    padding-bottom: 6px;
}

.full-width {
    width: 100%;
}

.full-page {
    position: fixed;
    left: 0;
    top: var(--mud-appbar-height);
    margin: 4px 24px 0px 24px;
    max-height: calc(100% - 140px);
    overflow-y: auto;
}

/*  fixes horizontal dividers */
hr:not([size]) {
    height: 2px !important;
}

.full-height {
    height: 100%;
}

.transparent-background {
    background-color: unset !important;
}

.icon-opacity-50 {
    opacity: 0.5;
}

.truncate-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.error-description-cell {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 10vw;
}

@media (max-width: 1280px) {
    .error-description-cell {
        max-width: 100%;
        min-width: 0;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
    }

    .mud-table-cell.stacked-label-cell {
        flex-direction: column;
        align-items: start;
        row-gap: 2px;
    }

    .mud-table-cell.stacked-label-cell:before {
        padding-right: 0;
        padding-inline-end: 0;
    }
}

.day-card-body .mud-stack {
    min-width: 0;
}

.day-card-body .mud-typography {
    overflow-wrap: break-word;
}

/* AssignmentCleanupDialog: keep stepper action buttons always visible, scroll step content */
.assignment-cleanup-dialog .mud-dialog-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    flex: 1;
    min-height: 0;
}

.assignment-cleanup-dialog .mud-stepper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.assignment-cleanup-dialog .mud-stepper-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0 24px;
}

.order-service-note-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.order-service-note-input .mud-input-slot,
.order-service-note-input textarea.mud-input-slot {
    font-size: 0.8125rem;
    line-height: 1.25rem;
}

.order-service-note-input .mud-input-label {
    font-size: 0.8125rem;
}
