﻿




/* =========================================================
   THEME VARIABLES
========================================================= */

:root {
    --bg-main: #f3f4f7;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #d1d5db;
    --shadow-soft: 0 4px 14px rgba(0,0,0,0.06);
    --shadow-card: 0 10px 30px rgba(0,0,0,0.08);
    --accent-red: #d31335;
    --card-glow: none;
}

/* =========================================================
   DARK MODE
========================================================= */

body.dark-mode {
    --bg-main: #2b2d31;
    --bg-sidebar: #202225;
    --bg-card: #3a3d42;
    --bg-input: #4a4d52;
    --text-main: #f3f4f6;
    --text-muted: #b6bcc8;
    --border-color: #555b66;
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.35);
    --shadow-card: 0 15px 40px rgba(0,0,0,0.45);
    --card-glow: 0 0 0 1px rgba(255,255,255,0.03), 0 0 25px rgba(211,19,53,0.08);
}



body {
    background: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.25s ease, color 0.25s ease;
}
.card {
    background: var(--bg-card) !important;
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.08);
    border-top: 3px solid rgba(211,19,53,0.18);
    box-shadow: 0 2px 10px rgba(0,0,0,0.04), 0 10px 30px rgba(0,0,0,0.06), 0 0 18px rgba(211,19,53,0.05);
    border-radius: 18px !important;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

    .card:hover {
       
        box-shadow: 0 4px 14px rgba(0,0,0,0.06), 0 18px 40px rgba(0,0,0,0.10), 0 0 24px rgba(211,19,53,0.10);
        border-top: 3px solid rgba(211,19,53,0.45);
    }
.form-control,
.form-select {
    background-color: var(--bg-input);
    color: var(--text-main);
    border-color: var(--border-color);
}

    .form-control:focus,
    .form-select:focus {
        background-color: var(--bg-input);
        color: var(--text-main);
    }

.text-muted {
    color: var(--text-muted) !important;
}

.table {
    color: var(--text-main);
}










/* =========================
   PRINT QUOTE STYLES
   ========================= */

.quote-print-only {
    display: none;
}

