.shd-section-sidebar-shell {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	background: var(--shd-section-sidebar-bg);
	border: 1px solid var(--shd-section-sidebar-border);
	border-radius: var(--shd-section-sidebar-radius);
	color: var(--shd-section-sidebar-text);
	font: 400 12px / 1.35 var(--shd-section-sidebar-font);
	transition: width 0.18s ease, min-width 0.18s ease;
	--shd-section-sidebar-bg: rgba(255, 255, 255, 0.08);
	--shd-section-sidebar-border: #43474c;
	--shd-section-sidebar-radius: 8px;
	--shd-section-sidebar-text: #eaecf0;
	--shd-section-sidebar-text-dim: #c0c2c5;
	--shd-section-sidebar-hover: #3a3b3d;
	--shd-section-sidebar-accent: #c7b07a;
	--shd-section-sidebar-footer-bg: #252525;
	--shd-section-sidebar-badge-bg: rgba(255, 255, 255, 0.12);
	--shd-section-sidebar-badge-border: rgba(255, 255, 255, 0.16);
	--shd-section-sidebar-badge-text: #eaecf0;
	--shd-section-sidebar-font: 'Artifakt Element', -apple-system, system-ui, 'Segoe UI', sans-serif;
}

:is(html[data-ui-theme='light'], html.light, html.lightgray, html.gray) .shd-section-sidebar-shell {
	--shd-section-sidebar-bg: #f7f9fb;
	--shd-section-sidebar-border: rgba(31, 41, 55, 0.16);
	--shd-section-sidebar-text: rgb(29, 31, 37);
	--shd-section-sidebar-text-dim: rgb(83, 89, 101);
	--shd-section-sidebar-hover: #e1e8ef;
	--shd-section-sidebar-accent: rgb(83, 89, 101);
	--shd-section-sidebar-footer-bg: #f8fafc;
	--shd-section-sidebar-badge-bg: rgba(31, 41, 55, 0.08);
	--shd-section-sidebar-badge-border: rgba(31, 41, 55, 0.14);
	--shd-section-sidebar-badge-text: rgb(29, 31, 37);
}

.shd-section-sidebar__sections {
	display: grid;
	gap: 3px;
	flex: 1 1 auto;
	min-height: 0;
	align-content: start;
	overflow-y: auto;
	padding: 6px;
}

.shd-section-sidebar__sections [data-svg-icon] {
	display: grid;
	width: 14px;
	height: 14px;
	flex: 0 0 14px;
	place-items: center;
}

.shd-section-sidebar__sections [data-svg-icon]>svg {
	width: 100%;
	height: 100%;
}

.shd-section-sidebar__section {
	min-width: 0;
}

.shd-section-sidebar__section-head {
	position: relative;
	min-width: 0;
}

