:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: #ffffff;
    --surface-muted: #f8fafc;
    --primary: #f97316;
    --primary-dark: #c2410c;
    --primary-soft: #fff7ed;
    --accent: #0ea5e9;
    --success: #16a34a;
    --warning: #f59e0b;
    --error: #dc2626;
    --text: #172033;
    --muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.28), transparent 34rem),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.22), transparent 30rem),
        linear-gradient(135deg, #0f172a 0%, #1e293b 48%, #111827 100%);
}

/* Accounting control center */
.accounting-page-dashboard {
    min-width: 0;
}

.dashboard-accounting-panel {
    min-width: 0;
}

.dashboard-accounting-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.38fr);
    align-items: end;
    gap: 28px;
    padding: 24px;
    border: 1px solid var(--border);
    background: #fff;
}

.dashboard-accounting-heading h2,
.dashboard-accounting-heading p {
    margin: 0;
}

.dashboard-accounting-heading > div:first-child > p:last-child {
    margin-top: 8px;
    color: var(--muted);
}

.accounting-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.38fr);
    align-items: end;
    gap: 28px;
}

.accounting-period-summary {
    display: grid;
    gap: 6px;
    padding-left: 24px;
    border-left: 1px solid var(--border);
}

.accounting-period-summary span,
.accounting-period-summary small {
    color: var(--muted);
}

.accounting-period-summary strong {
    font-size: 20px;
}

.accounting-filter-band {
    position: relative;
    z-index: 4;
    margin-top: 18px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    background: #fff;
}

.accounting-filter-heading,
.accounting-section-heading,
.accounting-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.accounting-filter-heading h2,
.accounting-section-heading h2,
.accounting-panel-heading h3 {
    margin: 0;
}

.accounting-presets {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.accounting-presets button {
    min-height: 36px;
    padding: 7px 12px;
}

.accounting-presets button.active {
    color: #fff;
    border-color: #343a42;
    background: #343a42;
}

.accounting-filter-form {
    display: grid;
    grid-template-columns: minmax(135px, 0.65fr) minmax(135px, 0.65fr) minmax(170px, 0.9fr) minmax(220px, 1.35fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 16px;
}

.accounting-filter-form label {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: #343a42;
    font-size: 12px;
    font-weight: 800;
}

.accounting-filter-form input,
.accounting-filter-form select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    margin: 0;
}

.accounting-section {
    min-width: 0;
    margin-top: 22px;
    padding: 26px 0 4px;
    scroll-margin-top: 18px;
    border-top: 1px solid var(--border);
}

.accounting-overview {
    border-top: 0;
}

.accounting-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.accounting-kpi {
    display: grid;
    min-width: 0;
    min-height: 132px;
    align-content: start;
    gap: 8px;
    padding: 20px;
    color: var(--text);
    text-align: left;
    border: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

button.accounting-kpi {
    cursor: pointer;
}

button.accounting-kpi:hover,
button.accounting-kpi:focus-visible {
    background: #fff8f2;
}

.accounting-kpi span,
.accounting-kpi small {
    color: var(--muted);
}

.accounting-kpi span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.accounting-kpi strong {
    overflow-wrap: anywhere;
    font-size: 28px;
    line-height: 1;
}

.accounting-alert-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.accounting-alert {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    min-width: 0;
    min-height: 72px;
    padding: 12px 14px;
    color: var(--text);
    text-align: left;
    border: 1px solid var(--border);
    border-left: 4px solid #94a3b8;
    border-radius: 4px;
    background: #fff;
}

.accounting-alert.warning { border-left-color: #f59e0b; }
.accounting-alert.danger { border-left-color: #dc2626; }
.accounting-alert.success { border-left-color: #16a34a; }
.accounting-alert span { min-width: 0; overflow-wrap: anywhere; }
.accounting-alert small { grid-column: 1 / -1; color: var(--muted); }

.accounting-analysis-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.8fr);
    gap: 22px;
    margin-top: 18px;
}

.accounting-analysis-panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border);
    background: #fff;
}

.accounting-panel-heading {
    align-items: baseline;
}

.accounting-panel-heading span {
    color: var(--muted);
    font-size: 12px;
}

.accounting-monthly-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    align-items: end;
    gap: 8px;
    min-height: 250px;
    margin-top: 18px;
}

.accounting-month-column {
    display: grid;
    align-content: end;
    gap: 7px;
    min-width: 0;
    text-align: center;
}

.accounting-bars {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 3px;
    height: 205px;
    border-bottom: 1px solid var(--border);
}

.accounting-bars span {
    width: min(13px, 42%);
    min-height: 2px;
    background: #343a42;
}

.accounting-bars .collected {
    background: #16a34a;
}

.accounting-month-column small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accounting-breakdown-list {
    display: grid;
    margin-top: 12px;
}

.accounting-breakdown-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 0.72fr);
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.accounting-breakdown-row > div,
.accounting-breakdown-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.accounting-breakdown-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.accounting-breakdown-value {
    text-align: right;
}

.accounting-breakdown-value span {
    display: block;
    height: 4px;
    margin-top: 7px;
    background: #e5e7eb;
}

.accounting-breakdown-value i {
    display: block;
    height: 100%;
    background: #f97316;
}

.accounting-aging-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    margin-top: 18px;
    background: var(--border);
    border: 1px solid var(--border);
}

.accounting-aging-item {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 18px;
    background: #fff;
}

.accounting-aging-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.accounting-aging-item strong {
    overflow-wrap: anywhere;
    font-size: 20px;
}

.accounting-aging-item > div {
    height: 4px;
    background: #e5e7eb;
}

.accounting-aging-item i {
    display: block;
    height: 100%;
    background: #64748b;
}

.accounting-aging-item.danger i { background: #dc2626; }

.accounting-top-clients-panel {
    margin-top: 16px;
}

.accounting-tax-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
    border: 1px solid var(--border);
}

.accounting-tax-grid > div {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 20px;
    border-right: 1px solid var(--border);
    background: #fff;
}

.accounting-tax-grid > div:last-child { border-right: 0; }
.accounting-tax-grid span { color: var(--muted); font-size: 12px; font-weight: 800; }
.accounting-tax-grid strong { overflow-wrap: anywhere; font-size: 22px; }

.accounting-register-tabs {
    display: flex;
    gap: 4px;
    margin-top: 18px;
    border-bottom: 1px solid var(--border);
}

.accounting-register-tabs button {
    min-height: 42px;
    padding: 9px 16px;
    color: var(--muted);
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
}

.accounting-register-tabs button.active {
    color: var(--text);
    border-bottom-color: #f97316;
}

.accounting-register-tabs span {
    display: inline-block;
    min-width: 24px;
    margin-left: 5px;
    padding: 2px 6px;
    border-radius: 20px;
    background: #e5e7eb;
    font-size: 11px;
}

.accounting-register {
    display: grid;
    min-width: 0;
}

.accounting-register[hidden] {
    display: none !important;
}

.accounting-record-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.82fr) minmax(220px, 1.35fr) minmax(150px, 0.78fr) minmax(130px, 0.68fr) auto;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.accounting-record-row.overdue {
    box-shadow: inset 4px 0 #dc2626;
    padding-left: 14px;
}

.accounting-record-row.refund {
    box-shadow: inset 4px 0 #f59e0b;
    padding-left: 14px;
}

.accounting-record-row > div,
.accounting-record-row strong,
.accounting-record-row small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.accounting-record-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.accounting-record-primary .status-chip {
    display: inline-flex;
    margin-top: 6px;
}

.accounting-tax-detail {
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 12px;
}

.accounting-record-amount {
    text-align: right;
}

.accounting-record-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.accounting-record-actions .button-link {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 12px;
}

.accounting-export-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.accounting-export-action {
    display: grid;
    gap: 6px;
    min-width: 0;
    min-height: 96px;
    align-content: center;
    padding: 18px 20px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    border-left: 4px solid #343a42;
    background: #fff;
}

.accounting-export-action.quickbooks {
    border-left-color: #16a34a;
}

.accounting-export-action:hover,
.accounting-export-action:focus-visible {
    background: #f8fafc;
}

.accounting-export-action span,
.accounting-export-note {
    color: var(--muted);
    font-size: 13px;
}

.accounting-export-action.disabled {
    opacity: 0.48;
    pointer-events: none;
}

.accounting-export-note {
    margin-top: 12px;
}

.accounting-quick-actions {
    margin-top: 18px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    background: #fff;
}

.accounting-quick-actions .accounting-export-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 14px;
}

.accounting-quick-actions .accounting-export-action {
    min-height: 78px;
    padding: 14px 16px;
}

.accounting-empty {
    display: grid;
    min-height: 120px;
    place-items: center;
    padding: 20px;
    color: var(--muted);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 1050px) {
    .accounting-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .accounting-filter-form .accounting-search-field {
        grid-column: 1 / -1;
    }

    .accounting-filter-form > button {
        grid-column: 1 / -1;
    }

    .accounting-alert-grid,
    .accounting-tax-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .accounting-tax-grid > div:nth-child(2) { border-right: 0; }
    .accounting-tax-grid > div:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }

    .accounting-analysis-grid {
        grid-template-columns: 1fr;
    }

    .accounting-quick-actions .accounting-export-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .accounting-aging-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .accounting-record-row {
        grid-template-columns: minmax(140px, 0.8fr) minmax(200px, 1.3fr) minmax(130px, 0.7fr) auto;
    }

    .accounting-tax-detail {
        display: none;
    }
}

@media (max-width: 760px) {
    .dashboard-accounting-heading,
    .accounting-hero {
        grid-template-columns: 1fr;
    }

    .accounting-period-summary {
        padding: 14px 0 0;
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .accounting-filter-band {
        padding: 16px;
    }

    .accounting-quick-actions {
        padding: 16px;
    }

    .accounting-quick-actions .accounting-export-grid {
        grid-template-columns: 1fr;
    }

    .accounting-filter-heading,
    .accounting-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .accounting-presets {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
    }

    .accounting-filter-form,
    .accounting-kpi-grid,
    .accounting-alert-grid,
    .accounting-aging-grid,
    .accounting-tax-grid,
    .accounting-export-grid {
        grid-template-columns: 1fr;
    }

    .accounting-filter-form .accounting-search-field,
    .accounting-filter-form > button {
        grid-column: auto;
    }

    .accounting-kpi {
        min-height: 104px;
    }

    .accounting-kpi strong {
        font-size: 24px;
    }

    .accounting-alert {
        min-height: 64px;
    }

    .accounting-tax-grid > div,
    .accounting-tax-grid > div:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .accounting-tax-grid > div:last-child {
        border-bottom: 0;
    }

    .accounting-monthly-chart {
        grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
        min-height: 210px;
    }

    .accounting-bars {
        height: 165px;
    }

    .accounting-record-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        padding: 14px 0;
    }

    .accounting-record-row > div:nth-child(2),
    .accounting-record-row > div:nth-child(3) {
        grid-column: 1 / -1;
    }

    .accounting-record-amount {
        grid-column: 2;
        grid-row: 1;
    }

    .accounting-record-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .accounting-export-action {
        min-height: 84px;
    }
}

body.modal-open {
    overflow: hidden;
}

.button-link {
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 0;
    border-radius: 999px;
    color: white;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.hero-action-row .button-link:hover {
    filter: brightness(1.04) saturate(1.08);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.28);
}

.help-text {
    color: var(--muted);
    margin: 8px 0 16px;
}

.import-export-card {
    margin: 20px 0;
}

.upload-actions input,
.inventory-actions input[type="file"] {
    max-width: 280px;
}

.app-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

html.shell-preloading .sidebar {
    visibility: hidden;
}

.demo-mode-global-alert {
    align-items: center;
    background: linear-gradient(135deg, #991b1b, #f97316);
    box-shadow: 0 14px 34px rgba(153, 27, 27, 0.32);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    justify-content: center;
    min-height: 44px;
    padding: 8px 18px;
    position: sticky;
    text-align: center;
    top: 0;
    z-index: 3000;
}

.demo-mode-global-alert strong {
    font-size: 13px;
    font-weight: 950;
    letter-spacing: 0.08em;
}

.demo-mode-global-alert span {
    font-size: 14px;
    font-weight: 800;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 28px;
    color: white;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(18px);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.brand-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
}

.brand-card.brand-dashboard-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.brand-card.brand-dashboard-link:hover {
    border-color: rgba(249, 115, 22, 0.62);
    background: rgba(249, 115, 22, 0.13);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
}

.brand-card.brand-dashboard-link:focus-visible {
    outline: 3px solid rgba(249, 115, 22, 0.72);
    outline-offset: 3px;
    border-color: rgba(249, 115, 22, 0.78);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    color: white;
    font-weight: 900;
    letter-spacing: -0.04em;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #ef4444);
    box-shadow: 0 14px 35px rgba(249, 115, 22, 0.36);
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 7px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
}

.brand-card h1,
.hero-panel h2,
.dashboard-card h2,
#resultat h2,
.empty-state h3 {
    margin: 0;
}

.brand-card h1 {
    font-size: 20px;
    line-height: 1.1;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar .eyebrow {
    color: #fed7aa;
}

.step-nav {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.step-nav::before {
    content: "Dans cette page";
    margin: 0 0 2px 4px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.step-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    transition: 0.2s ease;
}

.step-link:hover,
.step-link.active {
    color: white;
    border-color: rgba(255, 255, 255, 0.14);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(14, 165, 233, 0.1));
}

.step-link span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: #fed7aa;
    font-weight: 800;
    border-radius: 10px;
    background: rgba(249, 115, 22, 0.16);
}

.step-link.active span {
    color: white;
    background: linear-gradient(135deg, var(--primary), #ef4444);
    box-shadow: 0 10px 22px rgba(249, 115, 22, 0.24);
}

.sidebar-note {
    display: flex;
    gap: 10px;
    margin-top: 28px;
    padding: 16px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.5;
    border-radius: 18px;
    background: rgba(14, 165, 233, 0.12);
}

.sidebar-tools {
    display: grid;
    gap: 8px;
    margin-top: 24px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
}

.sidebar-tools-title {
    margin: 0 0 2px;
    color: rgba(255, 255, 255, 0.44);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sidebar-tools a {
    display: block;
    padding: 9px 10px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    transition: 0.2s ease;
}

.sidebar-tools a:hover {
    color: white;
    background: rgba(249, 115, 22, 0.18);
}

.sidebar-utility {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 20px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
}

.sidebar-utility-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    transition: 0.18s ease;
}

.sidebar-utility-button:hover,
.sidebar-utility-button:focus-visible {
    color: white;
    border-color: rgba(249, 115, 22, 0.34);
    outline: none;
    background: rgba(249, 115, 22, 0.22);
    transform: translateY(-1px);
}

.sidebar-utility-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: #fed7aa;
    font-size: 16px;
    line-height: 1;
}

.sidebar-notification-button {
    position: relative;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    margin: 0 0 12px;
    padding: 8px 12px;
    color: #fff7ed;
    border: 1px solid rgba(249, 115, 22, 0.34);
    border-radius: 8px;
    background: rgba(249, 115, 22, 0.13);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    text-align: left;
}

.sidebar-notification-button:hover,
.sidebar-notification-button:focus-visible {
    border-color: rgba(249, 115, 22, 0.72);
    outline: none;
    background: rgba(249, 115, 22, 0.27);
}

.notification-bell-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 1;
}

.notification-count-badge {
    display: grid;
    place-items: center;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    color: #fff;
    border-radius: 999px;
    background: #ef4444;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.notification-count-badge[hidden] {
    display: none;
}

.notification-center-overlay {
    position: fixed;
    inset: 0;
    z-index: 4190;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(9, 12, 17, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.notification-center-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 4200;
    display: flex;
    flex-direction: column;
    width: min(440px, 100vw);
    height: 100dvh;
    color: #172033;
    background: #f5f7f8;
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.24);
    transform: translateX(105%);
    transition: transform 0.22s ease;
}

body.notification-center-open {
    overflow: hidden;
}

body.notification-center-open .notification-center-overlay {
    opacity: 1;
    pointer-events: auto;
}

body.notification-center-open .notification-center-drawer {
    transform: translateX(0);
}

.notification-center-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 20px 18px;
    color: #fff;
    background: #171a1f;
}

.notification-center-header p,
.notification-center-header h2,
.notification-center-header span {
    margin: 0;
}

.notification-center-header p {
    color: #fb923c;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.notification-center-header h2 {
    margin-top: 3px;
    font-size: 27px;
    letter-spacing: 0;
}

.notification-center-summary {
    display: block;
    margin-top: 5px !important;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
}

.notification-center-close {
    display: grid;
    place-items: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    font-size: 27px;
    line-height: 1;
}

.notification-center-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #dce2e8;
    background: #fff;
}

.notification-center-toolbar button,
.notification-center-toolbar a {
    min-height: 36px;
    padding: 8px 10px;
    color: #344054;
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.notification-center-toolbar button:not(:disabled):hover,
.notification-center-toolbar a:hover {
    color: #c2410c;
    background: #fff7ed;
}

.notification-center-toolbar button:disabled {
    opacity: 0.42;
}

.notification-center-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
}

.notification-center-section + .notification-center-section {
    margin-top: 20px;
}

.notification-center-section h3 {
    margin: 0 0 8px;
    color: #667085;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.notification-center-list {
    display: grid;
    gap: 7px;
}

.notification-center-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 0;
    padding: 12px;
    color: #172033;
    border: 1px solid #dce2e8;
    border-left: 4px solid #f97316;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.notification-center-item:hover,
.notification-center-item:focus-visible {
    border-color: #fdba74;
    outline: none;
    background: #fffaf5;
}

.notification-center-item.severity-urgent {
    border-left-color: #dc2626;
}

.notification-center-item.is-read {
    opacity: 0.64;
    border-left-color: #98a2b3;
}

.notification-center-item-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #c2410c;
    border-radius: 6px;
    background: #fff2e8;
    font-size: 16px;
    font-weight: 900;
}

.notification-center-item-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.notification-center-item-copy strong {
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.25;
}

.notification-center-item-copy > span {
    display: -webkit-box;
    overflow: hidden;
    color: #667085;
    font-size: 12px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.notification-center-item-copy small {
    color: #b54708;
    font-size: 10px;
    font-weight: 800;
}

.notification-center-item-arrow {
    color: #98a2b3;
    font-size: 20px;
}

.notification-center-empty {
    display: grid;
    gap: 5px;
    padding: 28px 18px;
    color: #667085;
    text-align: center;
}

.notification-center-empty strong {
    color: #172033;
}

.admin-settings-shortcut {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0 0 16px;
    padding: 10px 12px;
    color: #fff7ed;
    border: 1px solid rgba(249, 115, 22, 0.36);
    border-radius: 8px;
    background: rgba(249, 115, 22, 0.14);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    transition: 0.18s ease;
}

.admin-settings-shortcut:hover,
.admin-settings-shortcut:focus-visible,
.admin-settings-shortcut.active {
    color: #fff;
    border-color: rgba(249, 115, 22, 0.72);
    outline: none;
    background: rgba(249, 115, 22, 0.28);
}

.admin-settings-shortcut-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    color: #fed7aa;
    font-size: 18px;
    line-height: 1;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.12);
}

.dashboard {
    min-width: 0;
    padding: 108px 30px 30px;
}

@media (min-width: 1181px) {
    .sidebar-collapsed .app-shell {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .sidebar-collapsed .sidebar {
        overflow-x: hidden;
        padding: 18px 12px;
    }

    .sidebar-collapsed .brand-card {
        justify-content: center;
        gap: 0;
        padding: 10px;
        border-radius: 20px;
    }

    .sidebar-collapsed .brand-card > div:not(.brand-mark),
    .sidebar-collapsed .session-user,
    .sidebar-collapsed .session-logout,
    .sidebar-collapsed .sidebar-note,
    .sidebar-collapsed .sidebar-tools,
    .sidebar-collapsed .app-version-badge {
        display: none;
    }

    .sidebar-collapsed .brand-mark {
        width: 44px;
        height: 44px;
    }

    .sidebar-collapsed .session-badge {
        grid-template-columns: 1fr;
        justify-items: center;
        margin: 10px 0 12px;
        padding: 10px;
        border-radius: 20px;
    }

    .sidebar-collapsed .sidebar-utility {
        grid-template-columns: 1fr;
        margin: 0 0 12px;
        padding: 8px;
    }

    .sidebar-collapsed .sidebar-utility-button {
        min-height: 40px;
        padding: 0;
        font-size: 0;
    }

    .sidebar-collapsed .sidebar-utility-icon {
        width: 22px;
        height: 22px;
        font-size: 18px;
    }

    .sidebar-collapsed .sidebar-notification-button {
        grid-template-columns: 1fr;
        justify-items: center;
        min-height: 46px;
        padding: 7px;
    }

    .sidebar-collapsed .notification-toggle-label {
        display: none;
    }

    .sidebar-collapsed .sidebar-notification-button .notification-count-badge {
        position: absolute;
        top: 2px;
        right: 2px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        font-size: 9px;
    }

    .sidebar-collapsed .admin-settings-shortcut {
        justify-content: center;
        min-height: 44px;
        padding: 8px;
        font-size: 0;
    }

    .sidebar-collapsed .admin-settings-shortcut-icon {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
        font-size: 20px;
    }

    .sidebar-collapsed .step-nav {
        gap: 8px;
        margin-top: 14px;
    }

    .sidebar-collapsed .step-nav::before {
        display: none;
    }

    html.sidebar-collapsed[data-ui-density] .step-link {
        justify-content: center;
        width: 100%;
        min-width: 0;
        min-height: 52px;
        gap: 0;
        padding: 9px;
        overflow: hidden;
        font-size: 0;
        border-radius: 15px;
        white-space: nowrap;
    }

    html.sidebar-collapsed[data-ui-density] .step-link > :not(span) {
        display: none;
    }

    html.sidebar-collapsed[data-ui-density] .step-link span {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

}

.hero-panel,
.dashboard-card,
.result-panel,
.stat-card {
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.hero-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px;
    border-radius: var(--radius-lg);
}

.hero-panel h2 {
    max-width: 820px;
    color: #0f172a;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.hero-copy {
    max-width: 720px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 17px;
}

.hero-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-action-row .button-link:not(.dashboard-header-action) {
    min-height: 46px;
    padding: 0 16px;
    color: #172033;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.hero-action-row .button-link:first-child:not(.dashboard-header-action) {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 16px 34px rgba(249, 115, 22, 0.24);
}

.hero-action-row .button-link:not(.dashboard-header-action):hover {
    filter: none;
    transform: translateY(-1px);
    border-color: rgba(249, 115, 22, 0.34);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
}

.hero-action-row .button-link:first-child:not(.dashboard-header-action):hover {
    box-shadow: 0 18px 36px rgba(249, 115, 22, 0.28);
}

.hero-panel:has(.header-import-export) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: stretch;
}

.hero-panel:has(.header-import-export) > div:first-child {
    max-width: none;
    min-width: 0;
}

.header-import-export {
    position: static;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    align-self: start;
    justify-content: stretch;
    align-items: stretch;
    gap: 8px;
    max-width: none;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(12px);
}

.header-import-export input[type="file"],
.backup-actions input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.header-import-export .button-link,
.header-import-export .secondary-button,
.header-import-export .file-trigger {
    align-items: center;
    color: #0f172a;
    border: 1px solid rgba(100, 116, 139, 0.34);
    background: #fff;
    box-shadow: none;
    display: inline-flex;
    justify-content: center;
    line-height: 1;
    min-height: 44px;
    padding: 0 13px;
    font-size: 13px;
    font-weight: 900;
    border-radius: 14px;
    text-decoration: none;
    width: 100%;
}

.header-import-export .button-link {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.22);
}

.header-import-export .button-link:hover,
.header-import-export .secondary-button:hover,
.header-import-export .file-trigger:hover {
    transform: translateY(-1px);
    border-color: rgba(249, 115, 22, 0.34);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
}

.file-trigger {
    cursor: pointer;
}

.header-import-export .file-trigger,
.backup-actions .file-trigger {
    border-style: dashed;
}

.compact-status {
    grid-column: 1 / -1;
    min-height: 0;
    margin: 0;
    padding-top: 2px;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
}

.dashboard-page .hero-panel.inventory-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
    align-items: stretch;
    gap: 24px;
}

.dashboard-page .hero-panel.inventory-hero:has(.dashboard-action-menu[open]) {
    z-index: 100;
}

.dashboard-page .hero-panel:has(.header-import-export) > div:first-child {
    max-width: none;
}

.dashboard-page .dashboard-hero-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    max-width: 700px;
    gap: 10px;
}

.dashboard-page .inventory-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.dashboard-page .inventory-hero h2 {
    font-size: clamp(30px, 4vw, 44px);
}

.dashboard-action-menu {
    position: relative;
    align-self: start;
    z-index: 70;
}

.dashboard-action-menu > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    color: #172033;
    border: 1px solid #dbe2ea;
    border-radius: 6px;
    background: #fff;
    font-weight: 850;
    cursor: pointer;
    list-style: none;
}

.dashboard-action-menu > summary::-webkit-details-marker {
    display: none;
}

.dashboard-action-menu > summary::after {
    content: '▾';
    margin-left: 10px;
    color: #f97316;
}

.dashboard-action-menu[open] > summary,
.dashboard-action-menu > summary:hover,
.dashboard-action-menu > summary:focus-visible {
    border-color: #f97316;
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.dashboard-action-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1;
    display: grid;
    width: min(320px, calc(100vw - 40px));
    overflow: hidden;
    padding: 8px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.22);
}

.dashboard-action-menu-panel a,
.dashboard-action-menu-panel button {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 12px;
    color: #172033;
    border: 0;
    border-radius: 5px;
    background: transparent;
    font: inherit;
    font-weight: 750;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.dashboard-action-menu-panel a:hover,
.dashboard-action-menu-panel button:hover,
.dashboard-action-menu-panel a:focus-visible,
.dashboard-action-menu-panel button:focus-visible {
    color: #c2410c;
    background: #fff7ed;
    outline: 2px solid #f97316;
    outline-offset: -2px;
}

.dashboard-menu-separator {
    height: 1px;
    margin: 6px 4px;
    background: #e2e8f0;
}

.dashboard-action-menu-panel .save-status {
    margin: 4px 8px 0;
}

.dashboard-header-action {
    min-height: 46px;
    padding: 0 16px;
    color: #172033;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-header-action.primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 16px 34px rgba(249, 115, 22, 0.24);
}

.dashboard-header-action.subtle {
    color: #475569;
    background: rgba(248, 250, 252, 0.82);
}

.dashboard-header-action:hover,
.dashboard-page .header-import-export .dashboard-backup-primary:hover,
.dashboard-page .header-import-export .dashboard-restore-button:hover,
.dashboard-page .header-import-export .dashboard-file-trigger:hover {
    filter: none;
    transform: translateY(-1px);
    border-color: rgba(249, 115, 22, 0.34);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
}

.dashboard-header-action.primary:hover,
.dashboard-page .header-import-export .dashboard-backup-primary:hover {
    box-shadow: 0 18px 36px rgba(249, 115, 22, 0.28);
}

.dashboard-page .header-import-export.dashboard-backup-panel {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    align-self: start;
    justify-content: stretch;
    gap: 12px;
    max-width: none;
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.dashboard-backup-head {
    display: grid;
    gap: 3px;
}

.dashboard-backup-head span {
    color: var(--primary);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dashboard-backup-head strong {
    color: #0f172a;
    font-size: 18px;
    line-height: 1.1;
}

.dashboard-backup-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(118px, auto) minmax(112px, auto);
    gap: 8px;
    align-items: stretch;
}

.dashboard-page .header-import-export .dashboard-backup-primary,
.dashboard-page .header-import-export .dashboard-file-trigger,
.dashboard-page .header-import-export .dashboard-restore-button {
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 900;
}

.dashboard-page .header-import-export .dashboard-backup-primary {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.22);
}

.dashboard-file-trigger {
    display: grid !important;
    gap: 2px;
    line-height: 1.1 !important;
}

.dashboard-file-trigger small {
    overflow: hidden;
    max-width: 118px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-page .header-import-export .dashboard-restore-button {
    color: #0f172a;
    background: #fff;
}

.dashboard-page .compact-status {
    padding-top: 2px;
    color: var(--muted);
    line-height: 1.35;
    text-align: left;
}

.dashboard-page .compact-status.success {
    color: var(--success);
}

.dashboard-page .compact-status.error {
    color: var(--error);
}

.hero-panel:has(.header-import-export) > div:first-child {
    max-width: none;
}

.backup-list,
.health-check-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.backup-card,
.health-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
}

.backup-card-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    align-items: center;
}

.backup-card div,
.health-card div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.backup-card strong,
.health-card strong {
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backup-card span,
.backup-card small,
.health-card small {
    color: var(--muted);
    font-size: 12px;
}

.health-card {
    justify-content: flex-start;
}

.health-card > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    color: #166534;
    font-size: 12px;
    font-weight: 900;
    border-radius: 999px;
    background: #dcfce7;
}

.health-card.warning > span,
.health-card.missing > span {
    color: #92400e;
    background: #fef3c7;
}

.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    color: var(--text);
    font-weight: 850;
    text-decoration: none;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
}

.secondary-link.compact {
    min-height: 38px;
    font-size: 13px;
}

.admin-links {
    position: absolute;
    z-index: 1000;
    top: -62px;
    right: 0;
    left: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
    border: 1px solid rgba(226, 232, 240, 0.84);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(18px);
    scrollbar-width: none;
}

.admin-links::-webkit-scrollbar {
    display: none;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 15px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.admin-link:hover {
    color: var(--text);
    background: rgba(248, 250, 252, 0.94);
    transform: translateY(-1px);
}

.admin-link.primary {
    color: #0f172a;
    font-weight: 950;
    border-color: rgba(249, 115, 22, 0.22);
    background: linear-gradient(180deg, #ffffff 0%, var(--primary-soft) 100%);
    box-shadow: inset 0 -3px 0 var(--primary), 0 10px 24px rgba(249, 115, 22, 0.14);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    font-size: 22px;
    border-radius: 16px;
    background: var(--primary-soft);
}

.stat-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.estimate-history-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.estimate-history-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    padding: 18px;
}

.estimate-history-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--primary);
}

.estimate-history-card.deposit-due-card::before {
    background: #f59e0b;
}

.estimate-history-card.balance-due-card::before {
    background: #0ea5e9;
}

.estimate-history-card.paid-card::before {
    background: #16a34a;
}

.estimate-history-card.project-scenario-card::before {
    background: #f97316;
}

.estimate-history-card.selected {
    border-color: rgba(249, 115, 22, 0.72);
    box-shadow: 0 18px 44px rgba(249, 115, 22, 0.16);
}

/* Registre compact des soumissions: la fiche active s'ouvre sous sa ligne. */
.quote-register-entry.estimate-history-card {
    padding: 0;
    overflow: visible;
    border-color: #cbd5e1;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
}

