/* Keep top-bar dropdowns above the site menu and sticky page headers.
   The topbar creates a stacking context, so its z-index must clear the
   site menu navbar (z-index 1100) and its dropdowns (1101) or the farm
   selector dropdown paints underneath the site menu.

   NOTE: the selector is `.navbar.topbar` (not just `.topbar`) because
   sidebar.css loads AFTER this file and sets `.navbar { z-index: 1100; }`
   on the same element. The two-class selector has higher specificity, so
   it wins regardless of source order. */
.navbar.topbar { position: relative; z-index: 1200; }

/* Top bar base */
.topbar-colors {
    background: #fff;
    /* live default */
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Test environment visual cue (pale warning pink) */
.topbar-colors--notlive {
    background: #ffe8ef !important;
    border-bottom-color: #ffc2d0 !important;
}

/* Right side badges */
.env-badges {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
    /* pushes to right */
    margin-right: 1rem;
    /* spacing */
}

.env-badge {
    font-size: .9rem;
    line-height: 1;
    color: #333;
}

.env-badge strong {
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    color: #fff;
    background: #2e7d32;
    /* live: green */
}

.topbar-colors--notlive .env-badge strong {
    background: #d32f2f;
}

/* Admin API link (base-template.html, right of the env badges) */
.api-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    margin: 0 .35rem;
    color: #555;
}

.api-link-label {
    margin-left: .5rem;
}

/* Current-farm display + selector (farm-selector.html) */
.farm-selector {
    display: flex;
    align-items: center;
    margin-left: .5rem;
}

.farm-selector .farm-selector-toggle,
.farm-selector .farm-selector-label {
    display: inline-flex;
    align-items: center;
    padding: .35rem .85rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 2rem;
    font-weight: 600;
    white-space: nowrap;
    /* transparent so the header colour (white / warning pink) shows through */
}

.farm-selector .farm-selector-toggle::after {
    margin-left: .5rem;
}

.farm-selector .farm-selector-current {
    color: #555;
}

.topbar .nav-item.farm-selector .farm-selector-toggle,
.topbar .nav-item.farm-selector .farm-selector-label {
  height: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  padding: .35rem .85rem;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 2rem;
}

/* Farm selector dropdown: nuke-top. It's a menu, it belongs on top of
   everything. 9999 clears the site menu (1100/1101) and every other
   stacked element in the topbar's stacking context. */
.topbar .nav-item.farm-selector .dropdown-menu {
  z-index: 9999;
}

.site-title { font-family: Manrope, sans-serif; font-size: 26px; line-height: 1.3; font-weight: 600; color: #2c3e50; letter-spacing: .2px; }

/* Bootstrap modals must sit above the top bar's 9999 menus on every page. */
.modal { z-index: 99999 !important; }
.modal-backdrop { z-index: 99998 !important; }
