/* Shared navigation chrome for the dashboard, internal pages, and stations. */
:root {
  --nav-ink: #edf3ff;
  --nav-muted: #aebdd4;
  --nav-surface: rgba(13, 25, 47, .96);
  --nav-surface-hover: rgba(33, 51, 79, .98);
  --nav-border: rgba(170, 193, 229, .28);
  --nav-border-hover: rgba(190, 211, 246, .55);
  --nav-accent: #9db9f4;
  --nav-accent-soft: rgba(126, 158, 221, .15);
  --nav-shadow: 0 12px 30px rgba(4, 12, 28, .2);
}
html.cockpit-light {
  --nav-ink: #20344f;
  --nav-muted: #5e7390;
  --nav-surface: rgba(250, 252, 255, .97);
  --nav-surface-hover: rgba(235, 242, 251, .99);
  --nav-border: rgba(111, 137, 173, .3);
  --nav-border-hover: rgba(82, 112, 157, .52);
  --nav-accent: #365d98;
  --nav-accent-soft: rgba(66, 103, 159, .1);
  --nav-shadow: 0 10px 28px rgba(54, 77, 112, .12);
}

.app-navbar {
  --nav-ink: #edf3ff;
  --nav-muted: #aebdd4;
  --nav-surface: rgba(13, 25, 47, .88);
  --nav-surface-hover: rgba(33, 51, 79, .94);
  --nav-border: rgba(170, 193, 229, .28);
  --nav-border-hover: rgba(190, 211, 246, .55);
  --nav-accent: #9db9f4;
  --nav-accent-soft: rgba(126, 158, 221, .15);
  --nav-shadow: 0 12px 30px rgba(4, 12, 28, .2);
  position: relative;
  z-index: 40;
  width: min(calc(100% - clamp(24px, 5vw, 96px)), 1600px);
  margin: 0 auto;
  border: 1px solid var(--nav-border);
  border-radius: 16px;
  color: var(--nav-ink);
  background: var(--nav-surface);
  box-shadow: var(--nav-shadow), inset 0 1px rgba(255, 255, 255, .1);
  backdrop-filter: blur(16px) saturate(1.16);
  -webkit-backdrop-filter: blur(16px) saturate(1.16);
  font-family: Inter, var(--font-sans, sans-serif);
}

html.cockpit-light .app-navbar {
  --nav-ink: #20344f;
  --nav-muted: #5e7390;
  --nav-surface: rgba(250, 252, 255, .88);
  --nav-surface-hover: rgba(235, 242, 251, .96);
  --nav-border: rgba(111, 137, 173, .3);
  --nav-border-hover: rgba(82, 112, 157, .52);
  --nav-accent: #365d98;
  --nav-accent-soft: rgba(66, 103, 159, .1);
  --nav-shadow: 0 10px 28px rgba(54, 77, 112, .12);
  box-shadow: var(--nav-shadow), inset 0 1px rgba(255, 255, 255, .92);
}

.app-navbar-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.5vw, 22px);
  min-height: 58px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 8px 16px;
}

.app-navbar-branding,
.app-navbar-brand,
.app-navbar-actions,
.app-navbar-nav {
  display: flex;
  align-items: center;
}

.app-navbar-branding { min-width: 0; gap: 12px; flex: 0 1 auto; }
.app-navbar-brand {
  flex: 0 0 auto;
  gap: 9px;
  color: var(--nav-ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.novamodus-lockup { position: relative; display: block; width: 126px; height: 32px; flex: 0 0 auto; }
.novamodus-lockup__light { display: block; width: 120px; height: 30px; object-fit: contain; }
.novamodus-lockup__dark { display: none; }
html:not(.cockpit-light) .novamodus-lockup__light { display: none; }
html:not(.cockpit-light) .novamodus-lockup__dark { position: absolute; inset: 0; display: block; }
.novamodus-lockup__wordmark { position: absolute; inset: 0; display: block; width: 120px; height: 30px; object-fit: contain; filter: brightness(0) invert(1); }
.app-navbar-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--nav-muted);
  text-decoration: none;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  white-space: nowrap;
  transition: color 180ms ease;
}
.app-navbar-back > span:first-child { font-family: Inter, sans-serif; font-size: 22px; line-height: .8; }
.app-navbar-back:hover { color: var(--nav-ink); }
.app-navbar-divider { width: 1px; height: 26px; flex: 0 0 1px; background: var(--nav-border); }
.app-navbar-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin: 0;
  color: var(--nav-ink);
  font-family: Inter, var(--font-display, sans-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.2;
  white-space: nowrap;
}
.app-navbar-title .beta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 6px;
  border: 1px solid var(--nav-border);
  border-radius: 5px;
  color: var(--nav-accent);
  font: 700 9px/1 Inter, sans-serif;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.app-navbar-nav { justify-content: center; gap: 4px; min-width: 0; margin-inline: auto; }
