header {
  position: sticky;
  top: 0;
  /*display: grid;*/
  grid-template-columns: subgrid;
  height: var(--header-height);
  backdrop-filter: blur(10px);
  z-index: 20;
  padding: 0 30px; 
  margin-top: 15px; 
  box-sizing: border-box; 
}

.header-contents-container {
  grid-column: full-pad-start / full-pad-end;
  display: grid;
  grid-template-columns: auto 0 1fr;
  grid-template-areas: "left middle right";
  align-items: center;
  column-gap: var(--semibreve);
}

@media only screen and (min-width: 640px) {
  .header-contents-container.dashboard {
    grid-template-columns: 240px 1fr auto;
  }
}

.header-logo-container {
  grid-area: left;
  margin: 0 -8px;
  padding: 4px 8px;
  border-radius: var(--quaver);
  width: clamp(9.375rem, 4.9528rem + 11.7925vw, 12.5rem);
  display: flex;
  align-items: center;

  &:has(>.logo-link:hover) {
    background-color: rgb(from var(--mb) r g b / 0.2);
  }
  &:has(>.logo-link:active) {
    background-color: rgb(from var(--mb) r g b / 0.4);
  }
}

.logo-link {
  display: flex;
  justify-content: center;
  background: none;
  &:hover {
    background: none;
  }
}

.logo {
  object-fit: contain;
}

/* breadcrumb links */
.header-middle-breadcrumb-container {
  overflow-x: scroll;
  padding: var(--crotchet) 0;
}

.header-middle-breadcrumb-ul {
  display: none;
  align-items: center;
  gap: var(--crotchet);
  list-style: none;
  margin: auto 0;
}

@media (min-width: 640px) {
  .header-middle-breadcrumb-ul {
    display: flex;
  }
}

.header-breadcrumb-divider {
  color: var(--shw);
}

.header-breadcrumb-icon {
  flex-shrink: 0;
  color: var(--bg);
  height: 20px;
  width: 20px;
}

/* right nav */
.header-right-nav {
  grid-area: right;
  display: flex;
  flex-direction: row;
  justify-content: end;
}

.header-right-nav-ul {
  display: flex;
  flex-direction: row;
  justify-content: end;
  padding: 0;
  list-style: none;
  gap: var(--minim);
}

.header-text-link,
.header-breadcrumb-link {
  color: var(--shw);
  text-decoration: none;
  padding: var(--semiquaver) var(--quaver);
  border-radius: var(--quaver);
  white-space: nowrap;

  &:hover {
    background-color: rgb(from var(--mb) r g b / 0.2);
  }

  &:active {
    background-color: rgb(from var(--mb) r g b / 0.4);
    color: var(--shw);
  }
}

.account-button,
.home-button {
  background: none;
  height: 32px;
  width: 32px;
  border: none;
  border-radius: var(--quaver);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  &:hover {
    background-color: rgb(from var(--mb) r g b / 0.2);
  }
  &:active {
    background-color: rgb(from var(--mb) r g b / 0.4);
  }
  & > svg {
    color: var(--shw);
  }
}

/* hide hamburger */
@media (min-width: 640px) {
  .hamburger-wrapper {
    display: none;
  }
}

/* show hamburger */
@media (max-width: 640px) {
  .header-right-nav-ul {
    display: none;
  }
}


.notification-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.notification-avatar {
  border-radius: 50%;
  width: 48px;
  height: 48px;
  object-fit: cover;
}

.notification-badge {
  position: absolute;
  bottom: -4px;   /* move slightly down if needed */
  right: -4px;    /* move slightly right if needed */
  width: 36px;    /* doubled from 18px */
  height: 36px;   /* doubled from 18px */
  border-radius: 50%;
  border: 2px solid #fff;
  background: #fff;
}


.notifications-dropdown {
  position: relative;
}

.notifications-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 110%;           /* just below the bell icon */
  right: 0;
  width: 500px;
  max-height: 400px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 999;
  padding: 0.5rem 0;
}

.dropdown-menu.hidden {
  display: none;
}

.dropdown-header {
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #eee;
}

.notifications-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notifications-list li {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #f3f3f3;
}

.notifications-list li.unread {
  background: #f5f9ff;
}

.notification-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.empty-msg {
  padding: 1rem;
  text-align: center;
  color: #777;
}

/* Mobile adjustments */
@media only screen and (max-width: 640px) {
  .dropdown-menu {
    width: 90vw;
    right: 5vw;
  }
}



.nav-user-icon {
  --size: 32px;
  height: var(--size);
  width: var(--size);
  border-radius: 50%;
  object-fit: cover;
}