/* The marketing site's fonts (Inter, Inter Tight — SIL OFL 1.1, latin subset), self-hosted the
   same way. Here rather than in layouts.css so the sign-in pages get them too. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url(../fonts/inter-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter Tight';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url(../fonts/inter-tight-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Global autocomplete disable - prevents browser autofill and password managers */
/* Autocomplete attributes should be set in HTML, not CSS */

/* Additional attributes to prevent autofill */
/* Autocomplete attributes should be set in HTML, not CSS */

/* Prevent Chrome autofill highlighting */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: inherit !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

/* Prevent Firefox autofill */
input:-moz-autofill {
    background-color: transparent !important;
    color: inherit !important;
}

/* Customer search suggestions styling */
.customer-suggestion-item {
    padding: 12px 16px !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

.customer-suggestion-item:hover {
    background-color: var(--mud-palette-action-hover) !important;
}

.add-customer-item {
    padding: 12px 16px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.add-customer-item:hover {
    background-color: var(--mud-palette-primary) !important;
}

.add-customer-item:hover * {
    color: white !important;
}

/* MudBlazor specific overrides */
/* Autocomplete attributes should be set in HTML, not CSS */

/* Performance optimizations for input responsiveness */
.mud-input-control input,
.mud-input-control textarea,
.mud-input-control select {
    /* Improve input responsiveness */
    will-change: auto;
    transform: translateZ(0);
    /* Reduce input lag */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Optimize MudBlazor components for better performance */
.mud-text-field {
    contain: style paint;
}

/* Reduce unnecessary repaints */
.mud-list-item {
    contain: layout style paint;
}

/* Optimize suggestion dropdowns */
.customer-suggestions {
    contain: layout style paint;
    transform: translateZ(0);
}

/* Additional input performance optimizations */
input, textarea, select {
    /* Force hardware acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Optimize rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Reduce input delay */
    -webkit-tap-highlight-color: transparent;
}


/* Optimize focus states */
input:focus, textarea:focus, select:focus {
    outline: none;
    /* Prevent layout shifts */
    box-shadow: 0 0 0 2px var(--mud-palette-primary);
}

/* Optimize MudBlazor input focus */
.mud-input-control input:focus,
.mud-input-control textarea:focus,
.mud-input-control select:focus {
    outline: none;
}

/* Login page styling */
.card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 8px;
}

.card-header {
    background: #2563eb;
    color: white;
    border-radius: 8px 8px 0 0 !important;
    border: none;
    border-bottom: 2px solid #1d4ed8;
}

.card-header h2 {
    margin: 0;
    font-weight: 500;
}

.form-floating {
    position: relative;
}

.form-floating > .form-control,
.form-floating > .form-control-plaintext {
    height: calc(3.5rem + 2px);
    line-height: 1.25;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity .1s ease-in-out,transform .1s ease-in-out;
}

.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: .65;
    transform: scale(.85) translateY(-0.5rem) translateX(0.15rem);
}

.form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 12px 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.2);
}

.btn-primary {
    background: #2563eb;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

.text-danger {
    color: #dc3545 !important;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

#blazor-error-ui {
    background: lightyellow;
    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;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHZpZXdCb3g9IjAgMCA1NiA0OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTU2IDQ5SDBWMGg1NnY0OVoiIGZpbGw9IiNGNUY1RjUiLz4KPHRleHQgeD0iMjgiIHk9IjI1IiBmb250LWZhbWlseT0iQXJpYWwiIGZvbnQtc2l6ZT0iMTQiIGZvbnQtd2VpZ2h0PSJib2xkIiBmaWxsPSIjNjU2NTY1IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+QXBwIGVycm9yPC90ZXh0Pgo8L3N2Zz4K) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

/* Standard CRUD page shell */
.crud-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crud-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.crud-page-title {
    margin: 0;
}

.crud-page-subtitle {
    margin-top: 0.35rem;
    color: var(--mud-palette-text-secondary);
}

.crud-filter-panel,
.crud-table-panel {
    border-radius: 12px;
}

.crud-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
}

.crud-result-count {
    color: var(--mud-palette-text-secondary);
}

