/* Quote module demo (/QuoteDemo). Prefix: qd-. Works from a narrow SuperOffice web panel up to full screen.
   Look inspired by proplan.no: deep navy, warm cream, pill buttons, very rounded cards, soft shadows.
   "Brown" (proplan.no's font) is commercial; Figtree is a free look-alike. Scoped to .qd-theme (set by MainLayout). */

@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap");

.qd-theme {
    --qd-navy: #05152e;
    --qd-navy-hover: #142a4d;
    --qd-ink: #222222;
    --qd-muted: #66625e;
    --qd-cream: #fff0df;
    --qd-cream-soft: #fff8f0;
    --qd-blue: #3a4fa3;
    --qd-sky: #4aa3df;
    --qd-mist: #e9eef8;
    --qd-line: rgba(5, 21, 46, 0.08);
    --qd-radius: 22px;
    --qd-radius-sm: 14px;
    --qd-shadow: 0 1px 2px rgba(5, 21, 46, 0.04), 0 8px 24px rgba(5, 21, 46, 0.06);
    --qd-shadow-lg: 0 12px 40px rgba(5, 21, 46, 0.12);
    --qd-font: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

    --bs-body-font-family: var(--qd-font);
    --bs-body-color: var(--qd-ink);
    --bs-secondary-color: var(--qd-muted);
    --bs-link-color-rgb: 58, 79, 163;
    --bs-border-radius: 12px;
    --bs-border-radius-sm: 10px;
    --bs-border-radius-lg: 16px;
    font-family: var(--qd-font);
    color: var(--qd-ink);
    background: var(--qd-cream-soft);
}

.qd-theme .text-muted {
    color: var(--qd-muted) !important;
}

.qd-theme a {
    color: var(--qd-blue);
}

/* App header (overrides MainLayout's scoped styles only on demo pages) */
.app-shell.qd-theme .app-header {
    background: rgba(255, 248, 240, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--qd-line);
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.app-shell.qd-theme .app-title {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--qd-navy);
}