.quote-register-entry.estimate-history-card::before {
    width: 4px;
    border-radius: 8px 0 0 8px;
}

.quote-register-entry.estimate-history-card.selected {
    border-color: rgba(249, 115, 22, 0.72);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.quote-register-entry.selected::before {
    border-radius: 8px 0 0 0;
}

.quote-register-row {
    display: grid;
    width: 100%;
    min-height: 76px;
    grid-template-columns: minmax(145px, 0.85fr) minmax(210px, 1.35fr) minmax(150px, 0.85fr) minmax(145px, 0.75fr) 28px;
    gap: 16px;
    align-items: center;
    padding: 12px 16px 12px 20px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.quote-register-row:hover,
.quote-register-entry.selected .quote-register-row {
    background: #fff8f2;
}

.quote-register-entry.selected .quote-register-row {
    border-radius: 8px 8px 0 0;
}

.quote-register-row:focus-visible {
    outline: 3px solid rgba(249, 115, 22, 0.24);
    outline-offset: 2px;
}

.quote-register-row > span:not(.quote-register-chevron) {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.quote-register-row strong,
.quote-register-row small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.quote-register-row strong {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.25;
}

.quote-register-reference strong,
.quote-register-financial strong {
    font-size: 17px;
}

.quote-register-row small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.quote-register-status {
    justify-items: start;
}

.quote-register-status .status-chip {
    width: fit-content;
}

.quote-register-financial {
    text-align: right;
}

.quote-register-chevron {
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    text-align: center;
    transform: rotate(0deg);
    transition: transform 0.18s ease;
}

.quote-register-entry.selected .quote-register-chevron {
    transform: rotate(180deg);
}

.quote-register-detail {
    min-width: 0;
    padding: 20px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    background: #fff;
}

.quote-register-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.quote-register-overview > div {
    display: grid;
    min-width: 0;
    gap: 4px;
    padding: 14px 16px;
    border-right: 1px solid var(--border);
}

.quote-register-overview > div:last-child {
    border-right: 0;
}

.quote-register-overview span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.quote-register-overview strong,
.quote-register-overview small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.quote-register-overview strong {
    color: var(--ink);
    font-size: 14px;
}

.quote-register-overview small {
    color: var(--muted);
    font-weight: 700;
}

.quote-register-chips {
    margin: 16px 0;
}

.quote-register-actions,
.quote-register-more-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.quote-register-actions {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.quote-register-more {
    min-width: 150px;
}

.quote-register-more > summary {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-weight: 850;
    cursor: pointer;
    list-style: none;
}

.quote-register-more > summary::-webkit-details-marker {
    display: none;
}

.quote-register-more > summary::after {
    content: "⌄";
    margin-left: 8px;
    color: var(--muted);
}

.quote-register-more[open] > summary {
    border-color: rgba(249, 115, 22, 0.58);
    background: #fff8f2;
}

.quote-register-more-panel {
    width: 100%;
    margin-top: 10px;
}

.quote-register-technical-details {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

@media (max-width: 1100px) {
    .quote-register-row {
        grid-template-columns: minmax(130px, 0.8fr) minmax(190px, 1.25fr) minmax(140px, 0.8fr) minmax(125px, 0.7fr) 28px;
        gap: 12px;
    }

    .quote-register-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quote-register-overview > div:nth-child(2) {
        border-right: 0;
    }

    .quote-register-overview > div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 720px) {
    .quote-register-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 14px;
        padding: 14px 14px 14px 18px;
    }

    .quote-register-reference {
        grid-column: 1;
        grid-row: 1;
    }

    .quote-register-chevron {
        grid-column: 2;
        grid-row: 1;
    }

    .quote-register-client {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .quote-register-status {
        grid-column: 1;
        grid-row: 3;
    }

    .quote-register-financial {
        grid-column: 2;
        grid-row: 3;
    }

    .quote-register-detail {
        padding: 16px;
    }

    .quote-register-overview {
        grid-template-columns: 1fr;
    }

    .quote-register-overview > div,
    .quote-register-overview > div:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .quote-register-overview > div:last-child {
        border-bottom: 0;
    }

    .quote-register-actions > *,
    .quote-register-more,
    .quote-register-more > summary,
    .quote-register-more-panel > * {
        width: 100%;
    }
}

.installation-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.installation-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12), inset 6px 0 0 rgba(37, 99, 235, 0.16);
    padding: 18px;
}

.installation-card.scheduled-card {
    border-color: rgba(14, 165, 233, 0.34);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12), inset 6px 0 0 rgba(14, 165, 233, 0.22);
}

.installation-card.confirmed-card,
.installation-card.active-card {
    border-color: rgba(249, 115, 22, 0.34);
    background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12), inset 6px 0 0 rgba(249, 115, 22, 0.24);
}

.installation-card.completed-card {
    border-color: rgba(22, 163, 74, 0.34);
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12), inset 6px 0 0 rgba(22, 163, 74, 0.24);
}

.installation-card.warning-card {
    border-color: rgba(220, 38, 38, 0.28);
    background: linear-gradient(180deg, #ffffff 0%, #fef2f2 100%);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12), inset 6px 0 0 rgba(220, 38, 38, 0.2);
}

.installation-card.selected {
    border-color: rgba(14, 165, 233, 0.72);
    box-shadow: 0 18px 44px rgba(14, 165, 233, 0.16);
}

.installation-checklist-grid {
    margin: 18px 0;
}

.installation-filters {
    grid-template-columns: minmax(240px, 1fr) 210px;
}
.installation-print-card {
    margin: 20px 0;
}
.installation-document h3 {
    margin: 22px 0 10px;
    color: #0f172a;
}
.installation-document-grid small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 750;
}
.installation-checklist-print {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0 20px;
}
.installation-checklist-print span {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    font-weight: 800;
}
.signature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}
.signature-grid div {
    min-height: 86px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
}
.signature-grid span {
    display: block;
    min-height: 42px;
    margin-top: 12px;
    border-bottom: 1px solid #94a3b8;
}

.estimate-history-head {
    align-items: flex-start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
    margin-bottom: 14px;
}

.estimate-card-main {
    flex: 1;
    min-width: 0;
}

.estimate-history-head.with-scenario-image {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) minmax(260px, auto);
}

.estimate-card-model-image,
.estimate-card-model-placeholder {
    width: 120px;
    height: 90px;
    border-radius: 12px;
    background: #f8fafc;
}

.estimate-card-model-image {
    border: 1px solid var(--border);
    overflow: hidden;
}

.estimate-card-model-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.estimate-card-model-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 850;
}

.estimate-history-head h3 {
    margin: 0 0 4px;
}

.estimate-history-head p {
    color: var(--muted);
    margin: 0;
}

.estimate-details {
    margin-top: 14px;
}

.estimate-details summary {
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 800;
}

.estimate-workflow-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
    margin-top: 20px;
    min-width: 0;
}

.estimate-editor-panel,
.estimate-calendar-panel {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.82);
    padding: 18px;
}

.estimate-folder-identity {
    align-items: stretch;
    background: linear-gradient(135deg, rgba(255, 122, 39, 0.12), rgba(15, 23, 42, 0.04));
    border: 1px solid rgba(255, 122, 39, 0.28);
    border-radius: var(--radius-md);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.6fr);
    margin-bottom: 18px;
    padding: 14px;
}

.estimate-folder-main strong {
    color: var(--text);
    display: block;
    font-size: 22px;
    line-height: 1.1;
    margin-top: 2px;
}

.estimate-folder-main small {
    color: var(--muted);
    display: block;
    font-weight: 800;
    margin-top: 5px;
}

.estimate-folder-meta {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.estimate-folder-meta div {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 0;
    padding: 10px 12px;
}

.estimate-folder-meta span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.estimate-folder-meta strong {
    color: var(--ink);
    display: block;
    font-size: 14px;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.estimate-card-actions,
.status-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.estimate-card-actions {
    justify-content: flex-end;
    max-width: 460px;
    min-width: 260px;
}

.estimate-card-actions .secondary-button,
.estimate-card-actions .button-link,
.estimate-card-actions .danger-button {
    flex: 0 1 auto;
    white-space: nowrap;
}

.estimate-card-actions .primary-card-action {
    color: white;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.secondary-button.primary-card-action {
    color: white;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.status-chip-row {
    margin: 8px 0 14px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 850;
    border-radius: 999px;
    background: var(--primary-soft);
}

.status-chip.muted {
    color: var(--muted);
    background: #f1f5f9;
}

.status-chip.success {
    color: #166534;
    background: #dcfce7;
}

.status-chip.warning {
    color: #92400e;
    background: #fef3c7;
}

.next-action {
    margin-top: 8px;
    color: var(--primary-dark);
    font-weight: 800;
}

.calendar-list,
.timeline-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.calendar-event,
.timeline-event {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 13px;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-muted);
}

.calendar-event {
    cursor: pointer;
}

.calendar-event span,
.timeline-event span {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
}

.calendar-event small,
.timeline-event p {
    color: var(--muted);
    margin: 0;
}

.timeline-list h3 {
    margin: 18px 0 0;
}

.installations-page .dashboard {
    display: flex;
    flex-direction: column;
}

.installations-page .workflow-command-panel {
    order: 1;
}

.installations-page .inventory-table-card {
    order: 2;
}

.installations-page .installation-planner-card {
    order: 3;
}

.installations-page .installation-print-card {
    order: 4;
}

.quote-preview-card {
    margin: 20px 0;
}

.quote-preview {
    margin-top: 18px;
}

.quote-preview-modal.hidden {
    display: none;
}

.quote-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 3340;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 24px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.quote-preview-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(6px);
}

.quote-preview-modal-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1120px, 100%);
    max-height: min(90vh, 920px);
    overflow: auto;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.1), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.36);
}

.quote-preview-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.quote-preview-modal-close:hover,
.quote-preview-modal-close:focus-visible {
    border-color: rgba(249, 115, 22, 0.42);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.quote-preview-modal-toolbar {
    align-items: flex-start;
    gap: 18px;
    padding-right: 48px;
}

.quote-preview-modal .inventory-toolbar {
    align-items: flex-start;
    gap: 18px;
    padding-right: 48px;
}

.quote-preview-modal .quote-preview {
    margin-top: 14px;
}

.quote-document {
    color: #111827;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #fff;
    padding: 28px;
}

.project-scenario-document-layout {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.project-scenario-document-layout.without-image {
    display: block;
}

.project-scenario-image {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    aspect-ratio: 4 / 3;
}

.project-scenario-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.estimate-foyer-summary {
    margin: 14px 0;
}

.estimate-foyer-card {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.estimate-foyer-card.without-image {
    grid-template-columns: 1fr;
}

.estimate-foyer-card img,
.estimate-foyer-placeholder {
    width: 132px;
    height: 96px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
}

.estimate-foyer-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
}

.estimate-foyer-card h3 {
    margin: 3px 0 8px;
}

.estimate-foyer-card p:last-child {
    margin: 8px 0 0;
    color: var(--muted);
}

.project-scenario-plan-summary {
    margin-top: 14px;
}

.mini-toggle {
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.86rem;
}

.quote-header,
.quote-grid,
.quote-totals {
    display: grid;
    gap: 16px;
}

.quote-header {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) 130px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    padding-bottom: 16px;
}

.quote-header img {
    width: 120px;
    justify-self: end;
}

.quote-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
}

.quote-detail-grid {
    margin: 12px 0 18px;
}

.quote-detail-grid > div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
}

.quote-grid p {
    margin: 6px 0 0;
    color: var(--muted);
}

.quote-plan-description {
    padding: 14px;
    color: #334155;
    line-height: 1.55;
    border-left: 4px solid var(--primary);
    border-radius: 14px;
    background: var(--primary-soft);
}

.quote-plan-summary {
    margin: 14px 0 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.72);
}

.quote-plan-summary h3 {
    margin: 14px 0 8px;
    color: #0f172a;
}

.quote-plan-summary h3:first-child {
    margin-top: 0;
}

.quote-plan-drawing {
    width: 100%;
    max-height: 300px;
    margin: 8px 0 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.installation-plan-drawings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.installation-plan-drawing {
    max-height: 260px;
    margin: 0;
}

.quote-plan-bg {
    fill: #f8fafc;
}

.quote-plan-roof {
    fill: #fed7aa;
    stroke: #f97316;
    stroke-width: 2;
}

.quote-plan-house {
    fill: #f8fafc;
    stroke: #cbd5e1;
    stroke-width: 2;
}

.quote-plan-ground {
    stroke: #94a3b8;
    stroke-width: 2;
}

.quote-plan-fireplace {
    fill: #0f172a;
}

.quote-plan-enclosure {
    fill: rgba(51, 65, 85, 0.12);
    stroke: #475569;
    stroke-width: 2;
    stroke-dasharray: 5 4;
}

.quote-plan-wall-plate {
    fill: #334155;
}

.quote-plan-clearance {
    fill: rgba(14, 165, 233, 0.1);
    stroke: rgba(14, 165, 233, 0.58);
    stroke-width: 1.5;
    stroke-dasharray: 5 4;
}

.quote-plan-path {
    fill: none;
    stroke: #f97316;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quote-plan-marker {
    fill: #fff;
    stroke: #f97316;
    stroke-width: 3;
}

.quote-plan-marker.penetration {
    stroke: #2563eb;
}

.quote-plan-marker.elbow {
    stroke: #eab308;
}

.quote-plan-label {
    fill: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.quote-plan-label.small {
    fill: #0f172a;
    font-size: 10px;
    font-weight: 900;
}

.quote-plan-label-line {
    stroke: rgba(15, 23, 42, 0.32);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.quote-plan-label-box {
    fill: rgba(255, 255, 255, 0.94);
    stroke: rgba(148, 163, 184, 0.62);
    stroke-width: 1;
}

.plan-estimate-details,
.project-plan-details {
    margin-top: 14px;
}

.plan-estimate-details .quote-plan-summary,
.project-plan-details .quote-plan-summary {
    box-shadow: none;
}

.quote-plan-table td:last-child,
.quote-plan-table th:last-child {
    text-align: left;
}

.quote-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.quote-table th,
.quote-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.quote-table th:last-child,
.quote-table td:last-child {
    text-align: right;
}

.quote-table .grouped-pieces-row td {
    background: rgba(236, 253, 245, 0.58);
    font-weight: 850;
}

.quote-table .grouped-pieces-row small,
.grouped-pieces-note {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.quote-totals {
    max-width: 360px;
    margin-left: auto;
}

.quote-totals div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.estimate-pieces-editor {
    margin: 18px 0;
    padding: 16px;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fafc;
}

.estimate-pieces-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.estimate-pieces-editor-head .button-group {
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
}

.piece-inventory-picker {
    min-height: 42px;
    min-width: min(360px, 100%);
    max-width: 100%;
    width: 100%;
}

.estimate-pieces-editor-head h3,
.estimate-pieces-editor-head p {
    margin: 0;
}

.estimate-pieces-editor-list {
    display: grid;
    gap: 10px;
}

.estimate-piece-edit-row {
    display: grid;
    grid-template-columns: 108px 82px minmax(160px, 1.2fr) minmax(112px, 0.72fr) minmax(120px, 0.72fr);
    gap: 10px;
    align-items: end;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 14px;
    background: #fff;
}

.estimate-piece-edit-row .input-group,
.estimate-piece-edit-row input {
    min-width: 0;
    width: 100%;
}

.estimate-piece-edit-meta {
    display: grid;
    gap: 3px;
    grid-column: 2 / span 3;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
}

.estimate-piece-edit-meta span,
.estimate-piece-edit-meta strong {
    overflow-wrap: anywhere;
}

.estimate-piece-edit-row .danger-button {
    grid-column: 5;
    width: 100%;
    min-width: 0;
    white-space: normal;
}

.estimate-piece-include-toggle {
    align-self: stretch;
    min-height: 48px;
}

.estimate-piece-edit-meta strong {
    color: #0f172a;
}

.quote-modification-block {
    margin: 22px 0;
    padding: 16px;
    border: 1px solid rgba(234, 179, 8, 0.42);
    border-radius: 16px;
    background: #fefce8;
}

.quote-modification-item + .quote-modification-item {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(234, 179, 8, 0.38);
}

.quote-acceptance-block {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 2px solid #0f172a;
    page-break-inside: avoid;
}

.quote-acceptance-text {
    color: #334155;
    line-height: 1.55;
}

.quote-acceptance-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
}

.quote-acceptance-summary div {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}

.quote-acceptance-summary span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.quote-acceptance-summary strong {
    color: #0f172a;
}

.quote-signature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.empty-state.compact {
    min-height: 180px;
}

.pieces-grid.compact {
    margin-top: 12px;
}

.kit-builder-layout {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 22px;
}

.full-size-kit-builder {
    width: 100%;
}

.kit-tool-switch {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 18px;
}

.kit-quick-toolbar {
    margin: 0 0 18px;
}

.kit-workflow-modal.hidden {
    display: none;
}

.kit-workflow-modal {
    position: fixed;
    inset: 0;
    z-index: 3370;
    display: grid;
    place-items: center;
    padding: 24px;
}

.kit-workflow-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(6px);
}

.kit-workflow-modal-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1120px, 100%);
    max-height: min(92vh, 900px);
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.36);
}

.kit-workflow-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
}

.kit-workflow-modal-heading {
    padding-right: 52px;
}

.kit-workflow-modal-body {
    min-height: 0;
    overflow: auto;
    padding: 4px 4px 14px;
}

.kit-workflow-modal-body > .section,
.kit-workflow-modal-body > .dashboard-card {
    margin: 0;
}

.kit-workflow-modal-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 0 0;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

#kit-import-modal input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tool-mode-button {
    align-items: flex-start;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 16px;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 94px;
    padding: 18px;
    text-align: left;
}

.tool-mode-button span {
    font-size: 18px;
    font-weight: 900;
}

.tool-mode-button small {
    color: var(--muted);
    font-weight: 700;
    line-height: 1.35;
}

.tool-mode-button.active {
    background: linear-gradient(135deg, #fff7ed, #ffffff);
    border-color: rgba(249, 115, 22, 0.55);
    box-shadow: 0 14px 30px rgba(249, 115, 22, 0.12);
}

.tool-intro-panel {
    background: #fff7ed;
    border: 1px solid rgba(249, 115, 22, 0.22);
    border-radius: 14px;
    color: var(--ink);
    padding: 18px;
}

.tool-intro-panel p {
    color: var(--muted);
    font-weight: 700;
    margin: 6px 0 0;
}

.model-link-toolbar {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1.3fr) repeat(2, minmax(150px, 0.8fr)) auto auto;
    margin: 14px 0;
}

.model-link-toolbar input,
.model-link-toolbar select,
.model-link-toolbar button {
    min-height: 44px;
}

.large-multi-select {
    min-height: 260px;
}

.kit-model-summary {
    grid-template-columns: 1fr;
    margin-top: 16px;
}

.kit-model-summary small {
    color: var(--muted);
    display: block;
    font-weight: 700;
    margin-top: 4px;
}

.kit-fireplace-options-card {
    border-color: rgba(249, 115, 22, 0.28);
}

.kit-options-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    margin-top: 18px;
}

.kit-options-layout .table-wrap {
    max-height: 560px;
    overflow: auto;
}

.model-options-relocation-card {
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin-top: 14px;
}

.kit-components-heading {
    margin-top: 28px;
}

.selected-components-list,
.inventory-parts-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.inventory-parts-list.grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.inventory-parts-list.list {
    grid-template-columns: 1fr;
}

.selected-kit-component,
.inventory-pick-card {
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 16px;
}

.inventory-pick-card {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.inventory-parts-list.grid .inventory-pick-card {
    align-items: stretch;
    grid-template-columns: 1fr;
}

.inventory-parts-list.grid .inventory-pick-card button {
    width: 100%;
}

.inventory-parts-list.list .inventory-pick-card {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.inventory-pick-card h3,
.selected-kit-component h3 {
    margin: 0 0 6px;
}

.inventory-pick-card p,
.selected-kit-component p {
    color: var(--muted);
    margin: 0;
}

.inventory-pick-card .inventory-description,
.selected-kit-component .inventory-description {
    margin-top: 8px;
}

.inventory-pick-card small {
    color: var(--muted);
    display: block;
    margin-top: 6px;
}

.inventory-pick-meta {
    display: grid;
    gap: 4px;
    min-width: 110px;
}

.inventory-parts-list.grid .inventory-pick-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-pick-meta span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.kit-component-head {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.compact-form {
    gap: 10px;
}

.compact-form .input-group {
    margin-bottom: 0;
}

.kit-save-actions {
    margin-top: 18px;
}

.view-toggle {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: white;
}

.view-toggle button {
    min-height: 36px;
    padding: 0 14px;
    color: var(--muted);
    border: none;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
}

.view-toggle button.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.toggle-line {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.toggle-line input {
    width: auto;
}

/* Specialized chimney-kit and fireplace-option workspaces */
.kit-specialized-container {
    display: grid;
    gap: 22px;
}

.kit-specialized-container > .section,
.kit-specialized-container > .dashboard-card,
.kit-build-workbench > .dashboard-card,
.option-setup-grid > .dashboard-card {
    margin: 0;
    border-radius: 8px;
}

.kit-specialized-hero .hero-action-row {
    margin-top: 20px;
}

.kit-section-heading,
.kit-primary-actions,
.kit-footer-save,
.option-save-panel {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.kit-primary-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.kit-identity-fields {
    margin-top: 18px;
}

.workflow-readiness {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
}

.workflow-readiness-item {
    align-items: center;
    display: grid;
    gap: 2px 10px;
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 62px;
    padding: 10px 12px;
    border: 1px solid #d8dee7;
    border-radius: 6px;
    background: #f8fafc;
}

.workflow-readiness-item > span {
    align-items: center;
    align-self: stretch;
    display: flex;
    grid-row: 1 / 3;
    justify-content: center;
    width: 34px;
    color: #64748b;
    border-radius: 4px;
    background: #e2e8f0;
    font-size: 13px;
    font-weight: 900;
}

.workflow-readiness-item strong,
.workflow-readiness-item small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-readiness-item small {
    color: var(--muted);
    font-weight: 700;
}

.workflow-readiness-item.complete {
    border-color: rgba(22, 163, 74, 0.28);
    background: #f0fdf4;
}

.workflow-readiness-item.complete > span {
    color: #166534;
    background: #dcfce7;
}

.kit-model-link-card .large-multi-select {
    width: 100%;
    min-height: 220px;
}

.kit-build-workbench {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
}

.kit-workbench-heading {
    align-items: flex-start;
}

.kit-inventory-filters {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(150px, 0.8fr));
    margin: 16px 0;
}

.kit-build-workbench .inventory-parts-list.grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.kit-build-workbench .selected-kit-component,
.kit-build-workbench .inventory-pick-card,
.kit-size-options-list .selected-kit-component {
    border-radius: 6px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.07);
}

.kit-size-options-list {
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.kit-footer-save {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.kit-footer-save span,
.option-save-panel p {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.option-setup-grid {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.55fr);
}

.option-source-card {
    position: sticky;
    top: 18px;
}

.option-readiness {
    grid-template-columns: 1fr;
}

.option-source-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
}

.option-save-panel {
    align-items: stretch;
    flex-direction: column;
    margin-top: 18px;
}

.option-save-panel button {
    width: 100%;
}

.option-save-panel p {
    margin: 0;
}

.option-catalogue-filters {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(260px, 1.3fr) minmax(220px, 0.7fr) auto;
    margin-top: 14px;
}

.option-catalogue-filters .input-group {
    margin: 0;
}

.option-all-brands {
    min-height: 46px;
    margin: 0 0 1px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
}

.specialized-options-layout {
    align-items: start;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
}

.option-table-panel {
    min-width: 0;
}

.specialized-options-layout .table-wrap {
    max-height: none;
}

.specialized-options-layout .inventory-table input,
.specialized-options-layout .inventory-table select {
    min-width: 110px;
}

.specialized-options-layout .inventory-table [data-kit-option-field="label"] {
    min-width: 220px;
}

@media (max-width: 1280px) {
    .kit-build-workbench,
    .option-setup-grid,
    .specialized-options-layout {
        grid-template-columns: 1fr;
    }

    .option-source-card {
        position: static;
    }

    .option-readiness {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .workflow-readiness {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .model-link-toolbar,
    .kit-inventory-filters,
    .option-catalogue-filters {
        grid-template-columns: 1fr 1fr;
    }

    .model-link-toolbar input,
    .kit-inventory-filters input,
    .option-catalogue-filters .input-group:first-child {
        grid-column: 1 / -1;
    }

    .option-all-brands {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .kit-section-heading,
    .kit-footer-save {
        align-items: stretch;
        flex-direction: column;
    }

    .kit-primary-actions,
    .kit-primary-actions > *,
    .kit-footer-save button {
        width: 100%;
    }

    .workflow-readiness,
    .option-readiness,
    .model-link-toolbar,
    .kit-inventory-filters,
    .option-catalogue-filters,
    .option-source-summary,
    .kit-size-options-list {
        grid-template-columns: 1fr;
    }

    .model-link-toolbar input,
    .kit-inventory-filters input,
    .option-catalogue-filters .input-group:first-child,
    .option-all-brands {
        grid-column: auto;
    }

    .kit-workbench-heading {
        display: grid;
        grid-template-columns: 1fr;
    }

    .kit-workbench-heading .view-toggle {
        justify-self: start;
    }

    .kit-model-link-card .large-multi-select {
        min-height: 190px;
    }

    .fireplace-options-page .option-table-panel .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .fireplace-options-page .option-table-panel .inventory-table,
    .fireplace-options-page .option-table-panel .inventory-table tbody,
    .fireplace-options-page .option-table-panel .inventory-table tr,
    .fireplace-options-page .option-table-panel .inventory-table td {
        display: block;
        width: 100%;
    }

    .fireplace-options-page .option-table-panel .inventory-table {
        min-width: 0;
        max-width: 100%;
        border: 0;
        background: transparent;
        table-layout: fixed;
    }

    .fireplace-options-page .option-table-panel .inventory-table thead {
        display: none;
    }

    .fireplace-options-page .option-table-panel .inventory-table tbody {
        display: grid;
        gap: 10px;
    }

    .fireplace-options-page .option-table-panel .inventory-table tr {
        overflow: hidden;
        padding: 8px;
        border: 1px solid var(--border);
        border-radius: 6px;
        background: #fff;
    }

    .fireplace-options-page .option-table-panel .inventory-table td {
        align-items: center;
        display: grid;
        gap: 10px;
        grid-template-columns: 86px minmax(0, 1fr);
        padding: 7px;
        border: 0;
        min-width: 0;
        max-width: 100%;
    }

    .fireplace-options-page .option-table-panel .inventory-table td::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .fireplace-options-page .option-table-panel .inventory-table td[colspan] {
        display: block;
        padding: 0;
    }

    .fireplace-options-page .option-table-panel .inventory-table td[colspan]::before {
        display: none;
    }

    .fireplace-options-page .option-table-panel .inventory-table input,
    .fireplace-options-page .option-table-panel .inventory-table select,
    .fireplace-options-page .option-table-panel .inventory-table button,
    .specialized-options-layout .inventory-table [data-kit-option-field="label"] {
        width: 100%;
        min-width: 0;
    }
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 8px 0 12px;
}

.check-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.check-card:hover {
    border-color: rgba(180, 83, 9, 0.35);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.check-card input {
    width: auto;
    margin: 0;
}

.check-card span {
    font-weight: 800;
    color: var(--text);
}

.capability-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin: 10px 0 14px;
}

.capability-grid .check-card {
    min-height: 48px;
}

.dimension-detail-grid {
    margin-bottom: 12px;
}

.inline-add-row {
    align-items: center;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 8px;
}

.inline-add-row input {
    margin: 0;
}

.model-action-row {
    margin-top: 18px;
}

.status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    padding: 5px 10px;
}

.status-pill.active {
    color: #166534;
    background: #dcfce7;
}

.status-pill.inactive {
    color: #991b1b;
    background: #fee2e2;
}

.clients-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    margin-bottom: 22px;
}

.client-directory-card {
    width: 100%;
}

.client-modal.hidden {
    display: none;
}

.inventory-modal.hidden {
    display: none;
}

.client-modal {
    position: fixed;
    inset: 0;
    z-index: 3300;
    display: grid;
    place-items: center;
    padding: 24px;
}

.inventory-modal {
    position: fixed;
    inset: 0;
    z-index: 3320;
    display: grid;
    place-items: center;
    padding: 24px;
}

.client-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(6px);
}

.inventory-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(6px);
}

.client-modal-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(760px, 100%);
    max-height: min(88vh, 820px);
    overflow: auto;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.1), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.36);
}

.inventory-modal-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(820px, 100%);
    max-height: min(88vh, 840px);
    overflow: auto;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.1), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.36);
}

.inventory-detail-modal-card {
    width: min(760px, 100%);
}

.inventory-import-modal-card {
    width: min(560px, 100%);
}

.inventory-import-modal-card input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.inventory-import-file-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    margin-top: 8px;
    border-style: dashed;
    font-weight: 900;
}

.client-reminder-modal-card {
    width: min(860px, 100%);
}

.client-workflow-modal-card {
    width: min(1120px, 100%);
    max-height: min(92vh, 900px);
    overflow: hidden;
}

.project-workflow-modal-card {
    width: min(1180px, 100%);
    max-height: min(92vh, 920px);
    overflow: hidden;
}

.quote-workflow-modal-card {
    width: min(1200px, 100%);
    max-height: min(92vh, 920px);
    overflow: hidden;
}

.installation-workflow-modal-card {
    width: min(1180px, 100%);
    max-height: min(92vh, 920px);
    overflow: hidden;
}

