/* EGB v1.4.0 — documented stacking model. Loaded after legacy style.css.
   Every interactive surface gets its own pair of overlay and foreground
   levels; a popover inside .topbar requires the HEADER to sit above its
   sibling backdrop, not merely a large z-index on the nested popover. */
:root {
  --z-sidebar: 30;
  --z-header: 35;
  --z-filter-overlay: 60;
  --z-filter-panel: 61;
  /* Higher than page cards but below the sticky topbar (35) and dialogs. */
  --z-inline-search-surface: 33;
  --z-mobile-mask: 90;
  --z-mobile-sidebar: 91;
  --z-header-backdrop: 120;
  --z-header-open: 140;
  --z-header-menu: 141;
  --z-search-options: 160;
  --z-chat-backdrop: 300;
  --z-chat-panel: 301;
  --z-assistant-backdrop: 320;
  --z-assistant-panel: 321;
  --z-modal-backdrop: 400;
  --z-modal-panel: 401;
  --z-confirm-backdrop: 500;
  --z-confirm-panel: 501;
  --z-work-backdrop: 600;
  --z-work-panel: 601;
  --z-proposal-backdrop: 620;
  --z-proposal-panel: 621;
  --z-history-backdrop: 640;
  --z-history-panel: 641;
  --z-financial-panel: 701;
  --z-toast: 2000;
}
/* Keep viewport dialogs and search results outside animation-created stacking contexts. */
body[data-theme-runtime] .content > * {animation:none!important;}
/* Shell: avoid accidental stacking contexts on the entire main content. */
body[data-theme-runtime] .topbar {z-index:var(--z-header)!important;}
body[data-theme-runtime] .topbar.theme-menu-open,
body[data-theme-runtime] .topbar:has(.theme-popover),
body[data-theme-runtime] .topbar:has(.notification-popover),
body[data-theme-runtime] .topbar:has(.account-menu) {
  position:relative!important;
  z-index:var(--z-header-open)!important;
  overflow:visible!important;
}
body[data-theme-runtime] .topbar :is(.theme-anchor,.notification-anchor,.account-anchor) {
  position:relative;
  z-index:auto!important;
}
body[data-theme-runtime] :is(.theme-backdrop,.notification-backdrop,.account-backdrop) {
  position:fixed!important;
  inset:0!important;
  z-index:var(--z-header-backdrop)!important;
  background:transparent!important;
}
body[data-theme-runtime] :is(.theme-popover,.notification-popover,.account-menu) {
  z-index:var(--z-header-menu)!important;
  background:var(--theme-surface)!important;
  color:var(--ink)!important;
  border:1px solid var(--theme-border)!important;
  overscroll-behavior:contain;
}
body[data-theme-runtime] .theme-popover{max-height:min(86dvh,800px)!important;overflow:auto!important;}
body[data-theme-runtime] .notification-popover{overflow:hidden!important;}
body[data-theme-runtime] .notification-list{overflow-y:auto!important;overscroll-behavior:contain;}
body[data-theme-runtime] .account-menu{max-height:min(70dvh,640px);overflow-y:auto!important;}
/* Search result menus must raise THEIR PAGE SECTION, not just the list.
   Legacy page-entry animations leave separate stacking contexts on .content > *,
   so increasing .searchable-select-list z-index alone cannot put results above
   subsequent stat cards, tabs or project grids. Only promote the currently
   open control and its containing section; release the elevation on close.
   Keep this below the sticky header, full-screen filters and modal dialogs. */