.qd-theme .page {
    background:
        radial-gradient(1200px 400px at 100% -10%, var(--qd-cream) 0%, transparent 60%),
        radial-gradient(900px 300px at -10% 0%, #fff4e8 0%, transparent 55%),
        var(--qd-cream-soft);
}

.quote-content {
    padding-top: 1rem;
}

@media (min-width: 992px) {
    .quote-content > * {
        max-width: 1320px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Typography */
.qd-theme h1, .qd-theme h2, .qd-theme h3, .qd-theme .h4 {
    color: var(--qd-navy);
    font-weight: 700;
    letter-spacing: -0.015em;
}

.qd-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--qd-muted);
    margin-bottom: 0.25rem;
}

/* Buttons: pills, navy primary */
.qd-theme .btn {
    border-radius: 9999px;
    font-weight: 600;
    padding: 0.5rem 1.15rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.qd-theme .btn:active {
    transform: translateY(1px);
}

.qd-theme .btn-sm {
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
}

.qd-theme .btn-group > .btn {
    border-radius: 0;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

.qd-theme .btn-group > .btn:first-child {
    border-top-left-radius: 9999px;
    border-bottom-left-radius: 9999px;
}

.qd-theme .btn-group > .btn:last-child {
    border-top-right-radius: 9999px;
    border-bottom-right-radius: 9999px;
}

.qd-theme .btn-primary {
    color: #fff;
    background-color: var(--qd-navy);
    border-color: var(--qd-navy);
}

.qd-theme .btn-primary:hover,
.qd-theme .btn-primary:focus-visible {
    color: #fff;
    background-color: var(--qd-navy-hover);
    border-color: var(--qd-navy-hover);
}

.qd-theme .btn-primary:disabled {
    color: #fff;
    background-color: #8a93a3;
    border-color: #8a93a3;
}

.qd-theme .btn-outline-primary,
.qd-theme .btn-outline-secondary {
    color: var(--qd-navy);
    background-color: #fff;
    border-color: rgba(5, 21, 46, 0.18);
}

.qd-theme .btn-outline-primary:hover,
.qd-theme .btn-outline-secondary:hover {
    color: var(--qd-navy);
    background-color: var(--qd-cream);
    border-color: rgba(5, 21, 46, 0.3);
}

.qd-theme .btn-outline-danger {
    background-color: #fff;
    border-color: rgba(220, 38, 38, 0.3);
}

.qd-theme .btn-success {
    background-color: #157347;
    border-color: #157347;
}

.qd-theme .btn-light {
    background: var(--qd-cream-soft);
}

.qd-theme .btn:focus-visible,
.qd-theme .form-control:focus,
.qd-theme .form-select:focus,
.qd-theme .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(74, 163, 223, 0.35);
    border-color: var(--qd-sky);
}

/* Inputs */
.qd-theme .form-control,
.qd-theme .form-select,
.qd-theme .input-group-text {
    border-color: rgba(5, 21, 46, 0.14);
    border-radius: 12px;
}

.qd-theme .input-group > .form-control,
.qd-theme .input-group > .form-select,
.qd-theme .input-group > .input-group-text,
.qd-theme .input-group > .btn {
    border-radius: 0;
}

.qd-theme .input-group > :first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.qd-theme .input-group > :last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.qd-theme .input-group-text {
    background: var(--qd-cream-soft);
    color: var(--qd-muted);
}

.qd-theme .form-label {
    font-weight: 600;
    color: var(--qd-navy);
}

.qd-theme .form-check-input:checked {
    background-color: var(--qd-navy);
    border-color: var(--qd-navy);
}

.qd-theme .form-text {
    color: var(--qd-muted);
}

.qd-theme .alert {
    border: 0;
    border-radius: var(--qd-radius-sm);
}

.qd-theme .alert-info,
.qd-theme .alert-primary {
    background: var(--qd-mist);
    color: var(--qd-navy);
}

.qd-theme .alert-secondary {
    background: var(--qd-cream);
    color: var(--qd-ink);
}

.qd-theme code {
    color: var(--qd-blue);
}

/* Demo bar */
.qd-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding-bottom: 0.9rem;
    margin-bottom: 1.1rem;
}

.qd-bar .qd-bar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
}

.qd-bar .qd-bar-links .btn {
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.7);
}

.qd-theme .qd-bar .badge.text-bg-warning {
    background: var(--qd-navy) !important;
    color: var(--qd-cream) !important;
    border-radius: 9999px;
    padding: 0.35rem 0.7rem;
    letter-spacing: 0.08em;
}

.qd-demo-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    border-radius: var(--qd-radius-sm);
    border: 1px dashed rgba(5, 21, 46, 0.2);
    background: rgba(255, 255, 255, 0.6);
    color: var(--qd-muted);
}

.qd-demo-note label {
    color: var(--qd-muted);
}

/* Cards */
.qd-card {
    background: #fff;
    border: 0;
    border-radius: var(--qd-radius);
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.1rem;
    box-shadow: var(--qd-shadow);
}

.qd-card h2, .qd-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.qd-hero {
    background: linear-gradient(135deg, #fff 0%, #fff 55%, var(--qd-cream) 100%);
    padding: 1.6rem 1.6rem 1.4rem;
}

.qd-hero-title {
    font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2.1rem);
    font-weight: 800 !important;
    margin-bottom: 0.25rem;
}

.qd-hero-sub {
    color: var(--qd-muted);
    font-weight: 500;
}

.qd-hero-text {
    max-width: 60ch;
    margin: 0.75rem 0 1.25rem;
    font-size: 1.02rem;
}

.qd-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    background: var(--qd-navy);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.qd-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.6rem;
    margin: 0;
}

