/* 케어나라 상단 네비게이션 바 — 사이드바 완전 대체 */

.topnav {
  display: flex; align-items: center;
  height: 52px; padding: 0 20px; gap: 0;
  user-select: none; z-index: 200;
}

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

.topnav-menu { display: flex; align-items: center; gap: 2px; flex: 1; }

.topnav-item { position: relative; }

.topnav-btn {
  display: flex; align-items: center;
  height: 52px; padding: 0 14px;
  background: none; border: none;
  color: rgba(255,255,255,.85);
  font-size: .875rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.topnav-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.topnav-item:has(.topnav-dropdown.open) .topnav-btn {
  color: #fff; border-bottom-color: rgba(255,255,255,.8); background: rgba(255,255,255,.1);
}
.topnav-btn--disabled { color: rgba(255,255,255,.3); cursor: not-allowed; }
.topnav-btn--disabled:hover { background: none; color: rgba(255,255,255,.3); }

/* 드롭다운 */
.topnav-dropdown {
  display: none; position: absolute;
  top: calc(100% + 2px); left: 0;
  min-width: 180px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 300; overflow: hidden;
  animation: dd-in .12s ease;
}
.topnav-dropdown.open { display: block; }
@keyframes dd-in { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

.topnav-dd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; color: #374151;
  text-decoration: none; font-size: .875rem; font-weight: 500;
  transition: background .1s; white-space: nowrap;
}
.topnav-dd-item:hover { background: #f1f5f9; color: #1e293b; }
.topnav-dd-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; }

/* 우측 */
.topnav-user {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; margin-left: auto;
  padding-left: 16px; border-left: 1px solid rgba(255,255,255,.15);
}
.topnav-username { color: rgba(255,255,255,.9); font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.topnav-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;
}
.topnav-logout:hover { background: rgba(220,38,38,.6); color: #fff; border-color: transparent; }

/* 햄버거 */
.topnav-hamburger {
  display: none; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px;
  width: 36px; height: 36px; background: none; border: none; cursor: pointer; margin-left: auto;
}
.topnav-hamburger span { display:block; width:20px; height:2px; background:rgba(255,255,255,.85); border-radius:2px; transition:transform .2s, opacity .2s; }
.topnav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topnav-hamburger.open span:nth-child(2) { opacity: 0; }
.topnav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 모바일 드로어 */
.topnav-drawer {
  display: none; position: fixed; top: 52px; left:0; right:0;
  background: #fff; border-top: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 199;
  max-height: calc(100vh - 52px); overflow-y: auto; padding: 8px 0 16px;
}
.topnav-drawer.open { display: block; }
.topnav-drawer-title { padding: 8px 20px 4px; font-size:.6875rem; font-weight:700; letter-spacing:.08em; color:#2563eb; text-transform:uppercase; }
.topnav-drawer-title--disabled { color: #94a3b8; }
.topnav-drawer-item { display:block; padding:10px 24px; color:#374151; text-decoration:none; font-size:.875rem; font-weight:500; transition:background .1s; }
.topnav-drawer-item:hover { background: #f1f5f9; }
.topnav-drawer-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; }

@media (max-width: 1200px) { .topnav-btn { padding: 0 10px; font-size: .8125rem; } }
@media (max-width: 768px) {
  .topnav-menu { display: none; }
  .topnav-username { display: none; }
  .topnav-logout { display: none; }
  .topnav-hamburger { display: flex; }
}