.client-workflow-modal-body {
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.project-workflow-modal-body {
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.quote-workflow-modal-body {
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.installation-workflow-modal-body {
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.client-workflow-modal-body > .dashboard-card {
    margin: 0;
}

.project-workflow-modal-body > .dashboard-card {
    margin: 0;
}

.quote-workflow-modal-body > .dashboard-card {
    margin: 0;
}

.installation-workflow-modal-body > .dashboard-card {
    margin: 0;
}

.project-workflow-modal-body .estimate-workflow-layout {
    grid-template-columns: minmax(0, 1fr);
}

.project-workflow-modal-body .estimate-calendar-panel {
    order: -1;
}

.quote-workflow-modal-body .estimate-workflow-layout {
    grid-template-columns: minmax(0, 1fr);
}

.quote-workflow-modal-body .estimate-calendar-panel {
    order: -1;
}

#projects-import-modal input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

#quotes-import-modal input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

#installations-import-modal input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.client-workflow-modal-body #client-document-card {
    display: block;
}

#clients-import-modal input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.client-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.inventory-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.client-modal-close:hover,
.client-modal-close:focus-visible {
    border-color: rgba(249, 115, 22, 0.42);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.inventory-modal-close:hover,
.inventory-modal-close:focus-visible {
    border-color: rgba(249, 115, 22, 0.42);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.inventory-modal-heading {
    padding-right: 52px;
}

.client-modal-form,
.client-reminder-modal-form,
.client-reminder-modal-list {
    min-height: 0;
    overflow: auto;
}

.inventory-modal-form {
    min-height: 0;
    margin-top: 18px;
    overflow: auto;
}

.client-modal-form,
.client-reminder-modal-form {
    margin-top: 18px;
}

.client-modal-actions,
.inventory-modal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.client-modal-action,
.inventory-modal-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    color: var(--text);
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    appearance: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.client-modal-action.primary,
.inventory-modal-action.primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.22);
}

.client-modal-action.danger,
.inventory-modal-action.danger {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.client-modal-action:hover,
.client-modal-action:focus-visible,
.inventory-modal-action:hover,
.inventory-modal-action:focus-visible {
    border-color: rgba(249, 115, 22, 0.34);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
}

.inventory-detail-body {
    display: grid;
    gap: 14px;
    margin-top: 10px;
}

.inventory-detail-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.inventory-detail-kicker > span:not(.category-pill):not(.stock-pill) {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    color: #475569;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 12px;
    font-weight: 900;
}

.inventory-detail-body h3 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.05;
}

.inventory-detail-body p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
}

.inventory-detail-specs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.inventory-detail-specs div,
.inventory-detail-note {
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
}

.inventory-detail-specs span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.inventory-detail-specs strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.25;
}

.inventory-detail-note h4,
.inventory-detail-note p {
    margin: 0;
}

.inventory-detail-note p {
    margin-top: 6px;
}

.client-modal-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.client-modal-summary div,
.client-reminder-modal-row {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.client-modal-summary div {
    padding: 12px 14px;
}

.client-modal-summary span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-modal-summary strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-size: 15px;
}

.client-reminder-modal-list {
    display: grid;
    flex: 1 1 auto;
    gap: 12px;
    margin-top: 16px;
    padding-right: 4px;
}

.client-reminder-modal-list h3 {
    margin: 0;
}

.client-reminder-modal-row {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.client-reminder-modal-row.done {
    opacity: 0.72;
    background: #f8fafc;
}

.client-reminder-modal-row h4,
.client-reminder-modal-row p {
    margin: 0;
}

.client-reminder-modal-row p {
    color: var(--muted);
}

.client-directory-controls {
    align-items: center;
    grid-template-columns: minmax(260px, 1fr) auto;
}

.client-view-toggle {
    flex: 0 0 auto;
}

.clients-list,
.projects-list,
.documents-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.clients-list.grid-view {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clients-list.list-view {
    grid-template-columns: 1fr;
}

.client-profile-inline-slot {
    display: none;
    grid-column: 1 / -1;
    min-width: 0;
}

.client-profile-inline-slot.expanded {
    display: block;
}

.client-profile-inline-slot > .client-profile-panel {
    display: block;
}

.client-card,
.project-card,
.document-card {
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 16px;
}

.client-card {
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11), inset 5px 0 0 rgba(249, 115, 22, 0.18);
}

.client-card.reminder-card {
    border-color: rgba(245, 158, 11, 0.34);
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11), inset 5px 0 0 rgba(245, 158, 11, 0.24);
}

.client-card.quote-linked-card {
    border-color: rgba(14, 165, 233, 0.34);
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11), inset 5px 0 0 rgba(14, 165, 233, 0.22);
}

.client-card.installation-linked-card {
    border-color: rgba(22, 163, 74, 0.34);
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11), inset 5px 0 0 rgba(22, 163, 74, 0.24);
}

.client-card.lead-card {
    border-color: rgba(148, 163, 184, 0.38);
}

.project-card {
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11), inset 5px 0 0 rgba(14, 165, 233, 0.18);
}

.document-card {
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11), inset 5px 0 0 rgba(22, 163, 74, 0.18);
}

.client-card,
.document-card {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.client-card-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.client-card-main {
    flex: 1 1 auto;
    min-width: 0;
}

.client-card-stats {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.client-card-stats div {
    padding: 9px 10px;
    border: 1px solid rgba(226, 232, 240, 0.86);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.client-card-stats span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.client-card-stats strong {
    display: block;
    margin-top: 3px;
    color: #0f172a;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.clients-list.grid-view .client-card {
    align-items: flex-start;
    flex-direction: column;
}

.clients-list.grid-view .client-card-actions {
    justify-content: flex-start;
    width: 100%;
}

.client-card.selected,
.project-card.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.client-profile-toggle {
    align-items: center;
    display: inline-flex;
    gap: 9px;
}

.client-profile-toggle i {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 160ms ease;
}

.client-profile-toggle.active i {
    transform: translateY(2px) rotate(225deg);
}

.client-card h3,
.project-card h3,
.document-card h3 {
    margin: 0 0 6px;
}

.client-card p,
.project-card p {
    color: var(--muted);
    margin: 0;
}

.client-card small,
.project-card small,
.document-card small {
    color: var(--muted);
}

.linked-estimate-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.linked-estimate-card {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.linked-estimate-card small,
.project-link-note {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-top: 4px;
}

.project-link-note {
    padding-top: 10px;
}

.project-estimate-group {
    position: relative;
    min-width: 0;
    overflow: visible;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
}

.project-estimate-group::before {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    border-radius: 8px 0 0 8px;
    background: #0284c7;
    content: "";
}

.project-estimate-group.expanded {
    border-color: rgba(2, 132, 199, 0.68);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.project-estimate-group.has-selection:not(.expanded) {
    border-color: rgba(2, 132, 199, 0.42);
}

.project-register-row {
    display: grid;
    width: 100%;
    min-height: 76px;
    grid-template-columns: minmax(220px, 1.4fr) minmax(88px, 0.45fr) minmax(170px, 0.9fr) minmax(130px, 0.7fr) 28px;
    gap: 16px;
    align-items: center;
    padding: 12px 16px 12px 20px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.project-register-row:hover,
.project-estimate-group.expanded .project-register-row {
    background: #f0f9ff;
}

.project-estimate-group.expanded .project-register-row {
    border-radius: 8px 8px 0 0;
}

.project-register-row:focus-visible {
    outline: 3px solid rgba(2, 132, 199, 0.24);
    outline-offset: 2px;
}

.project-register-row > span:not(.project-register-chevron) {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.project-register-row strong,
.project-register-row small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.project-register-row strong {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.25;
}

.project-register-title strong,
.project-register-total strong {
    font-size: 17px;
}

.project-register-row small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.project-register-quote {
    justify-items: start;
}

.project-register-quote .status-chip {
    width: fit-content;
}

.project-register-total {
    text-align: right;
}

.project-register-chevron {
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    text-align: center;
    transition: transform 0.18s ease;
}

.project-estimate-group.expanded .project-register-chevron {
    transform: rotate(180deg);
}

.project-register-detail {
    min-width: 0;
    padding: 20px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    background: #fff;
}

.project-group-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 900px) {
    .project-register-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 14px;
        padding: 14px 14px 14px 18px;
    }

    .project-register-title {
        grid-column: 1;
        grid-row: 1;
    }

    .project-register-chevron {
        grid-column: 2;
        grid-row: 1;
    }

    .project-register-scenarios {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .project-register-quote {
        grid-column: 1;
        grid-row: 3;
    }

    .project-register-total {
        grid-column: 2;
        grid-row: 3;
    }
}

@media (max-width: 720px) {
    .project-register-detail {
        padding: 16px;
    }

    .project-group-actions > * {
        width: 100%;
    }
}

.project-document-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid rgba(249, 115, 22, 0.32);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.project-document-callout strong,
.project-document-callout small {
    display: block;
}

.project-document-callout strong {
    color: #0f172a;
}

.project-document-callout small {
    margin-top: 3px;
    color: var(--muted);
}

.project-estimate-list {
    display: grid;
    gap: 14px;
}

.project-record-section {
    display: grid;
    gap: 12px;
}

.project-record-section + .project-record-section {
    margin-top: 4px;
}

.project-record-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px;
}

.project-record-section-heading p,
.project-record-section-heading strong {
    margin: 0;
}

.official-quote-section .estimate-history-card::before {
    background: #2563eb;
}

.project-estimate-group .estimate-history-card {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.project-panel {
    margin-top: 22px;
}

.client-profile-panel {
    margin: 22px 0;
}

.client-profile-inline-panel {
    position: relative;
    margin: 2px 0 12px;
    padding: 20px;
    border: 1px solid rgba(249, 115, 22, 0.42);
    background: linear-gradient(180deg, #fffaf5 0%, #ffffff 150px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12), inset 5px 0 0 rgba(249, 115, 22, 0.78);
    animation: clientProfileExpand 180ms ease-out both;
}

.client-profile-inline-panel::before {
    position: absolute;
    top: -9px;
    left: 42px;
    width: 16px;
    height: 16px;
    border-top: 1px solid rgba(249, 115, 22, 0.42);
    border-left: 1px solid rgba(249, 115, 22, 0.42);
    background: #fffaf5;
    content: '';
    transform: rotate(45deg);
}

@keyframes clientProfileExpand {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.client-profile-inline-heading {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.client-profile-inline-heading .card-heading {
    margin-bottom: 14px;
}

.client-profile-collapse-button {
    flex: 0 0 auto;
}

.client-profile-summary,
.client-profile-grid,
.client-profile-projects,
.client-reminders-list {
    display: grid;
    gap: 16px;
}

.client-profile-projects {
    margin-top: 18px;
}

.client-profile-grid {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
    margin-top: 20px;
}

.client-profile-hero,
.client-profile-projects-card,
.client-reminder-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    padding: 18px;
}

.client-profile-hero {
    display: flex;
    gap: 18px;
    justify-content: space-between;
    align-items: flex-start;
}

.client-profile-identity {
    flex: 1 1 560px;
    min-width: 0;
}

.client-profile-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.client-profile-contact-grid > div {
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 12px;
    background: #f8fafc;
}

.client-profile-contact-grid > .wide {
    grid-column: 1 / -1;
}

.client-profile-contact-grid span,
.client-profile-note > span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-profile-contact-grid strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.client-profile-contact-grid a {
    color: #0f172a;
    text-decoration-color: rgba(249, 115, 22, 0.52);
    text-underline-offset: 3px;
}

.client-profile-hero h2,
.client-reminder-card h4 {
    margin: 0 0 6px;
}

.client-profile-hero p,
.client-reminder-card p,
.client-profile-note {
    color: var(--muted);
    margin: 0;
}

.client-profile-note {
    margin-top: 10px;
    padding: 11px 13px;
    border-left: 3px solid var(--primary);
    border-radius: 10px;
    background: #fff7ed;
}

.client-profile-note p {
    margin-top: 4px;
    color: #475569;
}

.client-profile-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.client-profile-project-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: inset 5px 0 0 rgba(14, 165, 233, 0.18);
}

.client-profile-project-card.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.client-profile-project-card h4,
.client-profile-project-card p {
    margin: 0;
}

.client-profile-project-card p,
.client-profile-project-card small {
    color: var(--muted);
}

.client-profile-project-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-reminder-form {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface-soft);
    padding: 16px;
}

.client-reminder-card {
    display: flex;
    gap: 14px;
    justify-content: space-between;
    align-items: flex-start;
}

.client-reminder-card.done {
    opacity: 0.7;
    background: #f8fafc;
}

.client-call-note {
    margin-top: 8px !important;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff7ed;
    color: #9a3412 !important;
    font-size: 13px;
}

.client-reminder-close-note {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.client-reminder-close-note span {
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.client-reminder-close-note textarea {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}

.client-event {
    border-left: 4px solid var(--primary);
}

.client-event.reminder {
    border-left-color: #f59e0b;
}

.client-event.install,
.client-event.done {
    border-left-color: var(--success);
}

.client-event.quote,
.client-event.accepted,
.client-event.payment {
    border-left-color: #0ea5e9;
}

.project-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    margin-top: 22px;
}

.upload-panel {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.disabled-panel {
    opacity: 0.55;
    pointer-events: none;
}

.stat-card strong {
    display: block;
    margin-top: 2px;
    color: #0f172a;
    font-size: 16px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
    gap: 22px;
    align-items: start;
}

.config-panel {
    display: grid;
    gap: 18px;
}

.dashboard-card,
.result-panel {
    border-radius: var(--radius-lg);
}

.dashboard-card {
    padding: 24px;
}

.section {
    margin: 0;
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.step-badge {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    color: white;
    font-weight: 900;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary), #ef4444);
}

.step-badge.success {
    background: linear-gradient(135deg, var(--success), #0ea5e9);
}

.card-heading h2 {
    color: #0f172a;
    font-size: 23px;
    letter-spacing: -0.02em;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.input-group,
.model-group {
    margin: 0 0 16px;
}

.full-width {
    width: 100%;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 850;
}

select,
input[type="number"],
input[type="text"],
input[type="date"],
input[type="email"],
input[type="tel"],
textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: var(--text);
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: var(--surface-muted);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

select:focus,
input[type="number"]:focus,
input[type="text"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
    border-color: rgba(249, 115, 22, 0.72);
    background: white;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

.description-text,
.piece-description,
.inventory-description,
.model-description {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.description-text {
    margin: 8px 0 0;
}

select:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    background: #e2e8f0;
}

.card-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.roof-box-options {
    margin-top: 10px;
}

.wall-termination-options {
    margin: 12px 0;
}

.wall-termination-info {
    margin-bottom: 16px;
}

.manual-kit-panel {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.card-options label,
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    margin: 0;
    padding: 14px 16px;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
}

input[type="radio"],
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.floor-control {
    display: inline-grid;
    grid-template-columns: 48px 72px 48px;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.floor-control input {
    min-height: 46px;
    text-align: center;
    border: 0;
    border-radius: 0;
    background: white;
}

button {
    min-height: 48px;
    padding: 0 20px;
    color: white;
    font-size: 15px;
    font-weight: 900;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), #ef4444);
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(249, 115, 22, 0.32);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    box-shadow: none;
}

.floor-control button {
    min-height: 46px;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.floor-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.floor-item {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.floor-item h3 {
    margin: 0 0 14px;
    color: #0f172a;
    font-size: 17px;
}

.roof-pitch-input {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
}

.roof-pitch-input span {
    display: grid;
    place-items: center;
    min-height: 48px;
    padding: 0 14px;
    color: var(--muted);
    font-weight: 900;
    border-radius: 14px;
    background: #e2e8f0;
}

.note,
.info,
.error,
.modification-info {
    margin-top: 9px;
    font-size: 13px;
    line-height: 1.45;
}

.info {
    color: var(--muted);
}

.error {
    color: var(--error);
}

.note,
.modification-info {
    padding: 12px 14px;
    color: #92400e;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    background: #fff7ed;
}

#other-roof-type {
    margin-top: 12px;
}

.estimate-card {
    margin-top: 16px;
    padding: 16px;
    color: #0f172a;
    border: 1px solid #bae6fd;
    border-radius: 20px;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
}

.quick-client-panel {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
}

.calculator-client-context {
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.calculator-client-context > span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: var(--primary-soft);
}

.calculator-client-context strong {
    display: block;
    color: #0f172a;
}

.calculator-client-context small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.calculator-client-context.unlinked {
    border-color: #fed7aa;
    background: linear-gradient(135deg, #fff7ed, #ffffff);
}

.quote-context-grid {
    margin-top: 16px;
}

.quote-extra-details {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
}

.quote-extra-details summary {
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 900;
}

.compact-grid {
    gap: 10px;
}

.compact-grid input,
.compact-grid button {
    margin: 0;
}

.estimate-metrics,
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.metric,
.summary-item {
    padding: 14px;
    border: 1px solid rgba(14, 165, 233, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.summary-item.success {
    border-color: rgba(22, 101, 52, 0.22);
    background: #f0fdf4;
}

.summary-item.warning {
    border-color: rgba(146, 64, 14, 0.22);
    background: #fffbeb;
}

.metric span,
.summary-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric strong,
.summary-item strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 18px;
}

.summary-item small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-weight: 750;
}

.accounting-inline-panel {
    margin: 16px 0;
    padding: 16px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.92));
}

.invoice-inline-panel {
    margin: 16px 0;
    padding: 16px;
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.9), rgba(255, 255, 255, 0.94));
}

.payment-summary {
    margin: 12px 0;
}

.invoice-summary {
    margin: 12px 0;
}

.invoice-lifecycle-actions {
    border-top: 1px solid rgba(15, 23, 42, 0.12);
    margin-top: 18px;
    padding-top: 16px;
}

.invoice-related-documents {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 0;
}

.document-warning {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-weight: 800;
    margin-bottom: 18px;
    padding: 10px 14px;
    text-align: center;
}

.payment-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.invoice-document .quote-totals div:last-child {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(236, 253, 245, 0.86);
}

.calculator-plan-summary {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(14, 165, 233, 0.18);
}

.calculator-plan-summary h3 {
    margin: 0 0 10px;
    color: #0f172a;
}

.action-bar {
    position: sticky;
    bottom: 18px;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, 0.82);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(14px);
}

.action-bar button {
    min-width: 220px;
}

.calculator-plan-preview {
    margin: 10px 0 14px;
}

.calculator-plan-preview .quote-plan-drawing {
    width: 100%;
    min-height: 210px;
}

.estimate-save-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.estimate-save-actions button {
    flex: 1 1 210px;
}

.result-panel {
    position: sticky;
    top: 30px;
    min-height: 520px;
    padding: 24px;
}

.loading {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--primary-dark);
    font-weight: 900;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #fed7aa;
    border-top-color: var(--primary);
    border-radius: 999px;
    animation: spin 0.85s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#resultat {
    margin: 0;
    padding: 0;
    border: 0;
}

#resultat.hidden,
.hidden {
    display: none !important;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 430px;
    padding: 28px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 24px;
    background: #f8fafc;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
    font-size: 34px;
    border-radius: 26px;
    background: var(--primary-soft);
}

.empty-state h3 {
    color: #0f172a;
}

#liste-pieces {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.piece-card,
#liste-pieces > div {
    position: relative;
    padding: 14px 14px 14px 46px;
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.09);
}

.piece-card strong {
    display: block;
    color: #0f172a;
}

.piece-card .piece-code {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.piece-card .piece-description {
    margin-top: 6px;
}

.piece-card::before,
#liste-pieces > div::before {
    content: "✓";
    position: absolute;
    left: 14px;
    top: 14px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: white;
    font-size: 12px;
    font-weight: 900;
    border-radius: 8px;
    background: var(--success);
}

#liste-pieces .calculation-pieces-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(14, 165, 233, 0.28);
    border-radius: 16px;
    background: #f0f9ff;
    box-shadow: none;
}

#liste-pieces .calculation-pieces-control::before,
#liste-pieces .selectable-piece-card::before {
    display: none;
}

.calculation-pieces-control strong,
.calculation-pieces-control small {
    display: block;
}

.calculation-pieces-control small {
    margin-top: 2px;
    color: var(--muted);
    font-weight: 700;
}

.calculation-pieces-counts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.calculation-pieces-counts span {
    padding: 7px 10px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 850;
    border-radius: 999px;
    background: white;
}

#liste-pieces .selectable-piece-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
}

.piece-card-body {
    min-width: 0;
}

.piece-include-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 10px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.piece-include-toggle input {
    width: 18px;
    height: 18px;
}

.selectable-piece-card.excluded,
.estimate-piece-edit-row.excluded {
    opacity: 0.62;
    background: #f1f5f9;
}

.selectable-piece-card.excluded .piece-card-body,
.estimate-piece-edit-row.excluded .estimate-piece-edit-meta {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(100, 116, 139, 0.58);
}

.success-message {
    margin-top: 15px;
    padding: 12px;
    color: white;
    border-radius: 14px;
    text-align: center;
    background-color: var(--success);
}

.container {
    width: min(1180px, calc(100% - 36px));
    margin: 28px auto;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.dashboard-page .container,
.dashboard-page .inventory-page {
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.dashboard-page .container > .section,
.dashboard-page .import-export-card,
.dashboard-page .inventory-table-card {
    border: 1px solid rgba(226, 232, 240, 0.78);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 24px;
}

.dashboard-page .container > .section + .section,
.dashboard-page .container > .section + .import-export-card,
.dashboard-page .import-export-card + .section {
    margin-top: 22px;
}

.dashboard-page .container > .section h2,
.dashboard-page .import-export-card h2,
.dashboard-page .inventory-table-card h2 {
    margin-top: 0;
}

.component-section .section {
    margin: 14px 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: white;
}

.subsection,
.component-section,
.base-options,
.fireplace-options,
.ceiling-options,
.roof-options,
.chimney-options,
.installation-options,
.pitch-range {
    margin: 16px 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
}

.model-preview {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(135deg, #fff7ed, #ffffff);
}

.model-preview-media,
.model-preview-placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a, #334155);
}

.model-preview-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.model-preview-placeholder {
    display: grid;
    place-items: center;
    color: white;
    font-size: 42px;
}

.model-preview-content h3 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 22px;
}

.model-preview-content p {
    margin: 0 0 8px;
    color: var(--muted);
}

.model-preview-content .model-description {
    margin-top: 8px;
}

.model-preview-specs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin: 14px 0;
}

.model-preview-specs div {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
}

.model-preview-specs span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.model-preview-specs strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 13px;
}

.combustion-select-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.combustion-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.combustion-choice-button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.combustion-choice-button strong {
    font-size: 14px;
    line-height: 1.2;
}

.choice-check {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(100, 116, 139, 0.5);
    border-radius: 5px;
    flex: 0 0 auto;
}

.combustion-choice-button.active {
    border-color: rgba(249, 115, 22, 0.7);
    background: #fff7ed;
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.12);
}

.combustion-choice-button.active .choice-check {
    border-color: #f97316;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    box-shadow: inset 0 0 0 3px #fff7ed;
}

.room-model-recommendations {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.84);
}

.model-recommendation-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.model-recommendation-card {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
}

.model-recommendation-card strong {
    display: block;
    color: var(--text);
}

.model-recommendation-card small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.model-admin-image {
    width: min(360px, 100%);
    margin-top: 12px;
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.inventory-page {
    width: min(1500px, calc(100% - 42px));
    margin: 0 auto;
    padding: 30px 0;
}

.inventory-hero {
    margin-bottom: 22px;
}

.inventory-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
}

.full-span {
    grid-column: 1 / -1;
}

.inventory-actions,
.button-group,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.model-catalogue-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(72px, 1fr));
    gap: 6px;
    min-width: 168px;
}

.inventory-row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(62px, 1fr));
    gap: 6px;
    min-width: 210px;
}

.model-row-action,
.inventory-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 9px;
    color: #172033;
    border: 1px solid rgba(203, 213, 225, 0.88);
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.model-row-action.primary,
.inventory-row-action.primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.model-row-action.danger,
.inventory-row-action.danger {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.model-row-action:hover,
.model-row-action:focus-visible,
.inventory-row-action:hover,
.inventory-row-action:focus-visible {
    border-color: rgba(249, 115, 22, 0.36);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.1);
}

.estimates-page {
    display: flex;
    flex-direction: column;
}

.estimates-page .inventory-hero { order: 0; }
.estimates-page .workflow-command-panel { order: 1; }
.estimates-page .inventory-table-card { order: 2; }
.estimates-page .estimate-workflow-card { order: 3; }
.estimates-page .quote-preview-card { order: 4; }
.estimates-page .import-export-card { order: 5; }

.workflow-command-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.workflow-command-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid rgba(226, 232, 240, 0.86);
    border-radius: 20px;
    background: rgba(248, 250, 252, 0.76);
}

.workflow-command-card.primary {
    border-color: rgba(249, 115, 22, 0.3);
    background: linear-gradient(135deg, var(--primary-soft), #ffffff);
}

.workflow-command-card > span {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    color: white;
    font-weight: 950;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.workflow-command-card strong,
.workflow-command-card small {
    display: block;
}

.workflow-command-card strong {
    color: #0f172a;
}

.workflow-command-card small {
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.4;
}

.quick-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.quick-filter-chip {
    min-height: 38px;
    padding: 0 13px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    border: 1px solid rgba(226, 232, 240, 0.94);
    border-radius: 999px;
    background: white;
    box-shadow: none;
}

.quick-filter-chip strong {
    margin-left: 6px;
    color: #0f172a;
}

.quick-filter-chip.active {
    color: #0f172a;
    border-color: rgba(249, 115, 22, 0.38);
    background: var(--primary-soft);
}

.backup-actions {
    justify-content: flex-end;
}

.backup-warning-panel {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 16px;
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 18px;
    background: #fffbeb;
}

.backup-warning-panel strong {
    color: #78350f;
}

.secondary-button {
    color: var(--text);
    border: 1px solid var(--border);
    background: white;
    box-shadow: none;
}

.secondary-button.deposit-button {
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.36);
    background: #fffbeb;
}

.danger-button {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    box-shadow: none;
}

.save-status {
    margin-top: 12px;
    font-weight: 800;
}

.save-status.success {
    color: var(--success);
}

.save-status.error {
    color: var(--error);
}

.save-result-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.save-result-actions .button-link {
    min-height: 36px;
    padding: 0 14px;
}

.inventory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.inventory-toolbar h2 {
    margin: 0;
}

.config-panel {
    display: grid;
    gap: 22px;
}

.configuration-list {
    display: grid;
    gap: 10px;
}

.configuration-list > .empty-state {
    min-height: 112px;
    padding: 18px;
    border-radius: 14px;
}

.configuration-list > [data-directory-no-match][hidden] {
    display: none !important;
}

.configuration-item {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface-muted);
}

.configuration-item-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.supplier-configuration-card {
    padding: 14px;
    border-radius: 14px;
}

.configuration-directory-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 520px) auto;
    gap: 14px;
    align-items: end;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
}

.configuration-directory-toolbar .input-group {
    min-width: 0;
}

.configuration-directory-toolbar input[type="search"] {
    min-height: 42px;
    background: #fff;
}

.configuration-directory-count {
    min-width: 128px;
    padding: 11px 12px;
    color: var(--muted);
    text-align: center;
    white-space: nowrap;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 850;
}

.configuration-directory-item {
    padding: 0;
    overflow: clip;
    border-radius: 14px;
    background: #fff;
}

.configuration-directory-item[open] {
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.configuration-directory-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 64px;
    padding: 12px 14px;
    list-style: none;
    cursor: pointer;
    transition: background 0.18s ease;
}

.configuration-directory-summary::-webkit-details-marker {
    display: none;
}

.configuration-directory-summary:hover,
.configuration-directory-summary:focus-visible {
    outline: none;
    background: var(--primary-soft);
}

.configuration-directory-item[open] > .configuration-directory-summary {
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

.configuration-directory-summary-meta,
.configuration-directory-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.configuration-directory-summary-meta {
    flex: 0 0 auto;
}

.configuration-directory-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    color: #475569;
    white-space: nowrap;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 11px;
    font-weight: 900;
}

.configuration-directory-chip.active {
    color: #166534;
    background: #dcfce7;
}

.configuration-directory-chip.inactive {
    color: #991b1b;
    background: #fee2e2;
}

.configuration-directory-chip.current {
    color: #9a3412;
    background: #ffedd5;
}

.configuration-directory-chevron {
    width: 10px;
    height: 10px;
    margin: 0 5px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
}

.configuration-directory-item[open] .configuration-directory-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.configuration-directory-body {
    padding: 14px;
}

.configuration-directory-row-actions {
    margin-bottom: 12px;
}

.user-index {
    color: #6b21a8;
    background: #f3e8ff;
}

.supplier-card-heading {
    align-items: flex-start;
    margin-bottom: 12px;
}

.supplier-title-block {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.supplier-title-block > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.supplier-title-block strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.supplier-title-block small {
    color: var(--muted);
    font-size: 12px;
}

.supplier-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    color: #9a3412;
    font-size: 12px;
    font-weight: 900;
    border-radius: 10px;
    background: #ffedd5;
}

.installer-index {
    color: #075985;
    background: #e0f2fe;
}

.supplier-card-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.supplier-card-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.supplier-card-grid .input-group {
    min-width: 0;
}

.supplier-card-grid label {
    font-size: 11px;
}

.supplier-card-grid input,
.supplier-card-grid textarea {
    min-height: 38px;
    padding: 9px 10px;
    font-size: 13px;
}

.supplier-card-grid textarea {
    min-height: 72px;
}

.supplier-wide-field {
    grid-column: span 3;
}

.supplier-documents-panel {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.supplier-documents-heading,
.supplier-document-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.supplier-documents-heading {
    margin-bottom: 10px;
}

.supplier-documents-heading strong,
.supplier-document-row strong {
    display: block;
    color: var(--text);
}

.supplier-documents-heading small,
.supplier-document-row small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.supplier-documents-list {
    display: grid;
    gap: 8px;
}

.supplier-document-row {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
}

.supplier-document-row-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.supplier-document-actions input {
    max-width: 190px;
}

.installer-card-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.installer-summary-grid {
    margin: 12px 0 0;
}

.installer-summary-grid .summary-item {
    min-height: 70px;
}

.installer-wide-field {
    grid-column: span 7;
}

.compact-danger {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--muted);
}

.inline-check input {
    width: auto;
    min-height: auto;
}

.inventory-dimension-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(108px, 0.42fr);
    gap: 8px;
}

/* Orders workspace */
.orders-command-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.orders-toolbar,
.orders-filters,
.order-detail-heading,
.order-proof-block,
.order-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.orders-toolbar,
.order-detail-heading {
    justify-content: space-between;
}

.orders-filters {
    flex-wrap: wrap;
}

.orders-filters input {
    min-width: min(320px, 100%);
}

