/* LinkedIn-style top nav bar that supplements the dashboard sidebar.
   Lives at the top of .dash-content (sticky). */
.dash-topbar {
  --dash-topbar-logo-size: 34px;
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 56px;
  padding: 0 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* Mobile-only hamburger that opens the dashboard sidebar */
.dash-topbar__hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  background: none;
  padding: 0.3rem;
  margin-right: 0.1rem;
  color: #1f2328;
  cursor: pointer;
}
.dash-topbar__hamburger i { font-size: 1.4rem; line-height: 1; }

.dash-topbar__brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.5rem;
  min-width: 0;
  color: #0f172a;
  font-weight: 800;
  text-decoration: none;
}

.dash-topbar__brand:hover {
  color: #004182;
  text-decoration: none;
}

.dash-topbar__brand-logo {
  display: block;
  width: var(--dash-topbar-logo-size);
  min-width: var(--dash-topbar-logo-size);
  max-width: var(--dash-topbar-logo-size);
  height: var(--dash-topbar-logo-size);
  min-height: var(--dash-topbar-logo-size);
  max-height: var(--dash-topbar-logo-size);
  object-fit: contain;
  flex: 0 0 auto;
}

.dash-topbar__brand-text {
  display: inline-block;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
}

.dash-topbar__search {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100vw - 720px));
  min-width: 300px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
}
.dash-topbar__search i {
  position: absolute;
  left: 0.85rem;
  color: #65676b;
  font-size: 1rem;
  pointer-events: none;
}
.dash-topbar__search input {
  width: 100%;
  border: 0;
  background: #eef3f8;
  border-radius: 999px;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  font-size: 0.9rem;
  color: #1f2328;
  outline: none;
}
.dash-topbar__search input:focus {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(10, 102, 194, 0.4);
}

.dash-topbar__nav {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  margin-left: auto;
  height: 100%;
}
.dash-topbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 70px;
  padding: 0 0.5rem;
  border: 0;
  background: none;
  color: #65676b;
  font-size: 0.72rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  position: relative;
}
.dash-topbar__item i { font-size: 1.3rem; line-height: 1; }
.dash-topbar__item:hover { color: #1f2328; text-decoration: none; }
.dash-topbar__item.is-active { color: #1f2328; font-weight: 700; }
.dash-topbar__item.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: #1f2328;
}
.dash-topbar__icon-wrap { position: relative; display: inline-flex; }
.dash-topbar__badge {
  position: absolute;
  top: -6px; left: 12px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #cc1016;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Me dropdown */
.dash-topbar__me { position: relative; display: flex; align-items: stretch; }
.dash-topbar__me-btn span i { font-size: 0.9rem; vertical-align: middle; }
.dash-topbar__avatar {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin-bottom: 1px;
  display: inline-flex; align-items: center; justify-content: center;
}
.dash-topbar__avatar--fallback { background: linear-gradient(140deg,#0a66c2,#378fe9); color: #fff; font-weight: 700; font-size: 0.75rem; }
.dash-topbar__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 250px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15);
  padding: 0.5rem;
  z-index: 1100;
}
.dash-topbar__menu-head { padding: 0.5rem 0.6rem 0.6rem; border-bottom: 1px solid #eef0f2; margin-bottom: 0.4rem; }
.dash-topbar__menu-name { font-weight: 700; color: #1f2328; }
.dash-topbar__menu-role { font-size: 0.8rem; color: #65676b; }
.dash-topbar__menu-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.6rem; border-radius: 8px;
  color: #1f2328; text-decoration: none; font-size: 0.9rem; font-weight: 500;
}
.dash-topbar__menu-link i { font-size: 1.05rem; color: #65676b; }
.dash-topbar__menu-link:hover { background: #f3f6f8; text-decoration: none; color: #1f2328; }
.dash-topbar__menu-link--danger, .dash-topbar__menu-link--danger i { color: #cc1016; }
.dash-topbar__menu-sep { height: 1px; background: #eef0f2; margin: 0.4rem 0; }

/* Mobile-only top-right nav dropdown (collapses the four primary items) */
.dash-topbar__mobilenav { display: none; position: relative; align-items: stretch; }
.dash-topbar__mobilenav-btn { min-width: 44px; }
.dash-topbar__menu-count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #cc1016;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 991.98px) {
  .dash-topbar {
    --dash-topbar-logo-size: 30px;
    padding: 0 0.75rem;
    gap: 0.5rem;
    height: 52px;
  }
  .dash-topbar__hamburger { display: inline-flex; }
  .dash-topbar__brand-text { font-size: 0.92rem; }
  .dash-topbar__search {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    min-width: 0;
    transform: none;
    flex: 1 1 auto;
  }
  .dash-topbar__item span:not(.dash-topbar__icon-wrap):not(.dash-topbar__badge) { display: none; }
  .dash-topbar__item { min-width: 44px; }
  /* The four primary items and the Me dropdown collapse into the
     top-right mobile menu; only its trigger button stays visible. */
  .dash-topbar__item--primary { display: none; }
  .dash-topbar__me { display: none; }
  .dash-topbar__mobilenav { display: flex; }
}

@media (min-width: 992px) {
  .dash-topbar__brand {
    margin-left: max(0px, calc((100vw - 1360px) / 2 + 16px));
  }
}

@media (min-width: 1280px) {
  .dash-topbar {
    position: sticky;
  }

  .dash-topbar__nav {
    position: absolute;
    top: 0;
    left: calc(50% + 218px);
    margin-left: 0;
    margin-right: 0;
  }
}