.qd-fields > div {
    padding: 0.7rem 0.85rem;
    border-radius: var(--qd-radius-sm);
    background: var(--qd-cream-soft);
}

.qd-hero .qd-fields > div {
    background: rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 0 0 1px var(--qd-line);
}

.qd-fields dt {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--qd-muted);
    margin-bottom: 0.15rem;
}

.qd-fields dd {
    margin: 0;
    font-weight: 500;
}

/* Status pills */
.qd-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.qd-status-draft { background: #eef0f3; color: #4b5563; }
.qd-status-sent { background: var(--qd-mist); color: var(--qd-blue); }
.qd-status-signed { background: #e3f4ea; color: #157347; }
.qd-status-rejected { background: #fde8e8; color: #b42318; }

/* Quote list */
.qd-list {
    gap: 0.5rem;
}

.qd-theme .qd-list .list-group-item {
    border: 0;
    border-radius: var(--qd-radius-sm) !important;
    background: var(--qd-cream-soft);
    padding: 0.85rem 1rem;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.qd-theme .qd-list .list-group-item:hover {
    background: #fff;
    box-shadow: var(--qd-shadow);
    transform: translateY(-1px);
}

/* Stepper */
.qd-steps {
    display: flex;
    gap: 0.35rem;
    padding: 0.35rem;
    margin-bottom: 1.1rem;
    overflow-x: auto;
    border-radius: 9999px;
    background: #fff;
    box-shadow: var(--qd-shadow);
}

.qd-step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.5rem 0.9rem;
    border-radius: 9999px;
    color: var(--qd-muted);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.qd-theme a.qd-step {
    color: var(--qd-muted);
}

.qd-step:hover {
    background: var(--qd-cream-soft);
}

.qd-theme a.qd-step.active {
    background: var(--qd-navy);
    color: #fff;
}

.qd-theme a.qd-step.done {
    color: var(--qd-navy);
}

.qd-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--qd-cream);
    color: var(--qd-navy);
    font-size: 0.85rem;
}

.qd-step.active .qd-step-number {
    background: var(--qd-sky);
    color: #fff;
}

.qd-step.done .qd-step-number {
    background: #e3f4ea;
    color: #157347;
}

.qd-step-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Product search */
.qd-search {
    position: relative;
}

.qd-search .input-group-text,
.qd-search .form-control {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    font-size: 1.02rem;
    background: var(--qd-cream-soft);
    border-color: transparent;
}

.qd-search .form-control:focus {
    background: #fff;
}

.qd-search > .input-group > :first-child {
    border-top-left-radius: 9999px;
    border-bottom-left-radius: 9999px;
    padding-left: 1.1rem;
}

.qd-search > .input-group > :last-child {
    border-top-right-radius: 9999px;
    border-bottom-right-radius: 9999px;
}

.qd-search-results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 0.4rem);
    max-height: 24rem;
    overflow-y: auto;
    padding: 0.35rem;
    background: #fff;
    border-radius: var(--qd-radius-sm);
    box-shadow: var(--qd-shadow-lg);
}

.qd-search-result {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: 10px;
    background: none;
    text-align: left;
}

.qd-search-result:hover, .qd-search-result.selected {
    background: var(--qd-cream-soft);
}

.qd-search-result .qd-result-main {
    flex: 1;
    min-width: 0;
}

.qd-search-result .qd-result-name {
    font-weight: 600;
    color: var(--qd-navy);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Quote lines */
.qd-lines-head {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--qd-muted);
    padding-bottom: 0.4rem;
}

.qd-line {
    padding: 0.7rem 0.5rem;
    margin: 0 -0.5rem;
    border-top: 1px solid var(--qd-line);
    border-radius: 12px;
    transition: background-color 0.15s ease;
}

.qd-line:hover {
    background: var(--qd-cream-soft);
}

.qd-line-name {
    font-weight: 600;
    color: var(--qd-navy);
}

