/* Festivenomics Shell — the canonical top bar (spec §2).
 *
 * One bar, pixel-for-pixel identical on every surface. The recipe is the
 * Vault area's .fxbar family — the fullest implementation — merged with the
 * cross-app extras each surface proved out (economics' no-backdrop-filter
 * fallback, burger and 640px breakpoint; lineup's sign-in link and menu
 * name row). No app overrides anything here.
 *
 * Anatomy: .fxbar > .fx-logo, .fx-switch (.fx-mod ×3, plus Settings), .fx-right >
 * [.fx-badge] [.fx-sw > .fx-chip + .fx-swmenu]* .fx-acct > .fx-avatar +
 * .fx-menu. Menus open by adding .open (base display:none); the active
 * switcher item is .fx-mod.on or aria-current="page" — both styled alike.
 *
 * Distributed as real copies by scripts/sync-shell.sh; check-shell-drift.sh
 * fails when a copy diverges. Requires tokens.css before it in the cascade.
 */

.fxbar { position: sticky; top: 0; z-index: 50; height: 58px; display: flex; align-items: center; gap: 16px; padding: 0 18px; background: rgba(10, 10, 10, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
@supports not (backdrop-filter: blur(1px)) {
  .fxbar { background: rgba(10, 10, 10, .97); }
}

.fx-logo { display: flex; align-items: center; flex: none; }
.fx-logo img, .fx-logo svg { height: 40px; width: auto; display: block; }

/* ------------------------------------------------------ module switcher */
.fx-switch { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: var(--card); }
.fx-mod { display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 6px; font: 500 13px var(--body); color: var(--mut); white-space: nowrap; text-decoration: none; }
.fx-mod:hover { color: var(--dim); background: var(--card2); text-decoration: none; }
.fx-mod.on, .fx-mod[aria-current="page"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-line); }

/* Everything right of the module switcher. The auto margin lives here, not
   on the badge — live mode removes the badge, and hanging the push off it
   leaves the account chip stranded mid-bar. */
.fx-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex: none; }

/* A count pill inside a switcher item (open alerts on Vault, etc.) */
.fx-count { font: 700 10.5px var(--mono); color: var(--yellow2); background: var(--yellow2-bg); border-radius: 999px; padding: 0 6px; line-height: 16px; margin-left: 7px; }
button.fx-mod { border: 0; background: none; cursor: pointer; }

/* Environment badge — one pill, one wording; absent entirely in production */
.fx-badge { font: 700 10.5px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--yellow2); border: 1px solid rgba(255, 250, 52, .35); border-radius: 99px; padding: 4px 12px; white-space: nowrap; flex: none; background: none; }

/* Org & Event switcher — two chips: the tenant, and the edition every
   screen below is scoped to. */
.fx-sw { position: relative; flex: none; }
.fx-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 52ch; padding: 5px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--dim); font: 500 12.5px var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
span.fx-chip { cursor: default; }
.fx-chip:hover { color: var(--txt); border-color: var(--accent-line); }
.fx-chip[aria-expanded="true"] { color: var(--txt); border-color: var(--accent-line); }
.fx-dot { width: 8px; height: 8px; border-radius: 99px; flex: none; }
.fx-illus { font: 700 9.5px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--yellow2); }
.fx-swmenu { position: absolute; right: 0; top: 38px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 310px; max-width: 360px; padding: 5px; display: none; z-index: 60; }
.fx-swmenu.open { display: block; }
.fx-swmenu form { margin: 0; }
.fx-swmenu button { display: block; width: 100%; text-align: left; padding: 7px 11px; border: 0; border-radius: 7px; background: none; color: var(--dim); font: 500 13px var(--body); cursor: pointer; }
.fx-swmenu button:hover { background: var(--card2); color: var(--txt); }
.fx-swmenu button[aria-current="true"] { color: var(--accent); }
.fx-swmenu a { display: block; padding: 7px 11px; border-radius: 7px; font-size: 13px; color: var(--dim); text-decoration: none; }
.fx-swmenu a:hover { background: var(--card2); text-decoration: none; }
.fx-swgroup { padding: 8px 11px 3px; font: 700 9.5px var(--display); letter-spacing: .13em; text-transform: uppercase; color: var(--mut); }
.fx-swmeta { display: block; font: 400 11.5px var(--body); color: var(--mut); margin-top: 1px; }
.fx-swfoot { margin-top: 4px; padding: 8px 11px 4px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--mut); }
.fx-swsep { height: 1px; background: var(--line); margin: 5px 0; }
.fx-swmenu .swrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fx-swmenu .swrow .badge { flex: none; }
.fx-swmenu button[disabled] { opacity: .45; cursor: default; }
.fx-swmenu button[disabled]:hover { background: none; color: var(--dim); }
.fx-menu a[aria-current="true"] { color: var(--accent); }
/* Below the switcher's width the edition chip carries the tenant alone —
   its own menu still names the organization. */
@media (max-width: 900px) { .fx-sw-org { display: none; } }

/* ---------------------------------------------------------- account chip */
.fx-acct { position: relative; flex: none; }
.fx-avatar { width: 30px; height: 30px; border-radius: 99px; border: 0; padding: 0; background: var(--card2); color: var(--txt); font: 600 13px var(--body); display: grid; place-items: center; box-shadow: 0 0 0 1.5px var(--accent-line); cursor: pointer; }
.fx-menu { position: absolute; right: 0; top: 38px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 150px; padding: 5px; display: none; z-index: 60; }
.fx-menu.open { display: block; }
.fx-menu-name { padding: 7px 11px; font: 400 12px var(--body); color: var(--mut); border-bottom: 1px solid var(--line); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-menu a { display: block; padding: 7px 11px; border-radius: 7px; font-size: 13px; color: var(--dim); text-decoration: none; }
.fx-menu a:hover { background: var(--card2); color: var(--txt); text-decoration: none; }

/* Signed-out surfaces show a sign-in link where the account chip would be */
.fx-signin { font: 500 12.5px var(--body); color: var(--dim); text-decoration: none; border: 1px solid var(--line); border-radius: 7px; padding: 5px 11px; white-space: nowrap; }
.fx-signin:hover { color: var(--txt); text-decoration: none; }

/* Burger — mobile-only trigger for the app's off-canvas nav */
.nav-burger { display: none; border: 1px solid var(--line); background: none; color: var(--txt); border-radius: 6px; width: 36px; height: 36px; font-size: 1rem; cursor: pointer; flex: none; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .nav-burger { display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 880px) {
  .fxbar { gap: 10px; padding: 0 12px; overflow-x: auto; overflow-y: visible; }
  .fx-right { gap: 10px; }
  .fx-badge-fest { display: none; }
  .fx-mod { padding: 5px 10px; }
}
@media (max-width: 640px) {
  /* Below the switcher's minimum: the logo still says which product
     family you're in; the active module name lives in the app nav */
  .fx-switch { display: none; }
}
