/* ── Shared navy top nav ──────────────────────────────────────────────────
   Used by every page that's migrated off the older dark left-sidebar
   pattern (src/shared/app-sidebar.ts) onto the shared component in
   src/shared/top-nav.ts. Self-contained: only references the custom
   properties declared below, so a page can load just this file (plus
   hub.css for the shared --font variable) without hub-redesign.css's
   other hub-page-specific styling (cards, confetti, sidebar, etc). */

:root {
  --hb-navy: #16223D;
  --hb-blue: #2F8FEA;
  --hb-sky: #7CC4F5;
  --hb-page-bg: #F5F8FC;
  --hb-card-bg: #FFFFFF;
  --hb-card-border: #DCE6F5;
  --hb-text-muted: #8B93A3;
  --hb-text-primary: #25324A;
}

/* Light page background + centered content column -- shared by every page
   using this top nav, matching the hub page's own body background and
   the max-width its .hb-body centers content to. */
body.hb-body-bg {
  background: var(--hb-page-bg);
  min-height: 100vh;
}
.hb-page-center {
  max-width: 1296px;
  margin: 0 auto;
}

.hb-topnav {
  background: var(--hb-navy);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 40;
}

.hb-topnav-inner {
  max-width: 1296px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 25.2px;
  padding: 10.8px 23.4px;
}

.hb-topnav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}
.hb-topnav-logo-img {
  width: 27px;
  height: 27px;
  border-radius: 7.2px;
}
.hb-topnav-brand {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif;
  font-size: 13.1px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.hb-topnav-sub {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--hb-sky);
  line-height: 1.3;
}

.hb-topnav-links {
  display: flex;
  align-items: center;
  gap: 3.6px;
  flex: 1;
  flex-wrap: wrap;
}

.hb-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 3.6px;
  font-size: 12.2px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 7.2px 10.8px;
  border-radius: 7.2px;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.hb-nav-link:hover {
  color: #fff;
}
.hb-nav-link.active {
  color: #fff;
  font-weight: 800;
}
.hb-nav-link.active::after {
  content: '';
  position: absolute;
  left: 10.8px;
  right: 10.8px;
  bottom: 0;
  height: 1.8px;
  border-radius: 1.8px;
  background: var(--hb-sky);
}

/* "Opens externally" indicator -- .hb-nav-link's flex + gap already spaces
   it from the label text; color inherits from the link via currentColor. */
.hb-nav-ext-icon {
  opacity: 0.7;
  flex-shrink: 0;
}

.hb-topnav-actions {
  display: flex;
  align-items: center;
  gap: 5.4px;
  flex-shrink: 0;
}

.hb-icon-btn {
  position: relative;
  width: 30.6px;
  height: 30.6px;
  border-radius: 8999.1px;
  border: none;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hb-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Admin button -- a dark gray pill (distinct from the plain navy bar
   behind it) with white text/arrow, so it still reads as its own button
   without the old gold treatment. Same trigger/menu structure as every
   other .hb-dropdown (see initTopNavDropdowns in shared-topnav.js, which
   wires all .hb-dropdown elements generically -- no extra JS needed for
   this one). */
.hb-admin-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5.4px;
  border: none;
  background: #3A4356;
  color: #fff;
  font-size: 11.7px;
  font-weight: 700;
  cursor: pointer;
  padding: 5.4px 9px;
  border-radius: 8999.1px;
}
.hb-admin-trigger:hover {
  background: #454F64;
}
/* Soft highlight while on any admin page (activePage: 'admin') -- reads
   as "you're in that space" rather than just a plain hover state. */
.hb-admin-trigger.active {
  background: #4B5568;
}
.hb-admin-trigger-label {
  color: #fff;
}

/* Admin button's "needs attention" count -- gold pill with a dark navy
   number, between the label and the arrow. Populated client-side (see
   shared-topnav.js) from GET /api/admin/notifications/items; hidden
   entirely at zero (the `hidden` attribute, same [hidden] specificity
   fix as elsewhere in this file -- author `display` on an element that
   also carries [hidden] needs to explicitly re-declare `display: none`
   under an [hidden] selector, since otherwise it ties with and can beat
   the UA stylesheet's own [hidden] rule). */
.hb-admin-count-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21.6px;
  height: 21.6px;
  padding: 0 5.4px;
  border-radius: 8999.1px;
  background: #E8B949;
  color: #18223A;
  font-size: 10.3px;
  font-weight: 800;
  box-sizing: border-box;
}
.hb-admin-count-bubble[hidden] {
  display: none;
}

/* Bell's unread count -- red with a thin navy ring, top-right of the
   icon button. Populated client-side from the same per-notification
   localStorage "seen" state the bell's own dropdown list uses. */
