/**
 * Member dashboard sidebar — sticky on desktop, slide-out drawer on mobile.
 */

.bm-dash .bm-grid {
	display: grid !important;
	grid-template-columns: 250px minmax(0, 1fr) !important;
	gap: 24px !important;
	align-items: start !important;
}

.bm-dash .bm-sidebar-shell {
	min-width: 0;
	position: relative;
	z-index: 20;
}

.bm-dash .bm-sidebar {
	min-width: 0;
	position: relative;
}

/* Base nav — must work inside .bm-dash AND when portaled to body (mobile drawer) */
.bm-sidebar .bm-sidenav {
	display: flex;
	flex-direction: column;
	gap: 2px;
	background: #fff;
	border: 1px solid #e9ecf1;
	border-radius: 14px;
	padding: 12px;
	box-shadow: 0 4px 16px rgba(31, 45, 61, .04);
	font-family: Arial, Helvetica, sans-serif;
	box-sizing: border-box;
}

.bm-sidebar .bm-sidenav a {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border-radius: 10px;
	color: #1f2d3d;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
	transition: background .15s, color .15s, box-shadow .15s;
}

.bm-sidebar .bm-sidenav a i {
	font-size: 19px;
	width: 22px;
	text-align: center;
	color: #8a94a6;
	flex-shrink: 0;
}

.bm-sidebar .bm-sidenav a:hover {
	background: #e8f5e9;
	color: #1b5e20;
}

.bm-sidebar .bm-sidenav a:hover i {
	color: #2e7d32;
}

.bm-sidebar .bm-sidenav a.logout {
	color: #c0392b;
}

.bm-sidebar .bm-sidenav a.logout i {
	color: #c0392b;
}

.bm-sidebar .bm-sidenav a.logout:hover {
	background: #fdecea;
	color: #c0392b;
}

.bm-dash .bm-sidenav,
.bm-sidebar .bm-sidenav {
	position: sticky !important;
	top: 16px !important;
	max-height: calc(100vh - 32px);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.bm-dash .bm-grid > div {
	min-width: 0;
}

/* Toolbar row — directly under breadcrumb on mobile */
.bm-dash-toolbar {
	display: none;
	margin: -6px 0 16px;
}

.bm-dash .bm-crumb {
	margin-bottom: 12px;
}

/* Hamburger toggle — hidden on desktop */
.bm-sidebar-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: auto;
	min-width: 44px;
	height: 44px;
	margin: 0;
	padding: 0 14px 0 12px;
	border: 1px solid #e9ecf1;
	border-radius: 12px;
	background: #fff;
	color: #1f2d3d;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(31, 45, 61, .08);
	transition: background .15s, border-color .15s, box-shadow .15s;
}

.bm-sidebar-toggle-label {
	display: none;
	font-size: 14px;
	font-weight: 700;
	font-family: Arial, Helvetica, sans-serif;
}

.bm-sidebar-toggle:hover {
	background: #e8f5e9;
	border-color: #a5d6a7;
	color: #1b5e20;
}

.bm-sidebar-toggle:focus-visible {
	outline: 2px solid #2e7d32;
	outline-offset: 2px;
}

.bm-sidebar-overlay {
	display: none;
}

.bm-sidebar-close {
	display: none;
	align-items: center;
	justify-content: center;
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 10px;
	background: rgba(0, 0, 0, .06);
	color: #1f2d3d;
	font-size: 20px;
	cursor: pointer;
	z-index: 2;
}

.bm-sidebar-close:hover {
	background: rgba(0, 0, 0, .1);
}

.bm-sidebar-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6px 10px 14px;
	margin-bottom: 6px;
	border-bottom: 1px solid #e9ecf1;
}

.bm-sidenav-search {
	position: relative;
	margin-bottom: 10px;
}

.bm-sidenav-search i.uil-search {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 16px;
	color: #8a94a6;
	pointer-events: none;
}

.bm-sidenav-search input {
	width: 100%;
	height: 38px;
	border: 1px solid #e9ecf1;
	border-radius: 10px;
	padding: 0 34px 0 36px;
	font-size: 13px;
	font-family: Arial, Helvetica, sans-serif;
	color: #1f2d3d;
	background: #f8fafc;
	box-sizing: border-box;
}

.bm-sidenav-search input:focus {
	outline: none;
	border-color: #2e7d32;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(46, 125, 50, .12);
}