.shd-section-sidebar__section-toggle {
	box-sizing: border-box;
	display: flex;
	width: 100%;
	align-items: center;
	gap: 8px;
	min-width: 0;
	min-height: 36px;
	padding: 0 11px;
	border: 0;
	border-left: 2px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: var(--shd-section-sidebar-text-dim);
	font: 500 0.82rem/1.2 var(--shd-section-sidebar-font);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.shd-section-sidebar__section-head:has(.shd-section-sidebar__section-action) .shd-section-sidebar__section-toggle {
	padding-right: 36px;
}

.shd-section-sidebar__section-toggle>span:last-child {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.shd-section-sidebar__section-toggle .shd-svg-holder {
	transform: none;
}

.shd-section-sidebar__section-toggle:hover,
.shd-section-sidebar__section-toggle.is-selected {
	border-left-color: var(--shd-section-sidebar-accent);
	color: var(--shd-section-sidebar-text);
	background: var(--shd-section-sidebar-hover);
}

.shd-section-sidebar__section-toggle:focus-visible {
	outline: 2px solid var(--shd-section-sidebar-accent);
	outline-offset: -2px;
}

/* ── Badges & Counters ── */
.shd-section-sidebar__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	margin-left: auto;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	color: var(--shd-section-sidebar-badge-text);
	background: var(--shd-section-sidebar-badge-bg);
	border: 1px solid var(--shd-section-sidebar-badge-border);
	flex-shrink: 0;
}

.shd-section-sidebar__badge--danger {
	background: rgba(239, 68, 68, 0.2);
	border-color: rgba(239, 68, 68, 0.4);
	color: #fca5a5;
}

.shd-section-sidebar__badge--warning {
	background: rgba(245, 158, 11, 0.2);
	border-color: rgba(245, 158, 11, 0.4);
	color: #fde68a;
}

.shd-section-sidebar__badge--success {
	background: rgba(34, 197, 94, 0.2);
	border-color: rgba(34, 197, 94, 0.4);
	color: #86efac;
}

.shd-section-sidebar__badge--accent {
	background: var(--shd-section-sidebar-accent);
	border-color: var(--shd-section-sidebar-accent);
	color: #101010;
}

/* ── Collapsible Accordion Groups ── */
.shd-section-sidebar__group {
	display: grid;
	gap: 2px;
	margin-top: 4px;
}

.shd-section-sidebar__group-head {
	box-sizing: border-box;
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	padding: 4px 6px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--shd-section-sidebar-text-dim);
	font: 600 11px/1 'IBM Plex Sans Condensed', system-ui, sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	user-select: none;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.shd-section-sidebar__group-head:hover {
	color: var(--shd-section-sidebar-text);
	background: var(--shd-section-sidebar-hover);
}

.shd-section-sidebar__group-chevron {
	display: inline-flex;
	width: 12px;
	height: 12px;
	align-items: center;
	justify-content: center;
	transition: transform 0.18s ease;
}

.shd-section-sidebar__group.is-collapsed .shd-section-sidebar__group-chevron {
	transform: rotate(-90deg);
}

.shd-section-sidebar__group.is-collapsed .shd-section-sidebar__group-body {
	display: none;
}

.shd-section-sidebar__group-body {
	display: grid;
	gap: 2px;
}

.shd-section-sidebar__section-action {
	position: absolute;
	top: 50%;
	right: 4px;
	z-index: 1;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	min-width: 26px;
	height: 26px;
	min-height: 26px;
	margin: 0;
	padding: 0;
	line-height: 0;
}

.shd-section-sidebar__section-action .shd-svg-holder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
}

.shd-section-sidebar__section-body {
	display: grid;
	gap: 3px;
	padding: 5px 4px 7px 16px;
}

.shd-section-sidebar__footer {
	position: relative;
	display: grid;
	flex: 0 0 auto;
	grid-template-columns: 1fr;
	align-items: center;
	gap: 5px;
	padding: 6px;
	border-top: 1px solid var(--shd-section-sidebar-border);
	background: var(--shd-section-sidebar-footer-bg);
}

.shd-section-sidebar__footer .shd-module-nav-actions {
	display: grid;
	gap: 4px;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	margin: 0;
}

.shd-section-sidebar__footer .pb-btn {
	width: 100%;
	justify-content: center;
}

/* ── Sidebar Header / Brand Card ── */
.shd-section-sidebar__head,
.shd-section-sidebar__brand {
	flex: 0 0 auto;
	display: grid;
	align-items: center;
	padding: 8px 10px;
	grid-template-columns: 24px minmax(0, 1fr);
	gap: 8px;
	border: 0;
	border-bottom: 1px solid var(--shd-section-sidebar-border);
	border-radius: 0;
	background: transparent;
}

.shd-section-sidebar__head--with-help,
.shd-section-sidebar__brand--with-help {
	grid-template-columns: 24px minmax(0, 1fr) 24px;
}

.shd-section-sidebar__brand-copy {
	min-width: 0;
	display: grid;
	gap: 2px;
}

.shd-section-sidebar__brand-copy strong {
	display: block;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--shd-section-sidebar-text);
	font: 600 14px / 1.1 'IBM Plex Sans Condensed', system-ui, sans-serif;
}

.shd-section-sidebar__brand-copy span {
	display: block;
	max-width: 100%;
	margin-top: 1px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--shd-section-sidebar-text-dim);
	font-size: 10px;
	line-height: 1.2;
}