.orders-workspace {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.orders-list {
    display: grid;
    gap: 10px;
}

.order-list-entry {
    display: grid;
    min-width: 0;
}

.order-list-row {
    width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(150px, 1.25fr) minmax(110px, 0.7fr) auto 28px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    text-align: left;
}

.order-list-row:hover,
.order-list-row.selected {
    border-color: rgba(249, 115, 22, 0.65);
    background: #fff8f2;
}

.order-list-row:focus-visible {
    outline: 3px solid rgba(249, 115, 22, 0.22);
    outline-offset: 2px;
}

.order-list-entry.selected .order-list-row {
    border-bottom-color: var(--border);
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

.order-list-row > span:not(.status-chip):not(.order-list-chevron) {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.order-list-chevron {
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    text-align: center;
    transition: transform 0.18s ease;
}

.order-list-entry.selected .order-list-chevron {
    transform: rotate(180deg);
}

.order-list-row small,
.order-proof-block small,
.order-lines-table small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.order-detail-panel {
    min-width: 0;
    padding: 24px;
    scroll-margin-top: 20px;
    border: 1px solid rgba(249, 115, 22, 0.65);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.order-detail-heading > div {
    min-width: 0;
}

.order-detail-heading h2 {
    overflow-wrap: anywhere;
}

.order-financial-summary,
.order-status-form,
.order-proof-block,
.order-lines-block,
.order-billing-block,
.order-actions {
    margin-top: 20px;
}

.order-proof-block {
    flex-wrap: wrap;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.order-proof-block .eyebrow {
    flex-basis: 100%;
}

.order-lines-table {
    display: grid;
    margin-top: 12px;
    border-top: 1px solid var(--border);
}

.order-lines-table > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(90px, auto);
    gap: 12px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.order-lines-table > div > span:first-child {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.order-tax-summary {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding-top: 14px;
}

.order-tax-summary span:last-child {
    color: var(--fire);
}

.order-billing-block {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.order-payment-history {
    display: grid;
    margin: 14px 0;
    border-top: 1px solid var(--border);
}

.order-payment-history > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.order-payment-history span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.order-payment-history small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.order-payment-form {
    align-items: end;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft, #f8fafc);
}

.order-payment-notes {
    grid-column: span 2;
}

.order-payment-submit .primary-button {
    width: 100%;
}

.order-conversion-modal-card {
    width: min(900px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
}

.order-conversion-modal-card .commercial-workspace-summary {
    margin: 18px 0;
}

.order-acceptance-choice {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) auto minmax(0, 1.6fr);
    gap: 20px;
    align-items: stretch;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.order-acceptance-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.order-acceptance-divider::before,
.order-acceptance-divider::after {
    width: 1px;
    height: 42%;
    content: '';
    background: var(--border);
}

.order-acceptance-divider {
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 1180px) {
    .orders-command-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-detail-panel {
        padding: 20px;
    }
}

/* Dossier projet central */
.project-workspace-dashboard {
    display: grid;
    align-content: start;
    gap: 18px;
}

.project-workspace-finder {
    position: relative;
    z-index: 80;
    display: grid;
    min-width: 0;
    gap: 14px;
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.project-workspace-finder-heading,
.project-workspace-finder-row,
.project-workspace-finder-actions {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.project-workspace-finder-heading {
    justify-content: space-between;
}

.project-workspace-finder-heading .eyebrow {
    margin-bottom: 2px;
}

.project-workspace-finder-heading h2 {
    margin: 0;
    font-size: 24px;
    letter-spacing: 0;
}

.project-workspace-finder-heading > span {
    min-height: 20px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.project-workspace-finder-row {
    align-items: stretch;
}

.project-workspace-search-control {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    flex: 1 1 480px;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.project-workspace-search-control:focus-within {
    border-color: #f97316;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}

.project-workspace-search-icon {
    color: #64748b;
    font-size: 23px;
    font-weight: 900;
    text-align: center;
}

.project-workspace-search-control input[type="search"] {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 11px 4px;
    color: #0f172a;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 15px;
}

.project-workspace-search-control input[type="search"]::placeholder {
    color: #64748b;
}

.project-workspace-search-control button {
    width: 42px;
    height: 42px;
    padding: 0;
    color: #475569;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.project-workspace-search-control button:hover,
.project-workspace-search-control button:focus-visible {
    color: #c2410c;
    background: #fff7ed;
    outline: 2px solid #f97316;
    outline-offset: -2px;
}

.project-workspace-finder-actions {
    flex: 0 0 auto;
}

.project-workspace-finder-actions > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    white-space: nowrap;
}

.project-workspace-finder .project-workspace-search-results {
    top: calc(100% - 8px);
    right: 22px;
    left: 22px;
}

.workspace-empty-state .workspace-stage-band,
.workspace-empty-state .workspace-tabs,
.workspace-empty-state [data-workspace-panel],
.workspace-empty-state .project-workspace-header-actions {
    display: none;
}

.project-workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    min-width: 0;
    padding: 24px;
    color: #fff;
    border-radius: 8px;
    background: #20242a;
    box-shadow: var(--shadow);
}

.project-workspace-title-block {
    min-width: 0;
}

.project-workspace-title-block h2 {
    margin: 2px 0 8px;
    overflow-wrap: anywhere;
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: 0;
}

.project-workspace-title-block > p:not(.eyebrow) {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
}

.project-workspace-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.project-workspace-header .workspace-quick-payment {
    color: #20242a;
    border-color: #fff;
    background: #fff;
}

.workspace-chip-row,
.workspace-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.workspace-chip-row {
    margin-top: 16px;
}

.workspace-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    max-width: 100%;
    padding: 5px 10px;
    overflow-wrap: anywhere;
    color: #4b5563;
    border: 1px solid #d9dde2;
    border-radius: 6px;
    background: #f5f6f7;
    font-size: 12px;
    font-weight: 800;
}

.project-workspace-header .workspace-chip {
    color: rgba(255, 255, 255, 0.86);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
}

.workspace-chip.primary {
    color: #9a3412;
    border-color: #fed7aa;
    background: #fff7ed;
}

.project-workspace-header .workspace-chip.primary {
    color: #fff;
    border-color: #f97316;
    background: #c2410c;
}

.project-workspace-header .workspace-chip.warning {
    color: #fff7ed;
    border-color: #fb923c;
    background: #9a3412;
}

.website-visibility-fieldset {
    margin: 24px 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.website-visibility-fieldset legend,
.website-featured-heading strong {
    font-weight: 800;
}

.website-visibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.website-visibility-grid label,
.website-featured-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.website-hours-grid {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.website-hours-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) repeat(2, minmax(120px, 1fr)) minmax(100px, .75fr);
    align-items: center;
    gap: 10px;
}

.website-hours-row:not(.website-hours-header) {
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.website-hours-row input[type="time"] {
    min-width: 0;
    width: 100%;
}

.website-hours-closed {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 700px) {
    .website-hours-header {
        display: none;
    }

    .website-hours-row {
        grid-template-columns: minmax(90px, .7fr) repeat(2, minmax(0, 1fr));
    }

    .website-hours-row > label:first-child {
        grid-column: 1 / -1;
        font-weight: 800;
    }

    .website-hours-closed {
        grid-column: 1 / -1;
    }
}

.website-featured-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0 12px;
}

.website-featured-heading output {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 6px;
    color: #9a3412;
    background: #fff7ed;
    font-weight: 800;
}

.website-featured-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 700px) {
    .website-featured-heading {
        flex-direction: column;
    }

    .website-featured-actions {
        width: 100%;
        justify-content: space-between;
    }
}

.website-featured-models {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.website-featured-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.website-featured-card.selected {
    border-color: #f97316;
    background: #fff7ed;
}

.website-featured-card img,
.website-featured-placeholder {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 6px;
    background: #20242a;
}

.website-featured-card img {
    object-fit: cover;
}

.website-featured-placeholder {
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
}

.website-featured-card > span:last-child {
    min-width: 0;
}

.website-featured-card strong,
.website-featured-card small {
    display: block;
    overflow-wrap: anywhere;
}

.website-featured-card small {
    margin-top: 3px;
    color: var(--muted);
}

.workspace-actions-menu {
    position: relative;
}

.workspace-actions-menu > summary {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.workspace-actions-menu > summary::-webkit-details-marker {
    display: none;
}

.workspace-actions-menu > summary::after {
    content: '\2304';
    margin-left: 9px;
}

.workspace-actions-menu > div {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    display: grid;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(22, 27, 32, 0.2);
}

.workspace-actions-menu:not([open]) > div {
    display: none;
}

.workspace-actions-menu a {
    padding: 10px 12px;
    color: var(--text);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 750;
}

.workspace-actions-menu a:hover,
.workspace-actions-menu a:focus-visible {
    background: var(--surface-muted);
}

.workspace-stage-band {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.workspace-stage-head,
.workspace-section-heading,
.workspace-record-title,
.workspace-dialog-heading,
.workspace-dialog-actions,
.workspace-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.workspace-stage-head strong,
.workspace-section-heading h3,
.workspace-dialog-heading h2 {
    margin: 0;
}

.workspace-stage-head > span {
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 900;
}

.workspace-stage-rail {
    display: grid;
    grid-template-columns: repeat(8, minmax(72px, 1fr));
    gap: 0;
    margin-top: 16px;
    overflow-x: auto;
}

.workspace-stage-step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 7px;
    min-width: 72px;
    min-height: 62px;
    padding: 0 4px;
    color: #8a929c;
    border: 0;
    background: transparent;
    cursor: default;
}

.workspace-stage-step::before {
    position: absolute;
    top: 17px;
    right: 50%;
    left: -50%;
    height: 2px;
    content: '';
    background: #d9dde2;
}

.workspace-stage-step:first-child::before {
    display: none;
}

.workspace-stage-step span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 2px solid #c7cdd4;
    border-radius: 50%;
    background: #fff;
    font-size: 11px;
    font-weight: 900;
}

.workspace-stage-step small {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
}

.workspace-stage-step.done::before,
.workspace-stage-step.active::before {
    background: #f97316;
}

.workspace-stage-step.done span,
.workspace-stage-step.active span {
    color: #fff;
    border-color: #f97316;
    background: #f97316;
}

.workspace-stage-step.active small {
    color: var(--text);
}

.workspace-tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(22, 27, 32, 0.08);
    backdrop-filter: blur(12px);
}

.workspace-tabs button {
    flex: 1 0 auto;
    min-width: 108px;
    min-height: 40px;
    padding: 0 13px;
    color: #5c6570;
    border: 0;
    background: transparent;
    font-weight: 800;
}

.workspace-tabs button.active {
    color: #fff;
    background: #343a42;
}

.workspace-panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.workspace-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.workspace-kpi {
    min-width: 0;
    padding: 18px;
    border-right: 1px solid var(--border);
}

.workspace-kpi:last-child {
    border-right: 0;
}

.workspace-kpi span,
.workspace-kpi small,
.workspace-financial-grid span,
.workspace-definition-list dt,
.workspace-record-main small,
.workspace-record-total small,
.workspace-document-row small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.workspace-kpi strong {
    display: block;
    margin: 7px 0 4px;
    overflow-wrap: anywhere;
    font-size: 20px;
}

.workspace-overview-layout,
.workspace-design-layout,
.workspace-sales-grid,
.workspace-followup-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 26px;
}

.estimates-page > .legacy-record-editor {
    display: none;
}

.project-modal .legacy-record-editor,
.quote-modal .legacy-record-editor,
.legacy-record-route .estimates-page > .legacy-record-editor {
    display: block;
}

.workspace-section {
    min-width: 0;
    padding: 0;
}

.workspace-section + .workspace-section.workspace-timeline-section,
.workspace-timeline-section,
.workspace-finance-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.workspace-section-heading {
    align-items: flex-start;
    margin-bottom: 16px;
}

.workspace-section-heading h3 {
    font-size: 21px;
}

.workspace-section-heading small {
    max-width: 360px;
    color: var(--muted);
    text-align: right;
}

.workspace-next-action {
    padding: 20px;
    color: #fff;
    border-left: 4px solid #f97316;
    border-radius: 6px;
    background: #20242a;
}

.workspace-next-action > strong {
    font-size: 20px;
}

.workspace-next-action p {
    margin: 8px 0 18px;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.55;
}

.workspace-blocker-list {
    display: grid;
    gap: 8px;
}

.workspace-blocker-list > button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 12px;
    color: var(--text);
    text-align: left;
    border: 1px solid #fed7aa;
    background: #fff7ed;
}

.workspace-blocker-list > button span {
    color: #9a3412;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.workspace-empty {
    display: grid;
    justify-items: start;
    min-height: 120px;
    padding: 22px;
    color: var(--muted);
    border: 1px dashed #c7cdd4;
    border-radius: 6px;
    background: #fafafa;
}

.workspace-empty.success {
    color: #166534;
    border-color: #86efac;
    background: #f0fdf4;
}

.workspace-empty p {
    margin: 6px 0 0;
}

.workspace-timeline {
    display: grid;
    gap: 0;
}

.workspace-timeline-event {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.workspace-timeline-event:last-child {
    border-bottom: 0;
}

.workspace-timeline-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: #a7afb8;
    box-shadow: 0 0 0 4px #eef0f2;
}

.workspace-timeline-dot.commercial,
.workspace-timeline-dot.order {
    background: #f97316;
}

.workspace-timeline-dot.communication {
    background: #0ea5e9;
}

.workspace-timeline-dot.installation {
    background: #16a34a;
}

.workspace-timeline-event small,
.workspace-timeline-event strong,
.workspace-timeline-event p {
    display: block;
}

.workspace-timeline-event small {
    color: var(--muted);
    font-size: 11px;
}

.workspace-timeline-event p {
    margin: 4px 0 0;
    color: #626b75;
    line-height: 1.45;
}

.workspace-form {
    max-width: 1120px;
}

.workspace-form.compact {
    max-width: none;
}

.workspace-sales-followup-form {
    max-width: none;
}

.workspace-sales-summary-strip,
.workspace-dialog-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.workspace-dialog-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-sales-summary-strip > div,
.workspace-dialog-summary > div {
    min-width: 0;
    padding: 14px;
    border-right: 1px solid var(--border);
}

.workspace-sales-summary-strip > div:last-child,
.workspace-dialog-summary > div:last-child {
    border-right: 0;
}

.workspace-sales-summary-strip span,
.workspace-dialog-summary span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.workspace-sales-summary-strip strong,
.workspace-dialog-summary strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.workspace-sales-primary-actions {
    margin-bottom: 4px;
}

.workspace-checkbox-label {
    display: flex !important;
    grid-column: 1 / -1;
    align-items: center;
    grid-template-columns: none !important;
}

.workspace-checkbox-label input {
    width: 20px;
    min-height: 20px;
}

.workspace-order-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.workspace-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.workspace-form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-form-grid label,
.workspace-upload-form label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: #343a42;
    font-size: 13px;
    font-weight: 800;
}

.workspace-form-grid label.wide {
    grid-column: 1 / -1;
}

.workspace-form-grid input,
.workspace-form-grid select,
.workspace-form-grid textarea,
.workspace-upload-form input,
.workspace-upload-form select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--text);
    border: 1px solid #c7cdd4;
    background: #fff;
    font: inherit;
}

.workspace-form-grid textarea {
    resize: vertical;
}

.workspace-subheading {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.workspace-form-actions {
    justify-content: flex-end;
    margin-top: 20px;
}

.workspace-model-summary > img {
    display: block;
    width: 100%;
    height: 240px;
    margin-bottom: 18px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f5f6f7;
}

.workspace-definition-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.workspace-definition-list > div {
    min-width: 0;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.workspace-definition-list > div:nth-child(odd) {
    padding-right: 16px;
}

.workspace-definition-list dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.workspace-inline-actions {
    margin-top: 18px;
}

.button-link.secondary {
    color: var(--text);
    border: 1px solid var(--border);
    background: #fff;
}

.workspace-record-list {
    display: grid;
    border-top: 1px solid var(--border);
}

.workspace-record-row {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) minmax(130px, auto) minmax(180px, auto);
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.workspace-record-index {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #9a3412;
    border-radius: 6px;
    background: #fff7ed;
    font-size: 12px;
    font-weight: 900;
}

.workspace-record-main,
.workspace-record-total {
    min-width: 0;
}

.workspace-record-title {
    justify-content: flex-start;
}

.workspace-record-main p {
    margin: 5px 0;
    color: #4b5563;
}

.workspace-record-total {
    text-align: right;
}

.workspace-record-total strong {
    display: block;
    font-size: 17px;
}

.workspace-record-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.workspace-record-actions .button-link,
.workspace-record-actions button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 12px;
}

.workspace-financial-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.workspace-financial-grid > div {
    padding: 16px;
    border-right: 1px solid var(--border);
}

.workspace-financial-grid > div:last-child {
    border-right: 0;
}

.workspace-financial-grid strong {
    display: block;
    margin-top: 5px;
    font-size: 18px;
}

.workspace-financial-grid .success strong {
    color: #15803d;
}

.workspace-financial-grid .warning strong {
    color: #c2410c;
}

.workspace-payment-list {
    display: grid;
    margin-top: 18px;
}

.workspace-payment-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.workspace-installation-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 24px;
}

.workspace-installation-operation-section,
.workspace-installation-finance-section {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.workspace-installation-operation-section {
    margin-top: 18px;
}

.workspace-installation-financial-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-installation-payment-list {
    margin-top: 14px;
}

.workspace-installation-progress {
    display: grid;
    align-content: center;
    justify-items: start;
    padding: 20px;
    color: #fff;
    border-radius: 6px;
    background: #343a42;
}

.workspace-installation-progress strong {
    font-size: 34px;
}

.workspace-installation-progress p {
    color: rgba(255, 255, 255, 0.68);
}

.workspace-installation-empty {
    min-height: 240px;
    align-content: center;
}

.workspace-upload-form {
    display: grid;
    grid-template-columns: minmax(130px, 0.6fr) minmax(180px, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.workspace-project-documents {
    margin-top: 20px;
}

.workspace-project-upload-form {
    grid-template-columns: minmax(130px, 0.55fr) minmax(170px, 0.8fr) minmax(220px, 1.25fr) auto;
}

.workspace-project-upload-form .workspace-upload-file {
    min-width: 0;
}

.workspace-followup-layout .workspace-project-upload-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-followup-layout .workspace-project-upload-form .workspace-upload-file,
.workspace-followup-layout .workspace-project-upload-form button[type="submit"] {
    grid-column: 1 / -1;
}

.workspace-document-list {
    display: grid;
    margin-top: 14px;
}

.workspace-document-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.workspace-document-row > div {
    min-width: 0;
}

.workspace-document-row strong {
    display: block;
    overflow-wrap: anywhere;
}

.workspace-dialog {
    width: min(720px, calc(100vw - 32px));
    max-width: 720px;
    max-height: min(88dvh, 820px);
    padding: 0;
    overflow: auto;
    color: var(--text);
    border: 0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.workspace-commercial-dialog {
    width: min(1160px, calc(100vw - 32px));
    max-width: 1160px;
    max-height: calc(100dvh - 32px);
}

.workspace-revision-notice {
    margin: 16px 0;
    padding: 14px 16px;
    color: #7c2d12;
    border: 1px solid #fdba74;
    border-left: 4px solid #f97316;
    border-radius: 6px;
    background: #fff7ed;
}

.workspace-revision-notice.warning {
    color: #854d0e;
    border-color: #fde68a;
    border-left-color: #eab308;
    background: #fefce8;
}

.workspace-revision-notice strong,
.workspace-revision-notice p {
    display: block;
}

.workspace-revision-notice p {
    margin: 5px 0 0;
    line-height: 1.5;
}

.workspace-commercial-price-grid {
    align-items: stretch;
}

.workspace-commercial-preview {
    display: grid;
    align-content: center;
    min-height: 78px;
    padding: 12px 15px;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    background: #f0f9ff;
}

.workspace-commercial-preview span,
.workspace-commercial-preview small {
    color: var(--muted);
    font-size: 11px;
}

.workspace-commercial-preview strong {
    margin: 3px 0;
    font-size: 20px;
}

.workspace-piece-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 14px;
}

.workspace-piece-toolbar label,
.workspace-chimney-bundle-editor label,
.workspace-commercial-line label,
.workspace-modification-upload label {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: #343a42;
    font-size: 12px;
    font-weight: 800;
}

.workspace-piece-toolbar select,
.workspace-chimney-bundle-editor input,
.workspace-chimney-bundle-editor select,
.workspace-commercial-line input,
.workspace-modification-upload input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 10px;
    color: var(--text);
    border: 1px solid #c7cdd4;
    background: #fff;
    font: inherit;
}

.workspace-commercial-lines {
    display: grid;
    border-top: 1px solid var(--border);
}

.workspace-commercial-line {
    align-items: end;
    gap: 9px;
    min-width: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

#workspace-estimate-options-list .workspace-commercial-line {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(74px, 0.35fr) minmax(120px, 0.65fr) minmax(110px, 0.55fr) auto;
}

#workspace-estimate-pieces-list .workspace-commercial-line {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(74px, 0.35fr) minmax(105px, 0.55fr) minmax(120px, 0.65fr) minmax(110px, 0.55fr) auto;
}

.workspace-commercial-line > strong {
    align-self: center;
    text-align: right;
}

.workspace-commercial-line-head {
    align-items: center;
    padding: 8px 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.workspace-commercial-line label > span {
    display: none;
}

.workspace-commercial-line .danger-button.compact {
    min-height: 40px;
    padding: 0 11px;
}

.workspace-chimney-bundle-editor {
    display: grid;
    grid-template-columns: minmax(220px, 1.25fr) minmax(180px, 1fr) minmax(160px, 0.8fr) minmax(150px, 0.7fr);
    align-items: end;
    gap: 12px;
    margin-top: 18px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.workspace-chimney-bundle-editor .workspace-checkbox-label {
    grid-column: 1 / -1;
}

.workspace-modification-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.workspace-modification-list {
    display: grid;
    gap: 12px;
}

.workspace-modification-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr) auto;
    align-items: center;
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.workspace-modification-row > div:first-child strong,
.workspace-modification-row > div:first-child small {
    display: block;
    margin-top: 5px;
}

.workspace-modification-row > div:first-child small,
.workspace-modification-row > p {
    color: var(--muted);
}

.workspace-modification-row > p {
    margin: 0;
    line-height: 1.45;
}

.workspace-modification-row .workspace-inline-actions {
    margin-top: 0;
}

.workspace-modification-upload {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
    gap: 10px;
    padding: 12px;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    background: #fff7ed;
}

.workspace-installation-dialog {
    width: min(960px, calc(100vw - 32px));
    max-width: 960px;
}

.workspace-dialog-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 14px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.workspace-dialog-section-heading > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    color: #9a3412;
    border-radius: 6px;
    background: #fff7ed;
    font-size: 11px;
    font-weight: 900;
}

.workspace-dialog-section-heading strong,
.workspace-dialog-section-heading small {
    display: block;
}

.workspace-dialog-section-heading small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.workspace-installation-checklist {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.workspace-installation-checklist label {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 800;
}

.workspace-installation-checklist input {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
}

.workspace-installation-finance-actions {
    margin: -4px 0 4px;
}

.workspace-dialog::backdrop {
    background: rgba(16, 20, 25, 0.72);
    backdrop-filter: blur(4px);
}

.workspace-dialog > form {
    padding: 24px;
}

.workspace-dialog-heading {
    align-items: flex-start;
    margin-bottom: 14px;
}

.workspace-dialog-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    color: #fff;
    border: 0;
    background: #343a42;
    font-size: 26px;
    line-height: 1;
}

.workspace-dialog-actions {
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

@media (max-width: 1180px) {
    .project-workspace-page .workspace-tabs {
        top: 56px;
    }

    .project-workspace-header {
        flex-direction: column;
    }

    .project-workspace-header-actions {
        width: 100%;
    }

    .project-workspace-header-actions > .primary-button {
        flex: 1 1 auto;
    }

    .workspace-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .workspace-kpi:nth-child(3) {
        border-right: 0;
    }

    .workspace-kpi:nth-child(n + 4) {
        border-top: 1px solid var(--border);
    }

    .workspace-record-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .workspace-record-actions {
        grid-column: 2 / -1;
    }

    .workspace-financial-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .workspace-installation-financial-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .workspace-financial-grid > div:nth-child(3) {
        border-right: 0;
    }

    .workspace-financial-grid > div:nth-child(n + 4) {
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 760px) {
    .project-workspace-dashboard {
        gap: 12px;
        padding: 12px;
    }

    .project-workspace-finder {
        gap: 12px;
        padding: 16px;
    }

    .project-workspace-finder-heading {
        align-items: flex-start;
    }

    .project-workspace-finder-row {
        flex-direction: column;
    }

    .project-workspace-search-control {
        flex-basis: auto;
        width: 100%;
    }

    .project-workspace-finder-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .project-workspace-finder-actions > * {
        min-width: 0;
        white-space: normal;
        text-align: center;
    }

    .project-workspace-finder .project-workspace-search-results {
        right: 8px;
        left: 8px;
    }

    .project-workspace-header,
    .workspace-stage-band,
    .workspace-panel {
        padding: 16px;
    }

    .project-workspace-title-block h2 {
        font-size: 28px;
    }

    .project-workspace-header-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-actions-menu > summary {
        justify-content: center;
    }

    .workspace-actions-menu > div {
        right: 0;
        left: 0;
        min-width: 0;
    }

    .workspace-stage-rail {
        grid-template-columns: repeat(8, 78px);
    }

    .workspace-kpi-grid,
    .workspace-overview-layout,
    .workspace-design-layout,
    .workspace-sales-grid,
    .workspace-followup-layout,
    .workspace-form-grid,
    .workspace-form-grid.three,
    .workspace-definition-list,
    .workspace-installation-grid {
        grid-template-columns: 1fr;
    }

    .workspace-sales-summary-strip,
    .workspace-dialog-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workspace-sales-summary-strip > div,
    .workspace-dialog-summary > div,
    .workspace-sales-summary-strip > div:last-child,
    .workspace-dialog-summary > div:last-child {
        border-top: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }

    .workspace-sales-summary-strip > div:nth-child(even),
    .workspace-dialog-summary > div:nth-child(even),
    .workspace-sales-summary-strip > div:last-child,
    .workspace-dialog-summary > div:last-child {
        border-right: 0;
    }

    .workspace-kpi {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .workspace-kpi:last-child {
        border-bottom: 0;
    }

    .workspace-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-section-heading small {
        text-align: left;
    }

    .workspace-record-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .workspace-record-total {
        grid-column: 2;
        text-align: left;
    }

    .workspace-record-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .workspace-record-actions > * {
        flex: 1 1 140px;
    }

    .workspace-financial-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workspace-installation-financial-grid {
        grid-template-columns: 1fr;
    }

    .workspace-installation-financial-grid > div,
    .workspace-installation-financial-grid > div:nth-child(3) {
        border-right: 0;
    }

    .workspace-installation-checklist {
        grid-template-columns: 1fr;
    }

    .workspace-financial-grid > div,
    .workspace-financial-grid > div:nth-child(3) {
        border-right: 1px solid var(--border);
        border-top: 1px solid var(--border);
    }

    .workspace-financial-grid > div:nth-child(even) {
        border-right: 0;
    }

    .workspace-installation-financial-grid > div,
    .workspace-installation-financial-grid > div:nth-child(3) {
        border-right: 0;
    }

    .workspace-payment-list > div {
        grid-template-columns: 1fr auto;
    }

    .workspace-payment-list > div small {
        grid-column: 1 / -1;
    }

    .workspace-upload-form {
        grid-template-columns: 1fr;
    }

    .workspace-piece-toolbar,
    .workspace-chimney-bundle-editor,
    .workspace-modification-row,
    .workspace-modification-upload {
        grid-template-columns: 1fr;
    }

    .workspace-piece-toolbar > button,
    .workspace-modification-upload > button {
        width: 100%;
    }

    .workspace-commercial-line-head {
        display: none !important;
    }

    #workspace-estimate-options-list .workspace-commercial-line,
    #workspace-estimate-pieces-list .workspace-commercial-line {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 14px 0;
    }

    #workspace-estimate-options-list .workspace-commercial-line label:first-child,
    #workspace-estimate-pieces-list .workspace-commercial-line label:first-child {
        grid-column: 1 / -1;
    }

    .workspace-commercial-line label > span {
        display: block;
    }

    .workspace-commercial-line > strong {
        text-align: left;
    }

    .workspace-commercial-line .danger-button.compact {
        width: 100%;
    }

    .workspace-modification-row .workspace-inline-actions,
    .workspace-modification-upload {
        grid-column: 1;
    }

    .workspace-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
    }

    .workspace-dialog > form {
        padding: 18px;
    }

    .workspace-dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .workspace-dialog-actions > button {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .project-workspace-finder-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .orders-command-panel {
        grid-template-columns: 1fr;
    }

    .orders-toolbar,
    .order-detail-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .orders-filters,
    .orders-filters input,
    .orders-filters select {
        width: 100%;
    }

    .order-list-row {
        grid-template-columns: 1fr auto;
    }

    .order-list-row > span:first-child {
        grid-column: 1;
        grid-row: 1;
    }

    .order-list-chevron {
        grid-column: 2;
        grid-row: 1;
    }

    .order-list-row > span:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .order-list-row > span:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
    }

    .order-list-row > .status-chip {
        grid-column: 2;
        grid-row: 3;
    }

    .order-detail-panel {
        padding: 16px;
    }

    .order-lines-table > div {
        grid-template-columns: 1fr auto;
    }

    .order-lines-table > div > span:nth-child(2) {
        grid-column: 1 / -1;
    }

    .order-payment-form {
        grid-template-columns: 1fr;
    }

    .order-payment-notes {
        grid-column: auto;
    }

    .order-acceptance-choice {
        grid-template-columns: 1fr;
    }

    .order-acceptance-divider {
        flex-direction: row;
    }

    .order-acceptance-divider::before,
    .order-acceptance-divider::after {
        width: 42%;
        height: 1px;
    }
}

.chimney-bundle-controls {
    display: grid;
    grid-template-columns: minmax(190px, 1.2fr) minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(140px, 0.7fr);
    gap: 12px;
    align-items: end;
    margin: 16px 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong, var(--border));
    background: var(--surface-soft, var(--surface));
}

.chimney-bundle-controls.active {
    border-left-color: var(--fire);
}

.chimney-bundle-controls > .inline-check {
    align-self: center;
    min-height: 42px;
    color: var(--text);
    font-weight: 700;
}

.chimney-bundle-preview {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--muted);
}

.chimney-bundle-preview strong {
    color: var(--text);
}

@media (max-width: 520px) {
    .inventory-dimension-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .chimney-bundle-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .chimney-bundle-controls {
        grid-template-columns: 1fr;
    }
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.ghost-button {
    color: var(--text);
    border: 1px solid var(--border);
    background: transparent;
    box-shadow: none;
}

.ghost-button.danger {
    color: var(--error);
    border-color: rgba(220, 38, 38, 0.3);
}

.save-status.muted {
    color: var(--muted);
}

.configuration-jump-nav,
.dashboard-view-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    width: 100%;
    max-width: 100%;
    margin-top: 18px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

.configuration-jump-nav {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 0;
    padding: 0 10px;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    scrollbar-width: none;
}

.configuration-page .hero-panel.inventory-hero {
    display: block;
}

.hero-panel:has(.configuration-jump-nav) > div:first-child {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.hero-panel:has(.configuration-jump-nav) :is(h2, .hero-copy, .configuration-jump-nav) {
    min-width: 0;
    max-width: 100%;
}

.configuration-jump-nav .configuration-group-tab,
.dashboard-view-tabs [data-dashboard-tab] {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 16px;
    white-space: nowrap;
    color: var(--muted);
    font: inherit;
    font-weight: 800;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.configuration-jump-nav .configuration-group-tab {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    white-space: normal;
    text-align: center;
}

.configuration-jump-nav .configuration-group-tab:hover,
.dashboard-view-tabs [data-dashboard-tab]:hover {
    color: var(--text);
    background: rgba(249, 115, 22, 0.06);
}

.configuration-jump-nav .configuration-group-tab.active,
.dashboard-view-tabs [data-dashboard-tab].active {
    color: var(--text);
    border-bottom-color: var(--primary);
    background: rgba(249, 115, 22, 0.1);
    box-shadow: none;
}

.configuration-jump-nav .configuration-group-tab:focus-visible,
.dashboard-view-tabs [data-dashboard-tab]:focus-visible {
    position: relative;
    z-index: 1;
    outline: 3px solid rgba(249, 115, 22, 0.28);
    outline-offset: -3px;
}

[data-configuration-group][hidden] {
    display: none !important;
}

.site-publication-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.site-publication-summary .summary-item,
.site-publication-item {
    border: 1px solid var(--border-color, #d9dee7);
    background: var(--surface-soft, #f7f8fa);
    border-radius: 8px;
}

.site-publication-item.active {
    border-color: #86efac;
    background: #f0fdf4;
}

.site-publication-summary .summary-item {
    display: grid;
    gap: 5px;
    padding: 14px 16px;
    min-width: 0;
}

.site-publication-summary span,
.site-publication-item small {
    color: var(--muted-text, #667085);
}

.site-publication-summary strong {
    overflow-wrap: anywhere;
}

.site-publication-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.site-publication-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
}

.site-publication-item > div:first-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.site-publication-state {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e9edf3;
    color: #344054;
    font-size: 0.78rem;
    font-weight: 700;
}

.site-publication-state.installed,
.site-publication-state.rolled_back {
    background: #dcfce7;
    color: #166534;
}

.site-publication-state.superseded {
    background: #e5e7eb;
    color: #4b5563;
}

.site-publication-state.failed {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 760px) {
    .site-publication-summary {
        grid-template-columns: 1fr;
    }

    .site-publication-item {
        align-items: stretch;
        flex-direction: column;
    }
}

.modal-managed-section {
    display: none;
}

.client-workflow-modal-body > .modal-managed-section,
.installation-workflow-modal-body > .modal-managed-section {
    display: block;
    margin: 0;
}

.model-editor-workspace #model-form {
    display: none;
}

.model-editor-workspace {
    padding-bottom: 6px;
}

.model-editor-workspace > h2 {
    margin-bottom: 10px;
}

.configuration-page-status {
    position: sticky;
    top: 12px;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
    padding: 14px 16px;
    color: #7f1d1d;
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 14px;
    background: #fef2f2;
    box-shadow: 0 12px 28px rgba(127, 29, 29, 0.12);
}

.configuration-page-status > div {
    display: grid;
    gap: 3px;
}

.configuration-page-status span {
    font-size: 13px;
}

.configuration-readonly-value {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    color: #334155;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-muted);
    font-weight: 800;
}

#ui-density-status:empty {
    display: none;
}

.company-logo-field {
    grid-column: span 2;
}

.company-logo-control {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.company-logo-control > img {
    width: 112px;
    height: 82px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
}

.company-logo-control > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.company-logo-control > div > input[type="text"] {
    grid-column: 1 / -1;
}

.company-logo-control input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.company-logo-control .file-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #fff;
    font-weight: 850;
    cursor: pointer;
}

.company-logo-control .file-trigger:hover,
.company-logo-control .file-trigger:focus-visible {
    color: var(--primary);
    border-color: var(--primary);
    outline: none;
    background: var(--primary-soft);
}

.operation-maintenance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.operation-maintenance-actions .save-status {
    margin-top: 0;
}

.configuration-save-bar {
    position: sticky;
    bottom: 12px;
    z-index: 40;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(14px);
}

.configuration-save-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    color: var(--muted);
    font-size: 13px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
}

.status-dot.success {
    background: var(--success);
}

.status-dot.warning {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

#configuration-save-button.has-changes {
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18), 0 12px 26px rgba(249, 115, 22, 0.22);
}

.configuration-save-bar .save-status {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 0;
    overflow-wrap: anywhere;
}

.configuration-audit-list {
    display: grid;
    gap: 8px;
}

.configuration-audit-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
}

.configuration-audit-status {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: #166534;
    font-size: 11px;
    font-weight: 900;
    border-radius: 10px;
    background: #dcfce7;
}

.configuration-audit-row.denied .configuration-audit-status,
.configuration-audit-row.error .configuration-audit-status {
    color: #991b1b;
    background: #fee2e2;
}

.configuration-audit-row strong,
.configuration-audit-row small {
    display: block;
}

.configuration-audit-row small,
.configuration-audit-row time {
    color: var(--muted);
    font-size: 12px;
}

.configuration-confirm-card {
    width: min(520px, calc(100vw - 32px));
}

.configuration-confirm-card .help-text {
    margin: 14px 0;
    color: var(--text);
    line-height: 1.55;
}

.configuration-confirm-card .action-bar {
    justify-content: flex-end;
    margin-top: 16px;
}

.configuration-confirm-card .danger-button:disabled,
.configuration-item button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

@media (max-width: 760px) {
    .configuration-jump-nav {
        overflow: visible;
    }

    .configuration-jump-nav .configuration-group-tab {
        width: 100%;
        min-width: 0;
        padding-inline: 9px;
        white-space: normal;
    }

    .configuration-directory-toolbar {
        grid-template-columns: 1fr;
    }

    .configuration-directory-count {
        width: 100%;
        text-align: left;
    }

    .configuration-directory-summary {
        align-items: flex-start;
        min-height: 60px;
        padding: 11px 12px;
    }

    .configuration-directory-summary-meta {
        align-self: center;
    }

    .configuration-directory-chip:not(.active):not(.inactive):not(.current) {
        display: none;
    }

    .configuration-directory-body {
        padding: 12px;
    }

    .configuration-directory-row-actions,
    .supplier-documents-heading,
    .supplier-document-row,
    .supplier-document-row-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .configuration-directory-row-actions > *,
    .supplier-document-row-actions > * {
        width: 100%;
    }

    .configuration-page-status,
    .configuration-save-bar,
    .company-logo-control > div {
        align-items: stretch;
        flex-direction: column;
    }

    .configuration-page-status,
    .configuration-save-bar {
        display: flex;
    }

    .configuration-save-bar {
        flex-wrap: nowrap;
    }

    .configuration-save-state {
        margin-right: 0;
    }

    .configuration-save-bar > *,
    .configuration-save-bar button {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .configuration-save-bar .save-status {
        flex: 0 0 auto;
    }

    .company-logo-field {
        grid-column: 1 / -1;
    }

    .company-logo-control {
        grid-template-columns: 1fr;
    }

    .company-logo-control > img {
        width: 100%;
        height: 110px;
    }

    .company-logo-control > div {
        display: flex;
    }

    .company-logo-control .file-trigger {
        width: 100%;
    }

    .configuration-audit-row {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .configuration-audit-row time {
        grid-column: 2;
    }
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.18), transparent 32%), var(--bg);
}

.login-shell {
    width: min(460px, calc(100vw - 32px));
}

.login-card {
    display: grid;
    gap: 18px;
}

.login-brand {
    margin: 0;
}

.login-hint {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.session-badge {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 10px 0 24px;
    padding: 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    color: rgba(255, 255, 255, 0.78);
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.28), transparent 40%),
        rgba(15, 23, 42, 0.62);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-size: 13px;
}

.session-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 15px;
    color: #fff7ed;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--primary), #ef4444);
    box-shadow: 0 10px 22px rgba(249, 115, 22, 0.28);
}

.session-user {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.session-user span {
    overflow: hidden;
    color: white;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-user small {
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.session-user em {
    color: #fed7aa;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.session-logout {
    display: grid;
    place-items: center;
    grid-column: 1 / -1;
    width: 100%;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    font-size: 12px;
    font-weight: 900;
}

.session-logout:hover {
    background: rgba(249, 115, 22, 0.32);
}

.inventory-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(150px, 190px));
    gap: 10px;
    min-width: min(860px, 100%);
}

input[type="search"] {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: var(--text);
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: var(--surface-muted);
}

.inventory-summary {
    margin-bottom: 16px;
}

.bulk-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.82);
}

.bulk-action-bar strong {
    color: var(--text);
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1160px;
    background: white;
}

.inventory-table th,
.inventory-table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.inventory-table th {
    color: #475569;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #f8fafc;
}

.inventory-table .selection-cell {
    width: 46px;
    min-width: 46px;
    text-align: center;
}

.selection-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    cursor: pointer;
}