.bm-sidenav-search input::placeholder {
	color: #8a94a6;
}

.bm-sidenav-search-clear {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	width: 26px;
	height: 26px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #8a94a6;
	font-size: 14px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.bm-sidenav-search-clear:hover {
	background: #e8f5e9;
	color: #1b5e20;
}

.bm-sidenav-no-results {
	margin: 0 0 8px;
	padding: 10px 12px;
	border-radius: 10px;
	background: #f4f6fa;
	color: #8a94a6;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}

.bm-sidebar .bm-sidenav a.bm-sidenav-hidden {
	display: none !important;
}

.bm-dash .bm-sidenav .bm-sidenav-locked,
.bm-sidebar .bm-sidenav .bm-sidenav-locked {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	margin-top: 2px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	color: #8a94a6;
	background: #f4f6fa;
	border: 1px dashed #d5dbe3;
	cursor: not-allowed;
	opacity: 0.88;
	user-select: none;
}

.bm-dash .bm-sidenav .bm-sidenav-locked i,
.bm-sidebar .bm-sidenav .bm-sidenav-locked i {
	font-size: 18px;
	color: #8d6e00;
	flex-shrink: 0;
}

.bm-sidebar-logo {
	display: block;
	line-height: 0;
	text-decoration: none;
}

.bm-sidebar-logo img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 52px;
	object-fit: contain;
}

.bm-dash .bm-sidenav .bm-sidebar-brand + a,
.bm-sidebar .bm-sidenav .bm-sidebar-brand + a {
	margin-top: 2px;
}

/* Sidebar nav links — shared across dashboard pages */
.bm-dash .bm-sidenav a.active,
.bm-sidebar .bm-sidenav a.active {
	background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(27, 94, 32, .24);
}

.bm-dash .bm-sidenav a.active i,
.bm-sidebar .bm-sidenav a.active i {
	color: #fff !important;
}

.bm-dash .bm-sidenav a.nav-icapital,
.bm-sidebar .bm-sidenav a.nav-icapital {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin-top: 8px;
	padding: 12px 14px;
	min-height: 48px;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.35;
	border-radius: 10px;
	text-decoration: none;
	box-sizing: border-box;
}

.bm-dash .bm-sidenav a.nav-icapital:not(.active),
.bm-sidebar .bm-sidenav a.nav-icapital:not(.active) {
	background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(27, 94, 32, .28);
}

.bm-dash .bm-sidenav a.nav-icapital:not(.active) i,
.bm-sidebar .bm-sidenav a.nav-icapital:not(.active) i {
	color: #fff !important;
}

.bm-dash .bm-sidenav a.nav-icapital:hover:not(.active),
.bm-sidebar .bm-sidenav a.nav-icapital:hover:not(.active) {
	background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
	color: #fff !important;
	filter: brightness(1.05);
}

.bm-dash .bm-sidenav a.nav-icapital:hover:not(.active) i,
.bm-sidebar .bm-sidenav a.nav-icapital:hover:not(.active) i {
	color: #fff !important;
}

.bm-dash .bm-sidenav a.nav-icapital.active,
.bm-sidebar .bm-sidenav a.nav-icapital.active {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(160deg, #a5e05a 0%, #7cb342 38%, #2e7d32 72%, #1b5e20 100%) !important;
	color: #fff !important;
	font-weight: 800;
	border: 1px solid rgba(255, 255, 255, .35);
	box-shadow:
		0 6px 14px rgba(27, 94, 32, .38),
		inset 0 1px 0 rgba(255, 255, 255, .55),
		inset 0 -3px 8px rgba(0, 0, 0, .22);
	text-shadow: 0 1px 1px rgba(0, 0, 0, .28);
}

.bm-dash .bm-sidenav a.nav-icapital.active::before,
.bm-sidebar .bm-sidenav a.nav-icapital.active::before {
	content: "";
	position: absolute;
	top: 0;
	left: -120%;
	width: 55%;
	height: 100%;
	background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, .15) 35%, rgba(255, 255, 255, .65) 50%, rgba(255, 255, 255, .15) 65%, transparent 100%);
	transform: skewX(-20deg);
	animation: bm-nav-icapital-shine 3.2s ease-in-out infinite;
	pointer-events: none;
	z-index: 0;
}

