/*
 * Global modal / dialog layering (desktop web).
 * TopBar (.header) uses z-index 1045 in assets/css/style.css.
 * Radzen default dialog z-index is 1001 — below the header without this file.
 * Radzen notifications default to z-index 1002 — below modal masks (1099+) without notification rules below.
 */

:root {
	--muhasobe-app-header-z: 1045;
	--muhasobe-modal-base-z: 1100;
	--muhasobe-modal-backdrop-z: 1099;
	/* Above Radzen/Bootstrap modal stack, InvoiceSettingFormModal (12050), product overlays (10050). */
	--muhasobe-notification-z: 16000;
}

body.muhasobe-mobile-web {
	/* Mobile full-screen Radzen/Bootstrap modals use z-index 2500. */
	--muhasobe-notification-z: 3000;
}

/* Radzen NotificationService toasts — always above modal grey overlays. */
.rz-notification {
	z-index: var(--muhasobe-notification-z) !important;
}

/* Legacy / demo toast plugins (saas landing, admin samples). */
#toast-container,
.toast-container,
.jq-toast-wrap {
	z-index: var(--muhasobe-notification-z) !important;
}

body:not(.muhasobe-mobile-web) {
	--rz-dialog-zindex: var(--muhasobe-modal-base-z);
	--rz-dialog-mask-zindex: var(--muhasobe-modal-backdrop-z);
	--bs-modal-zindex: var(--muhasobe-modal-base-z);
	--bs-backdrop-zindex: var(--muhasobe-modal-backdrop-z);
}

body:not(.muhasobe-mobile-web) .rz-dialog-wrapper,
body:not(.muhasobe-mobile-web) .rz-dialog,
body:not(.muhasobe-mobile-web) .rz-dialog-side {
	z-index: var(--rz-dialog-zindex);
}

body:not(.muhasobe-mobile-web) .modal {
	z-index: var(--muhasobe-modal-base-z);
}

body:not(.muhasobe-mobile-web) .modal-backdrop {
	z-index: var(--muhasobe-modal-backdrop-z);
}

body:not(.muhasobe-mobile-web) .modal.show,
body:not(.muhasobe-mobile-web) .modal.fade.show,
body:not(.muhasobe-mobile-web) .modal.fade.show.d-block,
body:not(.muhasobe-mobile-web) .modal[style*="display: block"],
body:not(.muhasobe-mobile-web) .modal[style*="display:block"] {
	position: fixed;
	inset: 0;
	z-index: var(--muhasobe-modal-base-z);
}