.qd-theme .qd-line .badge.text-bg-warning {
    background: var(--qd-cream) !important;
    color: #9a5b13 !important;
    border-radius: 9999px;
    font-weight: 600;
}

.qd-mini-label {
    display: block;
    font-size: 0.7rem;
    color: var(--qd-muted);
}

@media (min-width: 768px) {
    .qd-mini-label {
        display: none;
    }
}

.qd-totals {
    margin-left: auto;
    max-width: 24rem;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-radius: var(--qd-radius-sm);
    background: var(--qd-cream-soft);
}

.qd-totals .row > div:last-child {
    text-align: right;
}

.qd-totals .qd-grand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--qd-navy);
    border-top: 2px solid var(--qd-navy);
    padding-top: 0.5rem;
    margin-top: 0.4rem;
}

/* Templates */
.qd-template-card {
    cursor: pointer;
    height: 100%;
    border: 2px solid transparent;
    border-radius: var(--qd-radius-sm);
    padding: 1rem;
    background: var(--qd-cream-soft);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.qd-template-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--qd-shadow);
}

.qd-template-card.selected {
    border-color: var(--qd-navy);
    background: #fff;
    box-shadow: var(--qd-shadow);
}

.qd-theme .qd-template-card .text-primary {
    color: var(--qd-navy) !important;
    font-weight: 600;
}

.qd-swatches {
    display: flex;
    gap: 0.25rem;
}

.qd-swatch {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.qd-block {
    border: 0;
    border-radius: var(--qd-radius-sm);
    margin-bottom: 0.5rem;
    background: var(--qd-cream-soft);
}

.qd-block-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.8rem;
    cursor: pointer;
}

.qd-theme .qd-block-head .badge {
    background: #fff !important;
    color: var(--qd-navy) !important;
    border: 0 !important;
    border-radius: 9999px;
    font-weight: 600;
}

.qd-block-head .qd-block-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qd-block-body {
    border-top: 1px solid var(--qd-line);
    padding: 0.85rem;
}

.qd-logo-preview {
    max-height: 3rem;
    max-width: 12rem;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 0.35rem;
    box-shadow: inset 0 0 0 1px var(--qd-line);
}

/* Preview */
.qd-preview {
    width: 100%;
    height: calc(100vh - 15rem);
    min-height: 28rem;
    border: 0;
    border-radius: var(--qd-radius);
    background: #e9e4dd;
    box-shadow: var(--qd-shadow);
}

.qd-sticky {
    position: sticky;
    top: 0;
}

/* Comments */
.qd-comments {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 15rem);
    min-height: 16rem;
}

.qd-comment-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem 0 0.75rem;
}

.qd-comment {
    max-width: 88%;
    padding: 0.55rem 0.85rem;
    border-radius: 18px 18px 18px 6px;
    background: var(--qd-cream-soft);
}

.qd-comment.mine {
    align-self: flex-end;
    border-radius: 18px 18px 6px 18px;
    background: var(--qd-navy);
    color: #fff;
}

.qd-comment-meta {
    font-size: 0.72rem;
    color: var(--qd-muted);
    margin-bottom: 0.1rem;
}

.qd-comment.mine .qd-comment-meta,
.qd-comment.mine .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Timeline */
.qd-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.qd-timeline li {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    padding: 0.4rem 0;
    color: #a8a29e;
    font-weight: 500;
}

.qd-timeline li i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #f3f1ee;
}

.qd-timeline li.done {
    color: #157347;
}

.qd-timeline li.done i {
    background: #e3f4ea;
}

.qd-timeline li.current {
    color: var(--qd-navy);
    font-weight: 700;
}

.qd-timeline li.current i {
    background: var(--qd-navy);
    color: #fff;
}

.min-w-0 {
    min-width: 0;
}