.shd-section-sidebar-shell :is(.shd-section-sidebar__brand-mark, .shd-section-sidebar__brand-help) {
	width: 24px;
	min-width: 24px;
	height: 24px;
	min-height: 24px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	appearance: none;
	border: 1px solid var(--shd-module-brand-icon-border);
	background: var(--shd-module-brand-icon-bg);
	color: var(--shd-module-brand-icon-text);
	font: 600 14px/1 'IBM Plex Sans Condensed', system-ui, sans-serif;
	text-decoration: none;
	cursor: pointer;
}

.shd-section-sidebar-shell :is(.shd-section-sidebar__brand-mark, .shd-section-sidebar__brand-help):hover {
	border-color: var(--shd-module-brand-icon-border-hover);
	background: var(--shd-module-brand-icon-bg-hover);
	color: var(--shd-module-brand-icon-text);
}

@media (max-width: 760px) {
	.shd-section-sidebar-shell > .shd-section-sidebar__brand {
		grid-template-columns: 44px minmax(0, 1fr);
		gap: 6px;
		padding: 6px 8px;
	}

	.shd-section-sidebar-shell > .shd-section-sidebar__brand.shd-section-sidebar__brand--with-help {
		grid-template-columns: 44px minmax(0, 1fr) 24px;
	}

	.shd-section-sidebar-shell--mobile-inline {
		display: contents;
	}

	.shd-section-sidebar-shell--mobile-inline > .shd-section-sidebar__brand {
		grid-column: 1 / -1;
		grid-row: 1;
	}

	.shd-section-sidebar-shell--mobile-inline > .shd-section-sidebar__footer {
		grid-column: 1 / -1;
		grid-row: 2;
		min-width: 0;
		max-width: 100%;
		display: flex;
		align-items: stretch;
		gap: 4px;
		padding: 4px;
		overflow-x: auto;
		overflow-y: hidden;
	}

	.shd-section-sidebar-shell--mobile-inline > .shd-section-sidebar__footer > * {
		flex: 0 0 auto;
		min-width: max-content;
	}

	.shd-section-sidebar-shell--mobile-inline > .shd-section-sidebar__footer .shd-module-nav-actions {
		display: flex;
		flex: 0 0 auto;
		width: auto;
		gap: 4px;
		padding: 0;
	}

	.shd-section-sidebar-shell--mobile-inline > .shd-section-sidebar__footer .pb-btn {
		width: auto;
		min-width: max-content;
		height: auto;
		min-height: 44px;
	}

	.shd-section-sidebar-shell--mobile-inline > nav.shd-section-sidebar__sections {
		grid-column: 1 / -1;
		grid-row: 3;
		min-width: 0;
		min-height: 0;
		display: flex;
		align-items: stretch;
		gap: 3px;
		padding: 3px;
		border: 1px solid var(--shd-section-sidebar-border);
		border-radius: 8px;
		overflow-x: auto;
		overflow-y: hidden;
	}

	.shd-section-sidebar-shell--mobile-inline > nav.shd-section-sidebar__sections > .shd-section-sidebar__section-toggle,
	.shd-section-sidebar-shell--mobile-inline > nav.shd-section-sidebar__sections > .shd-section-sidebar__section-body > .shd-section-sidebar__section-toggle {
		flex: 0 0 auto;
		width: auto;
		min-width: max-content;
		min-height: 44px;
		padding-inline: 11px;
	}

	.shd-section-sidebar-shell--mobile-inline > nav.shd-section-sidebar__sections > .shd-section-sidebar__section-body {
		flex: 0 0 auto;
		display: flex;
		align-items: stretch;
		gap: 3px;
		margin: 0;
		padding: 0 0 0 3px;
		border-top: 0;
		border-right: 0;
		border-bottom: 0;
		border-left: 1px solid var(--shd-section-sidebar-border);
	}

	.shd-section-sidebar-shell--mobile-inline > .shd-module-side-nav--projects {
		grid-column: 1 / -1;
		grid-row: 4;
		min-width: 0;
		min-height: 0;
	}
}

