header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 220px;
}

.brand-logo {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 1rem;
  background: radial-gradient(circle at 20% 20%, #e0f2fe, #38bdf8 45%, #0ea5e9 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 25px 45px -30px rgba(56, 189, 248, 0.9);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.9);
}

.navigation {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-width: 0;
}

.primary-nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
}

.primary-nav::-webkit-scrollbar {
  display: none;
}

.menu-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0;
  border: none;
  background: transparent;
  color: rgba(226, 232, 240, 0.75);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-align: center;
  transition: color 0.2s ease;
}

.menu-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    rgba(56, 189, 248, 0),
    rgba(56, 189, 248, 0.75),
    rgba(56, 189, 248, 0)
  );
  opacity: 0;
  transform: scaleX(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-link:hover,
.menu-link:focus-visible {
  color: #f8fafc;
}

.menu-link:hover::after,
.menu-link:focus-visible::after {
  opacity: 0.5;
  transform: scaleX(1);
}

.menu-link[data-active='true'] {
  color: #f8fafc;
}

.menu-link[data-active='true']::after {
  opacity: 1;
  transform: scaleX(1);
}

.menu-label {
  font-size: 0.95rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-left: auto;
}

.nav-group {
  position: relative;
}

.nav-group[hidden] {
  display: none;
}

.nav-trigger {
  color: rgba(226, 232, 240, 0.8);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 9999px;
  font: inherit;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: border 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.nav-trigger:hover,
.nav-trigger:focus-visible,
.nav-trigger[data-active='true'] {
  color: #f8fafc;
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(56, 189, 248, 0.2);
}

.nav-trigger svg {
  width: 0.9rem;
  height: 0.9rem;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 12rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 35px -20px rgba(15, 23, 42, 0.7);
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 20;
}

.nav-group[data-open='true'] .nav-menu {
  display: flex;
}

.nav-menu a {
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  background: transparent;
  color: rgba(226, 232, 240, 0.9);
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-menu a[data-active='true'] {
  color: #f8fafc;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: rgba(56, 189, 248, 0.15);
  color: #f8fafc;
}

.logout-button {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: rgba(226, 232, 240, 0.9);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: border 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.logout-button:hover,
.logout-button:focus-visible {
  background: rgba(248, 250, 252, 0.08);
  border-color: rgba(56, 189, 248, 0.7);
  color: #f8fafc;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.user-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.25);
  display: grid;
  place-items: center;
  color: #38bdf8;
  font-weight: 700;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-role {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.85);
}

@media (max-width: 768px) {
  header {
    padding: 1rem 1.25rem;
  }

  .navigation {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .primary-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}