@media print {

    @page {
        size: letter portrait;
        margin-top: .18in;
        margin-right: .12in;
        margin-bottom: .18in;
        margin-left: .12in;
    }

    html,
    body {
        width: 8.5in !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        overflow: visible !important;
    }

        body * {
            visibility: hidden !important;
        }

    .quote-print-only,
    .quote-print-only * {
        visibility: visible !important;
    }

    .quote-print-only {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 8.5in !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        z-index: 999999 !important;
    }

    .quote-page {
        padding-top: .06in !important;
        width: 816px !important;
        height: 10.55in !important;
        min-height: 10.55in !important;
        max-height: 10.55in !important;
        position: relative !important;
        overflow: hidden !important;
        background: white !important;
        box-sizing: border-box !important;
        page-break-after: always !important;
        break-after: page !important;
        font-family: Arial, Helvetica, sans-serif !important;
        color: #111 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

        .quote-page:last-child {
            page-break-after: auto !important;
            break-after: auto !important;
        }

    .quote-banner {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 8.5in !important;
        height: 1.42in !important;
        overflow: hidden !important;
        background: #050505 !important;
        border: none !important;
        z-index: 10 !important;
    }

    .banner-svg {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        border: none !important;
        z-index: 1 !important;
    }

    .logo-block {
        position: absolute !important;
        top: .06in !important;
        left: .25in !important;
        width: 1.75in !important;
        height: .82in !important;
        padding: .02in !important;
        background: transparent !important;
        z-index: 25 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

        .logo-block img {
            max-width: 100% !important;
            max-height: 100% !important;
            width: auto !important;
            height: auto !important;
            object-fit: contain !important;
            display: block !important;
        }

    .quote-number-area {
        position: absolute !important;
        top: .43in !important;
        right: .34in !important;
        z-index: 25 !important;
        color: white !important;
        text-align: right !important;
    }

    .quote-label {
        font-size: 8px !important;
        text-transform: uppercase !important;
        letter-spacing: 1.2px !important;
        font-weight: 900 !important;
        color: white !important;
    }

    .quote-number {
        margin-top: 4px !important;
        font-size: 17px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        color: white !important;
    }

    .quote-body {
        position: absolute !important;
        top: 1.48in !important;
        left: .24in !important;
        right: .24in !important;
        bottom: .58in !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: white !important;
        box-sizing: border-box !important;
        z-index: 2 !important;
    }

    .quote-summary-body,
    .quote-detail-body {
        display: block !important;
    }

    .quote-body h1 {
        margin: 0 !important;
        font-size: 28px !important;
        font-weight: 900 !important;
        color: #111 !important;
    }

    .subtitle {
        margin: 3px 0 0 0 !important;
        font-size: 11px !important;
        color: #666 !important;
    }

    .red-underline {
        width: .42in !important;
        height: 2px !important;
        background: #d31335 !important;
        margin: 8px 0 16px 0 !important;
    }

    .quote-info-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: .14in !important;
        margin-bottom: .20in !important;
    }

    .quote-info-card {
        min-height: .58in !important;
        background: white !important;
        border: 1px solid #ddd !important;
        border-radius: 7px !important;
        padding: .12in !important;
        display: flex !important;
        align-items: center !important;
        gap: .12in !important;
        box-shadow: 0 4px 12px rgba(0,0,0,.06) !important;
        box-sizing: border-box !important;
    }

    .quote-icon {
        width: .30in !important;
        height: .30in !important;
        border-radius: 50% !important;
        background: #d31335 !important;
        color: white !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: 900 !important;
        flex: 0 0 .30in !important;
    }

    .quote-info-card span {
        display: block !important;
        color: #666 !important;
        text-transform: uppercase !important;
        font-size: 8px !important;
        margin-bottom: 4px !important;
    }

    .quote-info-card strong {
        font-size: 11px !important;
        color: #111 !important;
    }

    .total-card {
        border: 1.5px solid #d31335 !important;
    }

        .total-card strong {
            color: #d31335 !important;
            font-size: 19px !important;
        }

    .quote-section-title {
        font-size: 15px !important;
        font-weight: 900 !important;
        margin: 0 0 8px 0 !important;
        color: #111 !important;
    }

        .quote-section-title::before {
            content: "▦";
            color: #d31335;
            margin-right: 7px;
        }

    .quote-table {
        width: 100% !important;
        border-collapse: collapse !important;
        background: white !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        box-shadow: 0 4px 13px rgba(0,0,0,.05) !important;
        table-layout: fixed !important;
    }

        .quote-table th {
            background: #090909 !important;
            color: white !important;
            padding: 7px 5px !important;
            font-size: 8px !important;
            text-transform: uppercase !important;
            text-align: center !important;
            border: 0 !important;
        }

        .quote-table td {
            padding: 8px 5px !important;
            text-align: center !important;
            border-bottom: 1px solid #e5e5e5 !important;
            font-size: 9px !important;
            word-wrap: break-word !important;
            color: #111 !important;
        }

    .summary-table th:nth-child(1),
    .summary-table td:nth-child(1) {
        width: 6%;
    }

    .summary-table th:nth-child(2),
    .summary-table td:nth-child(2) {
        width: 12%;
    }

    .summary-table th:nth-child(3),
    .summary-table td:nth-child(3) {
        width: 15%;
    }

    .summary-table th:nth-child(4),
    .summary-table td:nth-child(4) {
        width: 28%;
    }

    .summary-table th:nth-child(5),
    .summary-table td:nth-child(5) {
        width: 14%;
    }

    .summary-table th:nth-child(6),
    .summary-table td:nth-child(6) {
        width: 7%;
    }

    .summary-table th:nth-child(7),
    .summary-table td:nth-child(7) {
        width: 9%;
    }

    .summary-table th:nth-child(8),
    .summary-table td:nth-child(8) {
        width: 9%;
    }

    .quote-total-box {
        margin-top: .22in !important;
        margin-left: auto !important;
        width: 2.35in !important;
        border: 1.6px solid #d31335 !important;
        border-radius: 7px !important;
        background: white !important;
        padding: .12in .15in !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }

        .quote-total-box span {
            text-transform: uppercase !important;
            font-size: 12px !important;
            color: #111 !important;
        }

        .quote-total-box strong {
            color: #d31335 !important;
            font-size: 21px !important;
            font-weight: 900 !important;
        }

    .line-card {
        background: white !important;
        border: 1px solid #ddd !important;
        border-radius: 9px !important;
        padding: .10in !important;
        margin: 0 0 .12in 0 !important;
        box-shadow: 0 4px 13px rgba(0,0,0,.05) !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .compact-line-card {
        padding: .09in !important;
        margin-bottom: .10in !important;
    }

    .line-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: .07in !important;
    }

    .line-number {
        display: inline-flex !important;
        width: .22in !important;
        height: .22in !important;
        border-radius: 50% !important;
        background: #d31335 !important;
        color: white !important;
        align-items: center !important;
        justify-content: center !important;
        margin-right: 7px !important;
        font-weight: 900 !important;
        font-size: 10px !important;
    }

    .line-header strong {
        font-size: 13px !important;
    }

    .line-size {
        font-size: 10px !important;
        color: #333 !important;
    }

    .line-price {
        color: #d31335 !important;
        font-size: 14px !important;
        font-weight: 900 !important;
    }

    .detail-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: .06in !important;
        margin-bottom: .07in !important;
    }

        .detail-grid div {
            border: 1px solid #ddd !important;
            border-radius: 6px !important;
            padding: .045in !important;
            background: white !important;
            min-height: .32in !important;
            box-sizing: border-box !important;
        }

        .detail-grid span {
            display: block !important;
            color: #777 !important;
            font-size: 6px !important;
            text-transform: uppercase !important;
            margin-bottom: 2px !important;
        }

        .detail-grid strong {
            font-size: 7.5px !important;
            color: #111 !important;
        }

    .bom-table th {
        padding: 4px 4px !important;
        font-size: 7px !important;
    }

    .bom-table td {
        padding: 4px 4px !important;
        font-size: 7px !important;
    }

    .print-footer {
        position: absolute !important;
        left: .24in !important;
        right: .24in !important;
        bottom: .08in !important;
        height: .42in !important;
        background: white !important;
        box-sizing: border-box !important;
        z-index: 100 !important;
    }

    .md-footer {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        color: #d31335 !important;
        line-height: 1 !important;
    }

        .md-footer span {
            flex: 1 1 auto !important;
            height: 1.4px !important;
            background: #d31335 !important;
            display: block !important;
        }

        .md-footer b {
            flex: 0 0 auto !important;
            font-size: 14px !important;
            font-weight: 900 !important;
            color: #d31335 !important;
            letter-spacing: .5px !important;
        }

    .quote-thanks {
        text-align: center !important;
        color: #555 !important;
        font-size: 8px !important;
        font-style: italic !important;
        margin: 5px 0 0 0 !important;
        line-height: 1.1 !important;
    }

    .footer-page-number,
    .page-number {
        display: none !important;
    }
    .quote-customer-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: .14in !important;
        margin-bottom: .18in !important;
    }

    .quote-address-card {
        min-height: .72in !important;
        background: white !important;
        border: 1px solid #ddd !important;
        border-radius: 7px !important;
        padding: .11in !important;
        box-shadow: 0 4px 12px rgba(0,0,0,.05) !important;
        font-size: 10px !important;
        line-height: 1.25 !important;
        white-space: pre-line !important;
    }

    .address-title {
        color: #d31335 !important;
        text-transform: uppercase !important;
        font-weight: 900 !important;
        font-size: 8px !important;
        margin-bottom: 5px !important;
    }
}


