.quote-card {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(0,0,0,0.125);
    position: relative;
    overflow: hidden;
}

/* Kanban pipeline progress fill (see docs/frontend/quote_pipeline_progress.md) */
.quote-card--kanban .quote-card-body {
    position: relative;
    z-index: 1;
}

.quote-card--kanban .quote-card-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--quote-progress-pct, 0%);
    max-width: 100%;
    z-index: 0;
    pointer-events: none;
    transition: width 0.25s ease;
}

.quote-card--kanban[data-pipeline-tone="active"] .quote-card-progress-fill {
    background: rgba(13, 110, 253, 0.18);
}

.quote-card--kanban[data-pipeline-tone="won"] .quote-card-progress-fill {
    background: rgba(25, 135, 84, 0.22);
}

.quote-card--kanban[data-pipeline-tone="lost"] .quote-card-progress-fill {
    background: rgba(220, 53, 69, 0.2);
}

.quote-card--kanban[data-pipeline-tone="neutral"] .quote-card-progress-fill {
    background: rgba(108, 117, 125, 0.2);
}

html[data-theme="dark"] .quote-card--kanban[data-pipeline-tone="active"] .quote-card-progress-fill,
body[data-bs-theme="dark"] .quote-card--kanban[data-pipeline-tone="active"] .quote-card-progress-fill {
    background: rgba(79, 196, 219, 0.22);
}

