body.test-workspace-ui.test-page-workspace-open {
    --test-page-sticky-top: var(--test-workspace-navbar-bottom);
    min-height: 100dvh;
    overflow: visible !important;
    background: #f3f6fb;
}

body.test-workspace-ui.test-workspace-variant.test-page-workspace-open {
    --test-page-sticky-top: calc(var(--test-workspace-navbar-bottom) + 38px);
}

body.test-workspace-ui.test-page-workspace-open #app {
    min-height: var(--test-page-sticky-top);
}

body.test-workspace-ui.test-page-workspace-open #app > .navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
}

body.test-workspace-ui.test-workspace-variant.test-page-workspace-open #app > .test-version-bar {
    position: fixed;
    right: 0;
    left: 0;
    width: 100%;
}

body.test-workspace-ui.test-page-workspace-open #app > .main-content {
    display: none !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active {
    position: relative !important;
    inset: auto !important;
    z-index: 1 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: calc(100dvh - var(--test-page-sticky-top));
    padding: 1rem !important;
    overflow: visible !important;
    background: #f3f6fb !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active > .modal-content,
body.test-workspace-ui.test-page-workspace-open #modal.active.modal-side-panel > .modal-content,
body.test-workspace-ui.test-page-workspace-open #modal.active.vehicle-form-modal > .modal-content,
body.test-workspace-ui.test-page-workspace-open #modal.active.prospect-form-modal > .modal-content {
    display: flex !important;
    width: min(1240px, 100%) !important;
    max-width: 1240px !important;
    height: auto !important;
    min-height: calc(100dvh - var(--test-page-sticky-top) - 2rem);
    max-height: none !important;
    margin: 0 auto !important;
    overflow: visible !important;
    flex-direction: column !important;
    border: 1px solid var(--border);
    border-radius: 1rem !important;
    background: var(--surface);
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08) !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active .modal-header,
body.test-workspace-ui.test-page-workspace-open #modal.active.modal-side-panel .modal-header {
    position: sticky !important;
    top: var(--test-page-sticky-top) !important;
    z-index: 80 !important;
    flex: 0 0 auto;
    min-height: 64px;
    padding: 0.85rem 1.15rem !important;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.test-workspace-ui.test-page-workspace-open #modal-title::before {
    content: 'Espace de travail';
    display: block;
    margin-bottom: 0.12rem;
    color: var(--primary);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.test-workspace-ui.test-page-workspace-open #modal-title {
    line-height: 1.2;
}

body.test-workspace-ui .modal-close[data-test-page-close] {
    width: auto !important;
    min-width: 88px;
    flex: 0 0 auto;
    height: 40px;
    gap: 0.35rem;
    padding: 0 0.72rem;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    background: var(--background);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 750;
    white-space: nowrap;
}

body.test-workspace-ui .modal-close[data-test-page-close]:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: var(--primary-dark);
}

body.test-workspace-ui.test-page-workspace-open #modal.active .modal-body,
body.test-workspace-ui.test-page-workspace-open #modal.active.modal-side-panel .modal-body,
body.test-workspace-ui.test-page-workspace-open #modal.active.prospect-form-modal .modal-body {
    flex: 1 0 auto !important;
    min-height: 0;
    height: auto !important;
    padding: 1.15rem !important;
    padding-bottom: 1.5rem !important;
    overflow: visible !important;
    overscroll-behavior: auto;
}

body.test-workspace-ui.test-page-workspace-open #modal.active .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 75;
    flex: 0 0 auto;
    background: var(--surface);
}

body.test-workspace-ui.test-page-workspace-open #modal.active:has(.prospect-dossier) .modal-footer {
    position: static;
}

body.test-workspace-ui.test-page-workspace-open #modal.active .modal-footer .form-actions,
body.test-workspace-ui.test-page-workspace-open #modal.active .modal-footer .prospect-dossier-footer,
body.test-workspace-ui.test-page-workspace-open #modal.active .modal-footer .prospect-form-footer-actions {
    position: static !important;
    margin: 0 !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active .modal-body .form-actions:not(.vehicle-detail-actions) {
    bottom: 0 !important;
    z-index: 75;
    margin-bottom: 0 !important;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

body.test-workspace-ui.test-page-workspace-open #modal.active .sale-dossier,
body.test-workspace-ui.test-page-workspace-open #modal.active .rental-dossier,
body.test-workspace-ui.test-page-workspace-open #modal.active .prospect-dossier,
body.test-workspace-ui.test-page-workspace-open #modal.active .vehicle-send-form {
    width: 100%;
    max-width: none;
}

body.test-workspace-ui.test-page-workspace-open #modal.active .vehicle-send-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

