/* ===== 앱 셸 (사이드바 + 메인) ===== */
.app-shell { display: flex; min-height: 100vh; max-height: 100vh; overflow: hidden; }
.main { min-height: 0; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 60;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--line-soft);
  transition: background .15s;
}
.sidebar-brand:hover { background: var(--panel-soft); }
.sidebar-brand .logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, #3b82f6 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.sidebar-brand .logo-text { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
.sidebar-brand .logo-text b { color: var(--brand); }

.sidebar-section-label {
  font-size: 13px; font-weight: 700; color: var(--text);
  letter-spacing: .02em;
  padding: 20px 12px 8px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; flex: 1; overflow-y: auto; }
/* 섹션 라벨 다음에 오는 하위 메뉴는 들여쓰기 */
.sidebar-nav .nav-sub { margin-left: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  cursor: pointer; user-select: none;
  font-size: 14px; font-weight: 500; color: var(--sub);
  border: none; background: transparent; text-align: left;
  transition: all .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.75; }
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.tab-active {
  background: var(--brand-soft); color: var(--brand); font-weight: 600;
}
.nav-item.tab-active svg { stroke-width: 2.25; }

.sidebar-footer {
  border-top: 1px solid var(--line-soft);
  padding: 12px;
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--panel-soft);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, #60a5fa 100%);
  color: #fff; font-weight: 600; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-email {
  font-size: 12px; color: var(--text); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-logout {
  font-size: 11px; color: var(--sub);
  background: none; border: none; padding: 0; cursor: pointer;
  font-weight: 500;
}
.user-logout:hover { color: var(--danger); background: none !important; }

/* ===== 메인 ===== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-topbar {
  display: none;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 14px; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 40;
}
.hamburger {
  background: transparent; border: none; padding: 6px;
  cursor: pointer; color: var(--sub); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.hamburger:hover { background: var(--bg-soft) !important; }
.hamburger svg { width: 22px; height: 22px; }

/* ===== 페이지 헤더 ===== */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}
.page-title {
  margin: 0 0 4px; font-size: 22px; font-weight: 700;
  letter-spacing: -.015em; color: var(--text);
}
.page-subtitle { margin: 0; font-size: 13px; color: var(--sub); }
.page-meta { font-size: 12px; color: var(--muted); }

/* ===== 콘텐츠 / 패널 ===== */
.content { padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0; overflow-y: auto; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.row:last-child { margin-bottom: 0; }

/* ===== 사이드바 백드롭 + 모바일 ===== */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(2px);
  z-index: 55;
}

@media (max-width: 900px) {
  .main-topbar { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
}
