:root {
    --header-height: 50px;
    --sidebar-width: 250px;
}

/* --- Global Reset --- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #faf9f8;
    overflow: hidden; /* Prevents double scrollbars */
}

/* --- Header Shadow & Depth --- */
fluent-header {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1200;
}

/* --- Footer Styling --- */
.app-footer {
    background-color: #004578; /* Matches Header Blue */
    color: white;
    height: 20px; /* Fixed thin profile */
    flex-shrink: 0;
    z-index: 1200;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- Sidebar Container (The Shell) --- */
.sidebar-menu {
    width: var(--sidebar-width);
    background-color: #ffffff !important; /* Solid white */
    height: 100%;
    border-right: 1px solid #edebe9;
    flex-shrink: 0;
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
    z-index: 1100;
    display: flex;
    flex-direction: column;
}

/* Force Fluent NavMenu to fill the sidebar */
.sidebar-menu fluent-nav-menu {
    width: 100% !important;
    background-color: #ffffff !important;
}

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    min-width: 0; 
    overflow-y: auto;
    background-color: #faf9f8;
    z-index: 1;
}

.content-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Desktop Logic (Wider than 768px) --- */
@media (min-width: 768px) {
    body.sidebar-collapsed .sidebar-menu {
        width: 0;
        border-right: none;
        transform: translateX(-100%);
    }
}

/* --- Mobile/Tablet Logic (Floating Overlay) --- */
@media (max-width: 767.98px) {
    .sidebar-menu {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: 280px;
        background-color: #ffffff !important;
    }

    body.sidebar-open .sidebar-menu {
        transform: translateX(0);
        box-shadow: 10px 0 25px rgba(0,0,0,0.2);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        /* Adjusted to fit between Header and Footer */
        inset: var(--header-height) 0 30px 0; 
        background: rgba(0,0,0,0.5);
        z-index: 1050;
        backdrop-filter: blur(4px);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }
}

/* --- NavMenu Item Polish --- */
fluent-nav-link {
    margin: 4px 8px;
    border-radius: 4px;
    width: calc(100% - 16px) !important;
}

fluent-nav-link:hover {
    background-color: #e1dfdd;
}

/* --- Hamburger Button Utility --- */
.menu-trigger {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.menu-trigger:hover {
    background: rgba(255,255,255,0.1);
}

button:focus {
    outline: none;
}

/* --- Blazor Error UI --- */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}