:root {
    color-scheme: light only;
}

.btn-primary {
    background-color: #1f3165 !important;
}

.active {
    background-color: #1f3165 !important;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding:0;
}

.sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* Fixed width: never let wide page content shrink the sidebar. */
    flex: 0 0 280px;
    width: 280px;
    transition: flex-basis .18s ease, width .18s ease;
}

/* ---- Collapsible sidebar -------------------------------------------------
   Collapsed state is stored in localStorage and reflected as the
   `sidebar-collapsed` class on <html> (set before paint, so no flash).
   Only applies on desktop; on mobile the sidebar is a full off-canvas panel. */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.sidebar-logo {
    flex: 1 1 auto;
    min-width: 0;
}
.sidebar-logo p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-toggle-btn {
    flex: 0 0 auto;
    padding-left: .6rem;
    padding-right: .6rem;
}
/* Beat Bulma's `.menu-list a { display:block }` so items lay out as icon + label. */
.sidebar .sidebar-item {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.sidebar .sidebar-item svg {
    display: block;
}

@media screen and (min-width: 1025px) {
    html.sidebar-collapsed .sidebar {
        flex: 0 0 76px;
        width: 76px;
    }
    html.sidebar-collapsed .sidebar-label,
    html.sidebar-collapsed .sidebar-hide-collapsed,
    html.sidebar-collapsed .sidebar-badge,
    html.sidebar-collapsed .sidebar-logo,
    html.sidebar-collapsed .menu-label {
        display: none !important;
    }
    html.sidebar-collapsed .sidebar-header {
        justify-content: center;
    }
    html.sidebar-collapsed .sidebar .sidebar-item {
        justify-content: center;
        gap: 0;
    }
    html.sidebar-collapsed .sidebar-profile-trigger {
        justify-content: center !important;
    }
    html.sidebar-collapsed .sidebar-avatar {
        margin-right: 0 !important;
    }
    /* Reset Bulma's icon-with-text margins so a lone icon (e.g. the New Check +) centres. */
    html.sidebar-collapsed .sidebar .sidebar-item .icon {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    /* Let the profile hover menu escape the narrow rail instead of being clipped by overflow. */
    html.sidebar-collapsed .sidebar {
        overflow: visible;
    }
    html.sidebar-collapsed #profile-menu {
        width: 240px !important;
    }
}

@media screen and (max-width: 1024px) {
    /* The collapse toggle is a desktop affordance; mobile uses the off-canvas. */
    .sidebar-header .sidebar-toggle-btn {
        display: none;
    }
}

.nav-link:hover {
    background-color: white !important;
}

@media screen and (min-width: 1025px) {
    #secure-navbar {
        display: none !important;
    }
    
}


/* On screens that are less than 1024px wide, hide the sidebar */
@media screen and (max-width: 1024px) {
    .sidebar {
        display: none;
    }
    
    .sidebar.is-active {
        position: fixed;
        top: 0;
        left: 0;
        display: flex !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 9999; /* Ensures it floats above everything */
        background-color: rgba(0, 0, 0, 0.1); /* Optional: adds a subtle overlay background */
    }
    
    /* The actual sidebar content */
    .sidebar.is-active aside {
        width: 280px !important; /* Keep your original sidebar width */
        height: 100vh;
        background-color: #f8f9fa; /* Ensure solid background */
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1); /* Optional: adds depth */
    }
    
    /* Optional: Click-to-close area */
    .sidebar.is-active::after {
        content: '';
        position: absolute;
        top: 0;
        left: 280px; /* Start after the sidebar */
        right: 0;
        bottom: 0;
        background: transparent;
        cursor: pointer;
    }
}


.main-content {
    overflow-y: auto;
    /* Allow this flex item to shrink so wide content scrolls inside it
       instead of squeezing the fixed-width sidebar. */
    min-width: 0;
}
