/* =========================================================================
   Shell — 새로운 헤더 + 사이드바 디자인 (CMTSCM-874)
   - 기존 design pattern 유지: scoped class prefix `shell-*` 로 분리
   - 기존 .gnb_*, .sideSection-layout 등은 그대로 두고, 신규 컴포넌트만 사용
   - 컬러 토큰은 React demo와 동일
   ========================================================================= */

:root {
	/* 브랜드 / 포인트 컬러 — Tailwind @theme 의 --color-primary-* 팔레트와 동일 값을 사용.
	   기존 변수명(--shell-green-*) 은 호환을 위해 유지하되 색만 파란색으로 교체. */
	--shell-green-50:  #eff5ff;
	--shell-green-100: #d3e1fb;
	--shell-green-200: #a7c4f7;
	--shell-green-500: #246beb;
	--shell-green-600: #1d56bc;
	--shell-green-700: #16408d;
	--shell-gray-50:   #f8fafc;
	--shell-gray-100:  #f1f5f9;
	--shell-gray-200:  #e2e8f0;
	--shell-gray-300:  #cbd5e1;
	--shell-gray-500:  #64748b;
	--shell-gray-700:  #334155;
	--shell-gray-900:  #0f172a;
	--shell-header-h:  56px;
	--shell-sidebar-w: 244px;
}

/* ========================== TopNav ========================== */
.shell-topnav {
	position: sticky;
	top: 0;
	z-index: 50;
	height: var(--shell-header-h);
	width: 100%;
	background: #ffffff;
	border-bottom: 1px solid var(--shell-gray-200);
	display: flex;
	align-items: stretch;
}
.shell-topnav__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	width: 100%;
	padding: 0 20px;
}

/* 좌측 로고 영역 — 기존 .change-logo 이미지를 그대로 사용 */
.shell-topnav__brand {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	flex-shrink: 0;
	height: 100%;
}
.shell-topnav__brand .change-logo {
	width: 120px;
	height: 36px;
	background: url('/assets/web/images/logo/bbaem02-61cf74522eb3f0640e510762bc208435.png') center / contain no-repeat;
}

/* GNB 탭 영역 */
.shell-topnav__tabs {
	display: flex;
	align-items: center;
	gap: 4px;
	height: 100%;
	margin-left: 8px;
}
.shell-topnav__tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	color: var(--shell-gray-700);
	text-decoration: none;
	transition: background-color 120ms ease, color 120ms ease;
	white-space: nowrap;
	cursor: pointer;
}
.shell-topnav__tab-icon {
	font-size: 14px;
	line-height: 1;
	color: var(--shell-gray-500);
	flex-shrink: 0;
}
.shell-topnav__tab-text {
	display: inline-block;
}
.shell-topnav__tab:hover {
	background: var(--shell-gray-100);
	color: var(--shell-gray-900);
}
.shell-topnav__tab:hover .shell-topnav__tab-icon {
	color: var(--shell-gray-700);
}
.shell-topnav__tab.is-active {
	background: var(--shell-gray-900);
	color: #ffffff;
	font-weight: 600;
}
.shell-topnav__tab.is-active .shell-topnav__tab-icon {
	color: #ffffff;
}

/* 우측 영역 */
.shell-topnav__right {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	height: 100%;
}