@media (max-width: 575.98px) {
    .qd-card {
        padding: 1rem;
        border-radius: 18px;
    }

    .qd-hero {
        padding: 1.2rem 1.1rem;
    }

    .qd-steps {
        scrollbar-width: none;
    }

    .qd-step {
        flex: 0 0 auto;
        padding: 0.4rem 0.55rem;
    }

    .qd-step-label {
        display: none;
    }

    .qd-step.active {
        flex: 1 1 auto;
    }

    .qd-step.active .qd-step-label {
        display: inline;
    }

    .qd-preview {
        height: 70vh;
    }
}

.min-w-0 {
    min-width: 0;
}

/* ---------- Overflow fixes: long names, e-mails and numbers must stay inside their boxes ---------- */
.qd-card,
.qd-fields > div,
.qd-template-card,
.qd-list-item,
.qd-block,
.qd-comment,
.qd-search-result,
.qd-summary-item,
.qd-break {
    min-width: 0;
    overflow-wrap: anywhere;
}

.qd-fields {
    grid-template-columns: repeat(auto-fill, minmax(min(11rem, 100%), 1fr));
}

.qd-pill {
    max-width: 100%;
    white-space: normal;
    text-align: center;
}

.qd-select-auto {
    width: auto;
    max-width: 100%;
    min-width: 0;
}

.qd-demo-note .form-select {
    max-width: 100%;
}

.qd-bar-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    flex: 1 1 12rem;
    min-width: 0;
}

.qd-crumb {
    max-width: 16rem;
    min-width: 0;
}

.qd-hero-title {
    overflow-wrap: anywhere;
}

.qd-totals {
    width: 100%;
}

.qd-totals .row > div {
    min-width: 0;
}

.qd-file {
    width: auto;
    max-width: 100%;
    min-width: 0;
}