.inventory-table td span {
    color: var(--muted);
    font-size: 13px;
}

.inventory-table .description-cell {
    min-width: 280px;
    max-width: 460px;
}

.inventory-table .inventory-description {
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}

.category-pill,
.stock-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-weight: 900;
}

.category-pill {
    color: #075985 !important;
    background: #e0f2fe;
}

.stock-pill {
    color: #166534 !important;
    background: #dcfce7;
}

.stock-pill.empty {
    color: #991b1b !important;
    background: #fee2e2;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20;
    padding: 28px;
    background: rgba(15, 23, 42, 0.58);
}

.modal-content {
    width: min(680px, 100%);
    margin: 5vh auto;
    padding: 24px;
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow);
}

.model-detail-modal.hidden {
    display: none;
}

.model-modal-host {
    display: contents;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.model-selector-host {
    display: none;
}

.quick-modal-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.model-form-modal.hidden {
    display: none;
}

.model-form-modal {
    position: fixed;
    inset: 0;
    z-index: 3360;
    display: grid;
    place-items: center;
    padding: 24px;
}

.model-form-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(6px);
}

.model-form-modal-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1020px, 100%);
    max-height: min(92vh, 880px);
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.36);
}

.model-form-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
}

.model-form-modal-heading {
    padding-right: 52px;
}

.model-form-modal-body {
    min-height: 0;
    overflow: auto;
    padding: 4px 4px 14px;
}

.model-form-modal-body .subsection {
    margin: 0;
}

.model-form-modal-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 0 0;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.model-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 3350;
    display: grid;
    place-items: center;
    padding: 24px;
}

.model-detail-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(6px);
}

.model-detail-modal-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(980px, 100%);
    max-height: min(90vh, 860px);
    overflow: auto;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.1), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.36);
}

.model-detail-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
}

.model-detail-modal-close:hover,
.model-detail-modal-close:focus-visible {
    border-color: rgba(249, 115, 22, 0.42);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.model-detail-heading {
    order: 0;
    padding-right: 52px;
}

.model-detail-body {
    order: 2;
    min-height: 0;
}

.model-detail-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
    gap: 20px;
    margin-top: 8px;
}

.model-detail-media,
.model-detail-placeholder {
    min-height: 260px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    background: #fff;
}

.model-detail-media {
    display: grid;
    place-items: center;
    overflow: hidden;
}

.model-detail-media img {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: contain;
}

.model-detail-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 900;
}

.model-detail-content {
    display: grid;
    align-content: start;
    gap: 14px;
}

.model-detail-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.model-detail-kicker > span:not(.status-pill) {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    color: #475569;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 12px;
    font-weight: 900;
}

.model-detail-content h3 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.05;
}

.model-detail-description {
    margin: 0;
    color: #475569;
    line-height: 1.55;
}

.model-detail-specs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.model-detail-specs div,
.model-detail-manuals,
.model-detail-options-preview {
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
}

.model-detail-specs span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.model-detail-specs strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.25;
}

.model-detail-manuals,
.model-detail-options-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.model-detail-manuals h4,
.model-detail-options-preview h4,
.model-detail-options-preview small,
.model-detail-manuals p {
    flex-basis: 100%;
    margin: 0;
}

.model-detail-manuals a,
.model-detail-options-preview span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    color: #0f172a;
    border: 1px solid rgba(203, 213, 225, 0.88);
    border-radius: 10px;
    background: #fff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.model-detail-options-preview small {
    color: var(--muted);
    font-weight: 850;
}

.model-detail-actions {
    order: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 14px 52px 18px 0;
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
}

.model-detail-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    color: var(--text);
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    appearance: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.model-detail-action.primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.22);
}

.model-detail-action:hover,
.model-detail-action:focus-visible {
    border-color: rgba(249, 115, 22, 0.34);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
}

.close {
    float: right;
    cursor: pointer;
    font-size: 28px;
    font-weight: 900;
}

.chimney-plan-stats {
    margin-top: 22px;
}

.chimney-plan-layout {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 22px;
    margin-top: 24px;
}

.plan-editor-card,
.plan-canvas-card,
.path-editor-card,
.plan-summary-card,
.plan-client-card {
    width: 100%;
}

.plan-canvas-card,
.path-editor-card,
.plan-summary-card,
.plan-client-card {
    min-width: 0;
}

.plan-drawing-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    align-items: stretch;
    gap: 12px;
    margin: 4px 0 14px;
    padding: 14px;
    border: 1px solid rgba(249, 115, 22, 0.18);
    border-radius: 20px;
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.16), transparent 34%),
        linear-gradient(135deg, #fff7ed, #ffffff);
}

.plan-toolbar-section {
    display: grid;
    gap: 8px;
    align-content: start;
    padding: 10px;
    border: 1px solid rgba(226, 232, 240, 0.86);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.primary-tools {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.add-tools {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.plan-nudge-controls {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plan-toolbar-label {
    grid-column: 1 / -1;
    color: #9a3412;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plan-tool,
.plan-nudge-controls button {
    min-height: 76px;
    padding: 12px;
    border-radius: 18px;
    box-shadow: none;
}

.plan-tool {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 5px 10px;
    color: #475569;
    text-align: left;
    border: 1px solid var(--border);
    background: #fff;
}

.plan-tool > span {
    display: grid;
    grid-row: span 2;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #c2410c;
    font-size: 16px;
    font-weight: 950;
    border-radius: 10px;
    background: #ffedd5;
}

.plan-tool strong,
.plan-tool small {
    display: block;
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.plan-tool strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.15;
}

.plan-tool small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.15;
    font-weight: 800;
}

.plan-tool.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), #ef4444);
    box-shadow: 0 10px 22px rgba(249, 115, 22, 0.22);
}

.plan-tool.active > span {
    color: #fff7ed;
    background: rgba(255, 255, 255, 0.2);
}

.plan-tool.active strong,
.plan-tool.active small {
    color: #fff;
}

.plan-tool-primary {
    min-height: 82px;
}

.plan-tool-auto {
    border-color: rgba(14, 165, 233, 0.32);
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.plan-tool-auto > span {
    color: #0369a1;
    background: #dbeafe;
}

.plan-nudge-controls button {
    min-height: 42px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 13px;
}

.plan-tool-status {
    margin-bottom: 12px;
    padding: 11px 13px;
    color: #854d0e;
    font-size: 13px;
    font-weight: 850;
    border: 1px solid #fed7aa;
    border-radius: 15px;
    background: #fffbeb;
}

.plan-view-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
}

.plan-canvas-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 14px 0 8px;
}

.plan-view-button {
    min-height: 34px;
    padding: 0 12px;
    color: #475569;
    font-size: 12px;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
}

.plan-view-button.active {
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #334155);
}

.plan-zoom-controls {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px;
    border: 1px solid rgba(249, 115, 22, 0.22);
    border-radius: 999px;
    background: #fff7ed;
}

#plan-zoom-label {
    min-width: 54px;
    color: #9a3412;
    font-size: 13px;
    text-align: center;
}

.plan-segment-quick-editor {
    margin: 0 0 14px;
    padding: 16px;
    border: 1px solid rgba(249, 115, 22, 0.26);
    border-radius: 20px;
    background: linear-gradient(135deg, #fff7ed, #ffffff);
    box-shadow: 0 18px 36px rgba(249, 115, 22, 0.12);
}

.quick-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.quick-editor-nav,
.angle-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.quick-editor-nav button,
.angle-preset-row button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
}

.quick-editor-head h3 {
    margin: 0;
    color: #0f172a;
}

.quick-angle-panel {
    display: grid;
    gap: 9px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #fed7aa;
    border-radius: 16px;
    background: #fffbeb;
}

.quick-angle-panel strong {
    color: #9a3412;
}

.quick-angle-panel small {
    color: #854d0e;
    font-weight: 800;
}

.plan-client-card {
    grid-column: 1 / -1;
}

.plan-client-context {
    display: grid;
    grid-template-columns: 46px 1fr;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.plan-client-context > span {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--primary-soft);
}

.plan-client-context strong,
.plan-client-context small,
.plan-client-context em {
    display: block;
}

.plan-client-context strong {
    color: #0f172a;
}

.plan-client-context small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.plan-client-context em {
    margin-top: 4px;
    color: var(--primary-dark);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.plan-client-context.unlinked {
    border-color: #fed7aa;
    background: linear-gradient(135deg, #fff7ed, #ffffff);
}

.plan-canvas-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    overflow: hidden;
    min-height: 620px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: linear-gradient(180deg, #bfdbfe 0%, #eff6ff 58%, #bbf7d0 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 20px 42px rgba(15, 23, 42, 0.12);
}

.plan-canvas-wrap.single-view {
    grid-template-columns: 1fr;
}

.plan-view-pane {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.88);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.46);
}

.plan-view-label {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 6px 10px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(8px);
}

#house-plan-svg,
#house-side-plan-svg {
    display: block;
    width: 100%;
    height: 620px;
    min-height: 620px;
    cursor: crosshair;
}

.plan-scene-bg {
    fill: url(#planSky);
}

.plan-side-bg {
    fill: url(#planSideSky);
}

.plan-sun {
    fill: #fde68a;
    opacity: 0.86;
}

.plan-paper {
    fill: rgba(255, 255, 255, 0.66);
    stroke: rgba(148, 163, 184, 0.42);
    filter: url(#planSoftShadow);
}

.plan-house {
    fill: url(#planWall);
    stroke: #334155;
    stroke-width: 3;
    filter: url(#planSoftShadow);
}

.plan-side-house {
    fill: url(#planSideWall);
    stroke: #334155;
    stroke-width: 3;
    filter: url(#planSoftShadow);
}

.plan-roof {
    fill: #991b1b;
    stroke: #451a03;
    stroke-width: 4;
    filter: url(#planSoftShadow);
}

.plan-ground,
.plan-floor-line {
    stroke: #94a3b8;
    stroke-width: 2;
    stroke-dasharray: 8 8;
}

.plan-ground {
    stroke: #166534;
    stroke-width: 4;
    stroke-dasharray: none;
}

.plan-fireplace {
    fill: #f97316;
    stroke: #9a3412;
    stroke-width: 3;
    filter: url(#planSoftShadow);
}

.plan-fireplace-enclosure {
    fill: rgba(51, 65, 85, 0.16);
    stroke: #475569;
    stroke-width: 3;
    stroke-dasharray: 8 5;
    filter: url(#planSoftShadow);
}

.plan-fireplace-wall-plate {
    fill: #334155;
    stroke: #0f172a;
    stroke-width: 2;
    filter: url(#planSoftShadow);
}

.plan-fireplace-clearance {
    fill: rgba(14, 165, 233, 0.1);
    stroke: rgba(14, 165, 233, 0.58);
    stroke-width: 2;
    stroke-dasharray: 7 6;
}

.plan-side-clearance-line {
    stroke: #0ea5e9;
    stroke-width: 3;
    stroke-dasharray: 8 6;
    stroke-linecap: round;
}

.plan-fireplace-handle {
    fill: #fff7ed;
    stroke: #f97316;
    stroke-width: 3;
}

.plan-fireplace-label,
.plan-svg-label {
    fill: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.plan-chimney-path {
    fill: none;
    stroke: #0f172a;
    stroke-width: 16;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 8px 10px rgba(15, 23, 42, 0.25));
}

.plan-chimney-hit-path {
    fill: none;
    stroke: transparent;
    stroke-width: 46;
    stroke-linecap: round;
    stroke-linejoin: round;
    cursor: copy;
    pointer-events: stroke;
}

.plan-chimney-selected-segment {
    fill: none;
    stroke: #f97316;
    stroke-width: 25;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.48;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(249, 115, 22, 0.55));
}

.plan-flow-arrow {
    fill: #f97316;
    stroke: #fff;
    stroke-width: 1.5;
    filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.2));
}

.plan-side-path {
    stroke: #1e293b;
}

.plan-side-measure-line {
    stroke: #2563eb;
    stroke-width: 2;
    stroke-dasharray: 6 5;
}

.plan-side-measure,
.plan-side-exit {
    font-size: 12px;
}

.plan-side-exit {
    fill: #c2410c;
}

.plan-marker,
.plan-marker-elbow,
.plan-marker-penetration {
    stroke: white;
    stroke-width: 3;
}

.plan-marker {
    fill: var(--accent);
}

.plan-marker-elbow {
    fill: var(--warning);
}

.plan-elbow-symbol {
    fill: none;
    stroke: #7c2d12;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 4;
}

.plan-elbow-text {
    fill: #7c2d12;
    font-size: 9px;
    font-weight: 900;
    pointer-events: none;
    text-anchor: middle;
}

.plan-marker-penetration {
    fill: var(--error);
}

.plan-point-hit {
    cursor: copy;
}

.plan-marker-hit {
    fill: transparent;
    stroke: transparent;
}

.plan-point-hit:hover .plan-marker-hit {
    fill: rgba(249, 115, 22, 0.12);
    stroke: rgba(249, 115, 22, 0.42);
    stroke-width: 2;
}

.plan-point-hit.selected .plan-marker-hit,
.plan-side-selected-marker {
    fill: rgba(249, 115, 22, 0.18);
    stroke: #f97316;
    stroke-width: 4;
}

.plan-exterior-clearance {
    stroke: #f97316;
    stroke-width: 5;
    stroke-dasharray: 8 7;
    stroke-linecap: round;
}

.plan-label-line {
    stroke: rgba(15, 23, 42, 0.34);
    stroke-dasharray: 3 4;
    stroke-width: 1.5;
}

.plan-label-box {
    fill: rgba(255, 255, 255, 0.9);
    stroke: rgba(148, 163, 184, 0.72);
    stroke-width: 1;
}

.plan-segment-label {
    font-size: 11px;
    pointer-events: none;
}

.plan-legend-box {
    fill: rgba(255, 255, 255, 0.86);
    stroke: rgba(148, 163, 184, 0.6);
}

.plan-legend-text {
    font-size: 11px;
}

.path-segments-list,
.plan-summary {
    display: grid;
    gap: 14px;
}

.path-segment-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
}

.path-segment-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.path-segment-head h3,
.plan-summary h3 {
    margin: 0;
}

.path-segment-head h3 {
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.mini-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.mini-actions button {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
}

.plan-actions {
    margin-top: 16px;
}

.wall-plan-field {
    display: none;
}

.mini-insert-actions {
    gap: 8px;
    margin-top: 12px;
}

.mini-insert-actions button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.plan-template-panel {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
    gap: 14px;
    align-items: center;
    margin: 16px 0 0;
    padding: 16px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 20px;
    background: linear-gradient(135deg, #f0f9ff, #ffffff);
}

.plan-template-panel h3 {
    margin: 0 0 5px;
    color: #0f172a;
}

.plan-template-panel small {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.4;
}

.template-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    align-items: center;
}

.template-controls select {
    grid-column: 1 / -1;
}

.template-controls select,
.template-controls button {
    margin: 0;
}

.template-controls button {
    min-width: 0;
    white-space: normal;
}

.plan-parts-list,
.plan-detail-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.7;
}

.plan-parts-list li::marker,
.plan-detail-list li::marker {
    color: var(--primary);
    font-weight: 900;
}

.dashboard-command-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
    gap: 22px;
    align-items: start;
    margin-bottom: 22px;
}

.dashboard-view-tabs {
    position: sticky;
    top: 0;
    z-index: 18;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0 0 22px;
    padding: 0 10px;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
}

.dashboard-view-tabs [data-dashboard-tab] {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    white-space: normal;
    text-align: center;
}

.dashboard-view-panel {
    min-width: 0;
    animation: dashboardViewIn 0.2s ease both;
}

.dashboard-view-panel[hidden] {
    display: none !important;
}

.dashboard-summary-grid.dashboard-view-panel {
    grid-template-columns: minmax(0, 1fr);
}

.dashboard-panel-anchor {
    display: block;
    height: 0;
    scroll-margin-top: 78px;
}

@keyframes dashboardViewIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-insight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px;
}

.dashboard-triple-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
    margin-bottom: 22px;
}

.dashboard-triple-grid > .dashboard-panel-anchor {
    position: absolute;
    top: 0;
    left: 0;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
    margin-bottom: 22px;
}

.dashboard-summary-card {
    position: relative;
    overflow: hidden;
    align-self: start;
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
}

.dashboard-summary-card::after {
    content: '';
    position: absolute;
    inset: auto 22px 0;
    height: 4px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, var(--primary), #ef4444);
    opacity: 0.72;
}

.dashboard-summary-card .card-heading {
    align-items: flex-start;
}

.dashboard-summary-card .pipeline-grid,
.dashboard-summary-card .accounting-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-summary-card .pipeline-card,
.dashboard-summary-card .accounting-card {
    background: rgba(255, 255, 255, 0.84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.dashboard-summary-card .accounting-card.warning {
    border-color: rgba(249, 115, 22, 0.34);
    background: #fff7ed;
}

.dashboard-summary-card .accounting-card.success {
    border-color: rgba(22, 163, 74, 0.3);
    background: #f0fdf4;
}

.dashboard-summary-card .pipeline-card strong,
.dashboard-summary-card .accounting-card strong {
    font-size: 20px;
}

.dashboard-summary-card .dashboard-list {
    gap: 9px;
}

.dashboard-summary-card .dashboard-list-item {
    padding: 11px;
    background: rgba(255, 255, 255, 0.82);
}

.dashboard-summary-card .dashboard-list-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.accounting-dashboard {
    display: grid;
    gap: 13px;
}

.accounting-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.accounting-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.accounting-action-card {
    display: grid;
    gap: 4px;
    padding: 11px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
}

.accounting-action-card span {
    font-size: 18px;
}

.accounting-action-card strong {
    color: #0f172a;
    font-size: 13px;
}

.accounting-action-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.accounting-dashboard-section {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.accounting-dashboard-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.accounting-dashboard-heading strong {
    color: #0f172a;
}

.accounting-dashboard-heading a {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.accounting-receivable-list {
    display: grid;
    gap: 9px;
}

.accounting-receivable-row {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
    padding: 11px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
}

.accounting-receivable-row > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #fef3c7;
}

.accounting-receivable-row strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
}

.accounting-receivable-row small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.crm-dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.crm-metric-card {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 8px;
    padding: 11px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.84);
}

.crm-metric-card > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--primary-soft);
}

.crm-metric-card strong {
    display: block;
    color: #0f172a;
    font-size: 20px;
    line-height: 1;
}

.crm-metric-card small,
.crm-metric-card em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
}

.crm-metric-card em {
    grid-column: 1 / -1;
}

.crm-dashboard-section {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.crm-dashboard-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.crm-dashboard-heading strong {
    color: #0f172a;
}

.crm-dashboard-heading a {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.crm-project-list {
    display: grid;
    gap: 9px;
}

.crm-project-row {
    display: grid;
    gap: 7px;
    padding: 12px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
}

.crm-project-row strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.crm-project-row small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.crm-pill {
    justify-self: start;
    padding: 5px 8px;
    border-radius: 999px;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    background: #e2e8f0;
}

.crm-pill.success {
    color: #166534;
    background: #dcfce7;
}

.crm-pill.muted {
    color: #854d0e;
    background: #fef3c7;
}

.dashboard-calendar-card {
    margin-bottom: 22px;
}

.dashboard-overview-calendar {
    scroll-margin-top: 78px;
}

.dashboard-triple-grid .dashboard-card,
.dashboard-chart-card,
.dashboard-actions-card {
    min-height: 100%;
}

.dashboard-triple-grid .dashboard-list-item {
    padding: 11px;
}

.dashboard-triple-grid .dashboard-list-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.dashboard-bar-chart {
    display: grid;
    gap: 12px;
}

.dashboard-bar-row {
    display: grid;
    grid-template-columns: minmax(118px, 0.8fr) minmax(160px, 1fr) minmax(96px, auto);
    align-items: center;
    gap: 12px;
}

.dashboard-bar-row strong,
.quick-action-card strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
}

.dashboard-bar-row small,
.quick-action-card small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.dashboard-bar-row em {
    color: var(--primary-dark);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    text-align: right;
}

.dashboard-bar-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.dashboard-bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #ef4444);
}

.dashboard-donut-panel {
    display: grid;
    grid-template-columns: 132px 1fr;
    align-items: center;
    gap: 16px;
}

.dashboard-donut {
    display: grid;
    place-items: center;
    width: 132px;
    height: 132px;
    border-radius: 999px;
    background:
        radial-gradient(circle, white 0 48%, transparent 49%),
        conic-gradient(#2563eb 0 var(--install), #f97316 var(--install) calc(var(--install) + var(--callbacks)), #16a34a calc(var(--install) + var(--callbacks)) calc(var(--install) + var(--callbacks) + var(--ready)), #eab308 0 100%);
    box-shadow: inset 0 0 0 1px var(--border);
}

.dashboard-donut strong {
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
}

.dashboard-donut small {
    margin-top: -38px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-chart-legend {
    display: grid;
    gap: 9px;
}

.dashboard-chart-legend span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.dashboard-chart-legend strong {
    margin-left: auto;
    color: #0f172a;
}

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.quick-action-card {
    display: grid;
    gap: 4px;
    padding: 13px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
}

.quick-action-card span {
    font-size: 20px;
}

.dashboard-kpi-grid .stat-card {
    min-height: 104px;
}

.dashboard-kpi-button {
    position: relative;
    width: 100%;
    color: inherit;
    border: 1px solid rgba(226, 232, 240, 0.78);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-kpi-button:hover,
.dashboard-kpi-button:focus-visible {
    border-color: rgba(249, 115, 22, 0.55);
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

.dashboard-kpi-open {
    position: absolute;
    top: 12px;
    right: 14px;
    color: #c2410c;
    font-size: 18px;
    font-weight: 900;
}

.dashboard-widget-open {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-left: auto;
    padding: 0;
    color: #475569;
    border: 1px solid #dbe2ea;
    border-radius: 6px;
    background: #fff;
    font-size: 19px;
    cursor: pointer;
}

.dashboard-widget-open:hover,
.dashboard-widget-open:focus-visible {
    color: #c2410c;
    border-color: #f97316;
    background: #fff7ed;
    outline: 2px solid rgba(249, 115, 22, 0.18);
}

.dashboard-global-search {
    position: relative;
    z-index: 80;
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 12px;
    padding: 18px 20px;
    color: #fff;
    border: 1px solid #343a42;
    border-radius: 8px;
    background: #20242a;
    box-shadow: var(--shadow);
}

.dashboard-global-search-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    min-width: 0;
    gap: 16px;
}

.dashboard-global-search-heading .eyebrow {
    margin-bottom: 2px;
    color: #fb923c;
}

.dashboard-global-search-heading h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    letter-spacing: 0;
}

.dashboard-global-search-heading > span {
    min-height: 20px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-global-search-control {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 6px;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-global-search-control:focus-within {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.dashboard-global-search-icon {
    color: #64748b;
    font-size: 23px;
    font-weight: 900;
    text-align: center;
}

.dashboard-global-search-control input {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 12px 4px;
    color: #0f172a;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 16px;
}

.dashboard-global-search-control input::placeholder {
    color: #64748b;
}

.dashboard-global-search-control button {
    width: 42px;
    height: 42px;
    padding: 0;
    color: #475569;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.dashboard-global-search-control button:hover,
.dashboard-global-search-control button:focus-visible {
    color: #c2410c;
    background: #fff7ed;
    outline: 2px solid #f97316;
    outline-offset: -2px;
}

.dashboard-global-search-results {
    position: absolute;
    top: calc(100% - 4px);
    right: 20px;
    left: 20px;
    z-index: 100;
    max-height: min(66vh, 680px);
    overflow: auto;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
    overscroll-behavior: contain;
}

.dashboard-global-search-group + .dashboard-global-search-group {
    border-top: 1px solid #e2e8f0;
}

.dashboard-global-search-group > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    color: #475569;
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
}

.dashboard-global-search-result {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
    gap: 11px;
    padding: 11px 14px;
    color: inherit;
    border-top: 1px solid #f1f5f9;
    text-decoration: none;
}

.dashboard-global-search-result:hover,
.dashboard-global-search-result:focus-visible {
    background: #fff7ed;
    outline: 2px solid #f97316;
    outline-offset: -2px;
}

.dashboard-global-search-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #fff;
    border-radius: 5px;
    background: #1f2937;
    font-size: 10px;
    font-weight: 900;
}

.dashboard-global-search-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.dashboard-global-search-copy strong,
.dashboard-global-search-copy small,
.dashboard-global-search-meta {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-global-search-copy strong {
    color: #0f172a;
    font-size: 14px;
}

.dashboard-global-search-copy small,
.dashboard-global-search-meta {
    color: #64748b;
    font-size: 12px;
}

.dashboard-global-search-meta {
    max-width: 190px;
    font-weight: 800;
    text-align: right;
}

.dashboard-global-search-empty {
    display: grid;
    gap: 3px;
    padding: 22px 16px;
    color: #64748b;
    text-align: center;
}

.dashboard-global-search-empty strong {
    color: #334155;
}

@media (max-width: 760px) {
    .client-profile-inline-panel {
        margin-inline: -2px;
        padding: 16px;
    }

    .client-profile-inline-heading,
    .client-profile-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .client-profile-collapse-button {
        align-self: flex-end;
    }

    .client-profile-contact-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-profile-grid,
    .client-profile-project-grid,
    .client-profile-kpis {
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
    }

    .client-profile-grid > *,
    .client-profile-project-grid > *,
    .client-profile-kpis > * {
        min-width: 0;
    }

    .client-profile-contact-grid > .wide {
        grid-column: auto;
    }

    .client-profile-hero > .inventory-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .client-profile-hero > .inventory-actions > * {
        min-width: 0;
        width: 100%;
        white-space: normal;
    }

    .client-card,
    .document-card {
        align-items: stretch;
        flex-direction: column;
        min-width: 0;
    }

    .client-card-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        min-width: 0;
        justify-content: stretch;
    }

    .client-card-actions > * {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }

    .dashboard-global-search {
        padding: 14px;
    }

    .dashboard-global-search-heading {
        align-items: start;
    }

    .dashboard-global-search-results {
        right: 8px;
        left: 8px;
        max-height: 64vh;
    }

    .dashboard-global-search-result {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .dashboard-global-search-meta {
        grid-column: 2;
        max-width: 100%;
        text-align: left;
    }
}

@media (max-width: 430px) {
    .client-card-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

.dashboard-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.card-heading.no-margin {
    margin-bottom: 0;
}

.dashboard-calendar-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-calendar-add {
    min-height: 42px;
    padding: 0 16px;
}

.dashboard-calendar-status:empty {
    display: none;
}

.dashboard-calendar-status {
    margin: -8px 0 14px;
}

.dashboard-view-toggle {
    margin-left: 4px;
}

.dashboard-calendar-controls strong {
    min-width: 180px;
    color: #0f172a;
    font-size: 16px;
    text-align: center;
    text-transform: capitalize;
}

.dashboard-calendar-weekdays,
.dashboard-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-calendar-weekdays {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.dashboard-calendar-day {
    min-height: 118px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-calendar-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.dashboard-calendar-day-add {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #64748b;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    font-weight: 850;
}

.dashboard-calendar-day:hover .dashboard-calendar-day-add,
.dashboard-calendar-day-add:focus-visible {
    color: #c2410c;
    border-color: rgba(249, 115, 22, 0.3);
    background: #fff7ed;
    outline: none;
}

.dashboard-calendar-day.drop-target {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.dashboard-calendar-day.muted {
    border-style: dashed;
    background: rgba(248, 250, 252, 0.6);
}

.dashboard-calendar-day.today {
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.16);
}

.dashboard-calendar-day strong {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-bottom: 6px;
    color: #0f172a;
    border-radius: 10px;
    background: #f8fafc;
}

.calendar-events {
    display: grid;
    gap: 5px;
}

.calendar-event,
.calendar-more {
    display: block;
    padding: 5px 7px;
    color: #0f172a;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.25;
    border-radius: 10px;
    background: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.calendar-event.editable,
.dashboard-calendar-list-item[data-calendar-draggable="true"] {
    cursor: grab;
}

.calendar-event.dragging,
.dashboard-calendar-list-item.dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.calendar-event.locked {
    cursor: pointer;
}

.dashboard-calendar-list {
    display: grid;
    gap: 10px;
}

.dashboard-calendar-list-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border);
    border-left: 5px solid #94a3b8;
    border-radius: 16px;
    background: #fff;
}

.dashboard-calendar-list-item.install { border-left-color: #2563eb; }
.dashboard-calendar-list-item.callback { border-left-color: #f97316; }
.dashboard-calendar-list-item.sale,
.dashboard-calendar-list-item.accepted { border-left-color: #16a34a; }
.dashboard-calendar-list-item.accounting { border-left-color: #eab308; }

.dashboard-calendar-list-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.dashboard-calendar-list-item strong {
    color: #0f172a;
    font-size: 14px;
}

.calendar-event.install {
    background: #dbeafe;
    color: #1d4ed8;
}

.calendar-event.sale,
.calendar-event.accepted {
    background: #dcfce7;
    color: #166534;
}

.calendar-event.callback {
    background: #ffedd5;
    color: #c2410c;
}

.calendar-event.accounting {
    background: #fef9c3;
    color: #854d0e;
}

.dashboard-list,
.compact-list {
    display: grid;
    gap: 10px;
}

.dashboard-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-list-item:hover {
    transform: translateY(-1px);
    border-color: rgba(249, 115, 22, 0.28);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.dashboard-list-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--primary-soft);
}

.dashboard-list-item strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.dashboard-list-item small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.dashboard-quick-modal.hidden {
    display: none;
}

.dashboard-quick-modal {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: grid;
    place-items: center;
    padding: 24px;
}

.dashboard-quick-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
}

.dashboard-quick-modal-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(760px, 100%);
    max-height: min(86vh, 820px);
    overflow: hidden;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.1), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.36);
}

.dashboard-quick-modal-card.dashboard-widget-modal-card {
    width: min(980px, 100%);
}

.dashboard-reminder-modal-card {
    width: min(820px, 100%);
}

.dashboard-reminder-form {
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.dashboard-reminder-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.dashboard-reminder-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.dashboard-reminder-field.wide,
.dashboard-reminder-new-client-fields {
    grid-column: 1 / -1;
}

.dashboard-reminder-new-client-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-reminder-new-client-fields[hidden] {
    display: none;
}

.dashboard-reminder-field > span,
.dashboard-calendar-date-row label > span {
    color: #334155;
    font-size: 12px;
    font-weight: 900;
}

.dashboard-reminder-field :is(input, select, textarea),
.dashboard-calendar-date-row input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    font: inherit;
}

.dashboard-reminder-field textarea {
    min-height: 96px;
    resize: vertical;
}

.dashboard-calendar-date-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, auto);
    align-items: end;
    gap: 12px;
}

.dashboard-calendar-date-row label {
    display: grid;
    gap: 7px;
}

@media (max-width: 760px) {
    .dashboard-calendar-add {
        width: 100%;
    }

    .dashboard-calendar-day-head {
        gap: 0;
    }

    .dashboard-calendar-day-add {
        width: 18px;
        height: 18px;
        font-size: 14px;
    }

    .dashboard-reminder-grid,
    .dashboard-reminder-new-client-fields,
    .dashboard-calendar-date-row {
        grid-template-columns: 1fr;
    }
}

.dashboard-widget-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.dashboard-widget-summary-grid > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
}

.dashboard-widget-summary-grid span,
.dashboard-widget-detail-row small {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.dashboard-widget-summary-grid strong {
    color: #0f172a;
    font-size: 20px;
}

.dashboard-widget-detail-list {
    display: grid;
    gap: 8px;
}

.dashboard-widget-detail-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
}

.dashboard-widget-detail-main {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    gap: 10px;
    padding: 0;
    color: inherit;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.dashboard-widget-detail-main:hover strong,
.dashboard-widget-detail-main:focus-visible strong {
    color: #c2410c;
}

.dashboard-widget-detail-main:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 3px;
}

.dashboard-widget-detail-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.dashboard-widget-detail-copy strong,
.dashboard-widget-detail-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-widget-project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 10px;
    color: #9a3412;
    border: 1px solid #fed7aa;
    border-radius: 5px;
    background: #fff7ed;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-widget-project-link:hover,
.dashboard-widget-project-link:focus-visible {
    border-color: #f97316;
    outline: 2px solid rgba(249, 115, 22, 0.2);
}

.dashboard-quick-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.dashboard-quick-modal-close:hover,
.dashboard-quick-modal-close:focus-visible {
    border-color: rgba(249, 115, 22, 0.42);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.dashboard-quick-modal-body {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.dashboard-quick-modal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.94);
}

#dashboard-restore-modal input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dashboard-modal-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    color: var(--text);
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    appearance: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.dashboard-modal-action.primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.22);
}

.dashboard-modal-action:hover,
.dashboard-modal-action:focus-visible {
    border-color: rgba(249, 115, 22, 0.34);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
}

.dashboard-modal-action.primary:hover,
.dashboard-modal-action.primary:focus-visible {
    box-shadow: 0 18px 34px rgba(249, 115, 22, 0.28);
}

.dashboard-quick-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-quick-info-grid div,
.dashboard-quick-section,
.dashboard-quick-mini-row {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.dashboard-quick-info-grid div {
    padding: 13px 14px;
}

.dashboard-quick-info-grid span,
.dashboard-quick-mini-row small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-quick-info-grid strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 15px;
}

.dashboard-quick-section {
    padding: 16px;
}

.dashboard-quick-section h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 15px;
}

.dashboard-quick-section p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
}

.dashboard-quick-note-field {
    display: grid;
    gap: 8px;
}

.dashboard-quick-note-field span {
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-quick-note-field textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}

.dashboard-quick-mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding: 12px;
    color: inherit;
    text-decoration: none;
}