@media (max-width: 860px) {
	.shd-section-sidebar-shell--mobile-tabs {
		display: block;
		width: 100%;
		min-height: 0;
		overflow: hidden;
	}

	.shd-section-sidebar-shell--mobile-tabs > .shd-section-sidebar__sections {
		display: flex;
		flex: 0 0 auto;
		gap: 4px;
		padding: 4px;
		overflow-x: auto;
		overflow-y: hidden;
	}

	.shd-section-sidebar-shell--mobile-tabs .shd-section-sidebar__section-toggle {
		flex: 0 0 auto;
		width: auto;
		min-width: max-content;
		min-height: 44px;
		padding-inline: 12px;
	}
}

/* ── Edge Toggle Button (1-to-1 matching pbViewsToggle in project_db) ── */
.shd-section-sidebar__toggle {
	position: fixed;
	top: 50%;
	left: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3px;
	height: 84px;
	padding: 0;
	border: 1px solid var(--pb-toggle-border, #4a4a4a);
	border-left: 0;
	border-radius: 0 10px 10px 0;
	background: var(--pb-toggle-bg, #2d2d2d);
	color: var(--ui-text-dim, #c0c2c5);
	transform: translateY(-50%);
	z-index: 100;
	cursor: pointer;
	overflow: hidden;
	transition: width 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.shd-section-sidebar__toggle:hover {
	width: 24px;
	color: var(--ui-text, #eaecf0);
	background: var(--pb-toggle-bg-hover, #3a3832);
	border-color: var(--pb-toggle-border-hover, #8a7a55);
}

.shd-section-sidebar__toggle:focus-visible {
	width: 24px;
	outline: 2px solid var(--ui-active-border, var(--pb-toggle-border-hover, #8a7a55));
	outline-offset: 2px;
}

:is(html[data-ui-theme='light'], html.light, html.lightgray, html.gray) .shd-section-sidebar__toggle {
	border-color: var(--pb-toggle-border, rgba(0, 0, 0, 0.12));
	background: var(--pb-toggle-bg, #e8eef5);
	color: var(--ui-text-dim, rgb(83, 89, 101));
}

:is(html[data-ui-theme='light'], html.light, html.lightgray, html.gray) .shd-section-sidebar__toggle:hover {
	border-color: var(--pb-toggle-border-hover, rgba(0, 0, 0, 0.2));
	background: var(--pb-toggle-bg-hover, #dce5ee);
	color: var(--ui-text, rgb(29, 31, 37));
}

.shd-section-sidebar__toggle-glyph {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	line-height: 1;
	transform: none;
	pointer-events: none;
}

.shd-section-sidebar__toggle-glyph svg {
	width: 12px;
	height: 12px;
	display: block;
}

/* ── Collapsed Sidebar Shell State ── */
:is(.shd-module-shell, .profile-shell, .tasks-shell, .finance-shell, .crm-shell, .inventory-shell, .documents-shell, .discussions-shell, .notes-shell).is-sidebar-collapsed {
	--shd-module-sidebar-width: 0px !important;
	--tasks-sidebar-width: 0px !important;
	--finance-sidebar-width: 0px !important;
	--crm-sidebar-width: 0px !important;
	--inventory-sidebar-width: 0px !important;
	--documents-sidebar-width: 0px !important;
	--discussions-nav-width: 0px !important;
	--notes-nav-width: 0px !important;
	grid-template-columns: minmax(0, 1fr) !important;
	gap: 0 !important;
}

:is(.shd-module-shell, .profile-shell, .tasks-shell, .finance-shell, .crm-shell, .inventory-shell, .documents-shell, .discussions-shell, .notes-shell).is-sidebar-collapsed > .shd-section-sidebar-shell {
	display: none !important;
}

:is(.shd-module-shell, .profile-shell, .tasks-shell, .finance-shell, .crm-shell, .inventory-shell, .documents-shell, .discussions-shell, .notes-shell).is-sidebar-collapsed :where(.discussions-layout-resizer, .notes-layout-resizer) {
	display: none !important;
}
