/* =====================================================================
   Sidebar scrolling
   ---------------------------------------------------------------------
   The menu grew past the height of the screen once the procurement tools
   were added, and the overlayScrollbars plugin AdminLTE would normally
   use is not loaded (it is commented out in inc/footer.php). Its leftover
   .os-* wrapper markup is therefore inert, so the sidebar is made to
   scroll natively instead, with a slim scrollbar to match the dark theme.
   ===================================================================== */

/* Brand stays put; only the menu below it scrolls. Flex is used rather
   than a calc() height so the brand bar can be any height. */
.main-sidebar {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.main-sidebar .brand-link {
	flex: 0 0 auto;
}

.main-sidebar .sidebar {
	flex: 1 1 auto;
	min-height: 0;            /* lets the flex child actually shrink */
	overflow-y: auto;
	overflow-x: hidden;
}

/* The dormant overlayScrollbars wrappers carry inline heights and their
   own overflow, which would trap the scroll. Neutralise them. */
.main-sidebar .os-padding,
.main-sidebar .os-viewport,
.main-sidebar .os-content {
	height: auto !important;
	width: auto !important;
	overflow: visible !important;
	position: static !important;
}

.main-sidebar .os-content-glue,
.main-sidebar .os-resize-observer-host,
.main-sidebar .os-size-auto-observer,
.main-sidebar .os-scrollbar,
.main-sidebar .os-scrollbar-corner {
	display: none !important;
}

/* Slim scrollbar - Chrome, Edge, Safari */
.main-sidebar .sidebar::-webkit-scrollbar {
	width: 6px;
}

.main-sidebar .sidebar::-webkit-scrollbar-track {
	background: transparent;
}

.main-sidebar .sidebar::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, .22);
	border-radius: 3px;
}

.main-sidebar .sidebar:hover::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, .38);
}

.main-sidebar .sidebar::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, .55);
}

/* Slim scrollbar - Firefox */
.main-sidebar .sidebar {
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .28) transparent;
}

/* A little breathing room so the last menu item is not flush with the
   bottom edge when scrolled all the way down. */
.main-sidebar .sidebar nav {
	padding-bottom: .75rem;
}