/* Secondary/"muted" body text.
   The markup across the app uses Bootstrap's .text-muted, but Bootstrap is only linked by
   _Layout.cshtml (Identity pages) and PublicLayout.razor (the public quote-acceptance page).
   Inside the Blazor app — which is hosted by _Host.cshtml and does not load Bootstrap — every
   .text-muted was a no-op, so text meant to be de-emphasised rendered at full emphasis.
   Defining it here makes it resolve to the same token .crud-result-count uses, so secondary
   text reads identically on every page and in both themes. */
.text-muted {
    color: var(--mud-palette-text-secondary);
}

.crud-loading-state,
.crud-empty-state {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.crud-empty-state .mud-icon-root {
    margin-bottom: 0.75rem;
}

.crud-dialog-paper {
    width: min(96vw, 960px);
    max-height: 90vh;
    margin: 3rem auto;
    overflow-y: auto;
}

.crud-dialog-paper.crud-dialog-paper--narrow {
    width: min(96vw, 600px);
}

.crud-dialog-paper.crud-dialog-paper--wide {
    width: min(96vw, 1100px);
}

/* Centred modal surface for a <MudOverlay> whose content positions itself.
   Eleven dialogs each repeated this same ~150-character inline style, drifting on
   z-index and overflow along the way. The shared positioning lives here; a dialog that
   needs a different width still sets just `Style="max-width: …"`. */
.crud-modal-paper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 90vw;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

/* A dialog opened from on top of another one (note editors, line-item pickers). */
.crud-modal-paper.crud-modal-paper--nested {
    z-index: 1001;
}

@media (max-width: 959px) {
    .crud-table-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* Calendar Styles */
.calendar-day {
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 8px;
    cursor: pointer;
}

.calendar-day:hover {
    background-color: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-day-other-month {
    background-color: #fafafa;
    color: #999;
}

.calendar-day-other-month:hover {
    background-color: #f0f0f0;
}

.calendar-day .mud-chip {
    margin: 1px 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day .mud-text {
    margin-bottom: 4px;
}

/* Responsive calendar grid */
@media (max-width: 768px) {
    .calendar-day {
        min-height: 60px;
        padding: 4px;
    }
    
    .calendar-day .mud-chip {
        font-size: 0.6rem !important;
        padding: 2px 4px;
    }
}

/* Holiday Calendar Specific Styles */
.holiday-calendar {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px !important;
}

.holiday-calendar .mud-calendar {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px !important;
}

.holiday-calendar .mud-calendar-month {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px !important;
}

.holiday-calendar .mud-calendar-month-view {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px !important;
}

.holiday-calendar .mud-calendar-month-view .mud-calendar-month-view-day {
    min-height: 80px !important;
    height: auto !important;
    padding: 4px !important;
}

.holiday-calendar .mud-calendar-month-view .mud-calendar-month-view-day .mud-calendar-month-view-day-content {
    min-height: 60px !important;
    height: auto !important;
}

.holiday-calendar .mud-calendar-month-view .mud-calendar-month-view-day .mud-calendar-month-view-day-content .mud-calendar-month-view-day-items {
    max-height: none !important;
    overflow: visible !important;
}

/* Ensure calendar items are properly sized */
.holiday-calendar .mud-calendar-item {
    margin: 1px 0 !important;
    padding: 2px 4px !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Vehicle Dialog Styles */
.vehicle-dialog {
    position: relative !important;
    margin: 20px auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1000 !important;
}

/* Ensure dialog is properly positioned on all screen sizes */
@media (max-height: 600px) {
    .vehicle-dialog {
        margin: 10px auto !important;
        max-height: 95vh !important;
    }
}

/* Registration input styling */
.registration-container {
    background-color: var(--mud-palette-background) !important;
}

.registration-input {
    margin: 0 !important;
}

.registration-search-btn {
    min-width: 40px !important;
    height: 40px !important;
}

/* Enquiry View Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

.enquiry-dialog {
    width: 600px;
    max-width: 90vw;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Fix for MudSelect and MudAutocomplete double scroll bars */
/* The issue is caused by both the popover and list having overflow */
/* Only the innermost list should have scroll */

.mud-popover-provider .mud-popover,
.mud-select-popover,
.mud-autocomplete-popover {
    overflow: visible !important;
}

.mud-popover .mud-paper,
.mud-select-popover .mud-paper,
.mud-autocomplete-popover .mud-paper {
    overflow: visible !important;
}

/* Only the list should scroll */
.mud-popover .mud-list,
.mud-select-popover .mud-list,
.mud-autocomplete-popover .mud-list {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.mud-popover .mud-list-padding,
.mud-select-popover .mud-list-padding,
.mud-autocomplete-popover .mud-list-padding {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Prevent double scrollbars on the paper element */
.mud-paper.mud-elevation-8,
.mud-paper.mud-popover-paper {
    overflow: visible !important;
}

/* Ensure dropdowns don't exceed viewport */
.mud-select-popover .mud-list,
.mud-autocomplete-popover .mud-list {
    max-height: min(300px, calc(100vh - 200px)) !important;
}


/* Mobile responsive */
@media (max-width: 768px) {
    .enquiry-dialog {
        width: 95vw;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 12px 20px;
    }
    
    /* Mobile specific select fixes */
    .mud-popover .mud-list,
    .mud-select-popover .mud-list,
    .mud-popover .mud-list-padding {
        max-height: 250px !important;
    }
    
    /* Mobile specific autocomplete fixes */
    .mud-autocomplete-popover .mud-list,
    .mud-autocomplete-popover .mud-list-padding {
        max-height: 250px !important;
    }
} 
/* Dashboard figures (Shared/StatCard.razor): the label and icon on top, the figure below at full
   card width so a four-digit number never has to wrap. */
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    padding: 14px 16px 16px;
}

.stat-card--link {
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.stat-card--link:hover {
    border-color: rgba(var(--stat-rgb), 0.45) !important;
    box-shadow: 0 2px 4px rgba(11, 22, 38, 0.04), 0 6px 16px rgba(11, 22, 38, 0.06) !important;
}

.stat-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.stat-card-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    line-height: 1.35;
    padding-top: 4px;
}

.stat-card-value {
    font-family: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--mud-palette-text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.stat-card-hint {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.stat-card-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(var(--stat-rgb), 0.1);
    color: rgb(var(--stat-rgb));
}

@media (max-width: 599.98px) {
    .stat-card {
        padding: 12px 14px 14px;
    }

    .stat-card-value {
        font-size: 1.5rem;
    }
}

/* List toolbars: a search box and the filters beside it, wrapping onto two rows when narrow. */
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.list-toolbar-search {
    flex: 0 1 380px;
    min-width: 240px;
}

.list-toolbar-search .mud-input-control {
    margin: 0;
}

/* Pills follow the search box, or start the next row when they don't fit beside it. A plain
   result count sits at the far right. */
.list-toolbar-filters {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-start;
}

.list-toolbar-filters:has(> .crud-result-count) {
    justify-content: flex-end;
}

@media (max-width: 959.98px) {
    .list-toolbar-search {
        flex-basis: 100%;
    }

    .list-toolbar-filters,
    .list-toolbar-filters:has(> .crud-result-count) {
        flex-basis: 100%;
        justify-content: flex-start;
    }
}

/* Filter pills (Shared/FilterPills.razor). */
.filter-pills {
    display: flex;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding: 2px;
    margin: -2px;
    scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #e3e8ef;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.filter-pill:hover {
    background: #f7f9fc;
    border-color: #cbd5e1;
}

.filter-pill:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

.filter-pill--active,
.filter-pill--active:hover {
    background: #eff5ff;
    border-color: var(--mud-palette-primary);
    color: #1d4ed8;
}

.filter-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filter-pill-count {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    background: #eef3f9;
    color: #4a5768;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.filter-pill--active .filter-pill-count {
    background: var(--mud-palette-primary);
    color: #fff;
}

/* Detail pages (a job, quote, invoice, vehicle…): back button, title with its status, a subtitle,
   and the page's actions. Below 960px the actions drop under the title and wrap. */
.detail-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
    margin-bottom: 20px;
}

.detail-header-main {
    min-width: 0;
}

.detail-header-titlerow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.detail-header-title {
    margin: 0;
    overflow-wrap: anywhere;
}

.detail-header-subtitle {
    margin-top: 2px;
    color: var(--mud-palette-text-secondary);
}

.detail-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 959.98px) {
    .detail-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .detail-header-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 599.98px) {
    .detail-header .detail-header-title {
        font-size: 1.375rem;
    }

    .detail-header-actions .mud-button-root {
        flex: 1 1 auto;
    }
}

/* Section headings in cards: the icon lines up with the text and picks up the brand colour. */
h6.mud-typography > .mud-icon-root:first-child,
h5.mud-typography > .mud-icon-root:first-child {
    vertical-align: -0.2em;
    font-size: 1.25em;
}

h6.mud-typography > .mud-icon-root:first-child:not([class*="-text"]),
h5.mud-typography > .mud-icon-root:first-child:not([class*="-text"]) {
    color: var(--mud-palette-primary);
}

/* Segmented control: a small set of mutually exclusive modes (Part Finder's search modes). It
   scrolls sideways on a phone rather than wrapping. */
.segmented {
    display: inline-flex;
    gap: 2px;
    max-width: 100%;
    overflow-x: auto;
    padding: 3px;
    border-radius: 10px;
    background: #eef3f9;
    scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
    display: none;
}

.segmented-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 34px;
    padding: 0 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #4a5768;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.segmented-option:hover:not(:disabled) {
    color: #0a1220;
}

.segmented-option:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

.segmented-option:disabled {
    opacity: 0.6;
    cursor: default;
}

.segmented-option--active {
    background: #fff;
    color: var(--mud-palette-primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(11, 22, 38, 0.08), 0 1px 1px rgba(11, 22, 38, 0.04);
}

/* Property/value tables (System Info): the name in grey on the left, its value beside it. */
.key-value-table th[scope="row"] {
    width: 40%;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
    text-align: start;
    vertical-align: top;
}

.key-value-table td {
    overflow-wrap: anywhere;
}

/* The customer's quote and invoice (Pages/Public/AcceptQuote.razor, ViewInvoice.razor): every column fits on a phone,
   the description taking what is left and breaking long references rather than pushing the amounts off the screen. */
@media (max-width: 599.98px) {
    .quote-items-table th,
    .quote-items-table td,
    .invoice-lines-table th,
    .invoice-lines-table td {
        padding: 8px 6px !important;
        font-size: 0.8125rem;
    }

    .quote-items-table td:not(:first-child),
    .quote-items-table th:not(:first-child),
    .invoice-lines-table td:not(:first-child) {
        white-space: nowrap;
    }

    /* The invoice has a column more than the quote, so its headings may wrap ("Unit price") to leave the amounts room. */
    .invoice-lines-table th,
    .invoice-lines-table td {
        padding: 8px 4px !important;
    }

    .invoice-lines-table td:first-child {
        overflow-wrap: anywhere;
    }
}

/* Button rows that wrap as a whole rather than squeezing each label onto two lines. */
.quick-actions .mud-button-root {
    white-space: nowrap;
}

/* AddressInput (Shared/AddressInput.razor): the address finder's dropdown and map preview. */
.address-input-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 2px 0;
}

.address-input-option-icon {
    flex: none;
    margin-top: 2px;
    color: var(--mud-palette-text-secondary);
}

.address-input-option-text {
    min-width: 0;
}

.address-input-option-title {
    font-weight: 500;
}

.address-input-option-subtitle {
    display: block;
    white-space: normal;
    color: var(--mud-palette-text-secondary);
}

.address-input-note {
    display: block;
    padding: 8px 16px 4px;
    color: var(--mud-palette-text-secondary);
}

.address-input-credit {
    display: block;
    padding: 4px 16px 6px;
    font-size: 0.7rem;
    color: var(--mud-palette-text-disabled);
}

.address-input-map {
    height: 200px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    overflow: hidden;
}

.address-input-map-caption {
    color: var(--mud-palette-text-secondary);
}

/* Background Jobs (Pages/Admin/BackgroundJobs.razor) */
.background-jobs-error {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.background-jobs-server {
    overflow-wrap: anywhere;
}

.background-jobs-action {
    white-space: nowrap;
}

/* Roles and permissions: the permission picker and the roles list. */
.permission-module-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.permission-module-title { min-width: 0; flex: 1 1 220px; }
.permission-module-count { white-space: nowrap; }
.permission-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.25rem 1rem; padding: 0.35rem 0; border-top: 1px solid var(--mud-palette-lines-default); }
.permission-row-box { flex: 0 1 280px; min-width: 220px; }
.permission-row-box .mud-checkbox { margin: 0; }
.permission-row-detail { flex: 1 1 260px; min-width: 0; padding-top: 0.45rem; }
.permission-row-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.25rem; }
.permission-row-chips .mud-chip { margin: 0; }
.role-name-cell { min-width: 0; overflow-wrap: anywhere; }
