/* estate-topbar.css body-sha256:25c8cb397e1f3292f62490e5181c2b4b3a80febeacf876dd16e6497311080866 */
/*
 * THE ESTATE TOP BAR. One look for the bar across every app (2026-11-26).
 * Canonical copy: estate/topbar/estate-topbar.css. Edit it there, run
 * `python estate/topbar/install.py --stamp`, then install into each repo.
 * The first line carries a checksum of everything below it, so a test in each
 * app can tell a local edit from the real thing even with no estate folder.
 *
 * Chris, 2026-11-26, after the first pass: "order, size, style, and the
 * specific icon" must be the same in every app, based on CRM and
 * Scoping-Quoting. Nothing is removed from a bar and every app's guided tour
 * is left alone (its steps find their targets by id and data-tour, which stay).
 *
 * THE ORDER, left to right on the right-hand side, every app:
 *   version, app launcher, user name, help (?), the app's own items,
 *   bug report, integration failures, sign out.
 * An app shows only the items it has, in this order.
 *
 * THE ICONS are inline SVG from _estate_topbar_icons.html (Jinja) or
 * estateTopbarIcons.js (Node), Font Awesome 5 solid outlines, white, 18px
 * tall, each in the same 32px round button. Help is the plain "?" with no
 * circle round it; the hover ring is the only circle.
 *
 * An app opts in with class hooks:
 *   .estate-topbar           the bar itself
 *   .estate-topbar-logo      the company logo, from the brand pack (required)
 *   .estate-topbar-name      the app's name, beside the logo (required)
 *   .estate-topbar-context   a breadcrumb or page line inside the bar (COS)
 *   .estate-topbar-actions   the right-hand group
 *   .estate-topbar-icon      every icon button in it, holding one estate_icon()
 *   .estate-topbar-user      the signed-in person's name
 *   .estate-topbar-control   an app's own control (a select, a toggle)
 *   .estate-topbar-version   the version link, if it is neither the kit's
 *                            .rn-version nor carries data-testid="version-tag"
 *
 * It does NOT own where the bar is (fixed or sticky), how far a sidebar pushes
 * it right, or its z-index: those belong to each app's layout.
 *
 * Every size is in px, not rem: the estate's root font is 12px in most apps
 * and 14px to 18px in COS (scaled to the screen), so a rem bar would be a
 * different height in every app. No bare element rules; every selector starts
 * at .estate-topbar, so nothing leaks into the page.
 *
 * Load it LAST, after the app's own stylesheets and <style> blocks: the legacy
 * rules it replaces (.new-ui-topheader, .header-dialog-button, .cos-tour-btn)
 * have the same or lower specificity, so order decides. #new-toprightnav is an
 * id rule in the shared new-style.css (position: absolute), so it is named
 * here as well.
 */