/* =========================
   APP UI STYLES
   ========================= */

html,
body {
    background-color: #f5f6f8 !important;
}

.content,
main,
.page {
    background-color: #f5f6f8 !important;
}

.content {
    max-width: 100% !important;
    width: 100% !important;
}

.page {
    max-width: 100%;
}

    .page main {
        width: 100%;
    }


h3,
h4,
h5 {
    color: #2c2c2c;
}

h5 {
    font-weight: 700;
}

.btn {
    border-radius: 10px;
}

.btn-primary {
    background-color: #b30000 !important;
    border-color: #b30000 !important;
    color: white !important;
}

    .btn-primary:hover {
        background-color: #8a0000 !important;
        border-color: #8a0000 !important;
    }

.btn-outline-primary {
    color: #b30000 !important;
    border-color: #b30000 !important;
}

    .btn-outline-primary:hover {
        background-color: #b30000 !important;
        color: white !important;
    }

.nav-link.active,
.nav-item .active {
    background-color: #b30000 !important;
    color: white !important;
}

.cpq-layout {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 24px !important;
    align-items: flex-start !important;
    width: 100% !important;
}

    .cpq-layout > .card:first-child {
        flex: 0 0 520px !important;
        max-width: 620px !important;
    }

    .cpq-layout > .card:last-child {
        flex: 1 1 auto !important;
        min-width: 420px !important;
    }

.cpq-form-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
}

@media (max-width: 800px) {
    .cpq-layout {
        flex-direction: column !important;
    }

        .cpq-layout > .card:first-child,
        .cpq-layout > .card:last-child {
            width: 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
            flex: none !important;
        }

    .cpq-form-grid {
        grid-template-columns: 1fr !important;
    }
}

label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.form-control,
.form-select {
    border-radius: 8px;
}

.table th {
    font-size: 12px;
    text-transform: uppercase;
    background: #111;
    color: white;
}

.table td {
    font-size: 13px;
}

