/*
 * mudblazor-fixes.css  —  SafeHouse FMS
 * Place: SafeHouse/wwwroot/css/mudblazor-fixes.css
 *
 * WHY THE PAGES DON'T SCROLL — definitive diagnosis from screenshot:
 *
 * The layout renders correctly (global bar, sidebar, module topbar all
 * appear — so app.css IS loaded and working). The scroll chain is:
 *
 *   .app-shell          height:100vh; overflow:hidden   ← app.css ✓
 *   .app-body           flex:1;       overflow:hidden   ← app.css ✓
 *   .module-shell       flex:1;       overflow:visible  ← app.css ✓
 *   .module-content-wrap flex:1;      overflow:hidden   ← app.css ✓
 *   .page-content       flex:1;       overflow:hidden   ← app.css ✓
 *   .page-main          flex:1;       overflow-y:auto   ← SHOULD SCROLL
 *
 * The CURRENT mudblazor-fixes.css (old version still in project) has:
 *
 *   .module-content-wrap { overflow: visible !important }   ← BREAKS IT
 *   .page-content        { overflow: visible !important }   ← BREAKS IT
 *   .page-main           { overflow-y: auto !important }    ← fine but pointless
 *
 * Setting overflow:visible on .page-content removes the height bound
 * that .page-main needs. page-main then has infinite available height
 * so overflow-y:auto never triggers — content just overflows invisibly.
 *
 * THE FIX: Remove those two lines entirely. The app.css values are
 * correct. This file must NOT override page-content or page-main.
 */

/* ════════════════════════════════════════════════════════════════
   WHAT THIS FILE MUST DO:
   1. Fix MudBlazor popover (theme.css + site.css break it)
   2. Keep module-topbar visible for dropdown menus
   
   WHAT THIS FILE MUST NOT DO:
   - Touch .page-content  (app.css correctly sets overflow:hidden)
   - Touch .page-main     (app.css correctly sets overflow-y:auto)
   - Touch .module-shell  (app.css correctly sets overflow:visible)
   - Touch .module-content-wrap (app.css correctly sets overflow:hidden)
   ════════════════════════════════════════════════════════════════ */

/* ── Fix MudBlazor popover provider ─────────────────────────────
   theme.css sets:  .mud-popover-provider { position: relative !important }
   site.css  sets:  .mud-popover-provider { position: relative !important }
   This breaks MudSelect / MudMenu / MudDatePicker dropdowns.
   position:fixed makes the portal escape all overflow ancestors.      */
.mud-popover-provider {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    z-index: 0 !important; /* provider itself needs no z-index */
    pointer-events: none !important;
}
.mud-popover-provider > * {
    pointer-events: all !important;
}
.mud-popover {
    position: fixed !important;
    z-index: 1500 !important;
}
.mud-popover-content {
    position: static !important;
}

/* ── Module topbar: overflow visible so its dropdown menus float ── */
.module-topbar {
    overflow: visible !important;
    position: relative !important;
    z-index: 10 !important;
}
.mud-overlay {
    z-index: 1300 !important;
}

/* Dialog container — above overlay, below popovers */
.mud-dialog-container {
    z-index: 1400 !important;
}