/* ---------- Status colours ---------- */
.qd-good { color: #157347 !important; }
.qd-warn { color: #9a5b13 !important; }

/* ---------- Tags, tabs, chips ---------- */
.qd-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.55rem;
    border-radius: 9999px;
    background: var(--qd-mist);
    color: var(--qd-blue);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.qd-tag-muted { background: #f3f1ee; color: var(--qd-muted); }
.qd-tag-warn { background: var(--qd-cream); color: #9a5b13; }
.qd-tag-good { background: #e3f4ea; color: #157347; }

.qd-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.qd-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.85rem;
    border: 0;
    border-radius: 9999px;
    background: var(--qd-cream-soft);
    color: var(--qd-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

.qd-tab:hover { color: var(--qd-navy); }

.qd-tab.active {
    background: var(--qd-navy);
    color: #fff;
}

.qd-count {
    display: inline-block;
    padding: 0 0.45rem;
    border-radius: 9999px;
    background: rgba(5, 21, 46, 0.08);
    font-size: 0.72rem;
}

.qd-tab.active .qd-count { background: rgba(255, 255, 255, 0.2); }

.qd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.qd-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    min-width: 0;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--qd-line);
    border-radius: 9999px;
    background: #fff;
    color: var(--qd-navy);
    font-size: 0.85rem;
    text-align: left;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.qd-chip:hover {
    background: var(--qd-cream);
    box-shadow: var(--qd-shadow);
}

.qd-chip .text-truncate { max-width: 16rem; }

.qd-chip-sm {
    padding: 0.15rem 0.6rem;
    font-size: 0.78rem;
}

.qd-chip-bundle {
    border-radius: var(--qd-radius-sm);
    padding: 0.5rem 0.8rem;
}

.qd-star { color: #c9c3bb; text-decoration: none; }
.qd-star:hover, .qd-star.on { color: #e0a100; }

.qd-product-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.1rem;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    background: var(--qd-cream);
    color: var(--qd-navy);
}

.qd-search-result { cursor: pointer; }

/* ---------- Summary bar (sticky) ---------- */
.qd-summary {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding: 0.6rem 1.1rem;
    margin-bottom: 0.9rem;
    border-radius: var(--qd-radius-sm);
    background: rgba(5, 21, 46, 0.96);
    color: #fff;
    box-shadow: var(--qd-shadow-lg);
}

.qd-summary-item {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.qd-summary-label {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
}

.qd-summary-value {
    font-weight: 700;
    white-space: nowrap;
}

.qd-summary .qd-good { color: #7ee2a8 !important; }
.qd-summary .qd-warn { color: #ffd28a !important; }
.qd-summary .text-danger { color: #ff9b9b !important; }
.qd-summary .text-muted { color: rgba(255, 255, 255, 0.55) !important; }

.qd-summary-save {
    margin-left: auto;
    flex-direction: row;
    align-items: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 575.98px) {
    .qd-summary { gap: 0.4rem 1rem; padding: 0.5rem 0.8rem; }
    .qd-summary-value { font-size: 0.9rem; }
    .qd-summary-save { display: none; }
}

/* ---------- Line types ---------- */
.qd-line-section { background: var(--qd-cream-soft); }

.qd-section-input {
    font-weight: 700;
    color: var(--qd-navy);
    background: transparent;
    border-color: transparent;
    font-size: 1rem;
}

.qd-section-input:hover { border-color: var(--qd-line); }

.qd-line-optional {
    background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 240, 223, 0.5) 10px 20px);
}

.qd-line-discount .form-control { color: #157347; }

.qd-line-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding-top: 0.15rem;
    font-size: 0.85rem;
}

.qd-line-actions .btn-link {
    color: var(--qd-muted);
    text-decoration: none;
    font-weight: 500;
}

.qd-line-actions .btn-link:hover { color: var(--qd-navy); }

.qd-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--qd-line);
}

/* ---------- Quote list ---------- */
.qd-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qd-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem 0.35rem 0;
    border-radius: var(--qd-radius-sm);
    background: var(--qd-cream-soft);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.qd-list-item:hover {
    background: #fff;
    box-shadow: var(--qd-shadow);
}

.qd-theme a.qd-list-link {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    color: var(--qd-ink);
    text-decoration: none;
}

.qd-list-action { flex: 0 0 auto; }

.qd-copy-panel {
    padding: 0.75rem 1rem;
    border-radius: var(--qd-radius-sm);
    border: 1px dashed rgba(5, 21, 46, 0.2);
    background: #fff;
}

/* ---------- Approval and activity ---------- */
.qd-card-attention {
    background: linear-gradient(135deg, #fff 0%, #fff 60%, var(--qd-cream) 100%);
    box-shadow: inset 4px 0 0 #e0a100, var(--qd-shadow);
}

.qd-activity {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 22rem;
    overflow-y: auto;
}

.qd-activity li {
    display: flex;
    gap: 0.7rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--qd-line);
}

.qd-activity li:last-child { border-bottom: 0; }

.qd-activity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--qd-cream-soft);
    color: var(--qd-navy);
}

/* ---------- Gallery ---------- */
.qd-gallery-card {
    position: relative;
    overflow: hidden;
    padding-top: 1.6rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.qd-gallery-card:hover { transform: translateY(-2px); box-shadow: var(--qd-shadow-lg); }
.qd-gallery-card.selected { box-shadow: 0 0 0 2px var(--qd-navy), var(--qd-shadow); }

.qd-gallery-band {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.55rem;
}

/* ---------- Text area with formatting toolbar ---------- */
.qd-textarea .form-control {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.qd-format-bar {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem 0.3rem;
    border: 1px solid rgba(5, 21, 46, 0.14);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: var(--qd-cream-soft);
}

.qd-format-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.7rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--qd-navy);
}

.qd-format-btn:hover { background: #fff; }

.qd-format-hint {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--qd-muted);
    min-width: 0;
}

.qd-theme details > summary { cursor: pointer; }

/* ---------- Badges, bell, toast ---------- */
.qd-badge-host {
    position: relative;
}

.qd-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 9999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
}

.qd-bell {
    position: relative;
}

.qd-bell-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.45rem);
    z-index: 40;
    width: min(22rem, 92vw);
    padding: 0.85rem;
    border-radius: var(--qd-radius-sm);
    background: #fff;
    box-shadow: var(--qd-shadow-lg);
}

.qd-bell-list {
    display: flex;
    flex-direction: column;
    max-height: 22rem;
    overflow-y: auto;
}

.qd-notification {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    width: 100%;
    padding: 0.5rem;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--qd-ink);
    font-size: 0.88rem;
}

