:root {
  /* --- System Colors (Added) --- */
  --color-red: #F21D0D;
  --color-pink: #E8175E;
  --color-magenta: #B92ED1;
  --color-purple: #6D3DC2;
  --color-navy: #4255bd;
  --color-blue: #0D8DF2;
  --color-cyan: #03AEFC;
  --color-green: #4DB251;
  --color-yellow: #FFBF00;
  --color-orange: #FF9800;
  --color-dahong: #FF3D00;
  --color-brown: #A0705F;
  --color-iron: #7F7F7F;
  --color-steel: #688897;

  --color-red-light: #FEE9E7;
  --color-pink-light: #FDE8EF;
  --color-magenta-light: #F8EBFB;
  --color-purple-light: #F1ECF9;
  --color-navy-light: #EDEEF9;
  --color-blue-light: #E7F4FE;
  --color-cyan-light: #E6F7FF;
  --color-green-light: #EEF8EE;
  --color-yellow-light: #FFF9E6;
  --color-orange-light: #FFF5E6;
  --color-dahong-light: #FFECE6;
  --color-brown-light: #F6F1EF;
  --color-iron-light: #F3F3F3;
  --color-steel-light: #F0F4F5;

  --color-red-medium: #FAA59E;
  --color-pink-medium: #F6A2BF;
  --color-magenta-medium: #E3ABEC;
  --color-purple-medium: #C5B1E7;
  --color-navy-medium: #B3BBE5;
  --color-blue-medium: #9ED1FA;
  --color-cyan-medium: #9ADFFE;
  --color-green-medium: #B8E0B9;
  --color-yellow-medium: #FFE599;
  --color-orange-medium: #FFD699;
  --color-dahong-medium: #FFB199;
  --color-brown-medium: #D9C6BF;
  --color-iron-medium: #CCCCCC;
  --color-steel-medium: #C3CFD5;

  /* --- Primary Brand Levels --- */
  --primary-lv-0: #E9EEED;
  --primary-lv-1: #D2DCDB;
  --primary-lv-2: #A5B9B6;
  --primary-lv-3: #789792;
  --primary-lv-4: #4B746D;
  --primary-lv-5: #35635C;
  --primary-lv-6: #1E5149;
  --primary-lv-7: #1B443D;
  --primary-lv-8: #193833;
  --primary-lv-9: #162A27;

  /* --- Legacy Aliases (Maintained for compatibility) --- */
  --primary-color: var(--primary-lv-6);
  --primary-hover: var(--primary-lv-5);
  --primary-light: var(--primary-lv-0);

  --text-main: #111827;
  --text-muted: #6B7280;
  --border-color: #E5E7EB;
  --bg-color: #F9FAFB;
  --bg-light: #FAFAFA;
  --sidebar-bg: #ffffff;
  --white: #FFFFFF;
  --danger: var(--color-red);

  --dash-primary: #6cc020;
  --dash-light: #f2f9ec;
  --dash-danger: #cf222e;

  --header-height: 52px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  letter-spacing: -0.02em;
  /* 모든 요소에 자간 규칙 일괄 적용 */
}

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  line-height: 1.5;
  font-size: 14px;
  overflow: hidden;
}

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
}

/* --- Main Header & GNB/LNB --- */
.main-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  height: var(--header-height);
}

.header-container {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.main-logo {
  height: 34px;
  width: auto;
}

.brand h1 {
  font-size: 1.1rem;
  /* 전체적으로 살짝 축소 */
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.brand h1 .sub-title {
  font-size: 0.85rem;
  /* 영문 제목은 더 작게 */
  color: var(--primary-color);
  font-weight: 600;
  margin-left: 0.25rem;
}

.integrated-nav {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-group {
  display: flex;
  align-items: center;
  height: 100%;
}

.gnb-trigger {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  padding: 0 1rem;
  cursor: pointer;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.lnb-shelf {
  display: none;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.75rem;
  height: 60%;
  border-left: 1px solid var(--border-color);
  margin-left: 0.25rem;
  animation: fadeIn 0.2s ease-out;
}

.nav-group:hover .lnb-shelf,
.nav-group.is-showing-shelf .lnb-shelf {
  display: flex;
}

.lnb-item {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
}

.lnb-item:hover {
  color: var(--primary-color);
  background-color: var(--bg-color);
}

.lnb-item.active {
  color: var(--primary-color);
  background-color: var(--primary-light);
  font-weight: 700;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Global Actions & Buttons --- */
.header-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.8rem;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  height: 28px;
  line-height: 1;
  white-space: nowrap; /* 텍스트 줄바꿈 방지 */
  flex-shrink: 0; /* 크기 찌그러짐 방지 */
}

.btn i,
.btn svg {
  width: 12px !important;
  height: 12px !important;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  border: 1px solid var(--primary-color);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-danger {
  color: var(--danger) !important;
  border-color: var(--danger) !important;
}

/* --- Layout Frame --- */
.content-area {
  flex: 1;
  padding: 1.25rem 2rem 0; /* 상단 여백 1.25rem 추가 */
  overflow: hidden;
  /* 전체 스크롤 차단 */
  display: flex;
  flex-direction: column;
}

.view-container {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* 내부 스크롤을 유도하기 위해 설정 */
}

/* --- Footer --- */
.main-footer {
  height: 40px;
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 1.5rem;
  flex-shrink: 0;
}

.main-footer p {
  font-family: 'Pretendard Variable', Pretendard, sans-serif;
  font-size: 0.75rem;
  font-weight: 300;
  line-height: 1.25rem;
  letter-spacing: -0.0175rem;
  color: #777777;
  user-select: none;
  pointer-events: all;
  -webkit-user-drag: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.text-nowrap {
  white-space: nowrap;
}

/* --- Utility Styles --- */
.badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--primary-color);
  color: white;
}

.badge-muted {
  background-color: #9CA3AF;
  color: white;
}

.text-tag {
  color: var(--text-muted);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  background-color: var(--bg-light);
}

.font-bold {
  font-weight: 700;
}

/* --- Responsive Design (Tablet & Mobile) --- */
@media (max-width: 1200px) {
  .header-container { gap: 0.75rem; padding: 0 1rem; }
  .brand h1 { font-size: 1rem; }
  .brand h1 .sub-title { font-size: 0.75rem; }
}

@media (max-width: 992px) {
  .main-header { height: auto; padding: 0.5rem 0; }
  .header-container { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .integrated-nav { width: 100%; justify-content: flex-start; border-top: 1px solid var(--border-color); padding-top: 0.5rem; }
  .header-actions { width: 100%; justify-content: flex-end; padding-top: 0.5rem; }
  .content-area { padding: 0 1rem; }
}

@media (max-width: 768px) {
  .brand h1 .sub-title { display: none; } /* 아주 좁은 화면에선 영문명 숨김 */
  .header-actions .btn span { display: none; } /* 버튼 텍스트 숨기고 아이콘만 표시 */
  .header-actions .btn { padding: 0 0.5rem; }
}