.dashboard-quick-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-quick-checklist span {
    padding: 10px 12px;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-quick-checklist span.done {
    background: #dcfce7;
    color: #166534;
}

.pipeline-grid,
.accounting-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.pipeline-card,
.accounting-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
}

.pipeline-card span,
.accounting-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.pipeline-card strong,
.accounting-card strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-size: 24px;
}

.pipeline-card small,
.accounting-card small {
    display: block;
    margin-top: 3px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 850;
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        border-right: 0;
    }

    .sidebar-collapse-button {
        display: none;
    }

    .step-nav {
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    }

    .step-link {
        justify-content: center;
        font-size: 0;
    }

    .step-link span {
        font-size: 13px;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .result-panel {
        position: relative;
        top: auto;
    }

    .inventory-layout {
        grid-template-columns: 1fr;
    }

    .clients-layout,
    .client-profile-grid,
    .project-estimate-group-head,
    .project-content-grid,
    .estimate-workflow-layout,
    .workflow-command-panel,
    .dashboard-insight-grid,
    .dashboard-triple-grid,
    .dashboard-summary-grid,
    .dashboard-command-grid,
    .chimney-plan-layout {
        grid-template-columns: 1fr;
    }

    .plan-canvas-card {
        grid-row: auto;
    }

    .plan-drawing-toolbar {
        grid-template-columns: 1fr;
    }

    .primary-tools,
    .add-tools {
        grid-column: 1;
        grid-row: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plan-nudge-controls {
        grid-column: 1;
        grid-row: auto;
    }

    .admin-links {
        top: -60px;
        left: 0;
        right: 0;
    }

    .dashboard {
        padding-top: 92px;
    }
}

@media (max-width: 1040px) {
    .clients-list.grid-view {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .dashboard {
        padding: 92px 18px 18px;
    }

    .inventory-table-card .empty-state,
    .clients-list > .empty-state,
    .installation-list > .empty-state {
        min-height: 260px;
    }

    .hero-panel,
    .form-grid.two,
    .form-grid.three,
    .card-options,
    .estimate-metrics,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        display: grid;
    }

    .dashboard-page .hero-panel.inventory-hero,
    .dashboard-page .dashboard-hero-actions,
    .dashboard-backup-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-page .inventory-hero {
        align-items: stretch;
    }

    .dashboard-action-menu,
    .dashboard-action-menu > summary {
        width: 100%;
    }

    .dashboard-action-menu-panel {
        right: auto;
        left: 0;
        width: 100%;
    }

    .dashboard-header-action,
    .dashboard-page .header-import-export .dashboard-backup-primary,
    .dashboard-page .header-import-export .dashboard-file-trigger,
    .dashboard-page .header-import-export .dashboard-restore-button {
        justify-content: center;
        width: 100%;
    }

    .client-profile-hero,
    .client-reminder-card {
        display: grid;
    }

    .client-modal-summary,
    .client-modal-actions,
    .inventory-modal-actions,
    .inventory-detail-specs {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-card-header-row,
    .dashboard-calendar-controls {
        align-items: stretch;
        justify-content: flex-start;
    }

    .dashboard-card-header-row {
        display: grid;
    }

    .dashboard-calendar-controls strong {
        min-width: auto;
        text-align: left;
    }

    .pipeline-grid,
    .accounting-grid,
    .quick-action-grid,
    .dashboard-donut-panel,
    .dashboard-bar-row,
    .dashboard-calendar-list-item {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-donut-panel,
    .dashboard-bar-row,
    .dashboard-calendar-list-item {
        grid-template-columns: 1fr;
    }

    .dashboard-calendar-weekdays,
    .dashboard-calendar-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
    }

    .dashboard-calendar-weekdays {
        display: grid;
        font-size: 10px;
    }

    .dashboard-calendar-day {
        min-height: 54px;
        padding: 5px;
        border-radius: 10px;
    }

    .dashboard-calendar-day strong {
        width: 22px;
        height: 22px;
        margin-bottom: 3px;
        font-size: 11px;
        border-radius: 7px;
    }

    .dashboard-calendar-day .calendar-events {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
    }

    .dashboard-calendar-day .calendar-event {
        width: 8px;
        height: 8px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
    }

    .dashboard-calendar-day .calendar-more {
        padding: 1px 3px;
        font-size: 8px;
    }

    .inventory-toolbar,
    .inventory-filters,
    .inventory-parts-list.list .inventory-pick-card,
    .model-link-toolbar,
    .model-detail-layout,
    .model-detail-specs,
    .kit-options-layout,
    .client-card-stats,
    .estimate-history-head,
    .estimate-history-head.with-scenario-image,
    .model-preview,
    .quote-grid,
    .quote-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .estimate-card-actions {
        justify-content: flex-start;
        max-width: none;
        min-width: 0;
    }

    .estimate-card-model-image,
    .estimate-card-model-placeholder {
        width: 100%;
        max-width: 180px;
    }

    .quote-header img {
        justify-self: start;
    }

    .quote-preview-modal-toolbar,
    .quote-preview-modal .inventory-toolbar {
        padding-right: 0;
    }

    .clients-list.grid-view {
        grid-template-columns: 1fr;
    }

    .dashboard-card,
    .result-panel,
    .hero-panel {
        border-radius: 22px;
        padding: 18px;
    }

    .header-import-export {
        position: static;
        justify-content: flex-start;
        max-width: none;
        margin-top: 16px;
    }

    .dashboard-page .header-import-export.dashboard-backup-panel {
        margin-top: 0;
    }

    .model-detail-modal {
        padding: 10px;
        align-items: end;
    }

    .model-detail-modal-card {
        max-height: 92vh;
        padding: 20px;
        border-radius: 24px 24px 12px 12px;
    }

    .model-detail-actions {
        grid-template-columns: 1fr;
        margin: 14px 0 18px;
        padding: 12px;
    }

    .hero-panel:has(.header-import-export) > div:first-child {
        max-width: none;
    }

    .compact-status {
        text-align: left;
    }

    .supplier-card-heading,
    .supplier-card-actions {
        display: grid;
        justify-content: stretch;
    }

    .supplier-card-grid {
        grid-template-columns: 1fr;
    }

    .supplier-wide-field {
        grid-column: auto;
    }

    .installer-wide-field {
        grid-column: auto;
    }

    .backup-card,
    .backup-card-actions {
        display: grid;
        justify-content: stretch;
    }

    .estimate-foyer-card {
        grid-template-columns: 1fr;
    }

    .estimate-folder-identity,
    .estimate-folder-meta {
        grid-template-columns: 1fr;
    }

    .estimate-foyer-card img,
    .estimate-foyer-placeholder {
        width: 100%;
        max-width: 220px;
    }

    .primary-tools,
    .add-tools,
    .plan-nudge-controls {
        grid-template-columns: 1fr;
    }

    .plan-tool,
    .plan-tool-primary {
        min-height: 58px;
    }

    .plan-canvas-wrap,
    #house-plan-svg,
    #house-side-plan-svg {
        min-height: 520px;
        height: 520px;
    }

    .plan-template-panel,
    .template-controls {
        grid-template-columns: 1fr;
    }

    .admin-links {
        border-radius: 22px;
        justify-content: flex-start;
        padding: 7px;
    }

    .admin-link {
        min-height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }
}

.catalogue-client-page {
    display: grid;
    gap: 22px;
}

.catalogue-hero::after {
    display: none;
}

.catalogue-insights-panel {
    display: grid;
    gap: 18px;
    margin-top: 20px;
    padding: 24px;
    border-radius: var(--radius-lg);
}

.catalogue-insights-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.catalogue-insights-header h2,
.catalogue-insights-header p {
    margin: 0;
}

.catalogue-insights-header > p {
    max-width: 540px;
    color: var(--muted);
    line-height: 1.5;
}

.catalogue-questionnaire-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 14px;
}

.catalogue-questionnaire-grid .full-span {
    grid-column: 1 / -1;
}

.catalogue-questionnaire-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    background: #f8fafc;
}

.catalogue-questionnaire-summary {
    display: grid;
    gap: 2px;
    min-width: min(100%, 260px);
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.catalogue-questionnaire-summary strong {
    color: #0f172a;
    font-size: 15px;
}

.catalogue-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.catalogue-tip {
    display: grid;
    gap: 8px;
    min-height: 138px;
    padding: 16px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.catalogue-tip span {
    width: max-content;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
    background: rgba(249, 115, 22, 0.12);
}

.catalogue-tip strong {
    color: #0f172a;
    font-size: 20px;
}

.catalogue-tip p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.catalogue-feature {
    display: grid;
    align-items: stretch;
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
    gap: 24px;
}

.catalogue-feature-image,
.catalogue-card-image,
.catalogue-sheet-image {
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a, #334155);
}

.catalogue-feature-image {
    min-height: 330px;
    border-radius: 28px;
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.22);
}

.catalogue-feature-image img,
.catalogue-card-image img,
.catalogue-sheet-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalogue-feature-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 330px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(255, 247, 237, 0.95), rgba(240, 249, 255, 0.92)),
        white;
}

.catalogue-feature-copy h2,
.catalogue-sheet h2 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.catalogue-feature-copy p,
.catalogue-card-body p,
.catalogue-sheet p,
.catalogue-sheet li {
    color: var(--muted);
    line-height: 1.55;
}

.catalogue-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 14px;
}

.catalogue-filter-grid .full-span {
    grid-column: 1 / -1;
}

.catalogue-check {
    align-self: end;
    min-height: 44px;
}

.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.catalogue-load-more {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 10px 0 2px;
}

.catalogue-card {
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 26px;
    background: white;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.catalogue-card:hover,
.catalogue-card.selected {
    transform: translateY(-3px);
    border-color: rgba(249, 115, 22, 0.42);
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.16);
}

.catalogue-card-image {
    position: relative;
    height: 230px;
}

.catalogue-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 8px 12px;
    color: white;
    font-size: 12px;
    font-weight: 900;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(10px);
}

.catalogue-card-body {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.catalogue-card-body h3 {
    margin: 0;
    color: #0f172a;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.catalogue-specs,
.catalogue-sheet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.catalogue-specs.large {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 12px 0 18px;
}

.catalogue-specs > div,
.catalogue-sheet-grid .summary-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-muted);
}

.catalogue-specs span,
.catalogue-sheet-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.catalogue-specs strong,
.catalogue-sheet-grid strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
}

.catalogue-detail-card {
    margin-bottom: 28px;
}

.catalogue-sheet {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: white;
}

.catalogue-sheet-hero {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
    gap: 22px;
    margin-bottom: 20px;
}

.catalogue-sheet-image {
    min-height: 310px;
    border-radius: 22px;
}

.catalogue-info-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.catalogue-info-columns section {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
}

.catalogue-info-columns h3,
.catalogue-sheet h3 {
    margin: 0 0 10px;
    color: #0f172a;
}

.model-options-section {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 247, 237, 0.86), rgba(248, 250, 252, 0.96));
}

.model-options-list,
.model-option-group {
    display: grid;
    gap: 12px;
}

.model-option-group h3 {
    margin: 8px 0 0;
    color: #0f172a;
}

.model-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.model-option-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.model-option-card strong,
.model-option-card small {
    display: block;
}

.model-option-card small,
.catalogue-options-list span {
    color: var(--muted);
}

.option-quantity {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.option-quantity input {
    width: 72px;
    min-height: 34px;
    padding: 6px 8px;
}

.catalogue-options-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin: 12px 0 20px;
}

.catalogue-options-list section {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
}

.catalogue-options-list h4 {
    margin: 0 0 10px;
    color: var(--primary-dark);
}