.cpq-highlight {
    font-weight: 800;
    color: #1b5e20;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-block;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}
.quote-note-row td {
    border-top: none !important;
    padding-top: 0 !important;
}

.quote-note-cell {
    font-size: 10px !important;
    color: #666 !important;
    font-style: italic !important;
    padding-bottom: 12px !important;
}
.customer-number {
    color: #d31335 !important;
    font-weight: 900 !important;
}
.cpq-toast-message {
    margin-bottom: 16px;
}

    .cpq-toast-message .alert {
        border-radius: 12px;
        padding: 14px 18px;
    }
.cpq-topbar-wrapper {
    padding-top: 16px;
}


@keyframes modalPop {
    from {
        transform: scale(.94);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}
.project-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
    padding: 16px;
    background: white;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
}

    .project-toolbar input,
    .project-toolbar select {
        padding: 10px 14px;
        border-radius: 12px;
        border: 1px solid #d1d5db;
    }

.project-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

    .project-table th {
        background: #f8fafc;
        padding: 14px;
        text-align: left;
        font-size: 12px;
        text-transform: uppercase;
        color: #64748b;
    }

    .project-table td {
        padding: 16px 14px;
        border-top: 1px solid #eef2f7;
    }

.status-pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-green {
    background: #dcfce7;
    color: #166534;
}

.status-red {
    background: #fee2e2;
    color: #991b1b;
}

.status-blue {
    background: #dbeafe;
    color: #1e40af;
}

.status-orange {
    background: #ffedd5;
    color: #9a3412;
}

.status-yellow {
    background: #fef9c3;
    color: #854d0e;
}

.status-gray {
    background: #f1f5f9;
    color: #475569;
}
.selected-row {
    background: #eff6ff;
}

.project-detail-panel {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
}

.detail-card {
    background: white;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    padding: 18px;
}

    .detail-card h2 {
        margin-top: 4px;
        margin-bottom: 8px;
    }

    .detail-card h3 {
        margin: 0;
    }

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

.mini-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.install-box {
    background: #f8fafc;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 10px;
}

    .install-box p {
        color: #64748b;
        margin: 4px 0 8px;
    }

/* =========================================================
   PREMIUM DARK MODE POLISH
========================================================= */

body.dark-mode .sidebar {
    background: linear-gradient( 180deg, #1f2125 0%, #181a1e 100% ) !important;
    border-right: 1px solid rgba(255,255,255,0.06);
}

body.dark-mode .top-row {
    background: #2f3237 !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

body.dark-mode .card {
    border-radius: 18px;
    box-shadow: var(--shadow-card), var(--card-glow);
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    border-radius: 12px;
}

body.dark-mode table {
    border-color: rgba(255,255,255,0.08);
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(255,255,255,0.025);
}

body.dark-mode .btn-outline-secondary {
    color: #f3f4f6;
    border-color: #6b7280;
}

    body.dark-mode .btn-outline-secondary:hover {
        background: #4b5563;
        color: white;
    }



/* DARK MODE TEST - make it obvious */
body.dark-mode,
body.dark-mode .page,
body.dark-mode main,
body.dark-mode article.content {
    background: #2b2d31 !important;
    color: #f3f4f6 !important;
}

    body.dark-mode .card {
        background: #3a3d42 !important;
        color: #f3f4f6 !important;
        border-color: #555b66 !important;
    }

    body.dark-mode .top-row {
        background: #25272b !important;
        border-bottom-color: #444 !important;
    }

    body.dark-mode .form-control,
    body.dark-mode .form-select {
        background: #4a4d52 !important;
        color: #f3f4f6 !important;
        border-color: #666 !important;
    }


/* =========================================================
   CPQ DARK MODE - NO JAVASCRIPT VERSION
========================================================= */

.cpq-dark,
.cpq-dark main,
.cpq-dark .content {
    background: #2b2d31 !important;
    color: #f3f4f6 !important;
}

    .cpq-dark .top-row {
        background: #25272b !important;
        border-bottom-color: #444 !important;
    }

    .cpq-dark .card {
        background: #3a3d42 !important;
        color: #f3f4f6 !important;
        border: 1px solid #555b66 !important;
        box-shadow: 0 15px 40px rgba(0,0,0,.45) !important;
    }

    .cpq-dark .form-control,
    .cpq-dark .form-select {
        background: #4a4d52 !important;
        color: #f3f4f6 !important;
        border-color: #666 !important;
    }

    .cpq-dark .text-muted {
        color: #b6bcc8 !important;
    }

    .cpq-dark h3,
    .cpq-dark h4,
    .cpq-dark h5,
    .cpq-dark label,
    .cpq-dark strong,
    .cpq-dark td {
        color: #f3f4f6 !important;
    }

    .cpq-dark .table th {
        background: #181a1e !important;
        color: white !important;
    }

    .cpq-dark .table td {
        background: #3a3d42 !important;
        color: #f3f4f6 !important;
        border-color: #555b66 !important;
    }


/* =========================================================
   GLOBAL DARK MODE
========================================================= */

.page.cpq-dark,
.page.cpq-dark main,
.page.cpq-dark .content,
.page.cpq-dark article,
.page.cpq-dark body {
    background: #2b2d31 !important;
    color: #f3f4f6 !important;
}

    /* cards */
    .page.cpq-dark .card,
    .page.cpq-dark .detail-card,
    .page.cpq-dark .project-table,
    .page.cpq-dark .project-toolbar {
        background: #3a3d42 !important;
        color: #f3f4f6 !important;
        border-color: #555b66 !important;
    }

    /* inputs */
    .page.cpq-dark input,
    .page.cpq-dark select,
    .page.cpq-dark textarea,
    .page.cpq-dark .form-control,
    .page.cpq-dark .form-select {
        background: #4a4d52 !important;
        color: #f3f4f6 !important;
        border-color: #666 !important;
    }

    /* text */
    .page.cpq-dark h1,
    .page.cpq-dark h2,
    .page.cpq-dark h3,
    .page.cpq-dark h4,
    .page.cpq-dark h5,
    .page.cpq-dark h6,
    .page.cpq-dark label,
    .page.cpq-dark strong,
    .page.cpq-dark td,
    .page.cpq-dark th,
    .page.cpq-dark span,
    .page.cpq-dark div,
    .page.cpq-dark p {
        color: #f3f4f6 !important;
    }

    /* tables */
    .page.cpq-dark .table td,
    .page.cpq-dark .table th {
        background: #3a3d42 !important;
        border-color: #555b66 !important;
    }

    .page.cpq-dark .table th {
        background: #1f2125 !important;
    }

    /* top bar */
    .page.cpq-dark .top-row {
        background: #25272b !important;
        border-bottom: 1px solid #444 !important;
    }

/* page background */
.page.cpq-dark {
    min-height: 100vh;
}

    /* =========================================================
   DARK MODE FINAL CLEANUP
========================================================= */

    /* force all cards dark */
    .page.cpq-dark .card,
    .page.cpq-dark .detail-card,
    .page.cpq-dark .project-toolbar,
    .page.cpq-dark .project-table,
    .page.cpq-dark .mini-row,
    .page.cpq-dark .install-box {
        background: #3a3d42 !important;
        color: #f3f4f6 !important;
        border-color: #555b66 !important;
    }

    /* ALL bootstrap backgrounds */
    .page.cpq-dark .bg-white,
    .page.cpq-dark .bg-light {
        background: #3a3d42 !important;
    }

    /* form controls */
    .page.cpq-dark input,
    .page.cpq-dark select,
    .page.cpq-dark textarea,
    .page.cpq-dark .form-control,
    .page.cpq-dark .form-select {
        background: #4a4d52 !important;
        color: #f3f4f6 !important;
        border: 1px solid #666 !important;
    }

        /* placeholders */
        .page.cpq-dark input::placeholder,
        .page.cpq-dark textarea::placeholder {
            color: #b6bcc8 !important;
        }

    /* dropdown arrows */
    .page.cpq-dark select {
        color-scheme: dark;
    }

    /* text cleanup */
    .page.cpq-dark label,
    .page.cpq-dark span,
    .page.cpq-dark div,
    .page.cpq-dark td,
    .page.cpq-dark th,
    .page.cpq-dark p,
    .page.cpq-dark strong,
    .page.cpq-dark small,
    .page.cpq-dark h1,
    .page.cpq-dark h2,
    .page.cpq-dark h3,
    .page.cpq-dark h4,
    .page.cpq-dark h5,
    .page.cpq-dark h6 {
        color: #f3f4f6 !important;
    }

    /* muted text */
    .page.cpq-dark .text-muted {
        color: #b6bcc8 !important;
    }

    /* table fixes */
    .page.cpq-dark table,
    .page.cpq-dark .table {
        background: #3a3d42 !important;
        color: #f3f4f6 !important;
    }

        .page.cpq-dark .table td,
        .page.cpq-dark .table th {
            background: #3a3d42 !important;
            border-color: #555b66 !important;
        }

    /* dashboard tiles */
    .page.cpq-dark .dashboard-tile,
    .page.cpq-dark .metric-box,
    .page.cpq-dark .summary-box {
        background: #4a4d52 !important;
        color: #f3f4f6 !important;
    }

    /* nav cleanup */
    .page.cpq-dark .mdwc-sidebar-wrapper {
        background: linear-gradient(180deg, #202225, #181a1e) !important;
    }

    /* top bar */
    .page.cpq-dark .top-row {
        background: #25272b !important;
        border-bottom: 1px solid #444 !important;
    }


.cpq-quote-items-card {
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .cpq-quote-items-card .table-responsive {
        flex: 1;
        overflow-x: auto;
        overflow-y: auto;
        min-height: 0;
    }

    .cpq-quote-items-card table {
        min-width: 1400px;
    }

    .cpq-quote-items-card .table td,
    .cpq-quote-items-card .table th {
        white-space: nowrap;
        vertical-align: middle;
    }



.cpq-master-layout {
    display: grid;
    grid-template-columns: 42% 58%;
    gap: 1rem;
    align-items: stretch;
}

.cpq-configurator-column {
    flex: 0 0 42%;
    min-width: 650px;
}

.cpq-quote-column {
    flex: 1;
    min-width: 0;
}

.cpq-quote-items-card {
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

    .cpq-quote-items-card table {
        min-width: 1400px;
    }
.cpq-dashboard-wide {
    margin-top: 2px;
    padding: 6px 10px;
}

    .cpq-dashboard-wide .card-body {
        padding: 10px;
    }

.cpq-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}
.cpq-metric-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 8px 12px;
    min-height: 62px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .cpq-metric-box h3,
    .cpq-metric-box h4,
    .cpq-metric-box h5 {
        margin: 0;
        font-size: 16px;
        line-height: 1.1;
    }

    .cpq-metric-box small,
    .cpq-metric-box label {
        font-size: 11px;
        margin-bottom: 2px;
    }

@media (max-width: 1400px) {

    .cpq-master-layout {
        flex-direction: column;
    }

    .cpq-configurator-column {
        min-width: 0;
    }
    .cpq-dashboard-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
        margin-top: 6px;
    }
}
.cpq-full-row {
    grid-column: 1 / -1;
}
/* =========================================================
   EXPANDED WORKSPACE MODE
========================================================= */

.cpq-workspace-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.cpq-workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex: 0 0 auto;
}

.cpq-workspace-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

.cpq-workspace-config {
    flex: 0 0 42%;
    overflow-y: auto;
    border-radius: 14px;
}

.cpq-workspace-grid {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    .cpq-workspace-grid .card {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .cpq-workspace-grid .table-responsive {
        flex: 1;
        overflow-x: auto;
        overflow-y: auto;
        min-height: 0;
    }
/* =========================================================
   EXPANDED WORKSPACE MODAL
========================================================= */

.cpq-workspace-modal .modal-dialog {
    max-width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    margin: 20px auto;
}

.cpq-workspace-modal .modal-content {
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
}

.cpq-workspace-modal .modal-body {
    height: 100%;
    overflow: hidden;
    background: #f5f6f8;
}

.cpq-workspace-modal .cpq-master-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr !important;
    gap: 12px !important;
    height: 100%;
}

.cpq-workspace-modal .cpq-configurator-column {
    min-width: 0 !important;
    width: 100% !important;
}

.cpq-workspace-modal .cpq-master-layout {
    display: flex !important;
    flex-direction: column !important;
    height: 100%;
    overflow: hidden;
}
.cpq-workspace-modal .cpq-quote-items-card {
    height: 100% !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cpq-workspace-modal .cpq-dashboard-wide {
    display: none !important;
}
.cpq-workspace-modal .cpq-configurator-column {
    flex: 0 0 42% !important;
    overflow-y: auto;
    padding-right: 6px;
}
.cpq-workspace-modal .cpq-quote-column {
    flex: 1 1 auto !important;
    min-height: 0;
    overflow: hidden;
}
.cpq-workspace-modal .quote-items-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    min-height: 0;
}
.cpq-quote-items-card {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08), 0 0 30px rgba(211,19,53,0.10);
}

.cpq-dashboard-wide {
    box-shadow: 0 8px 30px rgba(0,0,0,0.06), 0 0 20px rgba(0,150,255,0.06);
}

.cpq-configurator-column {
    position: relative;
}

    .cpq-configurator-column::after {
        content: "";
        position: absolute;
        top: 10px;
        right: -10px;
        width: 1px;
        height: calc(100% - 20px);
        background: linear-gradient( to bottom, transparent, rgba(0,0,0,0.08), transparent );
    }

/* EXPANDED WORKSPACE - 50/50 LAYOUT */

.cpq-workspace-modal .modal-body {
    padding: 12px !important;
    overflow: hidden !important;
}

.cpq-workspace-modal .cpq-master-layout {
    height: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 50% 50% !important;
    gap: 10px !important;
    overflow: hidden !important;
}

.cpq-workspace-modal .cpq-configurator-column,
.cpq-workspace-modal .cpq-quote-column {
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

    .cpq-workspace-modal .cpq-configurator-column > .card,
    .cpq-workspace-modal .cpq-quote-column > .card {
        height: 100% !important;
        overflow: auto !important;
    }

/* make configurator compact only in expanded mode */
.cpq-workspace-modal .cpq-form-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
}

.cpq-workspace-modal label {
    font-size: 11px !important;
    margin-bottom: 2px !important;
}

.cpq-workspace-modal .form-control,
.cpq-workspace-modal .form-select {
    height: 30px !important;
    min-height: 30px !important;
    padding: 3px 8px !important;
    font-size: 12px !important;
}

.cpq-workspace-modal .mb-3 {
    margin-bottom: 6px !important;
}

.cpq-workspace-modal h5 {
    font-size: 16px !important;
    margin-bottom: 8px !important;
}

.cpq-workspace-modal .cpq-full-row {
    grid-column: 1 / -1 !important;
}

/* quote grid fills bottom half */
.cpq-workspace-modal .cpq-quote-items-card {
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
}

    .cpq-workspace-modal .cpq-quote-items-card .table-responsive {
        height: 100% !important;
        overflow: auto !important;
    }
/* =========================================================
   GLOBAL BACKGROUND DEPTH
========================================================= */

body,
.page,
main,
.content {
    background: linear-gradient( 180deg, #dfe4ea 0%, #d4dae2 100% ) !important;
}
/* =========================================================
   PREMIUM CARD DEPTH
========================================================= */
/* =========================================================
   PREMIUM CARD DEPTH
========================================================= */

.card {
    background: rgba(255,255,255,0.96) !important;
    border-radius: 18px !important;
    border: 1px solid rgba(255,255,255,0.85) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 12px 30px rgba(0,0,0,0.08), 0 0 22px rgba(211,19,53,0.06) !important;
    transition: box-shadow .25s ease !important;
    position: relative !important;
    z-index: 1 !important;
}

    .card:hover {
        box-shadow: 0 6px 18px rgba(0,0,0,0.08), 0 18px 42px rgba(0,0,0,0.12), 0 0 32px rgba(211,19,53,0.12) !important;
    }
/* =========================================
   FORCE WARNING MODAL ABOVE EVERYTHING
========================================= */

.project-bid-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.55) !important;
    z-index: 2147483646 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.project-bid-modal {
    position: relative !important;
    z-index: 2147483647 !important;
}

/* stop cards from floating above modal */
.card,
.cpq-quote-items-card,
.cpq-dashboard-wide {
    z-index: auto !important;
}
    /* Make the card containing the warning sit above every other CPQ card */
    .card:has(.project-bid-overlay) {
        position: relative !important;
        z-index: 2147483647 !important;
    }

/* Warning overlay itself */
.project-bid-overlay {
    z-index: 2147483647 !important;
}

.project-bid-modal {
    z-index: 2147483647 !important;
}
/* =========================================================
   MDC NEXUS APP SHELL / MAIN LAYOUT
========================================================= */

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: #eef1f5;
}

.page {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
    z-index: 10;
}

main {
    flex: 1;
    min-width: 0;
    background: linear-gradient(135deg, #d5d9df 0%, #eef1f5 45%, #c9ced6 100%);
}

.top-row {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 16px;
}

.content {
    padding: 16px;
}

/* =========================================================
   MDC NEXUS SIDEBAR
========================================================= */

.mdwc-sidebar-wrapper {
    min-height: 100vh;
    width: 250px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,250,250,.94));
    border-right: 1px solid #ddd;
    box-shadow: 4px 0 18px rgba(0,0,0,.06);
    padding: 16px 12px;
    transition: width .25s ease;
    overflow: hidden;
}

    .mdwc-sidebar-wrapper.collapsed {
        width: 72px;
    }

.mdwc-hamburger {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: #d31335;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 18px;
}

.mdwc-logo-area {
    background: white;
    border-radius: 18px;
    padding: 18px 14px;
    margin-bottom: 24px;
    box-shadow: 0 8px 22px rgba(0,0,0,.08);
    border: 1px solid #eee;
    text-align: center;
}

.mdwc-logo {
    max-width: 185px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.mdwc-sidebar-wrapper.collapsed .mdwc-logo-area {
    padding: 8px;
    border-radius: 12px;
}

.mdwc-sidebar-wrapper.collapsed .mdwc-logo {
    max-width: 42px;
}

.mdwc-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mdwc-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 14px;
    color: #252525 !important;
    text-decoration: none;
    font-weight: 600;
    transition: all .15s ease-in-out;
    border: 1px solid transparent;
    white-space: nowrap;
}

    .mdwc-nav-link:hover {
        background: #fff2f5;
        border-color: #f3c2cc;
        color: #d31335 !important;
    }

    .mdwc-nav-link.active {
        background: linear-gradient(135deg, #d31335, #a80f2b);
        color: white !important;
    }

.mdwc-sidebar-wrapper.collapsed .link-text {
    display: none;
}

.mdwc-sidebar-wrapper.collapsed .mdwc-nav-link {
    justify-content: center;
    padding: 13px 10px;
}
/* =========================================================
   MDC NEXUS FLOATING SAVE MESSAGE / TOAST
========================================================= */

.cpq-toast-message {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5000;
    width: 650px;
    max-width: 90vw;
    pointer-events: none;
}

    .cpq-toast-message .alert {
        margin: 0;
        border-radius: 16px;
        padding: 16px 22px;
        box-shadow: 0 14px 34px rgba(0,0,0,.24);
        font-weight: 700;
        text-align: center;
        font-size: 1rem;
    }
.cpq-status-ribbon {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 14px;
    border: 1px solid #b7e4c7;
    background: linear-gradient(90deg, #f1fff6, #ffffff);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.cpq-save-status {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 18px;
}

    .cpq-save-status.saved {
        color: #15803d;
    }

    .cpq-save-status.dirty {
        color: #b45309;
    }

.cpq-status-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    color: white;
    background: #16a34a;
}

.cpq-save-status.dirty .cpq-status-icon {
    background: #f59e0b;
}

.cpq-status-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
}

.cpq-status-subtitle {
    font-size: 0.78rem;
    color: #475569;
    margin-top: 4px;
}

.cpq-ribbon-metric {
    flex: 1 1 170px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border-left: 1px solid #b7e4c7;
    min-height: 52px;
}

.cpq-ribbon-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dcfce7;
    color: #166534;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
}

