.app-topbar {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(220, 231, 224, 0.9);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 max(1rem, calc((100% - 1100px) / 2));
  box-shadow: 0 5px 20px rgba(20, 48, 32, 0.035);
  backdrop-filter: blur(16px);
}

.app-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.7rem;
  color: #17211d;
  font-size: 1.08rem;
  font-weight: 780;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.app-brand-mark {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.72rem;
  background: linear-gradient(145deg, #13a176, #087351);
  color: #fff;
  box-shadow: 0 4px 10px rgba(11, 123, 91, 0.22);
}

.app-brand-mark svg {
  width: 1.55rem;
  height: 1.55rem;
}

.app-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem;
  border: 1px solid #edf1ee;
  border-radius: 999px;
  background: #f8faf9;
}

.app-topbar .app-nav {
  gap: 0.3rem;
}

.app-nav-link,
.app-nav-primary,
.app-nav-logout {
  display: inline-flex;
  min-height: 2.45rem;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 620;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.app-nav-link {
  color: #64736c;
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
  background: #eaf4ee;
  color: #0b7b5b;
  outline: none;
}

.app-nav-link[aria-current="page"] {
  background: #fff;
  color: #0b7b5b;
  box-shadow: 0 1px 4px rgba(20, 48, 32, 0.1);
}

.app-nav-primary {
  margin-left: 0.3rem;
  border: 1px solid #087351;
  background: linear-gradient(135deg, #0b8a65, #087351);
  color: #fff;
  box-shadow: 0 4px 10px rgba(11, 123, 91, 0.16);
}

.app-nav-primary:hover,
.app-nav-primary:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #0b7b5b, #075f45);
  box-shadow: 0 6px 14px rgba(11, 123, 91, 0.22);
  outline: none;
}

.app-nav-logout {
  border: 1px solid transparent;
  background: transparent;
  color: #64736c;
  cursor: pointer;
}

.app-nav-logout:hover,
.app-nav-logout:focus-visible {
  border-color: #f2d6d4;
  background: #fff5f4;
  color: #a43a32;
  outline: none;
}

.app-nav-logout:disabled {
  cursor: wait;
  opacity: 0.65;
}

.app-request-count {
  display: grid;
  min-width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  border-radius: 999px;
  background: #0b7b5b;
  padding: 0 0.28rem;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

@media (max-width: 700px) {
  .app-topbar {
    min-height: auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem;
  }

  .app-brand {
    width: 100%;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.98rem;
  }

  .app-brand-mark {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.62rem;
  }

  .app-nav {
    width: min(100%, 30rem);
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0.1rem;
    padding: 0.2rem;
    scrollbar-width: none;
  }

  .app-nav::-webkit-scrollbar {
    display: none;
  }

  .app-topbar .app-nav {
    gap: 0.1rem;
  }

  .app-nav-link,
  .app-nav-primary,
  .app-nav-logout {
    min-width: 0;
    min-height: 2.2rem;
    flex: 0 0 auto;
    gap: 0.25rem;
    padding: 0.45rem 0.5rem;
    font-size: clamp(0.68rem, 2.5vw, 0.78rem);
  }

  .app-nav-primary {
    margin-left: 0.05rem;
  }
}