@media (hover: hover) and (pointer: fine) {
    html[data-theme="dark"] .quote-card--kanban:hover,
    body[data-bs-theme="dark"] .quote-card--kanban:hover {
        border-color: var(--iegi-cyan, #4FC4DB) !important;
    }
}

/* Quotes index metrics HUD */
.quotes-index-header,
.quotes-metrics-hud {
    --quotes-index-accent: var(--iegi-blue, #204C95);
    --quotes-index-accent-hover: #1B3F7A;
    --quotes-index-icon: var(--iegi-blue, #204C95);
    --quotes-metric-value-size: 1.65rem;
}

html[data-theme="dark"] .quotes-index-header,
html[data-theme="dark"] .quotes-metrics-hud,
body[data-bs-theme="dark"] .quotes-index-header,
body[data-bs-theme="dark"] .quotes-metrics-hud {
    --quotes-index-accent: var(--iegi-cyan, #4FC4DB);
    --quotes-index-accent-hover: #7dd8ea;
    --quotes-index-icon: var(--iegi-cyan, #4FC4DB);
}

.quotes-metrics-hud-grid .quotes-metric-tile {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    background: var(--bs-body-bg, #fff);
    padding: 0.9rem 0.75rem;
    height: 100%;
    min-height: 6.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.quotes-metrics-hud--loading .quotes-metric-tile--skeleton .quotes-metric-value {
    opacity: 0.45;
}

.quotes-metric-icon-wrap {
    display: block;
    margin-bottom: 0.35rem;
}

.quotes-metric-icon {
    font-size: 1.35rem;
    opacity: 0.92;
}

.quotes-metric-tile--primary .quotes-metric-icon,
.quotes-metric-tile--info .quotes-metric-icon {
    color: var(--quotes-index-icon, var(--iegi-blue, #204C95));
}

.quotes-metric-tile--success .quotes-metric-icon {
    color: var(--bs-success, #198754);
}

.quotes-metric-tile--secondary .quotes-metric-icon {
    color: var(--bs-secondary-color, #6c757d);
}

.quotes-metric-tile--muted .quotes-metric-icon {
    color: var(--bs-secondary-color, #6c757d);
}

.quotes-metric-title {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.3rem;
    color: var(--bs-secondary-color, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.quotes-metric-value {
    display: block;
    font-size: var(--quotes-metric-value-size);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--bs-body-color, #212529);
}

.quotes-metric-tile--primary .quotes-metric-value,
.quotes-metric-tile--info .quotes-metric-value {
    color: var(--quotes-index-accent, var(--iegi-blue, #204C95));
}

.quotes-metric-tile--success .quotes-metric-value {
    color: var(--bs-success, #198754);
}

.quotes-metric-sub {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    line-height: 1.25;
    max-width: 100%;
}

html[data-theme="dark"] .quotes-metrics-hud-grid .quotes-metric-tile,
body[data-bs-theme="dark"] .quotes-metrics-hud-grid .quotes-metric-tile {
    background: #374151;
    border-color: #4a5568;
    box-shadow: none;
}

html[data-theme="dark"] .quotes-metric-title,
body[data-bs-theme="dark"] .quotes-metric-title {
    color: #a0aec0;
}

html[data-theme="dark"] .quotes-metric-tile--primary .quotes-metric-value,
body[data-bs-theme="dark"] .quotes-metric-tile--primary .quotes-metric-value {
    color: var(--quotes-index-accent, #4FC4DB);
}

html[data-theme="dark"] .quotes-metric-tile--info .quotes-metric-value,
body[data-bs-theme="dark"] .quotes-metric-tile--info .quotes-metric-value {
    color: var(--quotes-index-accent, #4FC4DB);
}

html[data-theme="dark"] .quotes-metric-value,
body[data-bs-theme="dark"] .quotes-metric-value {
    color: #e2e8f0;
}

html[data-theme="dark"] .quotes-metric-tile--success .quotes-metric-value,
body[data-bs-theme="dark"] .quotes-metric-tile--success .quotes-metric-value {
    color: #75b798;
}

html[data-theme="dark"] .quotes-metric-sub,
body[data-bs-theme="dark"] .quotes-metric-sub {
    color: #a0aec0 !important;
}

@media (max-width: 767.98px) {
    .quotes-metrics-hud-grid > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .quotes-metrics-hud-grid .quotes-metric-tile {
        width: 100%;
    }
}

/* Quotes index empty / error banner */
.quotes-empty-state {
    padding: 1rem 1.25rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.45;
}

html[data-theme="light"] .quotes-empty-state,
html:not([data-theme="dark"]) .quotes-empty-state {
    background-color: #f8f9fa;
    color: #495057;
    border-color: #dee2e6;
}

html[data-theme="dark"] .quotes-empty-state,
body[data-bs-theme="dark"] .quotes-empty-state {
    background-color: #374151;
    color: #e2e8f0;
    border-color: #4a5568;
}

/* Quotes index header: desktop selects; mobile text chips + full-width new quote */
.quotes-index-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem 1rem;
}

.quotes-index-header-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    flex: 1 1 auto;
    min-width: 0;
}

.quotes-index-heading {
    margin: 0;
    font-size: calc(1.325rem + 0.9vw);
    line-height: 1.2;
    flex: 0 0 auto;
}

.quotes-index-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.35rem;
    min-width: 0;
}

.quote-index-filter {
    position: relative;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.quote-index-filter-body {
    min-width: 0;
    flex: 1 1 auto;
}

.quote-index-filter-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.1rem;
}

.quote-index-filter-icon {
    color: var(--quotes-index-icon, var(--iegi-blue, #204C95));
    font-size: 0.95rem;
    line-height: 1;
}

.quote-index-filter-select--location {
    width: 220px;
    max-width: 100%;
}

.quote-index-filter-select--owner {
    width: 260px;
    max-width: 100%;
}

.quote-index-filter-trigger {
    display: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 600;
    color: var(--bs-primary);
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quote-index-filter-trigger:hover,
.quote-index-filter-trigger:focus-visible {
    color: var(--bs-link-hover-color, var(--bs-primary));
}

.quotes-index-filter-sep {
    display: none;
    color: var(--bs-secondary-color);
    font-weight: 600;
    user-select: none;
}

@media (max-width: 767.98px) {
    .quotes-index-header {
        flex-direction: column;
        align-items: stretch;
    }

    .quotes-index-header-main {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .quotes-index-filters {
        width: 100%;
    }

    .quote-index-filter-trigger {
        display: inline-block;
        max-width: min(100%, 14rem);
    }

    .quotes-index-filter-sep {
        display: inline;
    }

    .quote-index-filter:not(.is-open) .quote-index-filter-select {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .quote-index-filter.is-open {
        width: 100%;
        flex: 1 1 100%;
    }

    .quote-index-filter.is-open .quote-index-filter-select {
        width: 100%;
        max-width: 100%;
    }

    .quote-index-filter.is-open .quote-index-filter-trigger {
        display: none;
    }

    .quotes-index-filters:has(.quote-index-filter.is-open) .quotes-index-filter-sep {
        display: none;
    }

    .quotes-index-header-actions {
        width: 100%;
    }

    .quotes-index-header-actions .btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .quote-index-filter-trigger,
    .quotes-index-filter-sep {
        display: none !important;
    }
}

html[data-theme="dark"] .quote-index-filter-trigger {
    color: var(--quotes-index-accent, #4FC4DB);
}

html[data-theme="dark"] .quote-index-filter-trigger:hover,
html[data-theme="dark"] .quote-index-filter-trigger:focus-visible {
    color: var(--quotes-index-accent-hover, #7dd8ea);
}

/* Kanban cards on /sales/quotes (html[data-theme], not bg-body) */
html[data-theme="light"] .quote-bucket-section .quote-card,
html:not([data-theme="dark"]) .quote-bucket-section .quote-card {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-color: rgba(0, 0, 0, 0.125) !important;
}

html[data-theme="light"] .quote-bucket-section .quote-card strong,
html:not([data-theme="dark"]) .quote-bucket-section .quote-card strong {
    color: #1a237e !important;
}

html[data-theme="light"] .quote-bucket-section .quote-card .small,
html:not([data-theme="dark"]) .quote-bucket-section .quote-card .small {
    color: #212529 !important;
}

html[data-theme="dark"] .quote-bucket-section .quote-card,
body[data-bs-theme="dark"] .quote-bucket-section .quote-card {
    background-color: #374151 !important;
    color: #e2e8f0 !important;
    border-color: #4a5568 !important;
}

html[data-theme="dark"] .quote-bucket-section .quote-card strong,
html[data-theme="dark"] .quote-bucket-section .quote-card .small,
body[data-bs-theme="dark"] .quote-bucket-section .quote-card strong,
body[data-bs-theme="dark"] .quote-bucket-section .quote-card .small {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .quote-bucket-section .quote-card .quote-card-manager-line,
body[data-bs-theme="dark"] .quote-bucket-section .quote-card .quote-card-manager-line {
    color: #a0aec0 !important;
}

html[data-theme="dark"] .quote-bucket-section .quote-card:not(.quote-card--kanban)::before,
body[data-bs-theme="dark"] .quote-bucket-section .quote-card:not(.quote-card--kanban)::before {
    background: rgba(255, 255, 255, 0.06);
}

.quote-card--kanban::before {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .quote-card--kanban:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }
}

.quote-card-manager-line {
    font-size: 0.8rem;
    line-height: 1.25;
}

.quote-card-sync-ns {
    text-decoration: underline;
    cursor: pointer;
}

.quote-card-sync-ns.disabled {
    pointer-events: none;
    opacity: 0.65;
}

.quote-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* Removed hover shift for quote cards */

@media (hover: hover) and (pointer: fine) {
    .quote-card:not(.quote-card--kanban):hover::before {
        opacity: 1;
    }
}

.quote-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Make the columns equal width */
.row > .col {
    min-width: 300px;
}

/* Add some padding to the scrollable container */
.overflow-auto {
    padding-bottom: 1rem;
}

/* Color coding for waiting times */
.quote-card[data-days-waiting="20"] {
    border-left: 4px solid #fd7e14; /* Bootstrap warning orange */
    background-color: rgba(253, 126, 20, 0.1);
}

.quote-card[data-days-waiting="30"] {
    border-left: 4px solid #dc3545; /* Bootstrap danger red */
    background-color: rgba(220, 53, 69, 0.1);
}

/* Add subtle indicators for waiting time */
.quote-card[data-days-waiting] .waiting-indicator {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-top: 0.5rem;
}

.quote-card[data-days-waiting="20"] .waiting-indicator {
    background-color: rgba(253, 126, 20, 0.2);
    color: #fd7e14;
}

.quote-card[data-days-waiting="30"] .waiting-indicator {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Status badges */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-weight: 500;
}

/* Quote Modal Theming */

:root {
    --quote-modal-bg: #fff;
    --quote-modal-header-bg: #f8f9fa;
    --quote-modal-footer-bg: #f8f9fa;
    --quote-modal-section-bg: #f8f9fa;
    --quote-modal-section-border: #dee2e6;
    --quote-modal-text: #222;
    --quote-modal-header-text: #222;
    --quote-modal-tab-bg: #fff;
    --quote-modal-tab-active-bg: #e9ecef;
    --quote-modal-tab-text: #495057;
    --quote-modal-tab-active-text: #0d6efd;
}

/* App uses html[data-theme=dark], not body[data-bs-theme=dark] — honor both */
html[data-theme="dark"],
body[data-bs-theme="dark"] {
    --quote-modal-bg: #181a1b;
    --quote-modal-header-bg: #232837;
    --quote-modal-footer-bg: #232837;
    --quote-modal-section-bg: #232837;
    --quote-modal-section-border: #404040;
    --quote-modal-text: #fff;
    --quote-modal-header-text: #fff;
    --quote-modal-tab-bg: #181a1b;
    --quote-modal-tab-active-bg: #232837;
    --quote-modal-tab-text: #b0b0b0;
    --quote-modal-tab-active-text: #fff;
}

.quote-modal .modal-content {
    background: var(--quote-modal-bg);
    color: var(--quote-modal-text);
}

/* Keep active ComboBox dropdown above neighboring fields in the quote modal */
.quote-modal .combo-box-container {
    z-index: 1;
}

.quote-modal .combo-box-container:focus-within {
    z-index: 1085;
}

.quote-modal .combo-box-dropdown {
    z-index: 1086 !important;
}

.quote-modal-header {
    background: var(--quote-modal-header-bg);
    color: var(--quote-modal-header-text);
    border-bottom: 1px solid var(--quote-modal-section-border);
    padding: 0.5rem 0.75rem;
}

.quote-modal-body {
    background: var(--quote-modal-bg);
    color: var(--quote-modal-text);
    padding: 0.5rem 0.75rem;
}

.quote-modal-footer {
    background: var(--quote-modal-footer-bg);
    border-top: 1px solid var(--quote-modal-section-border);
    padding: 0.5rem 0.75rem;
}

.quote-modal .quote-section {
    background: var(--quote-modal-section-bg);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--quote-modal-section-border);
}

.quote-section-header,
.quote-modal .quote-section .section-header {
    color: var(--quote-modal-header-text);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--quote-modal-section-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quote-modal .quote-section .section-content {
    color: var(--quote-modal-text);
}

/* General form fields in quote modal (not only pricing hero) */
html[data-theme="light"] .quote-modal .form-control,
html[data-theme="light"] .quote-modal .form-select,
html:not([data-theme="dark"]) .quote-modal .form-control,
html:not([data-theme="dark"]) .quote-modal .form-select {
    background-color: #fff;
    color: #212529;
    border-color: #ced4da;
}

html[data-theme="dark"] .quote-modal .form-control,
html[data-theme="dark"] .quote-modal .form-select,
html[data-theme="dark"] .quote-modal textarea.form-control,
body[data-bs-theme="dark"] .quote-modal .form-control,
body[data-bs-theme="dark"] .quote-modal .form-select,
body[data-bs-theme="dark"] .quote-modal textarea.form-control {
    background-color: #374151;
    color: #e2e8f0;
    border-color: #4a5568;
}

html[data-theme="dark"] .quote-modal .form-control:disabled,
html[data-theme="dark"] .quote-modal .form-select:disabled,
html[data-theme="dark"] .quote-modal .combo-box-input:disabled {
    background-color: #2d3748;
    color: #a0aec0;
    opacity: 1;
}

html[data-theme="dark"] .quote-modal .form-check-input {
    background-color: #374151;
    border-color: #4a5568;
}

html[data-theme="dark"] .quote-modal .text-muted,
body[data-bs-theme="dark"] .quote-modal .text-muted {
    color: #a0aec0 !important;
}

html[data-theme="dark"] .quote-modal .combo-box-dropdown.combo-box-dark .combo-box-no-results {
    color: #a0aec0;
}

.quote-nav-tabs {
    border-bottom: 1px solid var(--quote-modal-section-border);
}

/* Quote edit modal: no keylines sandwiching the tab blurb (tabs | blurb | panel). */
.quote-edit-grid .quote-supporting-area .quote-nav-tabs {
    border-bottom: none;
}

.quote-nav-link {
    color: var(--quote-modal-tab-text);
    border: none;
    padding: 0.5rem 0.75rem;
    margin-right: 0.25rem;
    border-radius: 4px 4px 0 0;
    background: var(--quote-modal-tab-bg);
    transition: background 0.2s, color 0.2s;
}

.quote-nav-link:hover {
    color: var(--quote-modal-tab-active-text);
    background: var(--quote-modal-tab-active-bg);
}

.quote-nav-link.active {
    color: var(--quote-modal-tab-active-text);
    background: var(--quote-modal-tab-active-bg);
    border: 1px solid var(--quote-modal-section-border);
    border-bottom: none;
}

.quote-btn {
    font-size: 0.875rem;
    border-radius: 4px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
}

.quote-btn-primary {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.quote-btn-primary:hover {
    background: #0b5ed7;
    border-color: #0b5ed7;
}

.quote-btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.quote-btn-secondary:hover {
    background: #495057;
    border-color: #495057;
}

.quote-dropdown-menu {
    background: var(--quote-modal-section-bg);
    border: 1px solid var(--quote-modal-section-border);
}

.quote-dropdown-item {
    color: var(--quote-modal-text);
}

.quote-dropdown-item:hover {
    background: var(--quote-modal-tab-active-bg);
    color: var(--quote-modal-tab-active-text);
}

/* Chance (%) slider - percentage displayed inside the track */
.chance-slider-wrap {
    position: relative;
    padding: 0.4rem 0;
}

.chance-slider-wrap .form-range.chance-slider {
    height: 2rem;
    padding: 0;
}

.chance-slider-value {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--quote-modal-text);
    text-shadow: 0 0 2px var(--quote-modal-bg), 0 0 4px var(--quote-modal-bg);
}

/* --- Quote edit workspace (modal layout) --- */
.quote-edit-dialog {
    max-width: 1140px;
}

@media (min-width: 1400px) {
    .quote-edit-dialog {
        max-width: 1320px;
    }
}

.quote-modal-control-bar {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.quote-modal-control-bar .btn-close {
    margin-left: 0.25rem;
}

/* Tab strip + tab panels stack; General pane holds the two-column workspace. */
.quote-edit-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Tight stack: tabs | blurb | panel (large gap felt like excess padding around help text). */
    gap: 0.4rem;
}

.quote-edit-grid > .qe-supporting,
.quote-edit-grid > .quote-tab-blurb-bar,
.quote-edit-grid > .tab-content.quote-supporting-tab-content {
    grid-column: 1 / -1;
}

.quote-tab-blurb-bar {
    width: 100%;
    padding: 0.15rem 0.5rem;
    box-sizing: border-box;
}

.quote-tab-blurb {
    width: 100%;
    max-width: none;
    line-height: 1.45;
    box-sizing: border-box;
}

.quote-edit-workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (max-width: 767.98px) {
    .quote-edit-grid {
        gap: 0.45rem;
    }

    .quote-edit-workspace-grid {
        gap: 1.5rem;
    }

    .qe-main-left-stack {
        display: contents;
    }

    .quote-edit-workspace-grid .qe-summary {
        order: 1;
    }

    .quote-edit-workspace-grid .qe-pricing {
        order: 2;
    }

    .quote-edit-workspace-grid .qe-customer {
        order: 3;
    }

    .quote-edit-workspace-grid .qe-confidence {
        order: 4;
    }

    .quote-modal-body {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-bottom: 1rem;
    }
}

@media (min-width: 768px) {
    .quote-edit-workspace-grid {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 34%);
        gap: 1.5rem;
        align-items: start;
    }

    .quote-edit-workspace-grid > .qe-main-left-stack,
    .quote-edit-workspace-grid > .qe-pricing,
    .quote-edit-workspace-grid > .qe-confidence {
        order: unset;
    }

    .quote-edit-workspace-grid .qe-main-left-stack {
        grid-column: 1;
        grid-row: 1 / span 2;
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        align-self: start;
    }

    .quote-edit-workspace-grid .qe-pricing {
        grid-column: 2;
        grid-row: 1;
    }

    .quote-edit-workspace-grid .qe-confidence {
        grid-column: 2;
        grid-row: 2;
    }
}

.quote-module.quote-section {
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.quote-pricing-hero {
    background: linear-gradient(155deg, #0c4a6e 0%, #0d6efd 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.12);
}

.quote-pricing-hero .section-header {
    color: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.22);
}

.quote-pricing-hero .section-content {
    color: #fff;
}

.quote-pricing-hero .form-label {
    color: rgba(255, 255, 255, 0.9);
}

.quote-price-hero-btn {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: default;
    transition: background-color 0.12s ease, opacity 0.12s ease;
}

.quote-price-hero-btn.quote-price-hero-btn--interactive {
    cursor: pointer;
}

.quote-price-hero-btn.quote-price-hero-btn--interactive:hover,
.quote-price-hero-btn.quote-price-hero-btn--interactive:focus-visible {
    background-color: rgba(255, 255, 255, 0.08);
    outline: none;
}

.quote-price-hero-btn:disabled {
    opacity: 1;
    cursor: default;
}

.quote-price-hero-display {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    pointer-events: none;
}

.quote-price-hero-hint {
    pointer-events: none;
}

.quote-price-edit-block.is-collapsed {
    display: none;
}

.quote-pricing-input-group .input-group-text,
.quote-pricing-input-group .form-control {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.35);
    color: #212529;
}

.quote-pricing-select {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.quote-pricing-select option {
    color: #212529;
}

html[data-theme="dark"] .quote-pricing-hero,
body[data-bs-theme="dark"] .quote-pricing-hero {
    background: linear-gradient(155deg, #0a2540 0%, #1e4d8c 100%);
}

html[data-theme="dark"] .quote-pricing-input-group .input-group-text,
html[data-theme="dark"] .quote-pricing-input-group .form-control,
body[data-bs-theme="dark"] .quote-pricing-input-group .input-group-text,
body[data-bs-theme="dark"] .quote-pricing-input-group .form-control {
    background-color: rgba(24, 26, 27, 0.95);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.quote-supporting-area {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.quote-supporting-area .quote-nav-tabs-subtle {
    opacity: 0.92;
    border-bottom: 1px solid var(--quote-modal-section-border);
}

.quote-supporting-area .quote-nav-tabs-subtle .quote-nav-link:not(.active) {
    background: transparent;
    font-size: 0.8125rem;
    padding: 0.45rem 0.65rem;
}

.quote-supporting-area .quote-nav-tabs-subtle .quote-nav-link.active {
    font-size: 0.8125rem;
}

.quote-supporting-tab-content {
    background: var(--quote-modal-section-bg);
    border: 1px solid var(--quote-modal-section-border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    /* Replaces template p-2: slightly smaller top so blurb sits closer to workspace. */
    padding: 0.35rem 0.5rem 0.5rem;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .quote-supporting-tab-content {
        padding: 0.4rem 1rem 1rem;
    }
}

.quote-confidence-hero-value {
    font-size: 1.75rem;
    line-height: 1.2;
}

.quote-confidence-bar {
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

html[data-theme="dark"] .quote-confidence-bar,
body[data-bs-theme="dark"] .quote-confidence-bar {
    background: rgba(255, 255, 255, 0.12);
}

.quote-confidence-bar-fill {
    height: 100%;
    width: 50%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6c757d, #0d6efd);
    transition: width 0.15s ease-out;
}

/* Solid fill + dark text so status never inherits modal header foreground (fixes white-on-wash). */
.quote-modal-header .quote-status-pill {
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.25;
    background-color: #ffc107;
    color: #1a1a1a;
    border: 1px solid #cc9a06;
}

html[data-theme="dark"] .quote-modal-header .quote-status-pill,
body[data-bs-theme="dark"] .quote-modal-header .quote-status-pill {
    background-color: #ffca2c;
    color: #1a1a1a;
    border-color: #d39e00;
}

.quote-modal-header .quote-customer-pill {
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.25;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-color: var(--bs-primary-bg-subtle, #cfe2ff);
    color: var(--bs-primary-text-emphasis, #052c65);
    border: 1px solid var(--bs-primary-border-subtle, #9ec5fe);
}

html[data-theme="dark"] .quote-modal-header .quote-customer-pill,
body[data-bs-theme="dark"] .quote-modal-header .quote-customer-pill {
    background-color: rgba(13, 110, 253, 0.22);
    color: #b6d4fe;
    border-color: rgba(13, 110, 253, 0.45);
}

.quote-tm-price-compare {
    color: var(--bs-secondary-color, #6c757d);
}

.quote-tm-price-compare .quote-tm-price-value {
    color: var(--bs-body-color);
}

.quote-chance-pill {
    font-weight: 600;
    font-size: 0.75rem;
}

.quote-line-autosave-status {
    align-self: stretch;
    min-width: 4.5rem;
    padding: 0.35rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--quote-modal-tab-text);
    white-space: nowrap;
}

.quote-line-autosave-status.is-saving {
    color: var(--quote-modal-tab-active-text);
}

.quote-line-autosave-status.is-saved {
    color: var(--bs-success, #198754);
}

.quote-line-autosave-status.is-error {
    color: var(--bs-danger, #dc3545);
}

/* Planning tab: plain text until click; picker on interaction */
.quote-modal #planning .quote-plan-date-static {
    display: block;
    width: 100%;
    border: none;
    background: transparent !important;
    box-shadow: none;
    padding: 0;
    min-height: 0;
    color: var(--quote-modal-text);
    opacity: 1;
    cursor: default;
}

.quote-modal #planning .quote-plan-date-wrap {
    position: relative;
    display: block;
    min-height: 1.5rem;
    cursor: pointer;
    border-radius: 0.375rem;
}

.quote-modal #planning .quote-plan-date-wrap:not(.is-active):not(:focus-within) {
    outline: none;
}

@media (hover: hover) and (pointer: fine) {
    .quote-modal #planning .quote-plan-date-wrap:not(.is-active):not(:focus-within):hover .quote-plan-date-display,
    .quote-modal #planning .quote-plan-date-wrap:not(.is-active):not(:focus-within):hover::before {
        text-decoration: underline;
        text-underline-offset: 0.15em;
    }
}

.quote-modal #planning .quote-plan-date-wrap.is-active,
.quote-modal #planning .quote-plan-date-wrap:focus-within {
    outline: 2px solid var(--quote-modal-tab-active-text);
    outline-offset: 1px;
}

.quote-modal #planning .quote-plan-date-wrap.is-active .quote-plan-date-input,
.quote-modal #planning .quote-plan-date-wrap:focus-within .quote-plan-date-input {
    padding: 0.375rem 0.75rem;
    min-height: calc(1.5em + 0.75rem + 2px);
    border: 1px solid var(--quote-modal-section-border);
    background-color: var(--quote-modal-bg);
    color: var(--quote-modal-text);
    box-shadow: none;
}

html[data-theme="light"] .quote-modal #planning .quote-plan-date-wrap.is-active .quote-plan-date-input,
html[data-theme="light"] .quote-modal #planning .quote-plan-date-wrap:focus-within .quote-plan-date-input,
html:not([data-theme="dark"]) .quote-modal #planning .quote-plan-date-wrap.is-active .quote-plan-date-input,
html:not([data-theme="dark"]) .quote-modal #planning .quote-plan-date-wrap:focus-within .quote-plan-date-input {
    background-color: #fff;
    border-color: #ced4da;
}

html[data-theme="dark"] .quote-modal #planning .quote-plan-date-wrap.is-active .quote-plan-date-input,
html[data-theme="dark"] .quote-modal #planning .quote-plan-date-wrap:focus-within .quote-plan-date-input,
body[data-bs-theme="dark"] .quote-modal #planning .quote-plan-date-wrap.is-active .quote-plan-date-input,
body[data-bs-theme="dark"] .quote-modal #planning .quote-plan-date-wrap:focus-within .quote-plan-date-input {
    background-color: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

.quote-modal #planning .quote-plan-date-input {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    min-height: 1.5rem;
    cursor: pointer;
    color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.quote-modal #planning .quote-plan-date-wrap.is-active .quote-plan-date-display,
.quote-modal #planning .quote-plan-date-wrap:focus-within .quote-plan-date-display,
.quote-modal #planning .quote-plan-date-wrap.is-active::before,
.quote-modal #planning .quote-plan-date-wrap:focus-within::before {
    display: none;
}

.quote-modal #planning .quote-plan-date-wrap input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}

.quote-modal #planning .quote-plan-date-wrap::before {
    content: attr(data-placeholder);
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary-color, #6c757d);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
}

.quote-modal #planning .quote-plan-date-wrap.has-value::before {
    display: none;
}

.quote-modal #planning .quote-plan-date-display {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--quote-modal-text);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
}

.quote-modal #planning .quote-plan-date-wrap:not(.has-value) .quote-plan-date-display {
    display: none;
}

.quote-modal #planning .quote-plan-date-input::-webkit-datetime-edit,
.quote-modal #planning .quote-plan-date-input::-webkit-datetime-edit-fields-wrapper,
.quote-modal #planning .quote-plan-date-input::-webkit-datetime-edit-text,
.quote-modal #planning .quote-plan-date-input::-webkit-datetime-edit-month-field,
.quote-modal #planning .quote-plan-date-input::-webkit-datetime-edit-day-field,
.quote-modal #planning .quote-plan-date-input::-webkit-datetime-edit-year-field {
    color: transparent !important;
}

@media (max-width: 767.98px) {
    .quote-modal .modal-dialog.quote-edit-dialog {
        margin: 0;
        max-width: 100%;
    }

    .quote-modal .modal-content {
        min-height: 100dvh;
        border-radius: 0;
        border: none;
    }

    .quote-modal .quote-modal-header-primary {
        min-width: 0 !important;
    }

    .quote-modal.modal .modal-dialog-scrollable .modal-body,
    .quote-modal .quote-modal-body {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .quote-modal.modal .modal-dialog-scrollable .modal-body::-webkit-scrollbar,
    .quote-modal .quote-modal-body::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .quote-modal .quote-edit-grid,
    .quote-modal .quote-edit-workspace-grid,
    .quote-modal .tab-content {
        max-width: 100%;
        overflow-x: hidden;
    }

    .quote-modal .quote-nav-tabs.overflow-auto {
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding-bottom: 0.25rem;
    }

    .quote-modal .quote-nav-tabs.overflow-auto::-webkit-scrollbar {
        display: none;
        height: 0;
    }

    .quote-modal .combo-box-container,
    .quote-modal .form-control,
    .quote-modal .form-select {
        max-width: 100%;
    }

    .quote-modal-action {
        min-height: 2.5rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .quote-modal-header-actions {
        width: 100%;
        justify-content: flex-start !important;
    }
}