/* ===== 전 페이지 공통 셸: 다크 상단바 · 좌측 사이드바 · 본문 컨테이너 ===== */

/* 페이지 이동 시 사이드바/상단바는 그대로 두고 본문만 바뀌는 것처럼 보이게 한다 */
@view-transition {
  navigation: auto;
}

.sidebar {
  view-transition-name: shell-sidebar;
}

.topbar {
  view-transition-name: shell-topbar;
}

::view-transition-old(shell-sidebar),
::view-transition-new(shell-sidebar),
::view-transition-old(shell-topbar),
::view-transition-new(shell-topbar) {
  animation: none;
  mix-blend-mode: normal;
  height: 100%;
  overflow: clip;
}

::view-transition-group(shell-sidebar),
::view-transition-group(shell-topbar) {
  animation-duration: 0s;
}

/* ===== 상단 바 ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: var(--topbar-h);
  padding: 0 20px;
  background: #111111;
  color: #f8fbff;
  border-bottom: 1px solid #1a1a1a;
}

.topbar__menu {
  display: none;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: 10px;
  color: #d5d8de;
}
.topbar__menu:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar__menu svg { width: 20px; height: 20px; stroke-width: 2; }

.topbar__dot {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}
.topbar__dot svg { width: 16px; height: 16px; stroke-width: 2; }

.topbar__title { font-size: 15px; font-weight: 800; letter-spacing: -.3px; color: #f4f5f7; }
.topbar__home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f4f5f7;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}
.topbar__spacer { flex: 1; }

.topbar__auth {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.topbar__user {
  max-width: 88px;
  overflow: hidden;
  color: #c8ccd3;
  font-size: 12.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.topbar__btn--ghost {
  border: 1px solid #5a5f68;
  color: #f4f5f7;
  background: transparent;
}
.topbar__btn--ghost:hover {
  background: rgba(255, 255, 255, .08);
  border-color: #8b9098;
  color: #fff;
}

.topbar__btn--primary {
  background: var(--primary);
  color: #fff;
}
.topbar__btn--primary:hover { background: var(--primary-dark); }

.topbar__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  color: #d5d8de;
}
.topbar__icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar__icon svg { width: 19px; height: 19px; }

.topbar__badge {
  position: absolute;
  top: 3px; right: 3px;
  min-width: 15px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ff4d4f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}
.topbar__badge[hidden] { display: none !important; }

.notice-pop {
  position: fixed;
  z-index: 60;
  width: min(360px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.notice-pop[hidden] { display: none !important; }
.notice-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.notice-pop__head strong {
  font-size: 13.5px;
  font-weight: 800;
}
.notice-pop__all {
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.notice-pop__list {
  max-height: min(420px, 70vh);
  overflow: auto;
}
.notice-pop__empty {
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.notice-pop__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.notice-pop__item:last-child { border-bottom: 0; }
.notice-pop__item:hover { background: #f8fbff; }
.notice-pop__dot {
  width: 8px;
  height: 8px;
  flex: none;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary);
}
.notice-pop__dot.is-off { background: #d5dbe7; }
.notice-pop__copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}
.notice-pop__title {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  word-break: keep-all;
}
.notice-pop__meta {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

/* ===== 레이아웃 ===== */
.layout {
  display: grid;
  width: 100%;
  height: calc(100% - var(--topbar-h));
  margin-top: var(--topbar-h);
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
}

/* ===== 사이드바 ===== */
.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100%;
  padding: 12px 10px 10px;
  background: #f3f8ff;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: flex-start;
  flex: none;
  gap: 8px;
  padding: 2px 8px 10px;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  flex: none;
  margin-top: 1px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}
.brand__mark svg { width: 17px; height: 17px; stroke-width: 1.9; }
.brand__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand__text {
  color: var(--primary);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -.4px;
  line-height: 1.3;
  white-space: normal;
}
.brand__text b { color: inherit; font-weight: 800; }
.brand__sub {
  min-height: 0;
  color: #1e293b;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -.3px;
}

.nav { flex: 1; min-height: 0; overflow: hidden; }
.nav__list { display: flex; flex-direction: column; gap: 2px; }

.nav__divider {
  height: 1px;
  margin: 5px 8px;
  border: 0;
  background: var(--line);
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  color: #0f172a;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.2px;
  text-align: left;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  box-shadow: none;
  transition: background .14s, color .14s;
}
.nav__link:hover:not(.is-active) { background: #dbeafe; color: var(--primary-dark); }
.nav__link.is-active,
.nav__link.is-active:hover,
.nav__link.is-active:active,
.nav__link.is-active:focus,
.nav__link.is-active:focus-visible {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}
.nav__link:focus,
.nav__link:focus-visible,
.nav__link:active {
  outline: none;
  box-shadow: none;
}
.nav__link span { flex: 1; white-space: nowrap; }
.nav__link.is-locked {
  opacity: .48;
}
.nav__link.is-locked:hover:not(.is-active) { background: #f1f5f9; color: #64748b; }
.nav__icon { width: 18px; height: 18px; flex: none; color: #3b6fd4; stroke-width: 2; }
.nav__link:hover:not(.is-active) .nav__icon { color: var(--primary); }
.nav__link.is-active .nav__icon,
.nav__link.is-active:hover .nav__icon,
.nav__link.is-active:active .nav__icon {
  color: var(--primary);
}

.nav__link--quiet { color: #0f172a; font-size: 14.5px; font-weight: 700; }

.nav__guest-hint {
  margin: 0 10px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
}

.sidebar__foot {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.scrim {
  position: fixed;
  inset: var(--topbar-h) 0 0;
  z-index: 29;
  background: rgba(23, 29, 43, .42);
}

/* ===== 본문 컨테이너 ===== */
.main {
  min-width: 0;
  height: 100%;
  padding: 22px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

/* ===== 사이드바 반응형 (모바일 드로어) ===== */
@media (max-width: 860px) {
  .topbar__menu { display: flex; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    z-index: 30;
    width: 264px;
    max-width: 264px;
    min-width: 264px;
    height: calc(100% - var(--topbar-h));
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .main { padding: 14px 14px 18px; }
  .topbar__btn { padding: 0 10px; font-size: 12px; }
  .topbar__user { display: none; }
}
