/* Stabilization: service-order and ERP create windows must keep fixed chrome and scroll their body. */
html body .vario-service-order-modal-layer .modal-dialog,
html body .vario-service-order-details-modal-layer .modal-dialog,
html body .vario-erp-create-wizard-modal .modal-dialog,
html[data-vario-theme] body .vario-service-order-modal-layer .modal-dialog,
html[data-vario-theme] body .vario-service-order-details-modal-layer .modal-dialog,
html[data-vario-theme] body .vario-erp-create-wizard-modal .modal-dialog {
    max-height: calc(100vh - 32px) !important;
}

html body .modal-content.vario-service-order-modal,
html body .modal-content.vario-service-order-details-modal,
html body .vario-erp-create-wizard-modal .modal-content,
html[data-vario-theme] body .modal-content.vario-service-order-modal,
html[data-vario-theme] body .modal-content.vario-service-order-details-modal,
html[data-vario-theme] body .vario-erp-create-wizard-modal .modal-content {
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(100vh - 32px) !important;
    overflow: hidden !important;
}

html body .modal-content.vario-service-order-modal>form,
html[data-vario-theme] body .modal-content.vario-service-order-modal>form {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
    max-height: inherit !important;
    overflow: hidden !important;
}

html body .modal-content.vario-service-order-modal>.modal-body.vario-contractor-modal-body,
html body .modal-content.vario-service-order-modal>form>.modal-body.vario-contractor-modal-body,
html body .modal-content.vario-service-order-details-modal>.modal-body.vario-contractor-modal-body,
html body .vario-erp-create-wizard-modal .modal-content>.modal-body.vario-erp-modal-body,
html[data-vario-theme] body .modal-content.vario-service-order-modal>.modal-body.vario-contractor-modal-body,
html[data-vario-theme] body .modal-content.vario-service-order-modal>form>.modal-body.vario-contractor-modal-body,
html[data-vario-theme] body .modal-content.vario-service-order-details-modal>.modal-body.vario-contractor-modal-body,
html[data-vario-theme] body .vario-erp-create-wizard-modal .modal-content>.modal-body.vario-erp-modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 150px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
}

/* Work orders list: keep the page fixed and scroll only the orders grid. */
html .vario-win-content:has(.vario-work-orders-page),
html[data-vario-theme] .vario-win-content:has(.vario-work-orders-page) {
    height: calc(100dvh - 86px) !important;
    max-height: calc(100dvh - 86px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

body:has(.vario-work-orders-page) {
    overflow: hidden !important;
}

html .vario-work-orders-register-pane,
html[data-vario-theme] .vario-work-orders-register-pane {
    display: block !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: auto !important;
    overscroll-behavior: contain !important;
}

html .vario-work-orders-table-scroll,
html[data-vario-theme] .vario-work-orders-table-scroll {
    min-height: 0 !important;
    overflow: visible !important;
}

html .vario-work-orders-table,
html[data-vario-theme] .vario-work-orders-table {
    margin: 0 !important;
    min-width: 1080px !important;
}

html .vario-work-orders-table tbody tr,
html[data-vario-theme] .vario-work-orders-table tbody tr {
    cursor: context-menu !important;
}
