/* =========================================================================
   app-chrome.css — the shared slim APP top bar for EVERY authenticated
   (login-required) page. ONE source of truth for back-end chrome POSITIONING
   so the bar + the right-side nav cluster are pixel-identical app-to-app
   (WebDNA loads are near-instant, so the chrome must not shift between screens).

   Loaded AFTER calendar.css on the schedule/call/estimate/settings
   (app/includes/calendar/layout-app-head.htm) and AFTER site.css on the
   staff/admin pages (includes/layout-head.htm, app pages only). The public
   marketing site does NOT load this file and keeps its full header + footer.

   Markup comes from ONE shared include — includes/app-bar.htm — used by every
   converged page; the schedule keeps its richer bar (app/includes/calendar/
   app-bar.htm) but renders the same <header class="app-bar"> shell with the
   shared nav-cluster last, so ALL positioning is driven from here.
   ========================================================================= */

/* Skip link (calendar pages don't load site.css; keep a11y parity everywhere). */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #002347;
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* Slim bar: logo/actions on the sides, page title centered on the viewport
   (1fr | auto | 1fr). Calendar .app-bar--cal uses the same column math in
   calendar.css (.app-bar__row--main) so Dashboard matches Users & roles. */
.app-bar {
  min-height: 2.75rem;
  box-sizing: border-box;
  margin: 0;
  padding: 0.4rem 0.75rem;
  background: var(--panel, var(--color-panel, #ffffff));
  border-bottom: 1px solid var(--line, var(--border, #e2e8f0));
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
}

.app-bar:not(.app-bar--cal) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.35rem;
}

.app-bar--cal {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.app-bar__start {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.65rem;
  justify-self: start;
  min-width: 0;
}

.app-bar__home {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.app-bar__logo {
  /* square mark (go.bongo.cc) — width capped; height follows */

  height: 26px;
  width: auto;
  display: block;
}

.app-bar__home:hover .app-bar__logo {
  opacity: 0.8;
}

.app-bar:not(.app-bar--cal) > .app-bar__title {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  max-width: min(40vw, 18rem);
}

.app-bar__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink, var(--color-text, #0f1b2e));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-bar__nav,
.app-bar__view-cluster,
.app-bar__views,
.app-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Right cluster: signed-in + theme + Dashboard flush right. */
.app-bar__actions {
  margin-left: auto;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
  min-width: 0;
  overflow: visible;
}

.app-bar:not(.app-bar--cal) > .app-bar__actions {
  grid-column: 3;
  justify-self: end;
  margin-left: 0;
}

.app-bar__who {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0 0.1rem 0 0;
  color: #5b9bd5;
  z-index: 40;
}

.app-bar__who-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.app-bar__who-btn:hover,
.app-bar__who-btn:focus-visible {
  background: rgba(91, 155, 213, 0.14);
  outline: none;
}

.app-bar__who-icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.app-bar__who-tip {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 60;
  min-width: 11rem;
  max-width: min(18rem, calc(100vw - 1.5rem));
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line, #d8dee8);
  background: var(--panel, #fff);
  box-shadow: 0 8px 24px rgba(15, 27, 46, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2px);
  transition: opacity 0.12s, visibility 0.12s, transform 0.12s;
  pointer-events: none;
  text-align: left;
}

.app-bar__who:hover .app-bar__who-tip,
.app-bar__who:focus-within .app-bar__who-tip,
.app-bar__who.is-open .app-bar__who-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.app-bar__who-email {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink, #243140);
  word-break: break-all;
}

.app-bar__who-role {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted, #64748b);
  text-transform: capitalize;
}

/* Current-location button + staff app menu */
.app-bar__dash {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 40;
}

/* Fixed width = longest Here labels (Customers / Estimates / Time Off) so
   List|Schedule|Map|Installs and account controls never shift between pages. */
.app-bar__here-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 7.75rem;
  min-width: 7.75rem;
  max-width: 7.75rem;
  flex: 0 0 7.75rem;
  padding-left: 0.65rem;
  padding-right: 1.35rem; /* room for absolute caret */
  gap: 0;
}

.app-bar__here-label {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.app-bar__here-caret {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.75;
  pointer-events: none;
}

/* Menu starts at 100% with padding-top as a hover bridge (no dead gap). */
.app-bar__dash-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 60;
  min-width: 12rem;
  padding: 0.35rem 0 0;
  margin: 0;
  border: none;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-bar__dash-menu-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.1rem;
  padding: 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--line, #d8dee8);
  background: var(--panel, #fff);
  box-shadow: 0 8px 24px rgba(15, 27, 46, 0.14);
}

.app-bar__dash:hover .app-bar__dash-menu,
.app-bar__dash:focus-within .app-bar__dash-menu,
.app-bar__dash.is-open .app-bar__dash-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.app-bar__dash-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink, #243140);
  text-decoration: none;
  text-align: left;
  white-space: nowrap;
}

.app-bar__dash-icon {
  flex: 0 0 1rem;
  width: 1rem;
  height: 1rem;
  opacity: 0.55;
}

.app-bar__dash-link:hover .app-bar__dash-icon,
.app-bar__dash-link:focus-visible .app-bar__dash-icon {
  opacity: 0.85;
}

.app-bar__dash-link:hover,
.app-bar__dash-link:focus-visible {
  background: var(--rh-btn-primary-fill, #e4ecf6);
  color: var(--rh-btn-primary, #002347);
  outline: none;
}

@media (max-width: 720px) {
  .app-bar:not(.app-bar--cal) {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .app-bar:not(.app-bar--cal) > .app-bar__start {
    grid-column: 1;
    grid-row: 1;
  }
  .app-bar:not(.app-bar--cal) > .app-bar__actions {
    grid-column: 2;
    grid-row: 1;
  }
  .app-bar:not(.app-bar--cal) > .app-bar__title {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
  }
}

/* Breathing room between the sticky bar and admin page content (consistent
   top offset so content sits the same distance below the bar on every page). */
.admin-surface {
  padding-top: 1.25rem;
}


/* go.bongo.cc — text wordmark (no graphic logo) */
.app-bar__home--wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 0.15rem 0.1rem;
}
.app-bar__wordmark {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #002347;
}
html[data-app-theme="night"] .app-bar__wordmark {
  color: #e8eef5;
}
.app-bar__home--wordmark:hover .app-bar__wordmark {
  opacity: 0.85;
}
