/* ─────────────────────────────────────────────────────────
   CareNara 앱 헤더 + 모바일 하단 탭바
   v=20260502
   ───────────────────────────────────────────────────────── */

/* ── 상단 헤더 ── */
.app-header {
  display: flex;
  align-items: center;
  height: var(--header-height, 60px);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 200;
  user-select: none;
  flex-shrink: 0;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  padding-right: 20px;
  margin-right: 8px;
  border-right: 1px solid rgba(255,255,255,.2);
  flex-shrink: 0;
  white-space: nowrap;
  transition: opacity .15s;
}
.app-logo:hover { opacity: .85; }

/* ── PC 탭 메뉴 ── */
.app-pc-menu {
  display: flex;
  align-items: center;
  flex: 1;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
}
.app-pc-menu::-webkit-scrollbar { display: none; }

.app-pc-tab {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.app-pc-tab:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.app-pc-tab.active {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.08);
}

/* ── 우측 영역 ── */
.app-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,.2);
}

/* 알림 벨 */
.app-bell {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 1.1rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .15s;
}
.app-bell:hover { background: rgba(255,255,255,.15); }

.app-notif-badge {
  display: none;
  position: absolute;
  top: -1px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: 0 4px;
  font-size: .6rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  line-height: 1;
}

/* 역할 배지 */
.app-role-badge {
  background: rgba(255,255,255,.18);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

/* 이름 */
.app-username {
  color: rgba(255,255,255,.9);
  font-size: .8125rem;
  font-weight: 500;
  white-space: nowrap;
}

/* 로그아웃 버튼 */
.app-logout {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
  font-size: .8125rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.app-logout:hover {
  background: rgba(220,38,38,.55);
  color: #fff;
  border-color: transparent;
}

/* ── 알림 패널 ── */
.app-notif-panel {
  display: none;
  position: fixed;
  top: calc(var(--header-height, 60px) + 4px);
  right: 16px;
  width: 320px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
  z-index: 10000;
  max-height: 420px;
  overflow-y: auto;
  animation: notif-in .12s ease;
}
.app-notif-panel.open { display: block; }
@keyframes notif-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.app-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-weight: 700;
  font-size: .9375rem;
  border-bottom: 1px solid #f3f4f6;
  position: sticky;
  top: 0;
  background: #fff;
}
.app-notif-readall {
  font-size: .75rem;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .1s;
}
.app-notif-readall:hover { color: #374151; }

.app-notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f9fafb;
  cursor: pointer;
  transition: background .1s;
}
.app-notif-item:hover { background: #f8fafc; }
.app-notif-item--unread { background: #eff6ff; }
.app-notif-item--unread:hover { background: #dbeafe; }
.app-notif-title { font-weight: 600; font-size: .875rem; margin-bottom: 2px; }
.app-notif-msg   { font-size: .8rem; color: #6b7280; }
.app-notif-time  { font-size: .75rem; color: #9ca3af; margin-top: 2px; }
.app-notif-empty,
.app-notif-loading { padding: 24px; text-align: center; color: #6b7280; font-size: .875rem; }

/* ── 모바일 하단 탭바 ── */
.app-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-tab-height, 60px);
  background: #fff;
  border-top: 1px solid #e5e7eb;
  z-index: 200;
  box-shadow: 0 -2px 10px rgba(0,0,0,.07);
  /* 탭 버튼 균등 배치 */
  flex-direction: row;
  align-items: stretch;
}

.app-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 6px 4px;
  transition: color .15s;
  height: 100%;
}
.app-tab-btn:hover  { color: #6b7280; }
.app-tab-btn.active { color: var(--tab-active, #2563eb); }

.app-tab-icon  { font-size: 1.3rem; line-height: 1; }
.app-tab-label { font-size: .625rem; font-weight: 600; white-space: nowrap; letter-spacing: -.01em; }

/* ── 더보기 드롭업 ── */
.app-dropup {
  display: none;
  position: fixed;
  bottom: calc(var(--bottom-tab-height, 60px) + 8px);
  right: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.13);
  z-index: 300;
  min-width: 170px;
  overflow: hidden;
  animation: dropup-in .15s ease;
}
.app-dropup.open { display: block; }
@keyframes dropup-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.app-dropup-item {
  display: block;
  padding: 13px 20px;
  color: #374151;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: background .1s;
  white-space: nowrap;
}
.app-dropup-item:hover { background: #f1f5f9; }
.app-dropup-item:not(:last-child) { border-bottom: 1px solid #f3f4f6; }

/* ── 반응형 ── */
/* PC (1024px+): 하단 탭바 숨김 */
@media (min-width: 769px) {
  .app-bottom-bar { display: none !important; }
  .app-dropup     { display: none !important; }
}

/* 태블릿 미만 (768px-): PC 메뉴·배지·이름·로그아웃 숨김 */
@media (max-width: 768px) {
  .app-pc-menu    { display: none; }
  .app-role-badge { display: none; }
  .app-username   { display: none; }
  .app-logout     { display: none; }
  .app-header     { padding: 0 16px; }
  .app-bottom-bar { display: flex; }
}

/* 중간 해상도: 탭 간격 축소 */
@media (min-width: 769px) and (max-width: 1200px) {
  .app-pc-tab { padding: 0 12px; font-size: .8125rem; }
}
