/**
 * 390 FieldOps — Nav Standard
 * Locked: Back LEFT (B3) · 390 + page name CENTER · Hub/Staff RIGHT (H3)
 * Tap targets ≥ 40×40. Safe-area via .nav-safe-top.
 */
:root {
  --nav-gold: #C9A227;
  --nav-gold-light: #E8C547;
  --nav-navy: #0A1628;
  --nav-base-pad: 8px;
}

/* Installed PWA + black-translucent: iOS often reports safe-area-inset-top as 0,
   so Back/Hub sit under the clock/battery. Floor the pad hard in standalone. */
@media (display-mode: standalone) {
  :root { --nav-base-pad: 47px; }
}
html.fo-standalone {
  --nav-base-pad: 47px;
}

/* !important + high specificity: page .header { padding: 0|8px 12px }
   shorthands load after this file and otherwise wipe safe-area under
   iOS black-translucent PWAs — Back/Hub become untappable under the status bar. */
header.nav-safe-top,
.header.nav-safe-top,
.hdr.nav-safe-top,
.admin-header.nav-safe-top,
.eos-header.nav-safe-top,
.sb-header.nav-safe-top,
.top-nav.nav-safe-top,
.nav-safe-top {
  padding-top: max(var(--nav-base-pad), env(safe-area-inset-top, 0px)) !important;
}

#navStandardMount,
.nav-standard-root {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
}

.nav-standard-side {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
}

.nav-standard-side--left {
  justify-content: flex-start;
}

.nav-standard-side--right {
  justify-content: flex-end;
}

.nav-standard-center {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  gap: 5px;
  text-align: left;
}

/* Brand stack: [390] FIELDOPS / PORTAL NAME — portal name lines up with the F */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.nav-brand__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.1;
  min-width: 0;
}

/* Hit area ≥ 40×40 via padding on the control */
.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 40px;
  min-height: 40px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.nav-pill[hidden],
.nav-pill.is-hidden {
  display: none !important;
}

.nav-pill__face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

/* B3 — Back (LEFT): white ghost */
.nav-pill--back .nav-pill__face {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-weight: 600;
}

/* H3 — Hub/Staff (RIGHT): gold gradient */
.nav-pill--hub .nav-pill__face {
  border-radius: 8px;
  background: linear-gradient(135deg, var(--nav-gold) 0%, var(--nav-gold-light) 100%);
  border: 1px solid var(--nav-gold);
  color: var(--nav-navy);
  font-weight: 700;
}

.nav-pill:active .nav-pill__face {
  transform: scale(0.97);
}

/* 390 badge — same family as Admin Portal logo; tap = easter egg */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.nav-badge__face {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--nav-gold);
  color: var(--nav-navy);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.nav-badge:active .nav-badge__face {
  transform: scale(0.96);
}

.nav-brand__name {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1.1;
  text-transform: uppercase;
}

.nav-page-title {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--nav-gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  line-height: 1.15;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* flush left with FIELDOPS — no extra indent */
  margin: 0;
  padding: 0;
}

/* Overflow ⋯ — not a corner pill; sits next to hub */
.nav-overflow {
  position: relative;
  flex-shrink: 0;
}

.nav-overflow__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.nav-overflow__btn:active {
  background: rgba(255, 255, 255, 0.2);
}

.nav-overflow__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: min(280px, 90vw);
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
  z-index: 200000;
  overflow: hidden;
}

.nav-overflow__menu.is-open,
.nav-overflow__menu.show {
  display: block;
}

.nav-overflow__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid #F1F5F9;
  background: #ffffff;
  color: #0F172A;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-overflow__item:last-child {
  border-bottom: none;
}

.nav-overflow__item:hover,
.nav-overflow__item:active {
  background: #F1F5F9;
}

.nav-overflow__item--danger {
  color: #DC2626;
}

.nav-overflow__item[hidden],
.nav-overflow__item.is-hidden {
  display: none !important;
}

.nav-overflow__icon {
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
}

/* Identity strip A — under header */
.nav-identity-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 6px 14px 10px;
  background: transparent;
  border-top: 1px solid rgba(201, 162, 39, 0.18);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
}

.nav-identity-strip .nav-id-name {
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
}

.nav-identity-strip .nav-id-org {
  color: var(--nav-gold);
  font-weight: 500;
}

.nav-identity-strip .nav-id-league {
  font-size: 11px;
  color: #94A3B8;
  cursor: pointer;
  border-bottom: 1px dashed #64748B;
}

.nav-identity-strip .nav-id-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  padding: 0;
}

.nav-identity-strip .nav-id-refresh:active {
  background: rgba(255, 255, 255, 0.18);
}

.nav-identity-strip .nav-id-refresh.spinning svg {
  animation: nav-spin 0.7s linear infinite;
}

@keyframes nav-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 360px) {
  .nav-brand__name {
    font-size: 15px;
  }
  .nav-page-title {
    max-width: 120px;
    font-size: 9px;
    letter-spacing: 1px;
  }
  .nav-badge__face {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .nav-pill__face {
    padding: 0 10px;
    font-size: 10px;
  }
}