.cpq-ribbon-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #111827;
}

.cpq-ribbon-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: #111827;
    margin-top: 2px;
}
.cart-detail-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 13px;
}

    .cart-detail-row span {
        color: #6b7280;
        min-width: 130px;
    }

    .cart-detail-row strong {
        color: #111827;
    }

.cpq-shade-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #fafafa;
}

.cpq-shade-section-title {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
    margin-bottom: 10px;
}

.cpq-fabric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 8px;
    padding: 4px;
}

.cpq-fabric-swatch {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s;
}

    .cpq-fabric-swatch:hover {
        border-color: #6b7280;
    }

    .cpq-fabric-swatch.active {
        border-color: #dc3545;
        background: #fff5f5;
    }

.cpq-swatch-color {
    width: 100%;
    height: 40px;
    border-radius: 4px;
    margin-bottom: 4px;
    border: 1px solid #d1d5db;
}

.cpq-swatch-label {
    font-size: 10px;
    line-height: 1.2;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cpq-swatch-no-cost {
    font-size: 9px;
    color: #dc3545;
    margin-top: 2px;
}

.cpq-selected-fabric-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
}

.cpq-swatch-color-sm {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    flex-shrink: 0;
}
.cpq-swatch-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 4px;
    border: 1px solid #d1d5db;
    display: block;
}
.cpq-swatch-color {
    width: 100%;
    height: 80px;
    border-radius: 4px;
    margin-bottom: 4px;
    border: 1px solid #d1d5db;
}

