/*
 * Dispatch primary navigation.
 *
 * Shared header chrome for every admin page, including the older templates that
 * still carry their own page styles. Two rules shape this file:
 *
 *   1. Values are literal. It must stand alone on templates that never load
 *      /admin.css, so it cannot depend on that file's custom properties.
 *   2. Selectors use an element plus a class. A legacy template styles the same
 *      markup with single-class rules in a <style> block, and element+class
 *      outranks a lone class, so this file wins no matter which one loads last.
 *
 * Navigation is text only: no pills, no filled or outlined backgrounds. The
 * current page is marked with an underline.
 */

nav.navbar {
  position: sticky;
  z-index: 100;
  top: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  padding: 0 32px;
  font-family: inherit;
}

nav.navbar .navbar-brand {
  flex: 0 0 auto;
}

nav.navbar .navbar-brand a {
  color: #111827;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

nav.navbar .navbar-brand a:hover {
  color: #000;
}

ul.navbar-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

a.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 -2px 0 transparent;
  color: #1f2937;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color 140ms ease, box-shadow 140ms ease;
}

nav.navbar a.nav-link:hover {
  background: transparent;
  color: #111827;
  box-shadow: inset 0 -2px 0 #cbd5e1;
}

a.nav-link--active,
nav.navbar a.nav-link[aria-current="page"] {
  background: transparent;
  box-shadow: inset 0 -2px 0 #1f2937;
  color: #111827;
  font-weight: 600;
}

nav.navbar .navbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

nav.navbar .navbar-actions form {
  margin: 0;
}

nav.navbar .navbar-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid #f0c5ca;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
  cursor: pointer;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

nav.navbar .navbar-actions .btn:hover {
  border-color: #e4a9b0;
  background: #ffe3e6;
  color: #86151f;
  opacity: 1;
}

nav.navbar a:focus-visible,
nav.navbar button:focus-visible {
  outline: 2px solid #2f6feb;
  outline-offset: 2px;
}

@media (max-width: 860px) {
  nav.navbar {
    gap: 8px;
    padding: 0 16px;
  }

  ul.navbar-nav {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  a.nav-link {
    padding: 0 10px;
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  nav.navbar .navbar-brand a {
    font-size: 17px;
  }

  nav.navbar .navbar-actions .btn {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  a.nav-link,
  nav.navbar .navbar-actions .btn {
    transition: none;
  }
}
