/* TheaCRM – Bootstrap modal stack and custom overlay contract.
   Layer values are defined once in thea-ui-layers.css. */
body.thea-modal-layer-open .thea-mobile-bottom-nav,
body.thea-modal-layer-open .thea-mobile-quick-add,
body.thea-modal-layer-open .thea-mobile-quick-add-backdrop,
body.thea-modal-layer-open .thea-mobile-main-menu,
body.thea-modal-layer-open .thea-mobile-main-menu-backdrop,
body.thea-modal-layer-open #notificationDropdown,
body.thea-modal-layer-open #mailDropdown,
body.thea-modal-layer-open .thea-top-dropdown{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

/* Fallback only. Managed Bootstrap modal/backdrop pairs receive inline z-indexes. */
.modal-backdrop.show:not(.thea-modal-layer-managed){
  z-index:var(--thea-z-modal-backdrop);
}
.modal.show:not(.thea-modal-layer-managed),
.modal.thea-modal-layer-pending:not(.thea-modal-layer-managed){
  z-index:var(--thea-z-modal);
  pointer-events:auto !important;
}
.modal.show .modal-dialog,
.modal.thea-modal-layer-pending .modal-dialog{
  position:relative;
  z-index:1;
}

/* Modal-like overlays use one semantic tier; blocking progress overlays use the next. */
.thea-ai-reply-backdrop.is-open,
.thea-mail-gallery.is-open,
.thea-email-composer-modal:not([hidden]),
.thea-mobile-email-delete-dialog:not([hidden]),
.project-camera-modal{
  z-index:var(--thea-z-custom-dialog) !important;
}
.thea-upload-local-overlay,
.thea-work-overlay,
.doklady-save-overlay,
#doklady-staging-open-overlay,
.attendance-monitor-overlay,
.monitor-exit-dialog{
  z-index:var(--thea-z-blocking-overlay) !important;
}

@media (max-width:767.98px){
  body.thea-modal-layer-open{
    overflow:hidden !important;
    padding-bottom:0 !important;
  }
}