body[data-theme-runtime] .content > :has(.searchable-select-list:not([hidden])) {
  position:relative;
  z-index:var(--z-inline-search-surface)!important;
  overflow:visible!important;
}
body[data-theme-runtime] .content :is(.panel,.panel-body,.visible-filter-panel,.toolbar,.form-grid,.field,.customer-lookup-row,.card):has(.searchable-select-list:not([hidden])) {
  position:relative;
  z-index:var(--z-inline-search-surface)!important;
  overflow:visible!important;
}
body[data-theme-runtime] .searchable-select:has(.searchable-select-list:not([hidden])) {
  z-index:var(--z-inline-search-surface)!important;
}
body[data-theme-runtime] .searchable-select-list:not([hidden]) {
  overflow-y:auto;
  overscroll-behavior:contain;
}
/* Filters and select menus. Always below the header and any full-screen dialog. */
body[data-theme-runtime] .filter-overlay {z-index:var(--z-filter-overlay)!important;}
body[data-theme-runtime] .project-filter-drawer {z-index:var(--z-filter-panel)!important;}
body[data-theme-runtime] .searchable-select-list {z-index:var(--z-search-options)!important;}
/* Chat, Nova and blocking dialog groups. Toasts must remain legible even in a
   full-screen approval/cancellation. Avoid changing normal table sticky layers. */
body[data-theme-runtime] .chat-backdrop {z-index:var(--z-chat-backdrop)!important;}
body[data-theme-runtime] .chose-chat {z-index:var(--z-chat-panel)!important;}
body[data-theme-runtime] .assistant-overlay-backdrop {z-index:var(--z-assistant-backdrop)!important;}
body[data-theme-runtime] .assistant-overlay {z-index:var(--z-assistant-panel)!important;}
body[data-theme-runtime] .modal-backdrop {z-index:var(--z-modal-backdrop)!important;}
body[data-theme-runtime] .modal-backdrop > .modal {position:relative;z-index:var(--z-modal-panel)!important;}
body[data-theme-runtime] :is(.archive-confirm-backdrop,.project-assistant-backdrop) {z-index:var(--z-confirm-backdrop)!important;}
body[data-theme-runtime] :is(.archive-confirm-dialog,.project-assistant-dialog) {z-index:var(--z-confirm-panel)!important;}
body[data-theme-runtime] :is(.my-tasks-backdrop,.my-detail-backdrop) {z-index:var(--z-work-backdrop)!important;}
body[data-theme-runtime] :is(.my-tasks-dialog,.my-detail-dialog) {z-index:var(--z-work-panel)!important;}
body[data-theme-runtime] :is(.smart-proposal-backdrop,.pipeline-backdrop) {z-index:var(--z-proposal-backdrop)!important;}
body[data-theme-runtime] :is(.smart-proposal-dialog,.pipeline-top-dialog) {z-index:var(--z-proposal-panel)!important;}
body[data-theme-runtime] .project-history-backdrop {z-index:var(--z-history-backdrop)!important;}
body[data-theme-runtime] .project-history-drawer {z-index:var(--z-history-panel)!important;}
body[data-theme-runtime] .financial-cancellation-backdrop {z-index:var(--z-financial-panel)!important;}
body[data-theme-runtime] #toast-root,
#toast-root {position:fixed!important;z-index:var(--z-toast)!important;pointer-events:none;}
#toast-root .toast{pointer-events:auto;}
body[data-theme-runtime] .khulasa-assistant-fab {z-index:45!important;}
/* A keyboard user must see the currently active control in every theme. */
body[data-theme-runtime] :is(.theme-popover,.notification-popover,.account-menu,.modal,.chose-chat,.assistant-overlay,.filter-drawer)
  :is(button,input,select,textarea,a):focus-visible {
  outline:2px solid var(--theme-primary)!important;
  outline-offset:2px!important;
}
@media(max-width:760px){
  body[data-theme-runtime] .mobile-mask {z-index:var(--z-mobile-mask)!important;}
  body[data-theme-runtime] .sidebar.show {z-index:var(--z-mobile-sidebar)!important;}
  body[data-theme-runtime] .theme-popover {max-height:calc(100dvh - 84px)!important;}
  body[data-theme-runtime] :is(.theme-popover,.notification-popover,.account-menu) {max-width:calc(100vw - 24px)!important;}
}
@media(prefers-reduced-motion:reduce){
  body[data-theme-runtime] :is(.theme-popover,.notification-popover,.account-menu,.modal,.chose-chat,.assistant-overlay,.project-history-drawer) {animation:none!important;transition:none!important;}
}
