/* USV — popover.css — 알림 팝오버 + 사용자 드롭다운 메뉴 (topbar 확장) */
/* ===================================================================
   46. 알림 버튼 + 팝오버 (topbar)
   =================================================================== */
.topbar-notif-wrap {
  position: relative;
  flex-shrink: 0;
}

.notif-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.notif-btn:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-strong);
}
.notif-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand-soft-border);
}
.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--surface);
  display: none;
}
.notif-dot.visible { display: block; }

.notif-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  z-index: var(--z-dropdown);
  display: none;
  overflow: hidden;
}
.notif-popover.open { display: block; }

.notif-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}
.notif-popover-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.notif-read-all {
  background: transparent;
  border: none;
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.notif-read-all:hover { background: var(--brand-soft); }

.notif-tabs {
  display: flex;
  gap: 4px;
  padding: 0 12px 4px;
  border-bottom: 1px solid var(--border);
}
.notif-tab {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.notif-tab:hover { color: var(--text); }
.notif-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.notif-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 4px 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.notif-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.notif-icon.success { background: var(--success-soft); color: var(--success-text); }
.notif-icon.info    { background: var(--brand-soft); color: var(--brand); }
.notif-icon.warn    { background: var(--warn-soft);  color: var(--warn-text); }
.notif-icon.mention { background: #FEF3C7; color: #B45309; }

.notif-content {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-time {
  font-size: 11px;
  color: var(--muted);
}

.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.notif-more {
  display: block;
  text-align: center;
  padding: 12px;
  font-size: 13px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.notif-more:hover { background: var(--brand-soft); }

/* ===================================================================
   47. 사용자 드롭다운 메뉴 (.topbar-user-wrap, .user-menu)
   =================================================================== */
.topbar-user-wrap {
  position: relative;
  flex-shrink: 0;
}
.topbar-user-wrap .topbar-user-btn.active {
  background: var(--bg);
  border-color: var(--border-strong);
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  z-index: var(--z-dropdown);
  display: none;
  padding: 6px;
  overflow: hidden;
}
.user-menu.open { display: block; }

.user-menu-header {
  padding: 10px 12px 6px;
}
.user-menu-name {
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.user-menu-email {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}
.user-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  text-align: left;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.user-menu-item:hover {
  background: var(--bg);
  color: var(--text);
}
.user-menu-item svg {
  flex-shrink: 0;
  color: var(--muted);
}
.user-menu-item:hover svg { color: var(--text); }
.user-menu-logout {
  color: var(--danger);
}
.user-menu-logout:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.user-menu-logout svg { color: var(--danger); }

/* 모바일 — 팝오버 뷰포트 내 고정 */
@media (max-width: 768px) {
  /* 알림 팝오버: 우측 8px, 좌측 8px 고정 */
  .notif-popover {
    position: fixed !important;
    top: calc(var(--header-height) + 4px) !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
  }
  /* 사용자 메뉴: 우측 8px 고정, 너비 꽉 채움 */
  .user-menu {
    position: fixed !important;
    top: calc(var(--header-height) + 4px) !important;
    right: 8px !important;
    width: 240px !important;
    max-width: calc(100vw - 16px) !important;
  }
}

