/* =========================================================================
   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;
}

.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;
}

/* Slim bar: Here ▾ left | actions right (New pill + help + user live in nav-cluster).
   Calendar .app-bar--cal keeps its own row layout in calendar.css. */
.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: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.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;
  flex: 1 1 auto;
}

.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;
}

/* Narrow “new record” forms opened from app-bar icon pills.
   Icon-pill size/color live in buttons.css (.btn--new-icon). */
.cust-wo-modal--form {
  max-width: min(560px, 96vw);
  width: min(560px, 96vw);
  max-height: min(92vh, 720px);
}
.cust-wo-modal--form .cust-wo-modal__panel {
  max-height: min(92vh, 720px);
}
.cust-wo-modal--form .admin-form--inline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}
.cust-wo-modal--form .admin-form--inline .admin-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
}
.cust-wo-modal--form .admin-form--inline .admin-field__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.cust-wo-modal--form .admin-form--inline .admin-field input,
.cust-wo-modal--form .admin-form--inline .admin-field select {
  width: 100%;
  min-width: 0;
}
.cust-wo-modal--form .admin-form--inline .admin-form__actions {
  margin-top: 0.25rem;
  padding-top: 0;
}
.cust-wo-modal--form .admin-section__lead,
.cust-wo-modal--form .admin-import-panel__hint {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}
.admin-section--list-first > .admin-section__head {
  margin-bottom: 0.65rem;
}
.admin-section--list-first > .admin-section__head h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink, var(--color-text, #0f1b2e));
  margin: 0;
}
.admin-section--list-first .admin-section__lead {
  display: none;
}

.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: help + New pill + account — flush right. */
.app-bar__actions {
  margin-left: auto;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
  min-width: 0;
  overflow: visible;
}

.nav-cluster .btn--new-icon {
  flex-shrink: 0;
}

/* Show ▾ / status filter pill on slim app-bar (Filter Orders, etc.) —
   same language as calendar .cal-range without requiring calendar.css. */
.app-bar .cal-range {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  z-index: 55;
}

.app-bar .cal-range.is-open {
  z-index: 1200;
}

.app-bar .cal-range__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-right: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.app-bar .cal-range__caret {
  font-size: 0.95rem;
  opacity: 0.85;
  line-height: 1;
}