.cpq-fabric-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cpq-fabric-modal {
    background: white;
    border-radius: 18px;
    width: min(1100px, 95vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
    overflow: hidden;
}

.cpq-fabric-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.cpq-fabric-modal-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    flex-shrink: 0;
}

.cpq-fabric-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.cpq-fabric-modal-tile {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    background: white;
    display: flex;
    flex-direction: column;
}

    .cpq-fabric-modal-tile:hover {
        border-color: #6b7280;
        box-shadow: 0 4px 12px rgba(0,0,0,.1);
    }

    .cpq-fabric-modal-tile.active {
        border-color: #dc3545;
        box-shadow: 0 4px 14px rgba(220,53,69,.2);
    }

.cpq-modal-swatch-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.cpq-modal-swatch-color {
    width: 100%;
    height: 100px;
    flex-shrink: 0;
}

.cpq-modal-tile-info {
    padding: 6px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 52px;
}

.cpq-modal-tile-name {
    font-size: 11px;
    font-weight: 600;
    color: #111827;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    margin-bottom: 4px;
    word-break: break-word;
}

.cpq-modal-tile-meta {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cpq-modal-openness {
    font-size: 9px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 999px;
    padding: 2px 6px;
    font-weight: 600;
    white-space: nowrap;
}

.cpq-modal-no-cost {
    font-size: 9px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 999px;
    padding: 2px 6px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── FABRIC MODAL NUCLEAR OVERRIDE ─────────────────────────── */
body .cpq-fabric-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    background: rgba(0,0,0,.6) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    width: 100vw !important;
    height: 100vh !important;
}

body .cpq-fabric-modal {
    position: relative !important;
    z-index: 1000000 !important;
    background: #ffffff !important;
    border-radius: 18px !important;
    width: min(1100px, 92vw) !important;
    max-height: 85vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: 0 24px 60px rgba(0,0,0,.4) !important;
    color: #111827 !important;
}

body .cpq-fabric-modal-header {
    background: #ffffff !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid #e5e7eb !important;
    flex-shrink: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

    body .cpq-fabric-modal-header h5 {
        color: #111827 !important;
        margin: 0 !important;
    }

    body .cpq-fabric-modal-header small {
        color: #6b7280 !important;
    }

body .cpq-fabric-modal-filters {
    background: #f8fafc !important;
    padding: 14px 20px !important;
    border-bottom: 1px solid #e5e7eb !important;
    flex-shrink: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr auto !important;
    gap: 12px !important;
}

    body .cpq-fabric-modal-filters label {
        color: #374151 !important;
        font-size: 12px !important;
    }

    body .cpq-fabric-modal-filters .form-select {
        background: white !important;
        color: #111827 !important;
        border: 1px solid #d1d5db !important;
    }

body .cpq-fabric-modal-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 14px !important;
    padding: 16px 20px !important;
    overflow-y: auto !important;
    flex: 1 !important;
    background: white !important;
    min-height: 0 !important;
}

body .cpq-fabric-modal-tile {
    background: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}

    body .cpq-fabric-modal-tile:hover {
        border-color: #6b7280 !important;
        box-shadow: 0 4px 12px rgba(0,0,0,.1) !important;
    }

    body .cpq-fabric-modal-tile.active {
        border-color: #dc3545 !important;
    }

body .cpq-modal-swatch-img {
    width: 100% !important;
    height: 130px !important;
    object-fit: cover !important;
    display: block !important;
    flex-shrink: 0 !important;
}

body .cpq-modal-swatch-color {
    width: 100% !important;
    height: 130px !important;
    flex-shrink: 0 !important;
    display: block !important;
}

body .cpq-modal-tile-info {
    padding: 8px 10px !important;
    background: #ffffff !important;
    flex-shrink: 0 !important;
}

body .cpq-modal-tile-name {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    display: block !important;
    white-space: normal !important;
    overflow: hidden !important;
    line-height: 1.3 !important;
    margin-bottom: 5px !important;
    word-break: break-word !important;
    max-height: 2.6em !important;
}

body .cpq-modal-tile-meta {
    display: flex !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
}

body .cpq-modal-openness {
    font-size: 9px !important;
    background: #dbeafe !important;
    color: #1e40af !important;
    border-radius: 999px !important;
    padding: 2px 6px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

body .cpq-modal-no-cost {
    font-size: 9px !important;
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-radius: 999px !important;
    padding: 2px 6px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

div.cpq-fabric-modal-tile img.cpq-modal-swatch-img {
    width: 100% !important;
    height: 130px !important;
    min-height: 130px !important;
    max-height: 130px !important;
    object-fit: cover !important;
    display: block !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: 130px !important;
}

div.cpq-fabric-modal-tile {
    height: auto !important;
    min-height: 180px !important;
    overflow: visible !important;
}
   

div.cpq-fabric-modal-grid {
    overflow-y: auto !important;
}
.modal-backdrop-simple {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box-simple {
    background: white;
    border-radius: 14px;
    width: min(700px, 95vw);
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