/* 회기 / 사업장 chip — 2줄 (label 위 / value 아래) + 좌측 아이콘 */
.shell-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 4px 12px;
	border: 1px solid var(--shell-gray-200);
	border-radius: 10px;
	background: #ffffff;
	color: var(--shell-gray-700);
	max-width: 220px;
}
.shell-chip__icon {
	font-size: 13px;
	line-height: 1;
	color: var(--shell-gray-500);
	flex-shrink: 0;
}
.shell-chip__stack {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	line-height: 1.15;
	min-width: 0;
}
.shell-chip__label {
	font-size: 10px;
	color: var(--shell-gray-500);
	font-weight: 500;
	letter-spacing: 0.02em;
}
.shell-chip__value {
	font-size: 13px;
	color: var(--shell-gray-900);
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.shell-chip__value:empty::before {
	content: '-';
	color: var(--shell-gray-300);
	font-weight: 400;
}

/* 사용자 영역 */
.shell-topnav__user {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding-left: 12px;
	margin-left: 4px;
	border-left: 1px solid var(--shell-gray-200);
	font-size: 13px;
	color: var(--shell-gray-700);
}
.shell-topnav__user-name {
	font-weight: 600;
	color: var(--shell-gray-900);
}
.shell-topnav__logout {
	background: none;
	border: none;
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 13px;
	color: var(--shell-gray-500);
	cursor: pointer;
	transition: background-color 120ms ease, color 120ms ease;
}
.shell-topnav__logout:hover {
	background: var(--shell-gray-100);
	color: var(--shell-gray-900);
}

/* ========================== Layout 오버라이드 ==========================
   기존 style.css 의 .section / .article-lcaReport 는 모든 내용을 가운데로
   몰고 max-width:1280px 로 제한한다. shell 레이아웃에서는 이를 무효화한다. */
.section.section-shell {
	width: 100%;
	padding: 0;
	display: block;
	align-items: stretch;
	gap: 0;
}
.article-lcaReport--shell {
	width: 100%;
	max-width: none;
	height: auto;
	display: block;
	justify-content: flex-start;
	align-items: stretch;
	/* 기존 layout 인자(snbMarginTop='mt-35') 가 만든 큰 여백 무력화 */
	margin-top: 0 !important;
}

/* ========================== Breadcrumb (naviBar) ==========================
   ⚠ 전역 style.css 의 .naviBar-contents { position:fixed; margin-top:80px }
   는 옛 80px 헤더 기준이라 새 56px shell 헤더와 어긋나 큰 빈 공간이 생긴다.
   in-browser Tailwind 로는 cascade 순서상 안정적으로 못 이겨 shell.css 에 유지.
   ----------------------------------------------------------------
   디자인: 메인메뉴 아이콘 배지 + '제목 / 제목 / 제목' 구조 + 마지막(.is-current) 강조
   색상: 본 파일 상단 --shell-green-* (값은 브랜드 블루로 교체됨) / --shell-gray-* */
main > .naviBar-contents,
body .naviBar-contents {
	position: static;
	margin-top: 0;
	height: 44px;
	padding: 0 20px;
	background: #ffffff;
	border-bottom: 1px solid var(--shell-gray-200);
	display: flex;
	align-items: center;
	justify-content: flex-start;
}
main > .naviBar-contents > div,
body .naviBar-contents > div {
	max-width: none;
	padding: 0;
	width: 100%;
}

/* 리스트 컨테이너 — 아이콘 + 항목들 가로 정렬, 가독성용 행간/자간 */
.naviBar-contents .naviBar-list {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
	line-height: 1.4;
	letter-spacing: -0.005em;
}

/* 메인 메뉴 아이콘 — 연한 블루 배지 + 진한 블루 아이콘 */
.naviBar-contents .naviBar-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 999px;
	background: var(--shell-green-50);
	color: var(--shell-green-600);
	font-size: 12px;
	line-height: 1;
	flex-shrink: 0;
	margin-right: 2px;
}
.naviBar-contents .naviBar-icon i { line-height: 1; }

/* 본문 텍스트 — 비활성은 옅은 회색, 현재 페이지(.is-current) 는 짙은 텍스트 + 굵게 */
.naviBar-contents .naviBar-text {
	font-size: 13px;
	font-weight: 500;
	color: var(--shell-gray-500);
	letter-spacing: -0.005em;
}
.naviBar-contents .naviBar-text.is-current {
	color: var(--shell-gray-900);
	font-weight: 700;
}

/* 구분자 '/' — 더 옅은 회색, 텍스트 선택 방지 */
.naviBar-contents .naviBar-sep {
	color: var(--shell-gray-300);
	font-size: 13px;
	font-weight: 400;
	user-select: none;
}

/* ========================== Content 영역 여백 ==========================
   기존 #apContent.mt-24 가 만든 큰 위쪽 여백 제거. shell-content 자체에
   적절한 padding 만 주어 헤더와 자연스럽게 붙도록 한다. */
.shell-content #apContent {
	margin-top: 0 !important;
}
.shell-content .s-contentsSection {
	padding: 20px 24px;
}

/* ========================== SideNav ========================== */
.shell-shell {
	display: flex;
	align-items: stretch;
	width: 100%;
	min-height: calc(100vh - var(--shell-header-h));
}

.shell-sidenav {
	width: var(--shell-sidebar-w);
	flex-shrink: 0;
	background: #ffffff;
	border-right: 1px solid var(--shell-gray-200);
	padding: 14px 10px;
	overflow-y: auto;
	max-height: calc(100vh - var(--shell-header-h));
	position: sticky;
	top: var(--shell-header-h);
}

.shell-sidenav__title {
	font-size: 11px;
	font-weight: 700;
	color: var(--shell-gray-500);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 6px 12px 10px;
}

.shell-section {
	margin-bottom: 4px;
}

.shell-section__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	padding: 8px 12px;
	border: none;
	background: transparent;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--shell-gray-700);
	cursor: pointer;
	text-align: left;
	transition: background-color 120ms ease;
}
.shell-section__header:hover {
	background: var(--shell-gray-100);
}
.shell-section__chevron {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-right: 2px solid var(--shell-gray-500);
	border-bottom: 2px solid var(--shell-gray-500);
	transform: rotate(45deg);
	transition: transform 150ms ease;
	flex-shrink: 0;
	margin-top: -3px;
}
.shell-section.is-collapsed .shell-section__chevron {
	transform: rotate(-45deg);
	margin-top: 2px;
}
.shell-section.is-collapsed .shell-section__body {
	display: none;
}