.app-bar .cal-range__menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  z-index: 90;
  min-width: 12rem;
  padding: 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--line, var(--border, #d8dee8));
  background: var(--panel, var(--color-panel, #fff));
  box-shadow: 0 10px 28px rgba(15, 27, 46, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-bar .cal-range__menu[hidden] {
  display: none !important;
}

.app-bar .cal-range__section {
  margin: 0.2rem 0 0;
  padding: 0.25rem 0.55rem 0.1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.app-bar .cal-range__opt {
  appearance: none;
  font: inherit;
  text-align: left;
  text-decoration: none;
  border: 0;
  background: transparent;
  color: var(--ink, #243140);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: block;
}

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

.app-bar .cal-range__opt--chip {
  text-align: center;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.app-bar .cal-range__opt.is-active,
.app-bar .cal-range__opt--chip.is-active,
.app-bar .cal-range__opt--chip.is-active:hover,
.app-bar .cal-range__opt--chip.is-active:focus-visible,
.app-bar .cal-range__opt--chip.is-on,
.app-bar .cal-range__opt--chip.is-on:hover,
.app-bar .cal-range__opt--chip.is-on:focus-visible {
  background: var(--rh-btn-primary-fill, #e4ecf6);
  color: var(--rh-btn-primary, #002347);
}

.app-bar .cal-range__hint {
  margin: 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 500;
  color: var(--muted, #64748b);
}

.app-bar .cal-range__sep {
  height: 1px;
  margin: 0.35rem 0.35rem;
  background: var(--line, var(--border, #d8dee8));
}

.app-bar .cal-range__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.app-bar .cal-range__toggle-mark {
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  border: 1.5px solid var(--line, #c3ccda);
  background: var(--panel, #fff);
  flex: 0 0 auto;
}

.app-bar .cal-range__toggle.is-on .cal-range__toggle-mark {
  border-color: var(--rh-btn-primary, #002347);
  background: var(--rh-btn-primary, #002347);
  box-shadow: inset 0 0 0 2px var(--panel, #fff);
}

html[data-app-theme="night"] .app-bar .cal-range__menu {
  background: var(--panel, #162033);
  border-color: var(--line, #2a3a52);
}

html[data-app-theme="night"] .app-bar .cal-range__section {
  color: var(--muted, #9aabbf);
}

html[data-app-theme="night"] .app-bar .cal-range__opt {
  color: var(--ink, #e8eef7);
}

html[data-app-theme="night"] .app-bar .cal-range__opt:hover,
html[data-app-theme="night"] .app-bar .cal-range__opt:focus-visible,
html[data-app-theme="night"] .app-bar .cal-range__opt.is-active,
html[data-app-theme="night"] .app-bar .cal-range__opt--chip.is-active,
html[data-app-theme="night"] .app-bar .cal-range__opt--chip.is-active:hover,
html[data-app-theme="night"] .app-bar .cal-range__opt--chip.is-active:focus-visible,
html[data-app-theme="night"] .app-bar .cal-range__opt--chip.is-on,
html[data-app-theme="night"] .app-bar .cal-range__opt--chip.is-on:hover,
html[data-app-theme="night"] .app-bar .cal-range__opt--chip.is-on:focus-visible {
  background: var(--rh-btn-primary-fill, #1a2d48);
  color: var(--rh-btn-primary, #8eb6e0);
}

html[data-app-theme="night"] .app-bar .cal-range__hint {
  color: var(--muted, #9aabbf);
}

html[data-app-theme="night"] .app-bar .cal-range__sep {
  background: var(--line, #2a3a52);
}

html[data-app-theme="night"] .app-bar .cal-range__toggle-mark {
  border-color: var(--line, #3a4d6a);
  background: var(--panel, #162033);
}

html[data-app-theme="night"] .app-bar .cal-range__toggle.is-on .cal-range__toggle-mark {
  border-color: var(--rh-btn-primary, #8eb6e0);
  background: var(--rh-btn-primary, #8eb6e0);
  box-shadow: inset 0 0 0 2px var(--panel, #162033);
}

.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: 100%;
  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.is-open .app-bar__who-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.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;
}

.app-bar__who-signout {
  display: block;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line, #e2e8f0);
  font-size: 0.8rem;
  color: var(--danger, #dc2626);
  text-decoration: none;
}
.app-bar__who-signout:hover { text-decoration: underline; }

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

/* 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: 0.75rem;
  gap: 0.45rem;
}

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

.app-bar__here-caret {
  flex: 0 0 auto;
  position: static;
  transform: none;
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.85;
  pointer-events: none;
  margin-left: 0.1rem;
}

/* 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: 90;
  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;
}

/* List|Schedule|Map|Installs — use Here ▾ (avoid redundant top-row pills). */
.nav-cluster .calls-switcher {
  display: none !important;
}

/* Here ▾ replaces the old left wordmark — title + nav, all breakpoints. */
.app-bar__home--wordmark {
  display: none !important;
}

.app-bar__brand .app-bar__dash,
.app-bar__start .app-bar__dash {
  z-index: 90;
}

.app-bar__here-btn {
  width: auto;
  min-width: 0;
  max-width: min(16rem, 46vw);
  flex: 0 1 auto;
  justify-content: flex-start;
  padding: 0.4rem 0.95rem 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  gap: 0.5rem;
}

/* Desktop: section nav reads as the title — a step above account. */
@media (min-width: 721px) {
  .app-bar__here-btn {
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0.5rem 1.1rem 0.5rem 1rem;
    min-height: 2.4rem;
    max-width: 18rem;
    gap: 0.55rem;
  }

  .app-bar__here-caret {
    font-size: 1.1rem;
  }
}

.app-bar__here-label {
  text-align: left;
}

/* Sun/moon pill — header (left of account) and Settings tabs. */
.settings-tabs .theme-toggle--pill,
.nav-cluster .theme-toggle--pill {
  flex-shrink: 0;
  height: 2.05rem;
  border-color: var(--rh-btn-line-strong, #c3ccda);
  background: var(--rh-btn-bg, var(--panel, #fff));
}

.settings-tabs .theme-toggle--pill .theme-toggle__btn,
.nav-cluster .theme-toggle--pill .theme-toggle__btn {
  min-width: 2.05rem;
  height: 100%;
  padding: 0 0.55rem;
  font-size: 1.05rem;
}

.app-bar__dash-demo {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line, #d8dee8);
}

.app-bar__dash-link--trial {
  font-weight: 700;
  color: #0b5fad;
}

html[data-app-theme="night"] .app-bar__dash-link--trial {
  color: #8ec0f0;
}

html[data-app-theme="night"] .app-bar__dash-demo {
  border-top-color: #2a3f58;
}

.app-bar__dash-theme-label {
  margin: 0 0 0.35rem;
  padding: 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

/* Menu under left title — open to the right so it stays on-screen. */
.app-bar__brand .app-bar__dash-menu,
.app-bar__start .app-bar__dash-menu {
  right: auto;
  left: 0;
}

@media (max-width: 720px) {
  .app-bar__dash-menu {
    min-width: min(16rem, calc(100vw - 1rem));
    max-width: calc(100vw - 1rem);
  }

  .app-bar__here-btn {
    max-width: min(70vw, 12rem);
    font-size: 1.2rem;
  }

  html[data-app-theme="night"] .app-bar .app-bar__here-btn,
  html[data-app-theme="night"] .cal-chrome .app-bar__here-btn {
    background: #1a2433;
    border-color: #2a3f58;
    color: #e8eef5;
  }
}

/* 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;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-app-theme="night"] .app-bar__wordmark {
  color: #e8eef5;
}
.app-bar__home--wordmark:hover .app-bar__wordmark {
  opacity: 0.85;
}

/* Help: link to public demo (production profile only) */
.guide-intro__demo {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  color: var(--color-muted, #5b6570);
  max-width: 42rem;
}
.guide-intro__demo a {
  font-weight: 600;
  color: var(--color-lane, #0e7c86);
}