.app-navbar-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--nav-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 180ms ease, background-color 180ms ease;
}
.app-navbar-nav a:hover,
.app-navbar-nav a.is-current { color: var(--nav-ink); background: var(--nav-accent-soft); }
.app-navbar-nav a.is-current::after {
  position: absolute;
  right: 12px;
  bottom: 3px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background: #d62836;
  content: "";
}

.app-navbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: clamp(170px, 20vw, 250px);
  min-width: 130px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--nav-border);
  border-radius: 10px;
  color: var(--nav-muted);
  background: rgba(255, 255, 255, .045);
}
.app-navbar-search svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.app-navbar-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--nav-ink);
  background: transparent;
  font: 500 12px/1.2 Inter, sans-serif;
}
.app-navbar-search input::placeholder { color: var(--nav-muted); opacity: .85; }
.app-navbar-search input:focus { box-shadow: none; }
.app-navbar-search:focus-within { border-color: var(--nav-accent); box-shadow: 0 0 0 3px var(--nav-accent-soft); }
.app-navbar-search kbd { flex: 0 0 auto; color: var(--nav-muted); font: 500 10px/1 IBM Plex Mono, monospace; }
.app-navbar .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-navbar .header-spacer { flex: 1 1 16px; min-width: 12px; }
.app-navbar-actions { flex: 0 0 auto; gap: 8px; }
.app-navbar .lp-admin-portal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--nav-border);
  border-radius: 999px;
  color: var(--nav-ink);
  background: var(--nav-accent-soft);
  text-decoration: none;
  font: 600 11px/1 Inter, sans-serif;
  white-space: nowrap;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.app-navbar .lp-admin-portal:hover { border-color: var(--nav-border-hover); background: var(--nav-surface-hover); transform: translateY(-1px); }
.app-navbar .lp-admin-portal .lp-pico { display: inline-flex; width: 16px; height: 16px; }
.app-navbar .lp-admin-portal .lp-pico svg { width: 100%; height: 100%; }
.app-navbar .lp-userbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  margin: 0;
  padding: 3px 9px 3px 4px;
  border: 1px solid var(--nav-border);
  border-radius: 999px;
  color: var(--nav-ink);
  background: rgba(255, 255, 255, .045);
  font: 500 11px/1 Inter, sans-serif;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}