.qd-notification:hover {
    background: var(--qd-cream-soft);
}

.qd-notification.unread {
    font-weight: 600;
}

.qd-notification.unread .qd-activity-icon {
    background: var(--qd-navy);
    color: #fff;
}

.qd-toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1050;
    display: flex;
    align-items: center;
    max-width: min(24rem, calc(100vw - 2rem));
    padding: 0.75rem 1rem;
    border-radius: var(--qd-radius-sm);
    background: var(--qd-navy);
    color: #fff;
    box-shadow: var(--qd-shadow-lg);
    cursor: pointer;
    animation: qd-toast-in 0.25s ease-out;
}

@keyframes qd-toast-in {
    from { transform: translateY(1rem); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* ---------- SharePoint (simulated) ---------- */
.qd-sp {
    overflow: hidden;
    border-radius: var(--qd-radius);
    background: #fff;
    box-shadow: var(--qd-shadow);
}

.qd-sp-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    background: linear-gradient(135deg, #036c70 0%, #1a9ba1 100%);
    color: #fff;
}

.qd-sp-site {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.qd-sp-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.4rem;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    font-weight: 800;
    font-size: 1.1rem;
}

.qd-choice .qd-sp-logo {
    background: #e6f4f4;
    color: #036c70;
}

.qd-sp-search {
    width: min(18rem, 100%);
}

.qd-sp-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.7rem 1.1rem;
    border-bottom: 1px solid var(--qd-line);
    font-weight: 600;
}

.qd-sp-crumbs a {
    color: var(--qd-navy);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.qd-sp-crumbs a:hover {
    text-decoration: underline;
}

.qd-sp-table th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--qd-muted);
    background: var(--qd-cream-soft);
}

.qd-sp-table td,
.qd-sp-table th {
    padding-left: 1.1rem;
}

.qd-theme a.qd-sp-name {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--qd-ink);
    font-weight: 500;
    text-decoration: none;
    min-width: 0;
}

.qd-theme a.qd-sp-name:hover {
    color: #036c70;
    text-decoration: underline;
}

.qd-sp-folder { color: #e0a100; font-size: 1.15rem; }
.qd-sp-pdf { color: #c4314b; font-size: 1.15rem; }

/* ---------- Connect wizard ---------- */
.qd-wizard-steps {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.qd-wizard-steps span {
    flex: 1;
    padding: 0.3rem 0.5rem;
    border-radius: 9999px;
    background: #f3f1ee;
    color: var(--qd-muted);
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

.qd-wizard-steps span.on {
    background: var(--qd-navy);
    color: #fff;
}

.qd-consent {
    padding: 1rem;
    border-radius: var(--qd-radius-sm);
    border: 1px solid var(--qd-line);
    background: #fafafa;
}

.qd-choice {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 2px solid transparent;
    border-radius: var(--qd-radius-sm);
    background: var(--qd-cream-soft);
    min-width: 0;
}

.qd-choice:hover {
    background: #fff;
    box-shadow: var(--qd-shadow);
}

.qd-choice.selected {
    border-color: var(--qd-navy);
    background: #fff;
}

.qd-chip.qd-chip-on {
    background: var(--qd-navy);
    border-color: var(--qd-navy);
    color: #fff;
}

.qd-example {
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: var(--qd-cream-soft);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
}

/* ---------- Compact (hidden) sale header ---------- */
.qd-sale-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