.hb-bell-count-bubble {
  position: absolute;
  top: 1px;
  right: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15.3px;
  height: 15.3px;
  padding: 0 3.6px;
  border-radius: 8999.1px;
  background: #F0625A;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  box-sizing: border-box;
  box-shadow: 0 0 0 1.4px var(--hb-navy, #16223D);
}
.hb-bell-count-bubble[hidden] {
  display: none;
}

/* ── Notification dropdowns (Admin's "Needs your attention" + the bell's
   "Your notifications") -- shared list/item/empty-state styling. Both
   are populated entirely client-side (shared-topnav.js); this is just
   the visual shell. */
.hb-notif-menu {
  width: 306px;
  max-width: calc(100vw - 28.8px);
  max-height: 378px;
  overflow-y: auto;
  padding: 0;
}
.hb-notif-header {
  font-size: 10.8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--hb-text-muted);
  padding: 10.8px 12.6px 7.2px;
}
.hb-notif-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12.6px 7.2px;
}
.hb-notif-header-row .hb-notif-header {
  padding: 0;
}
.hb-notif-mark-read {
  border: none;
  background: none;
  color: var(--hb-blue);
  font-size: 10.8px;
  font-weight: 700;
  cursor: pointer;
  padding: 1.8px;
}
.hb-notif-mark-read:hover {
  text-decoration: underline;
}
.hb-notif-list {
  display: flex;
  flex-direction: column;
}
.hb-notif-empty {
  padding: 12.6px;
  font-size: 11.7px;
  color: var(--hb-text-muted);
  text-align: center;
  margin: 0;
}
.hb-notif-item {
  display: block;
  padding: 9px 12.6px;
  border-top: 1px solid var(--hb-card-border);
  text-decoration: none;
  color: inherit;
}
.hb-notif-item:first-child {
  border-top: none;
}
.hb-notif-item:hover {
  background: var(--hb-page-bg);
}
.hb-notif-desc {
  font-size: 11.7px;
  font-weight: 600;
  color: var(--hb-text-primary);
  margin: 0 0 1.8px;
}
.hb-notif-time {
  display: block;
  font-size: 10.3px;
  color: var(--hb-text-muted);
}
.hb-notif-footer-link {
  display: block;
  text-align: center;
  font-size: 11.2px;
  font-weight: 700;
  color: var(--hb-blue);
  text-decoration: none;
  padding: 9px 12.6px;
  border-top: 1px solid var(--hb-card-border);
}
.hb-notif-footer-link:hover {
  background: var(--hb-page-bg);
}

/* Below 432px the notif menus no longer right-align under their trigger --
   the Admin/bell buttons aren't flush with the screen edge (the account
   avatar sits to their right), so a trigger-relative right:0 pushes the
   menu off the left edge of the viewport. Anchoring to the viewport itself
   via fixed positioning keeps it on-screen regardless of where the trigger
   sits. 63px clears the topnav's mobile height (55.8px) plus an 7.2px gap. */
@media (max-width: 480px) {
  .hb-notif-menu {
    position: fixed;
    top: 63px;
    left: 14.4px;
    right: 14.4px;
    width: auto;
    max-width: none;
  }
}

.hb-account-trigger {
  display: flex;
  align-items: center;
  gap: 5.4px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 3.6px 5.4px 3.6px 3.6px;
  border-radius: 8999.1px;
}
.hb-account-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
}
.hb-avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--hb-sky);
  color: var(--hb-navy);
  font-size: 10.8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Dropdowns (Coming Soon / Admin / Manager / account) ─────────────────── */
.hb-dropdown {
  position: relative;
}
.hb-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 3.6px;
}
.hb-dropdown-menu {
  position: absolute;
  top: calc(100% + 7.2px);
  left: 0;
  min-width: 198px;
  background: var(--hb-card-bg);
  border: 1px solid var(--hb-card-border);
  border-radius: 10.8px;
  box-shadow: 0 10.8px 28.8px rgba(22, 34, 61, 0.16);
  padding: 5.4px;
  z-index: 50;
}
.hb-dropdown-menu--right {
  left: auto;
  right: 0;
}
.hb-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  font-size: 11.7px;
  font-weight: 600;
  color: var(--hb-text-primary);
  text-decoration: none;
  padding: 8.1px 9px;
  border-radius: 7.2px;
}
a.hb-dropdown-item:hover {
  background: var(--hb-page-bg);
}
.hb-dropdown-item--static {
  color: var(--hb-text-muted);
  cursor: default;
}
.hb-dropdown-item--featured {
  color: var(--hb-blue);
  font-weight: 800;
}
.hb-dropdown-divider {
  height: 1px;
  background: var(--hb-card-border);
  margin: 5.4px 3.6px;
}

/* ── Home page only: gold points pill + enhanced account dropdown ───────── */
.hb-points-pill {
  display: flex;
  align-items: center;
  gap: 3.6px;
  background: linear-gradient(135deg, #FFE9A8, #F2C43D 55%, #D9A441);
  color: #5A3D0A;
  font-size: 11.2px;
  font-weight: 800;
  padding: 5.4px 10.8px;
  border-radius: 8999.1px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.hb-dropdown-header {
  padding: 7.2px 9px 9px;
}
.hb-dropdown-header-name {
  font-size: 12.6px;
  font-weight: 800;
  color: var(--hb-text-primary);
}
.hb-dropdown-header-sub {
  font-size: 10.8px;
  font-weight: 600;
  color: var(--hb-text-muted);
  margin-top: 1.8px;
}
.hb-dropdown-item--multiline {
  flex-direction: column;
  align-items: flex-start;
  gap: 1.8px;
}
.hb-dropdown-item-sub {
  font-size: 9.9px;
  font-weight: 600;
  color: var(--hb-text-muted);
}
@media (max-width: 640px) {
  .hb-points-pill {
    display: none;
  }
}
.hb-soon-tag {
  font-size: 8.6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--hb-blue);
  background: rgba(47, 143, 234, 0.12);
  border-radius: 8999.1px;
  padding: 1.8px 6.3px;
}

@media (max-width: 900px) {
  .hb-topnav-links {
    display: none;
  }
}