.shell-section__body {
	margin-top: 2px;
	padding-left: 6px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.shell-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px 7px 18px;
	border-radius: 6px;
	font-size: 13px;
	color: var(--shell-gray-700);
	text-decoration: none;
	line-height: 1.3;
	transition: background-color 120ms ease, color 120ms ease;
}
.shell-item:hover {
	background: var(--shell-gray-100);
	color: var(--shell-gray-900);
}
.shell-item.is-active {
	background: var(--shell-green-50);
	color: var(--shell-green-700);
	font-weight: 600;
}

/* depth 3 — 본문 내 일반 항목: 좌측에 큼직한 불릿 포인트로 구분 (depth 4 와 명확한 위계 차) */
.shell-section__body .shell-item:not(.shell-item--child) {
	position: relative;
	padding-left: 32px;
}
.shell-section__body .shell-item:not(.shell-item--child)::before {
	content: '';
	position: absolute;
	left: 13px;
	top: 50%;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--shell-gray-300);
	transform: translateY(-50%);
	transition: background-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.shell-section__body .shell-item:not(.shell-item--child):hover::before {
	background: var(--shell-gray-500);
}
.shell-section__body .shell-item:not(.shell-item--child).is-active::before {
	background: var(--shell-green-600);
	box-shadow: 0 0 0 2px var(--shell-green-100);
}

/* depth 3 subgroup — 자식(depth 4)을 가진 경우 접기/펴기 컨테이너 */
.shell-subgroup {
	display: block;
}
.shell-subgroup__row {
	display: flex;
	align-items: center;
	gap: 2px;
	padding-right: 4px;
	border-radius: 6px;
	transition: background-color 120ms ease;
}
.shell-subgroup__row:hover {
	background: var(--shell-gray-100);
}
.shell-subgroup__row > .shell-item {
	flex: 1 1 auto;
	min-width: 0;
}
/* row 내부의 link 자체 hover 배경은 row가 처리하므로 제거 (이중 hover 방지) */
.shell-subgroup__row > .shell-item:hover {
	background: transparent;
}
.shell-subgroup__row > .shell-item.is-active {
	background: var(--shell-green-50);
}
.shell-subgroup__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	background: transparent;
	border-radius: 4px;
	cursor: pointer;
	flex-shrink: 0;
	transition: background-color 120ms ease;
}
.shell-subgroup__toggle:hover {
	background: var(--shell-gray-200);
}
.shell-subgroup__chevron {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid var(--shell-gray-500);
	border-bottom: 1.5px solid var(--shell-gray-500);
	transform: rotate(45deg);
	transition: transform 150ms ease;
	margin-top: -2px;
}
.shell-subgroup.is-collapsed .shell-subgroup__chevron {
	transform: rotate(-45deg);
	margin-top: 2px;
}
.shell-subgroup.is-collapsed .shell-subgroup__body {
	display: none;
}
.shell-subgroup__body {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
/* 3뎁스에서 내려오는 연속된 세로 가지선 — 4뎁스 항목 그룹 전체를 관통 */
.shell-subgroup__body::before {
	content: '';
	position: absolute;
	left: 17px;
	top: 6px;
	bottom: 6px;
	width: 1px;
	background: var(--shell-gray-200);
}

/* depth 4 — 3뎁스에서 내려오는 세로선 위에 각 항목마다 불릿 배치 */
.shell-item--child {
	position: relative;
	padding-left: 36px;
	font-size: 12.5px;
	color: var(--shell-gray-500);
}
.shell-item--child::before {
	/* 항목별 불릿 — 세로선 정중앙(x=17.5)에 배치. depth 3 보다 작게(3px) 만들어 위계 표현 */
	content: '';
	position: absolute;
	left: 16px;
	top: 50%;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: var(--shell-gray-300);
	transform: translateY(-50%);
	/* 흰색 halo — 불릿이 세로선과 자연스럽게 만나도록 선을 살짝 가림 */
	box-shadow: 0 0 0 2px #ffffff;
	transition: background-color 120ms ease, box-shadow 120ms ease;
}
.shell-item--child:hover {
	background: var(--shell-gray-100);
	color: var(--shell-gray-900);
}
.shell-item--child:hover::before {
	background: var(--shell-gray-500);
	box-shadow: 0 0 0 2px var(--shell-gray-100);
}
.shell-item--child.is-active {
	background: var(--shell-green-50);
	color: var(--shell-green-700);
	font-weight: 600;
}
.shell-item--child.is-active::before {
	background: var(--shell-green-600);
	box-shadow: 0 0 0 2px var(--shell-green-50);
}

/* ========================== Content Area ========================== */
.shell-content {
	flex: 1 1 auto;
	min-width: 0;
	background: var(--shell-gray-50);
}
.shell-content__inner {
	padding: 0;
}

/* 기존 .gnb-navi, .allMenu 등은 신규 영역에서 숨김 */
.shell-topnav ~ * .gnb-navi,
body.shell-active .gnb-navi {
	display: none;
}
