/* ============================================================
   host-shell-v3.css — 호스트 리뉴얼 v3 공통 셸
   원본: claude.ai/design "호스트 대시보드 UI 리뉴얼 v2"
   (Sidebar.dc.html / MobileTabbar.dc.html / 헤더 패턴)
   Wanted DS 토큰(css/wanted-ds.css) 필요. Light 전용.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: #171717;
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}
.ph, [class^="ph-"], [class*=" ph-"] { line-height: 1; display: inline-flex; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--ws-line-strong);
  border-radius: 9999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

@keyframes hv-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.hv-rise { animation: hv-rise .55s cubic-bezier(.2,.7,.2,1) both; }

/* ── 앱 레이아웃 ── */
.hv-app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: var(--ws-bg-alt);
}
.hv-main {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── 사이드바 ── */
.hv-sidebar-slot { width: 256px; flex: none; height: 100%; }
.hv-sidebar {
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  border-right: 1px solid var(--ws-line-alt);
  display: flex;
  flex-direction: column;
  padding: 18px 16px 14px;
  font-family: var(--font-sans);
}
.hv-logo { display: flex; align-items: center; gap: 9px; padding: 6px 8px 16px; text-decoration: none; }
.hv-logo-badge {
  width: 26px; height: 26px; border-radius: 8px; background: #3366FF;
  display: flex; align-items: center; justify-content: center; flex: none;
  color: #fff; font-weight: 800; font-size: 15px; line-height: 1;
}
.hv-logo-text { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: #171717; }
.hv-logo-sup { font-size: 10px; font-weight: 600; color: var(--ws-text-alternative); margin-top: -8px; }

.hv-side-cta { display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; }
.hv-cta-chat {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--ws-primary); color: #fff;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  text-decoration: none;
  transition: background var(--ws-duration-fast) var(--ws-ease-standard);
}
.hv-cta-chat:hover { background: var(--ws-primary-strong); }
.hv-cta-qr {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; border-radius: 12px;
  background: var(--ws-fill); color: var(--ws-text-alternative);
  text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer;
}
.hv-cta-qr:hover { filter: brightness(.98); background: rgba(112,115,124,.08); }
.hv-cta-qr.active { background: #EFF3FF; color: #3366FF; }

.hv-nav { flex: 1; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.hv-nav-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--ws-text-alternative); padding: 14px 8px 6px;
}
.hv-nav-row {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 12px;
  color: var(--ws-text-alternative); background: transparent;
  text-decoration: none; font-size: 14px; font-weight: 400; cursor: pointer;
  border: none; width: 100%; font-family: var(--font-sans); text-align: left;
}
.hv-nav-row:hover { background: rgba(112,115,124,.08); }
.hv-nav-row.active { background: #EFF3FF; color: #3366FF; font-weight: 600; }
.hv-nav-row .hv-nav-icon { font-size: 19px; }
.hv-nav-badge {
  margin-left: auto; background: #3366FF; color: #fff;
  font-size: 11px; font-weight: 600; min-width: 19px; height: 19px;
  border-radius: 9999px; display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.hv-nav-caret { font-size: 14px; margin-left: auto; color: var(--ws-text-assistive); transition: transform .18s ease; }
.hv-nav-row[aria-expanded="true"] .hv-nav-caret { transform: rotate(90deg); }
.hv-nav-plan {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: #7F54FF; background: #F6F7FE; border-radius: 9999px; padding: 2px 8px;
}
.hv-nav-sub { display: none; flex-direction: column; gap: 1px; }
.hv-nav-sub.open { display: flex; }
.hv-nav-sub a {
  display: flex; align-items: center;
  padding: 8px 10px 8px 40px; border-radius: 10px;
  color: var(--ws-text-alternative); text-decoration: none; font-size: 13px;
}
.hv-nav-sub a:hover { background: rgba(112,115,124,.08); }
.hv-nav-sub a.active { color: #3366FF; font-weight: 600; background: #EFF3FF; }

.hv-side-profile {
  border-top: 1px solid var(--ws-line-alt);
  padding-top: 12px; margin-top: 8px;
  display: flex; align-items: center; gap: 11px;
  cursor: pointer; text-decoration: none;
}
.hv-side-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: #EFF3FF; color: #3366FF;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; overflow: hidden;
}
.hv-side-profile-info { min-width: 0; flex: 1; }
.hv-side-profile-name {
  font-size: 13px; font-weight: 600; color: #171717;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hv-side-profile-sub { font-size: 12px; color: var(--ws-text-alternative); }
.hv-side-profile-caret { font-size: 16px; color: var(--ws-text-assistive); transition: color .12s ease; }
.hv-side-profile-wrap:hover .hv-side-profile-caret { color: var(--ws-text-alternative); }

/* ── 프로필 계정 팝오버(호버 시 위로 열림) ── */
.hv-side-profile-wrap { position: relative; }
.hv-side-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px);
  background: #FFFFFF; border: 1px solid var(--ws-line-alt); border-radius: 14px;
  box-shadow: var(--ws-shadow-overlay, 0 12px 32px rgba(0, 0, 0, .16));
  padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 40;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
/* 프로필과 메뉴 사이 6px 갭을 채우는 호버 브리지(호버 끊김 방지) */
.hv-side-menu::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; }
.hv-side-profile-wrap:hover .hv-side-menu,
.hv-side-menu:hover,
.hv-side-menu:focus-within { opacity: 1; visibility: visible; transform: translateY(0); }
.hv-side-menu-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--ws-text-normal);
  text-decoration: none; background: none; border: none; cursor: pointer; text-align: left; width: 100%;
  transition: background .12s ease;
}
.hv-side-menu-item:hover { background: var(--ws-fill); }
.hv-side-menu-item i { font-size: 17px; color: var(--ws-text-alternative); flex: none; }
.hv-side-menu-item.danger { color: #E5484D; }
.hv-side-menu-item.danger i { color: #E5484D; }

/* ── 페이지 헤더 ── */
.hv-header {
  flex: none; background: #FFFFFF;
  border-bottom: 1px solid var(--ws-line-alt);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 20px;
}
.hv-header-titles { min-width: 0; overflow: hidden; }
.hv-header-titles h1 {
  margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hv-header-titles p {
  margin: 2px 0 0; font-size: 13px; color: var(--ws-text-alternative);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hv-header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.hv-headsearch { width: 200px; position: relative; }
.hv-headsearch .ph {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: var(--ws-text-assistive);
}
.hv-headsearch input {
  width: 100%; height: 38px; border: none; border-radius: 12px;
  background: var(--ws-fill); padding: 0 12px 0 34px;
  font-size: 13px; font-family: var(--font-sans); color: #171717; outline: none;
}
.hv-datepill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 999px;
  background: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(112,115,124,.22);
  font-size: 13px; font-weight: 600; color: #4B4F57; cursor: pointer;
  border: none; font-family: var(--font-sans);
}
.hv-datepill .caret { font-size: 13px; color: #9EA1A8; }
.hv-bell {
  position: relative; width: 38px; height: 38px; border: none; border-radius: 12px;
  background: var(--ws-fill); display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.hv-bell .ph { font-size: 18px; color: var(--ws-text-alternative); }
.hv-bell-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--ws-negative); color: #fff;
  font-size: 10px; font-weight: 600; min-width: 17px; height: 17px;
  border-radius: 9999px; display: none; align-items: center; justify-content: center;
  border: 2px solid #fff; padding: 0 3px;
}
.hv-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--ws-primary); color: #fff;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: background var(--ws-duration-fast) var(--ws-ease-standard);
}
.hv-btn-primary:hover { background: var(--ws-primary-strong); }

/* ── 알림 패널 ── */
.hv-noti-wrap { position: relative; }
.hv-noti-panel {
  position: absolute; top: 46px; right: 0; width: 360px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 16px;
  box-shadow: 0 0 1px rgba(0,0,0,.12), 0 8px 28px rgba(23,23,23,.12);
  z-index: 80; display: none; overflow: hidden;
}
.hv-noti-panel.open { display: block; }
.hv-noti-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--ws-line-alt);
}
.hv-noti-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.hv-noti-head button {
  border: none; background: none; color: #3366FF; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: var(--font-sans); padding: 4px 6px; border-radius: 8px;
}
.hv-noti-head button:hover { background: #EFF3FF; }
.hv-noti-list { max-height: 400px; overflow-y: auto; }
.hv-noti-empty { text-align: center; padding: 34px 16px; color: var(--ws-text-alternative); font-size: 13px; }
.hv-noti-item {
  display: flex; gap: 11px; padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--ws-line-alt);
}
.hv-noti-item:last-child { border-bottom: none; }
.hv-noti-item:hover { background: var(--ws-bg-alt); }
.hv-noti-item.unread { background: #F7FAFF; }
.hv-noti-item .ico {
  width: 34px; height: 34px; border-radius: 10px; background: #EFF3FF; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.hv-noti-item .ico .ph { font-size: 16px; color: #3366FF; }
.hv-noti-item .tit { font-size: 13px; font-weight: 600; color: #171717; margin: 0 0 2px; }
.hv-noti-item .txt {
  font-size: 12px; color: var(--ws-text-alternative); margin: 0 0 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hv-noti-item .tm { font-size: 11px; color: var(--ws-text-alternative); }

/* ── 모바일 탭바 + 드로어 ── */
.hv-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(64px + var(--app-safe-bottom, env(safe-area-inset-bottom, 0px)));
  padding-bottom: var(--app-safe-bottom, env(safe-area-inset-bottom, 0px));
  background: #FFFFFF; border-top: 1px solid var(--ws-line);
  display: none; align-items: stretch; z-index: 50;
  box-shadow: var(--ws-shadow-strong);
  font-family: var(--font-sans);
}
.hv-tabbar a, .hv-tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none; border: none; background: none; cursor: pointer;
  color: var(--ws-text-alternative); font-size: 10px; font-weight: 600;
  font-family: var(--font-sans);
}
/* 활성 탭은 ph-fill, 비활성은 ph 를 쓰므로 .ph 만 지정하면 활성 아이콘이 크기 규칙을
   못 받아 버튼 기본(10px)으로 축소된다 → 아이콘 <i> 전체를 21px 로 고정 */
.hv-tabbar i { font-size: 21px; }
.hv-tabbar .active { color: #3366FF; }

.hv-drawer-wrap { display: none; font-family: var(--font-sans); }
.hv-drawer-dim {
  position: fixed; inset: 0; background: rgba(23,23,23,.44); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.hv-drawer-wrap.open .hv-drawer-dim { opacity: 1; pointer-events: auto; }
.hv-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 290px; max-width: 86vw;
  background: #FFFFFF; z-index: 61; display: flex; flex-direction: column;
  box-shadow: 0 0 40px rgba(23,23,23,.22);
  transform: translateX(-102%); transition: transform .24s cubic-bezier(.4,0,.2,1);
}
.hv-drawer-wrap.open .hv-drawer { transform: translateX(0); }
.hv-drawer-head {
  display: flex; align-items: center; gap: 9px;
  padding: 16px 16px 14px; border-bottom: 1px solid var(--ws-line-alt);
}
.hv-drawer-close {
  margin-left: auto; width: 34px; height: 34px; border: 0;
  background: var(--ws-fill); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.hv-drawer-close .ph { font-size: 18px; color: var(--ws-text-alternative); }
.hv-drawer-quick { padding: 12px 12px 4px; display: flex; gap: 8px; }
.hv-drawer-quick a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; border-radius: 12px; text-decoration: none;
  font-size: 13px; font-weight: 600;
}
.hv-drawer-quick a .ph { font-size: 18px; }
.hv-drawer-quick a.home { background: #EFF3FF; color: #3366FF; }
.hv-drawer-quick a.qr { background: var(--ws-fill); color: var(--ws-text-alternative); }
.hv-drawer-nav { flex: 1; overflow-y: auto; padding: 6px 12px 20px; }
.hv-drawer-nav .hv-nav-row { padding: 10px 10px; }

/* ── 반응형 ── */
@media (max-width: 1140px) {
  .hv-headsearch { width: 150px; }
  .hv-datepill-wrap { display: none !important; }
}
@media (max-width: 760px) {
  .hv-sidebar-slot { display: none; }
  .hv-tabbar { display: flex; }
  .hv-drawer-wrap { display: block; }
  /* 커스텀 웹킷 스크롤바(위 width:10px)는 모바일에서도 오버레이가 아닌
     레이아웃 폭을 차지해 콘텐츠가 좌측으로 쏠려 보임 → 터치 기기는
     스와이프 스크롤이므로 스크롤바 공간 자체를 제거(표준 모바일 패턴) */
  ::-webkit-scrollbar { width: 0; height: 0; }
  * { scrollbar-width: none; }
}
@media (max-width: 680px) {
  .hv-headsearch { display: none; }
  .hv-hide-sm { display: none !important; }
}