body.test-workspace-ui.test-page-workspace-open #modal.active .vehicle-send-shell,
body.test-workspace-ui.test-page-workspace-open #modal.active .vehicle-send-form > .vehicle-send-message,
body.test-workspace-ui.test-page-workspace-open #modal.active .vehicle-send-form > .form-actions {
    grid-column: 1 / -1;
}

body.test-workspace-ui.test-page-workspace-open #modal.active .vehicle-send-form > .form-actions {
    width: 100%;
    margin-inline: 0 !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active.pdf-viewer-modal {
    padding: 0.75rem !important;
    background: #f3f6fb !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active.pdf-viewer-modal > .modal-content {
    width: min(1400px, 100%) !important;
    max-width: 1400px !important;
    height: calc(100dvh - var(--test-page-sticky-top) - 1.5rem) !important;
    min-height: 520px;
    max-height: none !important;
    overflow: hidden !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active.pdf-viewer-modal .modal-header {
    position: static !important;
    top: auto !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active.pdf-viewer-modal .modal-body,
body.test-workspace-ui.test-page-workspace-open #modal.active.photo-viewer-open .modal-body {
    flex: 1 1 auto !important;
    height: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active.photo-viewer-open > .modal-content {
    width: 100% !important;
    max-width: none !important;
    height: calc(100dvh - var(--test-page-sticky-top) - 0.5rem) !important;
    min-height: 0;
    overflow: hidden !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active.photo-viewer-open {
    padding: 0.25rem !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active.photo-viewer-open .modal-header {
    position: static !important;
    top: auto !important;
    min-height: 52px;
    padding: 0.25rem 0.65rem !important;
}

body.test-workspace-ui.test-page-workspace-open #modal.active.photo-viewer-open #modal-title::before {
    display: none;
}

body.test-workspace-ui.test-page-workspace-open #modal.active.photo-viewer-open #modal-title {
    font-size: 1.05rem;
}

@media (max-width: 900px) {
    body.test-workspace-ui.test-page-workspace-open #modal.active .vehicle-send-form {
        grid-template-columns: 1fr;
    }

    body.test-workspace-ui.test-page-workspace-open #modal.active .vehicle-send-shell,
    body.test-workspace-ui.test-page-workspace-open #modal.active .vehicle-send-form > .vehicle-send-message,
    body.test-workspace-ui.test-page-workspace-open #modal.active .vehicle-send-form > .form-actions {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    body.test-workspace-ui.test-page-workspace-open {
        --test-page-sticky-top: var(--test-workspace-navbar-bottom);
    }

    body.test-workspace-ui.test-workspace-variant.test-page-workspace-open {
        --test-page-sticky-top: calc(var(--test-workspace-navbar-bottom) + 38px);
    }

    body.test-workspace-ui.test-page-workspace-open #modal.active {
        padding: 0 !important;
    }

    body.test-workspace-ui.test-page-workspace-open #modal.active > .modal-content,
    body.test-workspace-ui.test-page-workspace-open #modal.active.modal-side-panel > .modal-content,
    body.test-workspace-ui.test-page-workspace-open #modal.active.vehicle-form-modal > .modal-content,
    body.test-workspace-ui.test-page-workspace-open #modal.active.prospect-form-modal > .modal-content {
        width: 100% !important;
        min-height: calc(100dvh - var(--test-page-sticky-top));
        border-inline: 0;
        border-bottom: 0;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body.test-workspace-ui.test-page-workspace-open #modal.active .modal-header,
    body.test-workspace-ui.test-page-workspace-open #modal.active.modal-side-panel .modal-header {
        min-height: 58px;
        padding: 0.65rem 0.8rem !important;
    }

    body.test-workspace-ui.test-page-workspace-open #modal-title {
        font-size: 1.08rem;
    }

    body.test-workspace-ui.test-page-workspace-open #modal.active .modal-body,
    body.test-workspace-ui.test-page-workspace-open #modal.active.modal-side-panel .modal-body {
        padding: 0.8rem !important;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.test-workspace-ui .modal-close[data-test-page-close] {
        width: auto !important;
        min-width: 76px;
        min-height: 44px;
        padding-inline: 0.6rem;
    }

    body.test-workspace-ui.test-page-workspace-open #modal.active .modal-body .form-actions:not(.vehicle-detail-actions) {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    body.test-workspace-ui.test-page-workspace-open #modal.active.pdf-viewer-modal,
    body.test-workspace-ui.test-page-workspace-open #modal.active.photo-viewer-open {
        padding: 0 !important;
    }

    body.test-workspace-ui.test-page-workspace-open #modal.active.pdf-viewer-modal > .modal-content,
    body.test-workspace-ui.test-page-workspace-open #modal.active.photo-viewer-open > .modal-content {
        height: calc(100dvh - var(--test-page-sticky-top)) !important;
        min-height: calc(100dvh - var(--test-page-sticky-top));
    }
}
