/* ═══════════════════════════════════════════════════════════════
   sidebar-edit.css  —  Reusable sidebar navigation layout
   ═══════════════════════════════════════════════════════════════ */

/* ── Project color tokens ── */
:root {
	--db-primary: #1b6ec2;
	--db-primary-light: #e6f0fa;
	--db-notify-info: #1b6ec2;
	--db-notify-warn: #e2a03f;
	--db-notify-danger: #dc3545;
	--db-notify-success: #28a745;
}

/* ── Layout shell (breaks out of .container + flex layout) ── */
.sidebar-layout {
	width: var(--vw, 100vw);
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	margin-top: -1rem;
	margin-bottom: -1rem;
	display: flex;
	min-height: calc(100vh - 105px);
}

/* ── Sidebar ── */
.sidebar-edit {
	width: 220px;
	min-width: 220px;
	background: #f8f9fa;
	border-right: 1px solid #dee2e6;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}

/* ── Section headers ── */
.sidebar-section-label {
	padding: 0.85rem 1rem 0.35rem;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #495057;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	border-bottom: 1px solid #e9ecef;
	background: #f0f1f3;
}

.sidebar-nav {
	list-style: none;
	padding: 0;
	margin: 0;
}

/* ── Nav items ── */
.sidebar-nav li {
	position: relative;
}

.sidebar-nav li a {
	display: flex;
	align-items: center;
	padding: 0.55rem 1rem;
	color: #495057;
	text-decoration: none;
	font-size: 0.85rem;
	border-left: 3px solid transparent;
	transition: background 0.1s, border-color 0.1s;
	white-space: nowrap;
}

.sidebar-nav li a:hover {
	background: #e9ecef;
}

.sidebar-nav li a.active {
	background: var(--db-primary-light);
	border-left-color: var(--db-primary);
	color: var(--db-primary);
	font-weight: 500;
}

.sidebar-nav li a .nav-icon {
	width: 20px;
	text-align: center;
	flex-shrink: 0;
}

.sidebar-nav li a .nav-label {
	margin-left: 0.6rem;
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Notification dot ── */
.nav-notify {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	flex-shrink: 0;
	margin-left: auto;
	border: 2px solid #f8f9fa;
}

.nav-notify.notify-info    { background: var(--db-notify-info); }
.nav-notify.notify-warn    { background: var(--db-notify-warn); }
.nav-notify.notify-danger  { background: var(--db-notify-danger); }
.nav-notify.notify-success { background: var(--db-notify-success); }

/* ── Inline badge (short notification text) ── */
.nav-badge {
	font-size: 0.65rem;
	font-weight: 600;
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	margin-left: auto;
	flex-shrink: 0;
	white-space: nowrap;
	line-height: 1.4;
}

.nav-badge.badge-info    { background: var(--db-primary-light); color: var(--db-notify-info); }
.nav-badge.badge-warn    { background: #fff3cd;                color: #856404; }
.nav-badge.badge-danger  { background: #f8d7da;                color: var(--db-notify-danger); }
.nav-badge.badge-success { background: #d4edda;                color: var(--db-notify-success); }

/* On desktop: when a badge is present, hide the dot (badge is enough) */
.nav-notify:has(~ .nav-badge) { display: none; }

/* ── Sidebar popover (long notification text) ── */
.sidebar-popover.popover {
	min-width: 220px;
	max-width: 320px;
	font-size: 0.82rem;
	border-color: #dee2e6;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
	z-index: 1080;
}

.sidebar-popover .popover-body {
	padding: 0.6rem 0.85rem;
	color: #343a40;
}

.sidebar-popover.popover-danger .popover-body {
	color: var(--db-notify-danger);
}

/* ── Content area ── */
.sidebar-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.content-header {
	padding: 0.85rem 1.5rem;
	border-bottom: 1px solid #dee2e6;
	background: #fff;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0;
}

.content-header h1 {
	font-size: 1.2rem;
	margin: 0;
}

.content-body {
	flex: 1;
	padding: 1.5rem 2rem;
	overflow-y: auto;
}

/* ── Collapsed sidebar (small screens) — icon-only column ── */
@media (max-width: 991.98px) {
	.sidebar-edit {
		width: 52px;
		min-width: 52px;
	}

	.sidebar-section-label {
		display: none;
	}

	.sidebar-nav li a {
		justify-content: center;
		padding: 0.65rem 0;
	}

	.sidebar-nav li a .nav-label {
		display: none;
	}

	.sidebar-nav li a .nav-icon {
		font-size: 1rem;
		margin: 0;
	}

	/* Dot repositions to top-right of icon — always visible on mobile */
	.nav-notify {
		display: inline-block !important;
		position: absolute;
		top: 5px;
		right: 5px;
		margin-left: 0;
	}

	/* Hide inline badges on collapsed sidebar — dot is enough */
	.nav-badge {
		display: none !important;
	}

	.content-body {
		padding: 1.25rem;
	}
}

@media (max-width: 575.98px) {
	.content-header {
		padding: 0.65rem 1rem;
	}

	.content-header h1 {
		font-size: 1rem;
	}

	.content-body {
		padding: 1rem;
	}
}