.catalogue-options-list div {
    display: grid;
    gap: 3px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.catalogue-options-list div:first-of-type {
    border-top: 0;
}

@media (max-width: 980px) {
    .estimate-piece-edit-row {
        grid-template-columns: 1fr;
    }

    .estimate-piece-edit-meta,
    .estimate-piece-edit-row .danger-button {
        grid-column: auto;
    }

    #liste-pieces .selectable-piece-card,
    #liste-pieces .calculation-pieces-control {
        grid-template-columns: 1fr;
    }

    #liste-pieces .calculation-pieces-control {
        align-items: flex-start;
        flex-direction: column;
    }

    .estimate-pieces-editor-head {
        display: grid;
    }

    .catalogue-feature,
    .catalogue-sheet-hero,
    .catalogue-info-columns,
    .catalogue-insights-header {
        grid-template-columns: 1fr;
    }

    .catalogue-insights-header {
        display: grid;
        align-items: start;
    }

    .catalogue-filter-grid,
    .catalogue-questionnaire-grid,
    .catalogue-specs.large {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalogue-questionnaire-summary {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .catalogue-filter-grid,
    .catalogue-questionnaire-grid,
    .catalogue-specs,
    .catalogue-specs.large,
    .catalogue-sheet-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-quick-modal {
        padding: 10px;
        align-items: end;
    }

    .model-form-modal {
        padding: 10px;
        align-items: end;
    }

    .kit-workflow-modal {
        padding: 10px;
        align-items: end;
    }

    .client-modal {
        padding: 10px;
        align-items: end;
    }

    .project-modal {
        padding: 10px;
        align-items: end;
    }

    .quote-modal {
        padding: 10px;
        align-items: end;
    }

    .installation-modal {
        padding: 10px;
        align-items: end;
    }

    .inventory-modal {
        padding: 10px;
        align-items: end;
    }

    .quote-preview-modal {
        padding: 10px;
        align-items: end;
    }

    .dashboard-quick-modal-card {
        max-height: 92vh;
        padding: 20px;
        border-radius: 24px 24px 12px 12px;
    }

    .dashboard-widget-detail-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-widget-project-link {
        width: 100%;
    }

    .model-form-modal-card {
        max-height: 92vh;
        padding: 20px;
        border-radius: 24px 24px 12px 12px;
    }

    .kit-workflow-modal-card {
        max-height: 92vh;
        padding: 20px;
        border-radius: 24px 24px 12px 12px;
    }

    .client-modal-card {
        max-height: 92vh;
        padding: 20px;
        border-radius: 24px 24px 12px 12px;
    }

    .project-workflow-modal-card {
        max-height: 92vh;
        padding: 20px;
        border-radius: 24px 24px 12px 12px;
    }

    .quote-workflow-modal-card {
        max-height: 92vh;
        padding: 20px;
        border-radius: 24px 24px 12px 12px;
    }

    .installation-workflow-modal-card {
        max-height: 92vh;
        padding: 20px;
        border-radius: 24px 24px 12px 12px;
    }

    .inventory-modal-card {
        max-height: 92vh;
        padding: 20px;
        border-radius: 24px 24px 12px 12px;
    }

    .quote-preview-modal-card {
        max-height: 92vh;
        padding: 20px;
        border-radius: 24px 24px 12px 12px;
    }

    .dashboard-quick-modal-actions {
        grid-template-columns: 1fr;
        margin-top: 16px;
        padding-top: 14px;
    }

    .model-form-modal-actions {
        grid-template-columns: 1fr;
        margin-top: 16px;
        padding-top: 14px;
    }

    .kit-workflow-modal-actions {
        grid-template-columns: 1fr;
        margin-top: 16px;
        padding-top: 14px;
    }

    .dashboard-quick-info-grid,
    .dashboard-quick-checklist {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: letter;
        margin: 12mm;
    }

    body {
        background: white;
        color: #111827;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .sidebar,
    .hero-panel,
    .import-export-card,
    .estimate-workflow-card,
    .installation-planner-card,
    .inventory-table-card,
    .quote-preview-card .inventory-toolbar,
    .quote-preview-modal-backdrop,
    .quote-preview-modal-close,
    .installation-print-card .inventory-toolbar,
    .admin-links,
    .button-group,
    .save-status,
    .catalogue-insights-panel,
    #catalogue-filters,
    #catalogue-grid,
    .catalogue-detail-card .inventory-toolbar,
    .no-print {
        display: none !important;
    }

    .app-shell,
    .dashboard {
        display: block;
        min-height: auto;
        padding: 0;
    }

    .quote-preview-card,
    .quote-preview-modal-card,
    .installation-print-card,
    .quote-document,
    .catalogue-detail-card,
    .catalogue-sheet {
        display: block !important;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: white;
    }

    body.printing-quote-document .inventory-page > :not(.quote-preview-card),
    body.printing-client-document .dashboard > :not(.client-document-card),
    body.printing-installation-document .dashboard > :not(.installation-print-card) {
        display: none !important;
    }

    body.printing-quote-document .quote-preview-card,
    body.printing-quote-document .quote-preview-modal-card,
    body.printing-client-document .client-document-card,
    body.printing-installation-document .installation-print-card {
        display: block !important;
        width: 100% !important;
    }

    body.printing-quote-document .quote-preview-card,
    body.printing-quote-document .quote-preview-modal-card {
        position: static !important;
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body.printing-quote-document .quote-preview,
    body.printing-client-document .quote-preview,
    body.printing-installation-document .quote-preview {
        margin-top: 0;
    }

    body.printing-quote-document .quote-document,
    body.printing-client-document .quote-document,
    body.printing-installation-document .quote-document {
        width: 100% !important;
        max-width: none;
        color: #111827;
        font-size: 10.5pt;
        line-height: 1.42;
        overflow: visible;
        orphans: 3;
        widows: 3;
    }

    body.printing-model-detail .sidebar,
    body.printing-model-detail .hero-panel,
    body.printing-model-detail .container > .section:not(:first-child),
    body.printing-model-detail .container > .section:first-child > :not(#model-details),
    body.printing-model-detail .model-detail-modal-backdrop,
    body.printing-model-detail .model-detail-modal-close,
    body.printing-model-detail .model-detail-actions {
        display: none !important;
    }

    body.printing-model-detail .container,
    body.printing-model-detail .container > .section:first-child,
    body.printing-model-detail #model-details,
    body.printing-model-detail .model-detail-modal-card,
    body.printing-model-detail .model-detail-body {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: white !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    body.printing-model-detail .model-detail-layout {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 14px;
    }

    body.printing-model-detail .model-detail-media,
    body.printing-model-detail .model-detail-placeholder {
        min-height: 160px;
        max-height: 220px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.printing-model-detail .model-detail-content h3 {
        font-size: 20pt;
    }

    body.printing-model-detail .model-detail-specs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    body.printing-model-detail .model-detail-specs div,
    body.printing-model-detail .model-detail-manuals,
    body.printing-model-detail .model-detail-options-preview {
        padding: 7px;
        border-radius: 8px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.printing-inventory-detail .sidebar,
    body.printing-inventory-detail .hero-panel,
    body.printing-inventory-detail .inventory-table-card,
    body.printing-inventory-detail .inventory-modal-backdrop,
    body.printing-inventory-detail .inventory-modal-close,
    body.printing-inventory-detail .inventory-modal-actions,
    body.printing-inventory-detail .header-import-export,
    body.printing-inventory-detail .admin-links {
        display: none !important;
    }

    body.printing-inventory-detail .inventory-page,
    body.printing-inventory-detail #inventory-detail-modal,
    body.printing-inventory-detail .inventory-detail-modal-card,
    body.printing-inventory-detail .inventory-detail-body {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: white !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    body.printing-inventory-detail .inventory-detail-specs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    body.printing-inventory-detail .inventory-detail-specs div,
    body.printing-inventory-detail .inventory-detail-note {
        padding: 7px;
        border-radius: 8px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .quote-document h2 {
        margin: 0 0 6px;
        font-size: 19pt;
        line-height: 1.16;
    }

    .quote-document h3 {
        margin: 11px 0 6px;
        font-size: 12.5pt;
        line-height: 1.25;
        break-after: avoid;
        page-break-after: avoid;
    }

    .quote-document p {
        margin: 4px 0;
        overflow-wrap: anywhere;
    }

    .quote-header {
        grid-template-columns: minmax(0, 1fr) 88px;
        gap: 12px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .quote-header img {
        width: 82px;
        max-height: 70px;
        object-fit: contain;
    }

    .quote-grid,
    .quote-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 9px;
    }

    .quote-detail-grid > div,
    .quote-grid > div {
        min-width: 0;
        padding: 8px;
        border-radius: 8px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .quote-grid strong,
    .quote-detail-grid strong {
        display: block;
        font-size: 8.5pt;
        line-height: 1.2;
        text-transform: uppercase;
    }

    .quote-grid p,
    .quote-detail-grid p {
        margin-top: 3px;
        line-height: 1.3;
    }

    .quote-table {
        margin: 10px 0;
        table-layout: fixed;
        font-size: 9.5pt;
    }

    .quote-table th,
    .quote-table td {
        padding: 6px 7px;
        vertical-align: top;
        overflow-wrap: anywhere;
    }

    .quote-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .quote-table th:nth-child(2),
    .quote-table td:nth-child(2) {
        width: 48px;
        text-align: center;
    }

    .quote-table th:last-child,
    .quote-table td:last-child {
        width: 92px;
    }

    .quote-totals {
        max-width: 300px;
        margin-top: 8px;
        font-size: 10pt;
    }

    .quote-totals div {
        padding: 5px 0;
    }

    .quote-modification-item,
    .project-scenario-document-item {
        margin: 8px 0;
        padding: 9px;
        border-radius: 10px;
        break-inside: auto;
        page-break-inside: auto;
    }

    .project-scenario-document-layout {
        grid-template-columns: 105px minmax(0, 1fr);
        gap: 10px;
        break-inside: auto;
        page-break-inside: auto;
    }

    .project-scenario-image {
        width: 105px;
        min-height: 84px;
        aspect-ratio: 4 / 3;
    }

    .project-scenario-document-layout.without-image {
        display: block;
    }

    .quote-plan-summary {
        margin: 8px 0 10px;
        padding: 9px;
        border-radius: 10px;
        break-inside: auto;
        page-break-inside: auto;
    }

    .quote-plan-summary h3,
    .quote-modification-item h3,
    .project-scenario-document-item h3 {
        break-after: avoid;
        page-break-after: avoid;
    }

    .quote-plan-table {
        font-size: 9pt;
    }

    .quote-plan-table th,
    .quote-plan-table td {
        padding: 5px 6px;
    }

    .quote-acceptance-block {
        margin-top: 14px;
        padding-top: 10px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .signature-grid > div,
    .quote-signature-grid > div {
        min-height: 54px;
        padding: 8px;
    }

    .quote-header,
    .quote-grid,
    .quote-totals,
    .quote-acceptance-block,
    .signature-grid {
        page-break-inside: avoid;
    }

    .project-summary-document .quote-grid,
    .project-summary-document .quote-detail-grid,
    .project-summary-document .quote-modification-item,
    .project-summary-document .project-scenario-document-item {
        page-break-inside: auto;
        break-inside: auto;
    }

    .quote-plan-drawing {
        max-height: 190px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .quote-signature-grid,
    .signature-grid,
    .quote-acceptance-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .sidebar {
        padding: 18px;
    }

    .step-nav,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        justify-content: stretch;
    }

    .action-bar button {
        width: 100%;
    }

    .project-document-callout {
        align-items: stretch;
        flex-direction: column;
    }
}

.invoice-payments-admin {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.app-version-badge {
    display: block;
    margin: auto 14px 10px;
    color: var(--muted, #667085);
    font-size: 11px;
    text-align: center;
}

.invoice-payment-admin-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) minmax(90px, auto) minmax(120px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-top: 1px solid var(--border, #d9dee7);
}

.invoice-payment-admin-row.cancelled {
    opacity: 0.58;
    text-decoration: line-through;
}

.invoice-payment-row-actions {
    display: flex;
    gap: 6px;
}

.commercial-workspace-summary {
    position: sticky;
    top: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: -4px 0 10px;
    overflow: hidden;
    border: 1px solid var(--border, #d9dde2);
    border-radius: 8px;
    background: var(--border, #d9dde2);
    box-shadow: 0 8px 18px rgba(22, 27, 32, 0.08);
}

.commercial-workspace-summary > div {
    min-width: 0;
    padding: 10px 12px;
    background: #fff;
}

.commercial-workspace-summary span,
.commercial-workspace-summary small {
    display: block;
    overflow: hidden;
    color: var(--muted, #626b75);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commercial-workspace-summary span {
    font-weight: 800;
    text-transform: uppercase;
}

.commercial-workspace-summary strong {
    display: block;
    overflow: hidden;
    margin: 3px 0;
    color: var(--text, #20242a);
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commercial-workspace-summary .warning {
    box-shadow: inset 3px 0 0 #d97706;
}

.commercial-workspace-summary .success {
    box-shadow: inset 3px 0 0 #16803c;
}

.installation-commercial-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 14px 0 18px;
    overflow: hidden;
    border: 1px solid var(--border, #d9dde2);
    border-radius: 8px;
    background: var(--border, #d9dde2);
}

.installation-commercial-summary > div {
    min-width: 0;
    padding: 11px 12px;
    background: #fff;
}

.installation-commercial-summary span,
.installation-commercial-summary small {
    display: block;
    color: var(--muted, #626b75);
    font-size: 11px;
}

.installation-commercial-summary span {
    font-weight: 800;
    text-transform: uppercase;
}

.installation-commercial-summary strong {
    display: block;
    margin: 3px 0;
    overflow-wrap: anywhere;
}

.installation-commercial-summary .warning {
    box-shadow: inset 3px 0 0 #d97706;
}

.installation-commercial-summary .success {
    box-shadow: inset 3px 0 0 #16803c;
}

.commercial-section-nav {
    position: sticky;
    top: 76px;
    z-index: 7;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 18px;
    padding: 4px;
    border: 1px solid var(--border, #d9dde2);
    border-radius: 8px;
    background: #f5f6f7;
}

.commercial-section-nav button {
    min-height: 38px;
    padding: 7px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted, #626b75);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
}

.commercial-section-nav button:hover,
.commercial-section-nav button:focus-visible,
.commercial-section-nav button.active {
    color: #fff;
    outline: none;
    background: #343a42;
}

.commercial-section-anchor {
    scroll-margin-top: 142px;
}

#commercial-payments-panel,
#commercial-invoice-panel,
#commercial-installation-section {
    scroll-margin-top: 142px;
}

.commercial-prerequisite {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 16px 0;
    padding: 16px;
    border: 1px solid #e4c36a;
    border-radius: 8px;
    background: #fff9e8;
}

.commercial-prerequisite p {
    margin: 4px 0 0;
    color: var(--muted, #626b75);
}

.commercial-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--border, #d9dde2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 22px rgba(22, 27, 32, 0.09);
}

.commercial-actions-menu {
    position: relative;
}

.commercial-actions-menu > summary {
    display: grid;
    min-height: 42px;
    place-items: center;
    padding: 9px 18px;
    border: 1px solid var(--border, #d9dde2);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.commercial-actions-menu > summary::-webkit-details-marker {
    display: none;
}

.commercial-actions-menu-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    width: min(310px, 80vw);
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border, #d9dde2);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(22, 27, 32, 0.18);
}

.commercial-actions-menu-panel button {
    width: 100%;
    min-height: 38px;
    text-align: left;
}

.field-error-message {
    margin-top: 5px;
    color: #b42318;
    font-size: 12px;
    font-weight: 750;
}

.configuration-document-preview-card {
    width: min(920px, 100%);
    max-height: min(92vh, 900px);
    overflow-y: auto;
}

.configuration-document-readiness {
    margin: 12px 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--border, #d9dde2);
    border-radius: 8px;
}

.configuration-document-readiness p {
    margin: 4px 0 0;
}

.configuration-document-readiness.error {
    border-color: #f0a5a0;
    color: #8f1d18;
    background: #fff4f3;
}

.configuration-document-readiness.success {
    border-color: #9bd2ac;
    color: #145c2d;
    background: #f0fbf3;
}

#estimate-editor [aria-invalid="true"] {
    border-color: #d92d20 !important;
    outline: 2px solid rgba(217, 45, 32, 0.12);
}

@media (max-width: 760px) {
    .commercial-workspace-summary {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .installation-commercial-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .commercial-section-nav {
        position: static;
        display: flex;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
    }

    .commercial-section-nav button {
        min-width: 112px;
        flex: 0 0 auto;
    }

    .commercial-prerequisite,
    .commercial-action-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .commercial-action-bar > button,
    .commercial-actions-menu,
    .commercial-actions-menu > summary {
        width: 100%;
    }

    .commercial-actions-menu-panel {
        position: fixed;
        right: 12px;
        bottom: 76px;
        left: 12px;
        width: auto;
        max-height: 58vh;
        overflow-y: auto;
    }
}

@media (max-width: 720px) {
    .invoice-payment-admin-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Version optimale: shell applicatif compact, neutre et accessible. */
:root {
    --bg: #20242a;
    --bg-soft: #171a1f;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --surface-muted: #f5f6f7;
    --text: #20242a;
    --muted: #626b75;
    --border: #d9dde2;
    --shadow: 0 10px 28px rgba(22, 27, 32, 0.1);
    --radius-lg: 8px;
    --radius-md: 8px;
    --radius-sm: 6px;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: #eceff1;
}

.app-shell {
    --sidebar-column-width: 268px;
    grid-template-columns: 268px minmax(0, 1fr);
    background: linear-gradient(
        to right,
        #171a1f 0,
        #171a1f var(--sidebar-column-width),
        #eceff1 var(--sidebar-column-width),
        #eceff1 100%
    );
}

@media (min-width: 1181px) {
    .sidebar-collapsed .app-shell {
        --sidebar-column-width: 88px;
    }

    .sidebar-collapsed .global-app-nav {
        display: none;
    }
}

.sidebar {
    padding: 18px;
    background: #171a1f;
    backdrop-filter: none;
}

@media (min-width: 1181px) {
    .sidebar {
        position: relative;
        top: auto;
        align-self: stretch;
        width: auto;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .sidebar-utility {
        position: relative;
        top: auto;
    }

    .sidebar-collapsed .sidebar {
        overflow-x: clip;
        overflow-y: visible;
    }
}

.brand-card,
.sidebar-note,
.sidebar-tools,
.sidebar-utility,
.step-link,
.global-app-nav a {
    border-radius: 8px;
}

.brand-mark,
.brand-mark img,
.session-avatar,
.step-link span {
    border-radius: 6px;
}

.global-app-nav {
    display: grid;
    gap: 7px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.global-app-nav-group {
    min-width: 0;
}

.global-app-nav-group > summary {
    position: relative;
    min-height: 32px;
    padding: 8px 28px 8px 10px;
    color: rgba(255, 255, 255, 0.56);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    list-style: none;
    cursor: pointer;
    border-radius: 6px;
}

.global-app-nav-group > summary::-webkit-details-marker {
    display: none;
}

.global-app-nav-group > summary::after {
    position: absolute;
    top: 50%;
    right: 10px;
    content: '+';
    transform: translateY(-50%);
    font-size: 15px;
}

.global-app-nav-group[open] > summary::after {
    content: '\2212';
}

.global-app-nav-group > summary:hover,
.global-app-nav-group > summary:focus-visible {
    color: #fff;
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.global-app-nav-links {
    display: grid;
    gap: 3px;
    padding-top: 2px;
}

.global-app-nav-title {
    margin: 0 8px 5px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.global-app-nav a {
    min-height: 40px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.global-app-nav a:hover,
.global-app-nav a:focus-visible,
.global-app-nav a.active {
    color: #fff;
    outline: none;
    background: #343a42;
}

.global-app-nav a.active {
    box-shadow: inset 3px 0 0 var(--primary);
}

.admin-links {
    display: none;
}

.dashboard {
    padding: 24px;
    min-width: 0;
}

.app-shell,
.dashboard-page,
.inventory-page,
.inventory-layout,
.inventory-table-card,
.clients-layout,
.client-directory-card,
.table-wrap {
    min-width: 0;
    max-width: 100%;
}

.table-wrap {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    margin-top: 16px;
    padding-top: 12px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
}

.pagination-bar:empty {
    display: none;
}

.pagination-bar > div {
    display: flex;
    gap: 8px;
}

.pagination-bar button {
    min-height: 40px;
    padding: 0 14px;
    color: var(--text);
    border: 1px solid var(--border);
    background: #fff;
}

.pagination-bar button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.inventory-toolbar:has(.inventory-filters) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.inventory-toolbar:has(.inventory-filters) > .inventory-filters {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}

.hero-panel,
.dashboard-card,
.result-panel,
.stat-card,
.section,
.inventory-table-card,
.pipeline-card,
.accounting-card {
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: 22px;
}

.hero-panel h2 {
    font-size: 32px;
    line-height: 1.08;
    letter-spacing: 0;
}

.button-link,
button,
input,
select,
textarea,
.category-pill,
.status-pill {
    border-radius: 6px;
}

.button-link,
.dashboard-header-action.primary,
.header-import-export .button-link {
    background: var(--primary);
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.62);
    outline-offset: 2px;
}

:where(button, .button-link, .admin-link, .model-row-action, .client-modal-action, .inventory-modal-action) {
    min-height: 42px;
}

.mobile-app-header,
.mobile-sidebar-overlay {
    display: none;
}

@media (max-width: 1180px) {
    .configuration-jump-nav,
    .dashboard-view-tabs {
        top: 56px;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .app-shell {
        display: block;
        background: #eceff1;
    }

    .mobile-app-header {
        position: sticky;
        top: 0;
        z-index: 3200;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        min-height: 56px;
        padding: 8px 14px;
        color: #fff;
        background: #171a1f;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
    }

    .mobile-app-header strong {
        overflow: hidden;
        font-size: 15px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .mobile-header-actions > a,
    .mobile-notification-button {
        display: grid;
        place-items: center;
        width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0;
        color: #fff;
        border: 0;
        font-weight: 900;
        text-decoration: none;
        border-radius: 6px;
        background: var(--primary);
    }

    .mobile-notification-button {
        position: relative;
        background: #2b3037;
    }

    .mobile-notification-button .notification-toggle-label {
        display: none;
    }

    .mobile-notification-button .notification-bell-icon {
        width: 38px;
        height: 38px;
    }

    .mobile-notification-button .notification-count-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 19px;
        height: 19px;
        padding: 0 4px;
        font-size: 9px;
    }

    .mobile-menu-button {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-height: 40px;
        padding: 0 10px;
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: #2b3037;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 3400;
        display: flex;
        flex-direction: column;
        width: min(86vw, 330px);
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        touch-action: pan-y;
        padding-bottom: max(24px, env(safe-area-inset-bottom));
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 18px 0 48px rgba(0, 0, 0, 0.3);
    }

    body.mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.mobile-sidebar-open {
        overflow: hidden;
    }

    .admin-settings-shortcut {
        display: none;
    }

    .global-app-nav {
        margin-top: 12px;
        padding-top: 12px;
    }

    .mobile-sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 3300;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(18, 21, 25, 0.62);
    }

    body.mobile-sidebar-open .mobile-sidebar-overlay {
        display: block;
    }

    .step-nav {
        grid-template-columns: 1fr;
    }

    .step-link {
        justify-content: flex-start;
        min-height: 44px;
        font-size: 13px;
    }

    .demo-mode-global-alert {
        top: 56px;
    }

    .dashboard {
        padding: 16px;
    }

    .dashboard-page .hero-panel.inventory-hero,
    .hero-panel:has(.header-import-export) {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .dashboard {
        padding: 12px;
    }

    .inventory-toolbar:has(.inventory-filters) {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .inventory-toolbar:has(.inventory-filters) > .inventory-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .inventory-toolbar:has(.inventory-filters) > .inventory-actions > * {
        width: 100%;
    }

    .hero-panel,
    .dashboard-card,
    .result-panel,
    .section,
    .inventory-table-card {
        padding: 14px;
    }

    .hero-panel h2 {
        font-size: 26px;
    }

    .hero-copy {
        font-size: 15px;
    }
}

.header-action-menu,
.document-action-menu {
    position: relative;
    width: min(100%, 360px);
    min-width: 0;
    align-self: start;
}

.header-action-menu > summary,
.document-action-menu > summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 42px 0 14px;
    color: #0f172a;
    border: 1px solid rgba(100, 116, 139, 0.34);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    list-style: none;
}

.header-action-menu > summary::-webkit-details-marker,
.document-action-menu > summary::-webkit-details-marker {
    display: none;
}

.header-action-menu > summary::after,
.document-action-menu > summary::after {
    position: absolute;
    right: 15px;
    content: '\2304';
    color: var(--muted);
    font-size: 18px;
}

.header-action-menu[open] > summary,
.document-action-menu[open] > summary,
.header-action-menu > summary:hover,
.document-action-menu > summary:hover,
.header-action-menu > summary:focus-visible,
.document-action-menu > summary:focus-visible {
    border-color: rgba(249, 115, 22, 0.5);
    outline: none;
    box-shadow: 0 12px 28px rgba(249, 115, 22, 0.14);
}

.header-action-menu .header-import-export,
.document-action-menu .inventory-actions {
    width: 100%;
    max-width: none;
    margin-top: 8px;
}

.document-action-menu .inventory-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

@media (max-width: 860px) {
    .header-action-menu,
    .document-action-menu {
        width: 100%;
    }
}

/* Contrat responsive commun pour toutes les fenêtres de l'application. */
@media screen {
    :is(
        .client-modal,
        .inventory-modal,
        .model-form-modal,
        .model-detail-modal,
        .dashboard-quick-modal,
        .kit-workflow-modal,
        .quote-preview-modal
    ) {
        --modal-edge: clamp(12px, 2vw, 24px);
        z-index: 5000;
        max-width: 100vw;
        max-height: 100dvh;
        padding: var(--modal-edge);
        overflow: hidden;
        overscroll-behavior: contain;
        isolation: isolate;
    }

    :is(
        .client-modal-card,
        .inventory-modal-card,
        .model-form-modal-card,
        .model-detail-modal-card,
        .dashboard-quick-modal-card,
        .kit-workflow-modal-card,
        .quote-preview-modal-card
    ) {
        max-width: calc(100vw - var(--modal-edge) - var(--modal-edge));
        max-height: calc(100dvh - var(--modal-edge) - var(--modal-edge));
        min-width: 0;
        min-height: 0;
        overflow-x: hidden;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    :is(
        .client-modal-close,
        .inventory-modal-close,
        .model-form-modal-close,
        .model-detail-modal-close,
        .dashboard-quick-modal-close,
        .kit-workflow-modal-close,
        .quote-preview-modal-close
    ) {
        position: sticky;
        top: 0;
        right: auto;
        z-index: 20;
        flex: 0 0 auto;
        align-self: flex-end;
        margin: 0 0 -38px auto;
    }

    :is(
        .dashboard-quick-modal-body,
        .model-form-modal-body,
        .kit-workflow-modal-body,
        .client-modal-form,
        .client-reminder-modal-form,
        .client-reminder-modal-list,
        .client-workflow-modal-body,
        .project-workflow-modal-body,
        .quote-workflow-modal-body,
        .installation-workflow-modal-body,
        .inventory-modal-form
    ) {
        min-width: 0;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    :is(
        .modal-action-row,
        .client-modal-actions,
        .inventory-modal-actions,
        .model-form-modal-actions,
        .kit-workflow-modal-actions,
        .dashboard-quick-modal-actions
    ) {
        position: sticky;
        bottom: 0;
        z-index: 15;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        flex: 0 0 auto;
        gap: 10px;
        margin-top: 14px;
        padding: 12px 0 0;
        border-top: 1px solid rgba(203, 213, 225, 0.9);
        background: linear-gradient(180deg, rgba(248, 250, 252, 0), #f8fafc 12px);
    }

    :is(
        .modal-action-row,
        .client-modal-actions,
        .inventory-modal-actions,
        .model-form-modal-actions,
        .kit-workflow-modal-actions,
        .dashboard-quick-modal-actions
    ) > :is(button, a, label) {
        min-width: 0;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    :is(
        .client-modal-card,
        .inventory-modal-card,
        .model-form-modal-card,
        .model-detail-modal-card,
        .dashboard-quick-modal-card,
        .kit-workflow-modal-card,
        .quote-preview-modal-card
    ) :is(input, select, textarea, button, a, label) {
        max-width: 100%;
    }

    .order-conversion-modal-card .commercial-workspace-summary {
        position: static;
    }

    .order-acceptance-choice > * {
        min-width: 0;
    }
}

@media screen and (max-width: 640px) {
    :is(
        .client-modal,
        .inventory-modal,
        .model-form-modal,
        .model-detail-modal,
        .dashboard-quick-modal,
        .kit-workflow-modal,
        .quote-preview-modal
    ) {
        --modal-edge: 0px;
        align-items: end;
        padding: 0;
    }

    :is(
        .client-modal-card,
        .inventory-modal-card,
        .model-form-modal-card,
        .model-detail-modal-card,
        .dashboard-quick-modal-card,
        .kit-workflow-modal-card,
        .quote-preview-modal-card
    ) {
        width: 100%;
        max-width: 100vw;
        max-height: 100dvh;
        padding: 16px;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 8px 8px 0 0;
    }

    :is(
        .modal-action-row,
        .client-modal-actions,
        .inventory-modal-actions,
        .model-form-modal-actions,
        .kit-workflow-modal-actions,
        .dashboard-quick-modal-actions
    ) {
        grid-template-columns: 1fr;
    }

    :is(
        .client-modal-card,
        .inventory-modal-card,
        .model-form-modal-card,
        .model-detail-modal-card,
        .dashboard-quick-modal-card,
        .kit-workflow-modal-card,
        .quote-preview-modal-card
    ) .card-heading h2 {
        padding-right: 42px;
        font-size: 22px;
        line-height: 1.15;
    }

    .quick-modal-toolbar {
        flex-wrap: nowrap;
        max-width: 100%;
        padding-bottom: 6px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-gutter: stable;
    }

    .quick-modal-toolbar > * {
        flex: 0 0 auto;
    }
}

/* Estimation rapide vendeur */
.quick-estimate-modal-card {
    width: min(1180px, 100%);
    max-height: calc(100dvh - 32px);
    padding: 22px;
    border-radius: 8px;
    background: #f8fafc;
}

.quick-estimate-heading {
    align-items: flex-start;
    margin-right: 44px;
}

.quick-estimate-heading .help-text {
    max-width: 760px;
    margin-top: 5px;
}

.quick-estimate-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    gap: 6px;
    margin-top: 16px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #eef2f7;
}

.quick-estimate-steps button {
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #475569;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
    cursor: pointer;
}

.quick-estimate-steps button.active {
    border-color: #cbd5e1;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.quick-estimate-steps button:focus-visible {
    outline: 3px solid rgba(249, 115, 22, 0.28);
    outline-offset: 1px;
}

.quick-estimate-modal-body {
    display: block;
    margin-top: 12px;
    padding: 0 4px 2px 0;
}

.quick-estimate-modal-body > .save-status:not(:empty) {
    margin-bottom: 10px;
}

.quick-estimate-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.7fr);
    gap: 18px;
    align-items: start;
}

.quick-estimate-form,
.quick-estimate-panel,
.quick-estimate-grid,
.quick-estimate-field {
    min-width: 0;
}

.quick-estimate-panel {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.quick-estimate-panel[hidden] {
    display: none;
}

.quick-estimate-panel-head,
.quick-estimate-panel-head > div,
.quick-estimate-recommendation-head,
.quick-estimate-levels-head {
    display: flex;
    align-items: center;
}

.quick-estimate-panel-head,
.quick-estimate-recommendation-head,
.quick-estimate-levels-head {
    justify-content: space-between;
    gap: 12px;
}

.quick-estimate-panel-head {
    margin-bottom: 16px;
}

.quick-estimate-panel-head > div {
    gap: 9px;
}

.quick-estimate-panel-head > div > span {
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
}

.quick-estimate-panel-head h3 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
    letter-spacing: 0;
}

.quick-estimate-panel-head small,
.quick-estimate-recommendation-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.quick-estimate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.quick-estimate-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-estimate-field {
    display: grid;
    align-content: start;
    gap: 6px;
}

.quick-estimate-field.wide {
    grid-column: 1 / -1;
}

.quick-estimate-field > span,
.quick-estimate-floor-row label > span {
    color: #334155;
    font-size: 12px;
    font-weight: 850;
}

.quick-estimate-field :is(input, select, textarea),
.quick-estimate-floor-row :is(input, select) {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 14px;
}

.quick-estimate-field textarea {
    min-height: 116px;
    resize: vertical;
}

.quick-estimate-field :is(input, select, textarea):focus,
.quick-estimate-floor-row :is(input, select):focus {
    border-color: var(--primary);
    outline: 3px solid rgba(249, 115, 22, 0.14);
}

.quick-estimate-recommendation-head,
.quick-estimate-levels-head {
    margin: 20px 0 9px;
}

.quick-estimate-recommendations {
    display: grid;
    gap: 7px;
    max-height: 310px;
    overflow-y: auto;
    padding-right: 3px;
}

.quick-estimate-model {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    width: 100%;
    min-height: 72px;
    padding: 8px;
    border: 1px solid #dbe2ea;
    border-radius: 5px;
    background: #fff;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.quick-estimate-model:hover,
.quick-estimate-model:focus-visible,
.quick-estimate-model.selected {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.08);
}

.quick-estimate-model.selected {
    background: #fff7ed;
}

.quick-estimate-model > img,
.quick-estimate-model-placeholder {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background: #111827;
    color: #fff;
    object-fit: cover;
    font-size: 12px;
    font-weight: 900;
}

.quick-estimate-model-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.quick-estimate-model-copy :is(strong, small, em) {
    min-width: 0;
    overflow-wrap: anywhere;
}

.quick-estimate-model-copy small,
.quick-estimate-model-copy em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.quick-estimate-model-copy .quick-estimate-model-reason {
    color: #166534;
}

.quick-estimate-model-copy .quick-estimate-model-warning {
    color: #9a3412;
}

.quick-estimate-model-score {
    min-width: 42px;
    padding: 5px 7px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.quick-estimate-floor-list {
    display: grid;
    gap: 8px;
}

.quick-estimate-floor-row {
    display: grid;
    grid-template-columns: minmax(130px, 1.2fr) minmax(100px, 0.7fr) minmax(100px, 0.7fr) 38px;
    gap: 8px;
    align-items: end;
}

.quick-estimate-floor-row label {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.quick-estimate-floor-remove {
    display: grid;
    place-items: center;
    width: 38px;
    height: 42px;
    border: 1px solid #fecaca;
    border-radius: 4px;
    background: #fff;
    color: #b91c1c;
    font-size: 22px;
    cursor: pointer;
}

.quick-estimate-geometry {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.quick-estimate-preview {
    position: sticky;
    top: 0;
    display: grid;
    gap: 9px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f1f5f9;
}

.quick-estimate-preview-head {
    padding-bottom: 10px;
    border-bottom: 1px solid #cbd5e1;
}

.quick-estimate-preview-head strong {
    display: block;
    margin-top: 3px;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.quick-estimate-preview-block {
    display: grid;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid #dbe2ea;
}

.quick-estimate-preview-block:last-child {
    border-bottom: 0;
}

.quick-estimate-preview-block > strong {
    color: #0f172a;
    font-size: 13px;
}

.quick-estimate-preview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 8px;
    align-items: start;
    font-size: 12px;
}

.quick-estimate-preview-row span {
    color: var(--muted);
}

.quick-estimate-preview-row b {
    color: #334155;
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}

.quick-estimate-modal-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 12px;
    background: #f8fafc;
}

.quick-estimate-modal-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

.quick-estimate-modal-actions #qe-save-draft {
    order: -1;
}

@media (max-width: 900px) {
    .quick-estimate-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .quick-estimate-preview {
        position: static;
    }

    .quick-estimate-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .quick-estimate-modal-card {
        height: 100dvh;
        max-height: 100dvh;
        padding: 14px;
        border-radius: 0;
    }

    .quick-estimate-heading {
        margin-right: 34px;
    }

    .quick-estimate-heading .step-badge {
        display: none;
    }

    .quick-estimate-heading .help-text {
        font-size: 12px;
    }

    .quick-estimate-steps {
        display: flex;
        max-width: 100%;
        margin-top: 10px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .quick-estimate-steps button {
        flex: 0 0 auto;
        min-width: 92px;
    }

    .quick-estimate-modal-body {
        margin-top: 8px;
    }

    .quick-estimate-panel {
        padding: 14px;
    }

    .quick-estimate-panel-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .quick-estimate-grid,
    .quick-estimate-grid.three {
        grid-template-columns: minmax(0, 1fr);
    }

    .quick-estimate-floor-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
    }

    .quick-estimate-floor-row label:first-child {
        grid-column: 1 / -1;
    }

    .quick-estimate-model {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .quick-estimate-model > img,
    .quick-estimate-model-placeholder {
        width: 48px;
        height: 48px;
    }

    .quick-estimate-model-score {
        grid-column: 2;
        justify-self: start;
    }

    .quick-estimate-modal-actions {
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
        max-height: 190px;
        overflow-y: auto;
        padding-top: 9px;
    }

    .quick-estimate-modal-actions .dashboard-modal-action {
        min-height: 42px;
    }
}

/* Page de creation de projet */
.project-create-dashboard {
    min-width: 0;
}

.project-create-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.34fr);
    gap: 28px;
    align-items: end;
}

.project-create-hero-status {
    display: grid;
    gap: 5px;
    padding-left: 22px;
    border-left: 3px solid var(--primary);
}

.project-create-hero-status span,
.project-create-hero-status p {
    color: var(--muted);
    font-size: 12px;
}

.project-create-hero-status strong {
    color: #0f172a;
    font-size: 19px;
}

.quick-estimate-page {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    box-shadow: var(--shadow);
}

.quick-estimate-page[data-qe-ready="false"] .quick-estimate-form {
    opacity: 0.6;
    pointer-events: none;
}

.project-create-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

.project-create-heading h2 {
    margin: 3px 0 0;
    color: #0f172a;
}

.project-create-heading .help-text {
    max-width: 780px;
    margin-top: 5px;
}

.project-create-optional {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 11px;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
}

.project-create-workspace {
    scroll-margin-top: 82px;
}

.project-create-preview {
    top: 18px;
}

.project-completion-panel {
    display: grid;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #cbd5e1;
}

.project-completion-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.project-completion-head strong {
    display: block;
    margin-top: 2px;
    color: #0f172a;
    font-size: 15px;
}

#qe-completion-percent {
    color: var(--primary-dark);
    font-size: 22px;
    font-weight: 900;
}

.project-completion-meter {
    height: 8px;
    overflow: hidden;
    border-radius: 4px;
    background: #dbe2ea;
}

.project-completion-meter span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--primary);
    transition: width 220ms ease;
}

.project-completion-required {
    margin: 0;
    color: #b45309;
    font-size: 12px;
    font-weight: 800;
}

.project-completion-required.ready {
    color: #166534;
}

.project-completion-list {
    display: grid;
    gap: 5px;
}

.project-completion-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid #dbe2ea;
    border-left: 3px solid #94a3b8;
    border-radius: 4px;
    background: #fff;
    color: #334155;
    text-align: left;
    cursor: pointer;
}

.project-completion-row:hover,
.project-completion-row:focus-visible {
    border-color: var(--primary);
    outline: none;
}

.project-completion-row.partial {
    border-left-color: #f59e0b;
}

.project-completion-row.complete {
    border-left-color: #16a34a;
}

.project-completion-row-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.project-completion-row-copy strong,
.project-completion-row-copy small {
    overflow-wrap: anywhere;
}

.project-completion-row-copy strong {
    color: #0f172a;
    font-size: 12px;
}

.project-completion-row-copy small {
    color: var(--muted);
    font-size: 10px;
}

.project-completion-row b {
    min-width: 34px;
    color: #475569;
    font-size: 11px;
    text-align: right;
}

.quick-estimate-steps button[data-completion="partial"] {
    box-shadow: inset 0 -2px #f59e0b;
}

.quick-estimate-steps button[data-completion="complete"] {
    box-shadow: inset 0 -2px #16a34a;
}

.quick-project-created {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #86efac;
    border-radius: 5px;
    background: #f0fdf4;
}

.quick-project-created.hidden {
    display: none;
}

.quick-project-created strong {
    color: #166534;
}

.quick-project-created p {
    margin: 0;
    color: #475569;
    font-size: 12px;
}

.quick-project-created .button-link {
    justify-content: center;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 12px;
}

.quick-estimate-page-actions {
    position: sticky;
    z-index: 4;
    bottom: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: rgba(248, 250, 252, 0.96);
    box-shadow: 0 -6px 22px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
}

.quick-estimate-page-actions .dashboard-modal-action {
    min-width: 0;
    white-space: normal;
}

@media (max-width: 900px) {
    .project-create-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-create-hero-status {
        padding-left: 0;
        padding-top: 12px;
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .quick-estimate-page-actions {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .quick-estimate-page {
        padding: 14px;
        border-radius: 6px;
    }

    .project-create-heading {
        display: grid;
        gap: 10px;
    }

    .project-create-optional {
        justify-self: start;
        white-space: normal;
    }

    .quick-estimate-page .quick-estimate-steps {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .quick-estimate-page .quick-estimate-steps button {
        min-width: 0;
        white-space: normal;
    }

    .quick-estimate-page .quick-estimate-steps button:last-child {
        grid-column: 1 / -1;
    }

    .quick-estimate-page-actions {
        grid-template-columns: minmax(0, 1fr);
        max-height: none;
        overflow: visible;
    }
}

.quick-estimate-allocation-table {
    display: grid;
    gap: 7px;
    margin-top: 18px;
    overflow-x: auto;
}

.quick-estimate-allocation-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) repeat(4, minmax(120px, 1fr));
    gap: 8px;
    align-items: center;
    min-width: 700px;
}

.quick-estimate-allocation-row.heading {
    padding: 0 8px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.quick-estimate-allocation-row:not(.heading) {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #f8fafc;
}

.quick-estimate-allocation-row > strong {
    color: #334155;
    font-size: 13px;
}

.quick-estimate-allocation-row input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    font: inherit;
}

/* Project workspace containment must win over legacy dashboard sizing. */
.project-workspace-page .app-shell,
.project-workspace-page .project-workspace-dashboard,
.project-workspace-page .project-workspace-header,
.project-workspace-page .workspace-stage-band,
.project-workspace-page .workspace-stage-rail,
.project-workspace-page .workspace-tabs,
.project-workspace-page .workspace-panel,
.project-workspace-page .workspace-section,
.project-workspace-page .workspace-followup-layout > *,
.project-workspace-page .workspace-form-grid > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.project-workspace-page .workspace-stage-band {
    overflow: hidden;
}

.project-workspace-page .workspace-stage-rail,
.project-workspace-page .workspace-tabs {
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.project-workspace-page .workspace-upload-form,
.project-workspace-page .workspace-upload-form > *,
.project-workspace-page .workspace-upload-form input[type="file"] {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 900px) {
    .project-workspace-page .workspace-upload-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .project-workspace-page .dashboard.project-workspace-dashboard {
        padding: 12px;
    }
}

/* Densité locale par poste: compacte la mise en page sans zoomer le document. */
@media screen and (min-width: 1181px) {
    html[data-ui-density="compact"] body {
        font-size: 15px;
    }

    html[data-ui-density="compact"] .app-shell {
        --sidebar-column-width: 238px;
        grid-template-columns: 238px minmax(0, 1fr);
    }

    html[data-ui-density="dense"] .app-shell {
        --sidebar-column-width: 218px;
        grid-template-columns: 218px minmax(0, 1fr);
    }

    html[data-ui-density].sidebar-collapsed .app-shell {
        --sidebar-column-width: 88px;
        grid-template-columns: 88px minmax(0, 1fr);
    }

    html[data-ui-density="compact"] .sidebar {
        padding: 14px;
    }

    html[data-ui-density="dense"] .sidebar {
        padding: 12px;
    }

    html[data-ui-density="compact"] .dashboard {
        padding: 18px;
    }

    html[data-ui-density="dense"] .dashboard {
        padding: 14px;
    }

    html[data-ui-density="compact"] :is(.brand-card, .session-badge) {
        gap: 10px;
        padding: 12px;
    }

    html[data-ui-density="dense"] :is(.brand-card, .session-badge) {
        gap: 8px;
        padding: 10px;
    }

    html[data-ui-density="compact"] .brand-mark {
        width: 46px;
        height: 46px;
    }

    html[data-ui-density="dense"] .brand-mark {
        width: 42px;
        height: 42px;
    }

    html[data-ui-density="compact"] .global-app-nav {
        gap: 4px;
        margin-top: 14px;
        padding-top: 12px;
    }

    html[data-ui-density="dense"] .global-app-nav {
        gap: 2px;
        margin-top: 10px;
        padding-top: 9px;
    }

    html[data-ui-density="compact"] .global-app-nav-group > summary {
        min-height: 28px;
        padding-block: 6px;
        font-size: 10px;
    }

    html[data-ui-density="dense"] .global-app-nav-group > summary {
        min-height: 26px;
        padding-block: 5px;
        font-size: 10px;
    }

    html[data-ui-density="compact"] .global-app-nav a {
        min-height: 36px;
        padding: 8px 10px;
        font-size: 12px;
    }

    html[data-ui-density="dense"] .global-app-nav a {
        min-height: 33px;
        padding: 7px 9px;
        font-size: 12px;
    }

    html[data-ui-density="compact"] :is(.step-nav, .sidebar-utility) {
        gap: 6px;
    }

    html[data-ui-density="dense"] :is(.step-nav, .sidebar-utility) {
        gap: 4px;
    }

    html[data-ui-density="compact"] .step-link {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 12px;
    }

    html[data-ui-density="dense"] .step-link {
        min-height: 36px;
        padding: 7px 9px;
        font-size: 12px;
    }

    html[data-ui-density="compact"] .hero-panel {
        gap: 18px;
        padding: 18px;
    }

    html[data-ui-density="dense"] .hero-panel {
        gap: 14px;
        padding: 16px;
    }

    html[data-ui-density="compact"] .hero-panel h2 {
        font-size: 28px;
    }

    html[data-ui-density="dense"] .hero-panel h2 {
        font-size: 26px;
    }

    html[data-ui-density="compact"] .hero-copy,
    html[data-ui-density="dense"] .hero-copy {
        margin-top: 10px;
        font-size: 14px;
    }

    html[data-ui-density="compact"] .hero-action-row,
    html[data-ui-density="dense"] .hero-action-row {
        gap: 8px;
        margin-top: 13px;
    }

    html[data-ui-density="compact"] :is(.dashboard-card, .result-panel, .section, .inventory-table-card) {
        padding: 19px;
    }

    html[data-ui-density="dense"] :is(.dashboard-card, .result-panel, .section, .inventory-table-card) {
        padding: 16px;
    }

    html[data-ui-density="compact"] .stats-grid {
        gap: 12px;
        margin: 16px 0;
    }

    html[data-ui-density="dense"] .stats-grid {
        gap: 9px;
        margin: 12px 0;
    }

    html[data-ui-density="compact"] .stat-card {
        gap: 10px;
        min-height: 88px;
        padding: 14px;
    }

    html[data-ui-density="dense"] .stat-card {
        gap: 8px;
        min-height: 80px;
        padding: 12px;
    }

    html[data-ui-density="compact"] .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 19px;
    }

    html[data-ui-density="dense"] .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }

    html[data-ui-density="compact"] :is(.dashboard-command-grid, .dashboard-insight-grid, .dashboard-triple-grid, .dashboard-summary-grid) {
        gap: 16px;
        margin-bottom: 16px;
    }

    html[data-ui-density="dense"] :is(.dashboard-command-grid, .dashboard-insight-grid, .dashboard-triple-grid, .dashboard-summary-grid) {
        gap: 12px;
        margin-bottom: 12px;
    }

    html[data-ui-density="compact"] .card-heading {
        gap: 10px;
        margin-bottom: 14px;
    }

    html[data-ui-density="dense"] .card-heading {
        gap: 8px;
        margin-bottom: 11px;
    }

    html[data-ui-density="compact"] .step-badge {
        width: 39px;
        height: 39px;
    }

    html[data-ui-density="dense"] .step-badge {
        width: 36px;
        height: 36px;
    }

    html[data-ui-density="compact"] .card-heading h2 {
        font-size: 20px;
    }

    html[data-ui-density="dense"] .card-heading h2 {
        font-size: 19px;
    }

    html[data-ui-density="compact"] .form-grid {
        gap: 12px;
    }

    html[data-ui-density="dense"] .form-grid {
        gap: 9px;
    }

    html[data-ui-density="compact"] :is(.input-group, .model-group) {
        margin-bottom: 12px;
    }

    html[data-ui-density="dense"] :is(.input-group, .model-group) {
        margin-bottom: 9px;
    }

    html[data-ui-density="compact"] label,
    html[data-ui-density="dense"] label {
        margin-bottom: 6px;
        font-size: 12px;
    }

    html[data-ui-density="compact"] :is(select, input[type="number"], input[type="text"], input[type="date"], input[type="email"], input[type="tel"], input[type="search"], textarea) {
        min-height: 42px;
        padding: 9px 11px;
        font-size: 14px;
    }

    html[data-ui-density="dense"] :is(select, input[type="number"], input[type="text"], input[type="date"], input[type="email"], input[type="tel"], input[type="search"], textarea) {
        min-height: 39px;
        padding: 8px 10px;
        font-size: 13px;
    }

    html[data-ui-density="compact"] :where(button, .button-link, .admin-link, .model-row-action, .client-modal-action, .inventory-modal-action) {
        min-height: 38px;
    }

    html[data-ui-density="dense"] :where(button, .button-link, .admin-link, .model-row-action, .client-modal-action, .inventory-modal-action) {
        min-height: 36px;
    }

    html[data-ui-density="compact"] .dashboard-global-search {
        gap: 9px;
        padding: 14px 16px;
    }

    html[data-ui-density="dense"] .dashboard-global-search {
        gap: 7px;
        padding: 12px 14px;
    }

    html[data-ui-density="compact"] .dashboard-global-search-heading h2 {
        font-size: 21px;
    }

    html[data-ui-density="dense"] .dashboard-global-search-heading h2 {
        font-size: 19px;
    }
}

/* Installation workspace: compact register, explicit workflow tabs and local documents. */
.installations-page .installation-card.installation-register-entry {
    padding: 0;
    border-radius: 8px;
    box-shadow: none;
}

.installation-register-entry.expanded {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.installation-register-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.85fr) minmax(180px, 1.15fr) minmax(220px, 1.35fr) minmax(170px, 1fr) minmax(100px, 0.55fr) 28px;
    gap: 16px;
    align-items: center;
    width: 100%;
    min-height: 82px;
    padding: 14px 18px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #172033;
    text-align: left;
    cursor: pointer;
}

.installation-register-row:hover,
.installation-register-row:focus-visible {
    background: rgba(255, 255, 255, 0.72);
}

.installation-register-row > span {
    min-width: 0;
}

.installation-register-row strong,
.installation-register-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.installation-register-row strong {
    font-size: 14px;
    line-height: 1.35;
}

.installation-register-row small {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.installation-register-date small {
    margin: 0 0 4px;
    color: #c2410c;
    font-weight: 800;
    text-transform: uppercase;
}

.installation-register-balance {
    text-align: right;
}

.installation-register-chevron {
    display: grid !important;
    width: 28px;
    height: 28px;
    place-items: center;
    color: #64748b;
    font-size: 20px;
    transition: transform 160ms ease;
}

.installation-register-row[aria-expanded="true"] .installation-register-chevron {
    transform: rotate(180deg);
}

.installation-card-detail {
    padding: 18px;
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.82);
}

.installation-detail-summary {
    margin: 14px 0;
}

.installation-detail-note {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #e2e8f0;
}

.installation-detail-note p {
    margin: 0;
    color: #475569;
}

.installation-card-actions {
    justify-content: flex-start;
    margin-top: 16px;
}

.installation-workflow-modal-card,
.installation-related-document-modal-card {
    width: min(1080px, calc(100vw - 32px));
    max-height: min(94vh, 900px);
    padding: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.installation-workflow-modal-body,
.installation-related-document-body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.installation-workflow-modal-body > .installation-planner-card,
.installation-workflow-modal-body > .installation-print-card {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.installation-workflow-modal-body > .installation-planner-card > .card-heading,
.installation-workflow-modal-body > .installation-print-card > .inventory-toolbar {
    display: none;
}

.installation-planner-context {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
    border: 1px solid #dbe3ed;
    border-radius: 8px;
    background: #f8fafc;
}

.installation-planner-context > div {
    min-width: 0;
    padding: 12px 14px;
    border-right: 1px solid #dbe3ed;
}

.installation-planner-context > div:last-child {
    border-right: 0;
}

.installation-planner-context span,
.installation-planner-context strong,
.installation-planner-context small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.installation-planner-context span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.installation-planner-context strong {
    margin-top: 4px;
    font-size: 14px;
}

.installation-planner-context small {
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
}

.installation-form-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 8px;
    padding: 4px;
    border: 1px solid #dbe3ed;
    border-radius: 8px;
    background: #eef2f7;
}

.installation-form-tabs button {
    min-height: 42px;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.installation-form-tabs button:hover,
.installation-form-tabs button:focus-visible {
    background: #ffffff;
    color: #0f172a;
}

.installation-form-tabs button.active {
    background: #172033;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
}

.installation-form-section {
    min-width: 0;
    padding-top: 12px;
}

.installation-form-section[hidden] {
    display: none !important;
}

.installation-section-heading {
    margin-bottom: 12px;
}

.installation-section-heading h3,
.installation-section-heading p {
    margin: 0;
}

.installation-section-heading > p:last-child {
    margin-top: 4px;
    color: #64748b;
}

.installation-form-actions {
    position: sticky;
    z-index: 3;
    bottom: 0;
    margin-top: 16px;
    padding: 12px 0 0;
    border-top: 1px solid #dbe3ed;
    background: #ffffff;
}

.installation-form-more-actions {
    position: relative;
}

.installation-form-more-actions > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    list-style: none;
    cursor: pointer;
}

.installation-form-more-actions > summary::-webkit-details-marker {
    display: none;
}

.installation-form-more-actions > summary::after {
    margin-left: 8px;
    content: "⌄";
    font-size: 16px;
}

.installation-form-more-actions[open] > summary::after {
    transform: rotate(180deg);
}

.installation-form-more-panel {
    position: absolute;
    z-index: 12;
    bottom: calc(100% + 7px);
    left: 0;
    display: grid;
    width: min(260px, calc(100vw - 56px));
    gap: 6px;
    padding: 8px;
    border: 1px solid #dbe3ed;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.installation-form-more-panel > button {
    width: 100%;
    justify-content: flex-start;
}

.installation-related-document-toolbar {
    flex: 0 0 auto;
    padding-right: 34px;
}

.installation-related-document-body {
    flex: 1 1 auto;
    padding: 4px;
}

.installation-related-document-body .quote-document {
    margin: 0;
    border-radius: 8px;
}

@media (max-width: 1050px) {
    .installation-register-row {
        grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1fr) minmax(170px, 1fr) minmax(95px, 0.55fr) 28px;
    }

    .installation-register-row > span:nth-child(3) {
        display: none;
    }
}

@media (max-width: 760px) {
    .installation-register-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 12px;
        min-height: 76px;
        padding: 12px 14px;
    }

    .installation-register-row > span:nth-child(3),
    .installation-register-row > span:nth-child(4) {
        display: none;
    }

    .installation-register-row > span:nth-child(1),
    .installation-register-row > span:nth-child(2),
    .installation-register-row > span:nth-child(5) {
        grid-column: 1;
    }

    .installation-register-row > span:nth-child(5) {
        text-align: left;
    }

    .installation-register-chevron {
        grid-column: 2;
        grid-row: 1 / span 3;
    }

    .installation-planner-context {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .installation-planner-context > div:nth-child(2) {
        border-right: 0;
    }

    .installation-planner-context > div:nth-child(-n+2) {
        border-bottom: 1px solid #dbe3ed;
    }

    .installation-form-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .installation-workflow-modal-card,
    .installation-related-document-modal-card {
        width: 100%;
        max-height: 94vh;
        padding: 14px;
        border-radius: 8px 8px 0 0;
    }

    .installation-card-actions > :is(button, a),
    .installation-form-actions > :is(button, a) {
        width: 100%;
        justify-content: center;
    }

    .installation-form-actions {
        position: static;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .installation-form-more-actions,
    .installation-form-more-actions > summary {
        width: 100%;
    }

    .installation-form-more-panel {
        position: static;
        width: 100%;
        margin-top: 6px;
        box-shadow: none;
    }

    .installation-detail-note {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }
}

@media (max-width: 460px) {
    .installation-form-tabs button {
        min-height: 46px;
        font-size: 12px;
    }
}

/* Dossier client complet: lecture a l'ecran et document papier suivent la meme structure. */
#client-section-modal.client-document-modal .client-workflow-modal-card {
    width: min(1320px, 100%);
    max-height: min(96vh, 1040px);
}

#client-section-modal.client-document-modal .client-workflow-modal-body {
    padding: 12px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #eef2f5;
}

#client-section-modal.client-document-modal .client-workflow-modal-card > .client-modal-actions {
    display: none;
}

.client-workflow-modal-body #client-document-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.client-document-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.client-document-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.client-document-options {
    margin: 0 0 12px;
    padding: 10px 12px 12px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    background: #fff;
}

.client-document-options legend {
    padding: 0 7px;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.client-document-option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.client-document-option-grid .mini-toggle {
    justify-content: flex-start;
    margin: 0;
    border: 1px solid #dbe2ea;
    border-radius: 6px;
    background: #f8fafc;
}

.client-document-card .quote-preview {
    margin-top: 0;
}

.client-profile-document {
    width: min(100%, 1060px);
    margin: 0 auto;
    padding: 28px;
    border-color: #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.client-document-cover {
    align-items: stretch;
    margin: -28px -28px 0;
    padding: 28px;
    border: 0;
    background: #15191f;
    color: #fff;
}

.client-document-cover .eyebrow {
    color: #fb6a16;
}

.client-document-cover h2 {
    margin: 5px 0 14px;
    color: #fff;
    font-size: 34px;
    line-height: 1.05;
}

.client-document-cover img {
    align-self: start;
    width: min(120px, 100%);
    max-width: 100%;
    padding: 8px;
    border-radius: 6px;
    background: #fff;
}

.client-document-cover > div,
.client-document-project-title,
.client-document-stage-header > div {
    min-width: 0;
}

.client-document-cover h2,
.client-document-contact-list span,
.client-document-project-title h3,
.client-document-stage-header h4 {
    overflow-wrap: anywhere;
}

.client-document-contact-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 18px;
    color: #dbe2ea;
    font-size: 13px;
}

.client-document-contact-list span:last-child {
    grid-column: 1 / -1;
}

.client-document-contact-list strong {
    display: block;
    margin-bottom: 2px;
    color: #94a3b8;
    font-size: 10px;
    text-transform: uppercase;
}

.client-document-generated {
    margin: 16px 0 0;
    color: #94a3b8;
    font-size: 11px;
}

.client-document-overview {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0 -28px 24px;
    border-bottom: 1px solid #dbe2ea;
    background: #f8fafc;
}

.client-document-overview > div {
    min-width: 0;
    padding: 15px 12px;
    border-right: 1px solid #dbe2ea;
}

.client-document-overview > div:last-child {
    border-right: 0;
}

.client-document-overview span,
.client-document-overview strong {
    display: block;
}

.client-document-overview span {
    margin-bottom: 4px;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.client-document-overview strong {
    color: #111827;
    font-size: 20px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.client-document-overview .financial strong {
    color: #c2410c;
    font-size: 16px;
}

.client-document-client-note,
.client-document-note {
    margin: 14px 0;
    padding: 12px 14px;
    border-left: 4px solid #fb6a16;
    background: #fff7ed;
}

.client-document-client-note span,
.client-document-note strong {
    color: #9a3412;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.client-document-client-note p,
.client-document-note p {
    margin: 4px 0 0;
}

.client-document-projects-heading {
    margin: 28px 0 12px;
    padding-top: 18px;
    border-top: 2px solid #111827;
}

.client-document-projects-heading h3 {
    margin: 2px 0 0;
    font-size: 23px;
}

.client-document-project {
    margin: 0 0 28px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.client-document-project-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 18px 20px;
    background: #111827;
    color: #fff;
}

.client-document-project-index {
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 5px;
    color: #fb6a16;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.client-document-project-title p {
    margin: 0 0 2px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.client-document-project-title h3 {
    margin: 0;
    color: #fff;
    font-size: 23px;
}

.client-document-project-meta {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.client-document-project-meta > strong {
    color: #fff;
    font-size: 15px;
}

.client-document-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #475569;
    background: #e2e8f0;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
    white-space: nowrap;
}

.client-document-status.success {
    color: #166534;
    background: #dcfce7;
}

.client-document-status.active {
    color: #9a3412;
    background: #ffedd5;
}

.client-document-status.danger {
    color: #991b1b;
    background: #fee2e2;
}

.client-document-progress {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-bottom: 1px solid #dbe2ea;
    background: #f8fafc;
}

.client-document-progress-step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 5px;
    min-width: 0;
    padding: 12px 6px;
    color: #94a3b8;
    font-size: 10px;
    text-align: center;
}

.client-document-progress-step:not(:last-child)::after {
    position: absolute;
    top: 23px;
    right: -50%;
    z-index: 0;
    width: 100%;
    height: 2px;
    background: #cbd5e1;
    content: '';
}

.client-document-progress-step span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    font-weight: 900;
}

.client-document-progress-step.complete {
    color: #166534;
}

.client-document-progress-step.complete span,
.client-document-progress-step.complete::after {
    border-color: #16a34a;
    background: #dcfce7;
}

.client-document-progress-step.current {
    color: #9a3412;
}

.client-document-progress-step.current span {
    border-color: #fb6a16;
    background: #fff7ed;
}

.client-document-stages {
    padding: 0 20px 18px;
}

.client-document-stage {
    border-bottom: 1px solid #dbe2ea;
}

.client-document-stage:last-child {
    border-bottom: 0;
}

.client-document-stage-header {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    padding: 16px 0 10px;
}

.client-document-stage-number {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 5px;
    color: #fff;
    background: #fb6a16;
    font-size: 12px;
    font-weight: 900;
}

.client-document-stage-eyebrow {
    margin: 0 0 1px;
    color: #c2410c;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.client-document-stage-header h4 {
    margin: 0;
    color: #111827;
    font-size: 16px;
}

.client-document-stage-body {
    padding: 0 0 16px 49px;
}

.client-document-project-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-document-record-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.client-document-record-title h4 {
    margin: 0;
}

.client-document-empty {
    margin: 4px 0;
    padding: 12px;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    background: #f8fafc;
}

.client-document-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-document-timeline .timeline-event {
    border-radius: 6px;
}

.client-document-followup-table th:nth-child(2),
.client-document-followup-table td:nth-child(2),
.client-document-followup-table th:last-child,
.client-document-followup-table td:last-child {
    width: auto;
    text-align: left;
}

.client-document-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    padding-top: 12px;
    border-top: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 10px;
}

@media (max-width: 900px) {
    .client-document-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-document-toolbar-actions {
        justify-content: flex-start;
    }

    .client-document-option-grid,
    .client-document-project-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-document-overview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .client-document-overview > div:nth-child(3n) {
        border-right: 0;
    }
}

@media (max-width: 620px) {
    #client-section-modal.client-document-modal .client-workflow-modal-body {
        padding: 6px;
    }

    .client-document-option-grid,
    .client-document-project-facts,
    .client-document-contact-list,
    .client-document-timeline {
        grid-template-columns: 1fr;
    }

    .client-document-contact-list span:last-child {
        grid-column: auto;
    }

    .client-profile-document {
        padding: 18px;
    }

    .client-document-cover {
        grid-template-columns: minmax(0, 1fr) 72px;
        margin: -18px -18px 0;
        padding: 18px;
    }

    .client-document-cover h2 {
        font-size: 26px;
    }

    .client-document-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 0 -18px 18px;
    }

    .client-document-overview > div:nth-child(3n) {
        border-right: 1px solid #dbe2ea;
    }

    .client-document-overview > div:nth-child(2n) {
        border-right: 0;
    }

    .client-document-project-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .client-document-project-meta {
        grid-column: 1 / -1;
        justify-items: start;
    }

    .client-document-progress {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .client-document-progress-step::after {
        display: none;
    }

    .client-document-stages {
        padding: 0 12px 12px;
    }

    .client-document-stage-header {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .client-document-stage-header .client-document-status {
        grid-column: 2;
        justify-self: start;
    }

    .client-document-stage-number {
        width: 32px;
        height: 32px;
    }

    .client-document-stage-body {
        padding-left: 0;
    }

    .client-document-stage-body > .quote-table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }
}

@media print {
    .client-profile-document {
        width: 100%;
        max-width: none;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        font-size: 9.5pt;
    }

    .client-document-cover {
        margin: 0;
        padding: 18px;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .client-document-cover h2 {
        font-size: 24pt;
    }

    .client-document-overview {
        margin: 0 0 16px;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .client-document-overview > div {
        padding: 9px 8px;
    }

    .client-document-overview strong {
        font-size: 14pt;
    }

    .client-document-projects-heading {
        margin-top: 18px;
    }

    .client-document-project {
        margin: 0;
        border-radius: 0;
        break-before: page;
        page-break-before: always;
    }

    .client-document-project-header,
    .client-document-progress,
    .client-document-stage-number,
    .client-document-status,
    .client-document-client-note,
    .client-document-note {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .client-document-project-header {
        padding: 12px 14px;
    }

    .client-document-project-title h3 {
        font-size: 16pt;
    }

    .client-document-progress-step {
        padding: 8px 4px;
        font-size: 7.5pt;
    }

    .client-document-progress-step:not(:last-child)::after {
        top: 18px;
    }

    .client-document-progress-step span {
        width: 20px;
        height: 20px;
    }

    .client-document-stages {
        padding: 0 14px 10px;
    }

    .client-document-stage-header {
        padding: 10px 0 6px;
        break-after: avoid;
        page-break-after: avoid;
    }

    .client-document-stage-number {
        width: 30px;
        height: 30px;
    }

    .client-document-stage-body {
        padding: 0 0 10px 43px;
    }

    .client-document-stage-body > .quote-grid,
    .client-document-record-title,
    .client-document-followup-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .client-document-timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-document-footer {
        break-before: avoid;
        page-break-before: avoid;
    }
}

/* Les fenetres suivent la densite de l'application sans mise a l'echelle floue. */
@media screen and (min-width: 1181px) {
    html[data-ui-density="compact"] :is(
        .client-modal,
        .inventory-modal,
        .model-form-modal,
        .model-detail-modal,
        .dashboard-quick-modal,
        .kit-workflow-modal,
        .quote-preview-modal
    ) {
        --modal-edge: 12px;
    }

    html[data-ui-density="dense"] :is(
        .client-modal,
        .inventory-modal,
        .model-form-modal,
        .model-detail-modal,
        .dashboard-quick-modal,
        .kit-workflow-modal,
        .quote-preview-modal
    ) {
        --modal-edge: 8px;
    }

    html[data-ui-density="compact"] :is(
        .client-modal-card,
        .inventory-modal-card,
        .model-form-modal-card,
        .model-detail-modal-card,
        .dashboard-quick-modal-card,
        .kit-workflow-modal-card,
        .quote-preview-modal-card
    ) {
        padding: 18px;
        border-radius: 14px;
        font-size: 14px;
    }

    html[data-ui-density="dense"] :is(
        .client-modal-card,
        .inventory-modal-card,
        .model-form-modal-card,
        .model-detail-modal-card,
        .dashboard-quick-modal-card,
        .kit-workflow-modal-card,
        .quote-preview-modal-card
    ) {
        padding: 14px;
        border-radius: 12px;
        font-size: 13px;
    }

    html[data-ui-density="compact"] :is(
        .client-modal-card,
        .inventory-modal-card,
        .model-form-modal-card,
        .model-detail-modal-card,
        .dashboard-quick-modal-card,
        .kit-workflow-modal-card,
        .quote-preview-modal-card
    ) h3 {
        font-size: 17px;
    }

    html[data-ui-density="dense"] :is(
        .client-modal-card,
        .inventory-modal-card,
        .model-form-modal-card,
        .model-detail-modal-card,
        .dashboard-quick-modal-card,
        .kit-workflow-modal-card,
        .quote-preview-modal-card
    ) h3 {
        font-size: 15px;
    }

    html[data-ui-density="compact"] :is(.client-modal-card, .inventory-modal-card, .model-form-modal-card, .model-detail-modal-card, .dashboard-quick-modal-card, .kit-workflow-modal-card, .quote-preview-modal-card) .quote-document {
        padding: 20px;
        border-radius: 14px;
    }

    html[data-ui-density="dense"] :is(.client-modal-card, .inventory-modal-card, .model-form-modal-card, .model-detail-modal-card, .dashboard-quick-modal-card, .kit-workflow-modal-card, .quote-preview-modal-card) .quote-document {
        padding: 16px;
        border-radius: 12px;
    }

    html[data-ui-density="compact"] :is(.client-modal-close, .inventory-modal-close, .model-form-modal-close, .model-detail-modal-close, .dashboard-quick-modal-close, .kit-workflow-modal-close, .quote-preview-modal-close) {
        width: 34px;
        height: 34px;
        font-size: 21px;
    }

    html[data-ui-density="dense"] :is(.client-modal-close, .inventory-modal-close, .model-form-modal-close, .model-detail-modal-close, .dashboard-quick-modal-close, .kit-workflow-modal-close, .quote-preview-modal-close) {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}