/* ---- the bar ------------------------------------------------------------ */
.estate-topbar {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 54px;
  min-height: 54px;
  padding-right: 16px;
  background: #878a91;
  background-image: none;
  border: 0;
  box-shadow: none;
  color: #fff;
  font-family: 'Lato', Arial, sans-serif;
  font-size: 12px;
  line-height: 1.3;
  overflow: visible;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- left: which app, and where in it ------------------------------------ */
.estate-topbar .estate-topbar-logo {
  display: block;
  flex: 0 0 auto;
  height: 26px;
  width: auto;
  max-width: 120px;
  margin: 0;
  padding: 0;
  object-fit: contain;
}
.estate-topbar .estate-topbar-name {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 0;
  padding: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.02em;
  line-height: 22px;
  text-decoration: none;
}
.estate-topbar a.estate-topbar-name:hover { color: #fff; text-decoration: none; }
/* The brand block: a clear break between the logo and the name (Chris:
   "make sure theres enough of a break"). The bar's 16px gap, a thin light
   divider, then 14px: the name's text starts about 31px after the logo.
   ~ not +, since CRM keeps a hidden fallback between the two. */
.estate-topbar .estate-topbar-logo ~ .estate-topbar-name {
  margin-left: 0;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.45);
}
.estate-topbar .estate-topbar-context {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-style: italic;
  font-weight: 400;
}
.estate-topbar .estate-topbar-context a { color: #c8e8f2; text-decoration: none; }
.estate-topbar .estate-topbar-context a:hover { color: #fff; text-decoration: underline; }

/* ---- right: an even 8px between items, every item centred ---------------- */
.estate-topbar .estate-topbar-actions,
.estate-topbar #new-toprightnav.estate-topbar-actions {
  position: static;
  float: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  height: 54px;
  margin: 0 0 0 auto;
  padding: 0;
  right: auto;
  text-align: left;
}
.estate-topbar .estate-topbar-control {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
}
/* 26px tall with no vertical padding of its own: an app class on the select
   (FieldScheduling's .text-input, 8px top and bottom) otherwise leaves 8px
   inside for 12px text and cuts it off. Side padding stays the app's. */
.estate-topbar .estate-topbar-control select {
  box-sizing: border-box;
  height: 26px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 12px;
  line-height: normal;
}

/* The running version: the release-notes kit's .rn-version, or an app's own
   link (every one carries data-testid="version-tag", by estate convention).
   A white pill, so it reads on the grey. */
.estate-topbar .rn-version,
.estate-topbar .estate-topbar-version,
.estate-topbar [data-testid="version-tag"] {
  display: inline-block;
  flex: 0 0 auto;
  align-self: center;
  box-sizing: border-box;
  height: 22px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 11px;
  background: #fff;
  color: #333;
  font-size: 12px;
  font-weight: 400;
  line-height: 20px;
  white-space: nowrap;
  text-decoration: none;
}
.estate-topbar .rn-version:hover, .estate-topbar .rn-version:focus,
.estate-topbar .estate-topbar-version:hover, .estate-topbar .estate-topbar-version:focus,
.estate-topbar [data-testid="version-tag"]:hover, .estate-topbar [data-testid="version-tag"]:focus {
  background: #eef1f5;
  color: #000;
  border-color: rgba(0, 0, 0, 0.35);
}

/* One round 32px button for every icon action, the same size as the app
   launcher's button beside them. */
.estate-topbar .estate-topbar-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.estate-topbar .estate-topbar-icon:hover,
.estate-topbar .estate-topbar-icon[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.estate-topbar .estate-topbar-icon:focus { outline: none; }
.estate-topbar .estate-topbar-icon:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
/* The kit's glyph: one size for every icon, the colour of the button. */
.estate-topbar .estate-topbar-svg {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: 18px;
  margin: 0;
  fill: currentColor;
  pointer-events: none;
}

/* A count on an icon (the estate .badge, or .estate-topbar-badge), pinned to
   the button's top right corner rather than floating where .badge lands. */
.estate-topbar .estate-topbar-icon .badge,
.estate-topbar .estate-topbar-badge {
  position: absolute;
  top: -1px;
  right: -3px;
  left: auto;
  bottom: auto;
  display: block;
  box-sizing: border-box;
  min-width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  padding: 0 4px;
  border: 1px solid #878a91;
  border-radius: 8px;
  background: #d07b18;
  color: #fff;
  font-family: 'Lato', Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}

.estate-topbar .estate-topbar-user {
  display: block;
  flex: 0 1 auto;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 400;
}

/* The estate app launcher (estate/launcher): white like every other icon,
   the same size, no outside margin, since the group's gap spaces it. */
.estate-topbar .estate-launcher { margin: 0; flex: 0 0 auto; }
.estate-topbar .estate-launcher-btn { color: #fff; width: 32px; height: 32px; }
.estate-topbar .estate-launcher-btn svg { width: 18px; height: 18px; }
.estate-topbar .estate-launcher-btn:hover,
.estate-topbar .estate-launcher-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ---- a narrow window (a phone, or a desktop window made small) ----------
 * Nothing may overlap and nothing may run off the screen. The logo and the
 * name both stay (Chris: both, on every app); the logo gets smaller and the
 * name shortens with an ellipsis; the context line, version and user's name
 * are hidden; every action stays on screen. */
@media (max-width: 640px) {
  .estate-topbar { gap: 8px; padding-right: 8px; }
  .estate-topbar .estate-topbar-actions,
  .estate-topbar #new-toprightnav.estate-topbar-actions { gap: 2px; }
  .estate-topbar .estate-topbar-context,
  .estate-topbar .rn-version,
  .estate-topbar .estate-topbar-version,
  .estate-topbar [data-testid="version-tag"],
  .estate-topbar .estate-topbar-user { display: none; }
  .estate-topbar .estate-topbar-name { font-size: 15px; }
  .estate-topbar .estate-topbar-logo { height: 20px; max-width: 64px; }
  .estate-topbar .estate-topbar-logo ~ .estate-topbar-name { padding-left: 8px; }
  .estate-topbar .estate-topbar-icon,
  .estate-topbar .estate-launcher-btn { width: 30px; height: 30px; }
  .estate-topbar .estate-topbar-svg,
  .estate-topbar .estate-launcher-btn svg { height: 16px; }
  .estate-topbar .estate-launcher-btn svg { width: 16px; }
  /* An app's own control (COS's view switcher) gives way after the name: it
     narrows, and its icon goes, so a bar squeezed by a wide sidebar (COS
     leaves it 166px at 390) still ends inside the screen.
     The group itself never goes narrower than its icons (min-content: every
     button is a fixed 30px, so only a control can give). It used to be
     min-width: 0, which let the group shrink below its buttons; they spilled
     out to the left and drew over the app's name (Task Management at 390px,
     16px over it). The name is what shortens instead, with its ellipsis. */
  .estate-topbar .estate-topbar-actions,
  .estate-topbar #new-toprightnav.estate-topbar-actions { flex: 0 1 auto; min-width: min-content; }
  .estate-topbar .estate-topbar-icon,
  .estate-topbar .estate-launcher { flex-shrink: 0; }
  .estate-topbar .estate-topbar-control { flex: 0 1 auto; min-width: 0; overflow: hidden; }
  .estate-topbar .estate-topbar-control .estate-topbar-svg { display: none; }
  .estate-topbar .estate-topbar-control select { min-width: 0; max-width: 100%; width: 100%; }
  /* The launcher's panel hangs from its button's right edge; with the button
     part-way along a narrow bar, 300px of panel runs off the left of the
     screen. Pin it to the screen's right edge, just under the bar, instead. */
  .estate-topbar .estate-launcher-panel {
    position: fixed;
    top: 58px;
    right: 8px;
    left: auto;
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
  }
}