.app-navbar .lp-userbtn:hover { border-color: var(--nav-border-hover); background: var(--nav-surface-hover); }
.app-navbar .lp-userbtn .lp-av { display: none; }
.app-navbar .lp-userbtn .lp-initials {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid rgba(214, 40, 54, .72);
  border-radius: 50%;
  color: #fff;
  background: #d62836;
  font-size: 10px;
  font-weight: 700;
}
.app-navbar .lp-userbtn .lp-uname { max-width: 190px; overflow: hidden; color: var(--nav-ink); text-overflow: ellipsis; white-space: nowrap; }
.app-navbar .lp-userbtn .lp-caret { color: var(--nav-muted); }
.app-navbar .notif-bell {
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border-color: var(--nav-border);
  border-radius: 10px;
  color: var(--nav-muted);
  background: rgba(255, 255, 255, .045);
}
.app-navbar .notif-bell:hover { border-color: var(--nav-border-hover); color: var(--nav-ink); background: var(--nav-accent-soft); }
.app-navbar .notif-badge { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; color: #fff; background: #d62836; font: 700 10px/15px Inter, sans-serif; text-align: center; }
.app-navbar .notif-badge.hidden { display: none; }
.lp-pop.app-account-pop {
  position: fixed;
  z-index: 1000;
  min-width: min(250px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  overflow: hidden;
  border: 1px solid var(--nav-border-hover);
  border-radius: 12px;
  color: var(--nav-ink);
  background: var(--nav-surface);
  box-shadow: var(--nav-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.lp-pop.app-account-pop .lp-uhdr { padding: 13px 14px; border-bottom: 1px solid var(--nav-border); }
.lp-pop.app-account-pop .lp-un { color: var(--nav-ink); font: 600 14px/1.3 Inter, sans-serif; }
.lp-pop.app-account-pop .lp-ue { margin-top: 2px; color: var(--nav-muted); font: 11px/1.4 IBM Plex Mono, monospace; }
.lp-pop.app-account-pop .lp-ubadge { display: inline-block; margin-top: 8px; padding: 2px 7px; border: 1px solid var(--nav-border); border-radius: 999px; color: var(--nav-muted); font: 10px/1.4 Inter, sans-serif; }
.lp-pop.app-account-pop .lp-theme-group { padding: 5px 0; border-block: 1px solid var(--nav-border); }
.lp-pop.app-account-pop .lp-pitem { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 14px; border: 0; color: var(--nav-ink); background: transparent; font: 500 13px/1.3 Inter, sans-serif; text-align: left; text-decoration: none; cursor: pointer; }
.lp-pop.app-account-pop .lp-pitem:hover { background: var(--nav-accent-soft); }
.lp-pop.app-account-pop .lp-theme-choice { min-height: 36px; padding-block: 8px; }
.lp-pop.app-account-pop .lp-theme-choice[aria-checked="true"] { color: var(--nav-ink); background: var(--nav-accent-soft); }
.lp-pop.app-account-pop .lp-theme-choice[aria-checked="true"]::after { margin-left: auto; color: var(--nav-accent); content: "\2713"; font-weight: 700; }
.lp-pop.app-account-pop .lp-pitem .lp-pico { display: inline-flex; width: 17px; height: 17px; color: var(--nav-muted); }
.lp-pop.app-account-pop .lp-pitem .lp-pico svg { width: 100%; height: 100%; }
.lp-pop.app-account-pop .lp-pitem.lp-danger { color: #d62836; }
.lp-pop.app-account-pop .lp-pitem:focus-visible,
.notif-menu .notif-item:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: -2px; }
.notif-menu {
  position: fixed;
  z-index: 1000;
  width: min(320px, calc(100vw - 16px));
  max-height: 60vh;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--nav-border-hover);
  border-radius: 12px;
  color: var(--nav-ink);
  background: var(--nav-surface);
  box-shadow: var(--nav-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.notif-menu.hidden { display: none; }
.notif-empty, .notif-item { padding: 10px 12px; color: var(--nav-muted); font: 12px/1.45 Inter, sans-serif; }
.notif-item { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--nav-border); background: transparent; text-align: left; cursor: pointer; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--nav-accent-soft); }
.notif-item-subj { display: block; color: var(--nav-ink); font-weight: 600; }
.notif-item-body, .notif-item-meta { display: block; margin-top: 3px; color: var(--nav-muted); }
.lp-pop.hidden { display: none; }
.app-navbar a:focus-visible,
.app-navbar button:focus-visible,
.app-navbar input:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: 3px; }

.home-page .app-navbar { width: fit-content; max-width: 100%; margin: 0 auto; }
.home-page .app-navbar-inner { width: fit-content; max-width: 100%; min-height: 58px; padding-inline: 16px; }
.cfm-page .app-navbar { width: min(calc(100% - clamp(24px, 5vw, 96px)), 1600px); margin: 0 auto; }
.app-navbar--station { width: min(calc(100% - clamp(24px, 5vw, 96px)), 1600px); }
.app-navbar--standalone { width: min(calc(100% - 24px), 1600px); margin-top: 10px; }

@media (max-width: 980px) {
  .app-navbar-inner { gap: 10px; }
  .app-navbar-branding { gap: 9px; }
  .app-navbar-nav a { padding-inline: 9px; }
  .app-navbar .lp-userbtn .lp-uname { max-width: 125px; }
}

@media (max-width: 720px) {
  .app-navbar { width: calc(100% - 20px); margin-top: 0; }
  .app-navbar-inner { min-height: 54px; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; }
  .app-navbar-branding { flex: 1 1 auto; }
  .app-navbar-title { max-width: min(35vw, 190px); overflow: hidden; text-overflow: ellipsis; }
  .app-navbar-nav { order: 3; width: 100%; justify-content: flex-start; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .app-navbar-nav::-webkit-scrollbar { display: none; }
  .app-navbar-nav a { min-height: 32px; }
  .app-navbar .header-spacer { display: none; }
  .app-navbar-search { width: clamp(115px, 30vw, 180px); min-width: 110px; height: 34px; }
  .app-navbar-search kbd { display: none; }
  .app-navbar-actions { gap: 5px; }
  .app-navbar .lp-admin-portal { min-height: 34px; padding-inline: 9px; }
  .app-navbar .lp-admin-portal > span:last-child { display: none; }
  .app-navbar .lp-userbtn { min-height: 34px; }
  .app-navbar .lp-userbtn .lp-uname { display: none; }
  .app-navbar .notif-bell { width: 34px; height: 34px; }
  .home-page .app-navbar { width: 100%; margin-top: 0; }
  .cfm-page .app-navbar { width: calc(100% - 20px); }
  .app-navbar--standalone { margin-top: 8px; }
  .home-page .app-navbar-inner { padding-inline: 10px; }
}

@media (max-width: 390px) {
  .app-navbar-inner { gap: 7px; }
  .app-navbar-back { font-size: 11px; }
  .app-navbar-brand { gap: 6px; font-size: 13px; }
  .app-navbar .novamodus-lockup { width: 94px; height: 26px; }
  .app-navbar .novamodus-lockup__light { width: 88px; height: 22px; }
  .app-navbar .novamodus-lockup__wordmark { width: 88px; height: 22px; }
  .app-navbar-divider { height: 22px; }
  .app-navbar-title { max-width: 31vw; font-size: 13px; }
  .app-navbar-search { width: 108px; min-width: 96px; padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-navbar *, .app-navbar *::before, .app-navbar *::after { transition: none !important; }
}