.bm-dash .bm-sidenav a.nav-icapital.active::after,
.bm-sidebar .bm-sidenav a.nav-icapital.active::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
	pointer-events: none;
	z-index: 0;
}

.bm-dash .bm-sidenav a.nav-icapital.active i,
.bm-sidebar .bm-sidenav a.nav-icapital.active i {
	position: relative;
	z-index: 1;
	color: #fff !important;
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25));
}

.bm-dash .bm-sidenav a.nav-icapital.active:active,
.bm-sidebar .bm-sidenav a.nav-icapital.active:active {
	filter: brightness(.96);
}

@keyframes bm-nav-icapital-shine {
	0% { left: -120%; }
	55% { left: 130%; }
	100% { left: 130%; }
}

@media (max-width: 991px) {
	.bm-dash .bm-grid {
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 0 !important;
	}

	.bm-dash-toolbar {
		display: block;
		position: relative;
		z-index: 1;
	}

	.bm-dash-toolbar .bm-sidebar-toggle {
		display: inline-flex;
	}

	.bm-sidebar-toggle-label {
		display: inline;
	}

	/* Placeholder keeps grid layout; drawer is portaled to body on mobile */
	.bm-dash .bm-sidebar-shell {
		display: none;
	}

	.bm-sidebar-overlay {
		display: none;
		position: fixed;
		inset: 0;
		background: rgba(15, 23, 42, .5);
		z-index: 10040;
		opacity: 0;
		transition: opacity .25s ease;
		pointer-events: none;
	}

	body.bm-sidebar-open .bm-sidebar-overlay {
		display: block;
		opacity: 1;
		pointer-events: auto;
	}

	.bm-sidebar-shell.bm-sidebar-portal {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		width: 0;
		height: 0;
		overflow: visible;
		pointer-events: none;
		z-index: 10050;
	}

	.bm-sidebar-shell.bm-sidebar-portal .bm-sidebar {
		position: fixed !important;
		top: 0;
		left: 0;
		width: min(280px, 88vw);
		height: 100vh;
		height: 100dvh;
		padding: 0;
		margin: 0;
		transform: translateX(-105%);
		transition: transform .28s ease;
		pointer-events: none;
		visibility: hidden;
	}

	body.bm-sidebar-open .bm-sidebar-shell.bm-sidebar-portal {
		pointer-events: none;
	}

	body.bm-sidebar-open .bm-sidebar-shell.bm-sidebar-portal .bm-sidebar {
		transform: translateX(0);
		pointer-events: auto;
		visibility: visible;
	}

	.bm-sidebar-shell.bm-sidebar-portal .bm-sidenav {
		position: relative !important;
		top: 0 !important;
		max-height: none !important;
		height: 100%;
		min-height: 100%;
		border-radius: 0;
		border-top: none;
		border-bottom: none;
		border-left: none;
		padding: 12px 12px 16px;
		box-shadow: 4px 0 24px rgba(31, 45, 61, .18);
		background: #fff;
		overflow-y: auto;
	}

	.bm-sidebar-shell.bm-sidebar-portal .bm-sidebar {
		display: flex;
		flex-direction: column;
		background: #fff;
	}

	.bm-sidebar-shell.bm-sidebar-portal .bm-sidebar-brand {
		padding: 8px 44px 14px 10px;
		margin-bottom: 8px;
	}

	.bm-sidebar-shell.bm-sidebar-portal .bm-sidebar-logo img {
		max-height: 46px;
	}

	.bm-sidebar-close {
		display: inline-flex;
		top: 12px;
		right: 12px;
	}

	body.bm-sidebar-lock {
		overflow: hidden;
	}
}

@media (max-width: 767px) {
	.bm-dash .bm-sidenav a,
	.bm-sidebar .bm-sidenav a {
		padding: 10px 12px;
		font-size: 13px;
	}
}

@media (max-width: 575px) {
	.bm-dash .container {
		padding-left: 10px;
		padding-right: 10px;
	}

	.bm-dash .bm-sidenav a,
	.bm-sidebar .bm-sidenav a {
		padding: 9px 10px;
		font-size: 12px;
		gap: 8px;
		line-height: 1.25;
	}

	.bm-dash .bm-sidenav a i,
	.bm-sidebar .bm-sidenav a i {
		font-size: 17px;
		width: 18px;
		flex-shrink: 0;
	}
}
