/* Стили для шапки */
.header-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: saturate(160%) var(--blur);
  background: var(--bg-soft);
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: clamp(12px, 3vw, 16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  padding: 8px 0;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.logo {
  width: clamp(32px, 8vw, 36px);
  height: clamp(32px, 8vw, 36px);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  box-shadow: 0 6px 18px var(--ring);
  display: grid;
  place-items: center;
  color: #0b0f17;
  font-weight: 800;
  font-size: clamp(12px, 3vw, 14px);
  flex-shrink: 0;
}

.brand-title {
  font-weight: 800;
  letter-spacing: .2px;
  font-size: clamp(16px, 4vw, 18px);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border-radius: 999px;
  padding: 4px;
  margin: 0 auto;
}

.nav a {
  padding: clamp(6px, 1.5vw, 8px) clamp(10px, 2.5vw, 12px);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: clamp(12px, 3vw, 14px);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav a.active,
.nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,.08);
}

.actions {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 10px);
  flex-shrink: 0;
}

.btn-h {
  height: 40px;
  padding: 0 clamp(10px, 2.5vw, 14px);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  font-size: clamp(12px, 3vw, 14px);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-h:hover {
  background: rgba(255,255,255,.08);
}

.btn-h span {
  display: none;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #c7d2fe);
  color: #111827;
  display: grid;
  place-items: center;
  font-weight: 800;
  cursor: pointer;
  border: 3px solid rgba(255,255,255,.25);
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.avatar:hover {
  transform: scale(1.05);
  border-color: rgba(255,255,255,.4);
}

.dropdown {
  position: relative;
}

.menu {
  position: absolute;
  right: 0;
  top: 48px;
  min-width: 220px;
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 1000;
}

:root.light .menu {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0,0,0,.1);
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
}

.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.menu a:hover,
.menu button:hover {
  background: rgba(255,255,255,.12);
}

:root.light .menu a:hover,
:root.light .menu button:hover {
  background: rgba(0,0,0,.06);
}

/* Мобильное меню */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: rgba(255,255,255,.08);
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-soft);
  backdrop-filter: saturate(160%) var(--blur);
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding: 16px;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav a {
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 16px;
}

.mobile-nav a.active,
.mobile-nav a:hover {
  background: rgba(255,255,255,.08);
}

/* Адаптивные стили */
@media (min-width: 768px) {
  .btn-h span {
    display: inline;
  }
  
  .nav {
    margin: 0;
  }
}

@media (max-width: 767px) {
  .nav {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .brand-title {
    font-size: 16px;
  }
  
  .actions {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .header {
    height: 56px;
  }
  
  .brand-title {
    display: none;
  }
  
  .logo {
    width: 36px;
    height: 36px;
  }
  
  .btn-h {
    padding: 0 10px;
  }
  
  .avatar {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .container {
    padding: 0 12px;
  }
  
  .header {
    gap: 8px;
  }
  
  .actions {
    gap: 6px;
  }
}