/* UniqQ Sticky Context Bar v1: compact page identity plus the page's complete command set. */

/*
 * Compact Header v1 compatibility bridge.
 *
 * Older UniqQ views already declare a semantic page header, title owner, and
 * action owner.  Style that complete contract as Compact Header v1 from this
 * shared asset so those pages do not need another page-specific header skin.
 * Rich workflow heroes without both owners stay untouched until their content
 * is deliberately decomposed into title, commands, and body guidance.
 */
[data-uq-page-header] [data-uq-header-guidance] {
  display: none !important;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero):has([data-uq-header-title], [data-uq-page-header-title]):has([data-uq-header-actions], [data-uq-page-header-actions]) {
  --uq-compact-page-hero-height: 80px;
  --uq-compact-page-hero-padding-y: 8px;
  --uq-compact-page-hero-padding-x: 28px;
  --uq-compact-page-hero-radius: 20px;
  --uq-compact-page-hero-background: linear-gradient(112deg, #0a8068 0%, #0a8068 71%, #176b62 100%);
  --uq-compact-page-hero-background-color: #0a8068;
  align-items: center !important;
  background: var(--uq-compact-page-hero-background) !important;
  background-color: var(--uq-compact-page-hero-background-color) !important;
  border: 0 !important;
  border-radius: var(--uq-compact-page-hero-radius) !important;
  box-shadow: 0 10px 28px rgba(9, 82, 70, .12) !important;
  box-sizing: border-box !important;
  color: #fff !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 14px !important;
  isolation: isolate;
  justify-content: space-between !important;
  margin: 0 0 16px !important;
  min-height: var(--uq-compact-page-hero-height) !important;
  overflow: visible !important;
  padding: var(--uq-compact-page-hero-padding-y) var(--uq-compact-page-hero-padding-x) !important;
  position: relative !important;
  width: 100% !important;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero):has([data-uq-header-title], [data-uq-page-header-title]):has([data-uq-header-actions], [data-uq-page-header-actions])::after {
  background: url('../img/Logo-Q.png') no-repeat right -12px center / 230px auto;
  border-radius: inherit;
  content: "";
  inset: 0;
  opacity: .16;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero):has([data-uq-header-title], [data-uq-page-header-title]):has([data-uq-header-actions], [data-uq-page-header-actions]) > * {
  min-width: 0;
  position: relative;
  z-index: 1;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-title], [data-uq-page-header-title]) {
  align-items: center;
  column-gap: 8px;
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, max-content) auto;
  max-width: min(100%, 760px);
  min-width: 0;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-title], [data-uq-page-header-title]) > :is(.text-muted, [data-uq-breadcrumb]):first-child {
  color: rgba(255, 255, 255, .82) !important;
  font-size: calc(var(--uq-font-caption, 14px) * var(--uniqq-ui-scale, 1)) !important;
  font-weight: 650 !important;
  line-height: var(--uq-line-height-heading, 1.3) !important;
  margin: 0 0 3px !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-title], [data-uq-page-header-title]) > :is(.text-muted, [data-uq-breadcrumb]):first-child {
  grid-column: 1 / -1;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-title], [data-uq-page-header-title]) > :is(h1, h2, h3) {
  grid-column: 1;
  min-width: 0;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-title], [data-uq-page-header-title]) > .uq-context-help {
  grid-column: 2;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-title], [data-uq-page-header-title]) > :not(.text-muted):not([data-uq-breadcrumb]):not(h1):not(h2):not(h3):not(.uq-context-help) {
  grid-column: 1 / -1;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) .uq-compact-page-hero__title-row {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) .uq-compact-page-hero__title-row > :is(h1, h2, h3, h4) {
  min-width: 0;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-page-back]:not(.uq-mobile-page-back-source), [data-uq-mobile-page-back]) {
  align-items: center;
  background: #fff !important;
  border: 1px solid rgba(255, 255, 255, .84) !important;
  border-radius: 50% !important;
  color: #08715f !important;
  display: inline-flex !important;
  flex: 0 0 36px;
  height: 36px;
  justify-content: center;
  padding: 0 !important;
  text-decoration: none;
  width: 36px;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-page-back]:not(.uq-mobile-page-back-source), [data-uq-mobile-page-back]):hover {
  background: #eafbf6 !important;
  box-shadow: 0 8px 18px rgba(5, 43, 39, .2);
  color: #075f51 !important;
  transform: translateX(-2px);
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is(h1, h2, h3) {
  color: #fff !important;
  font-size: clamp(1.25rem, 1.7vw, 1.55rem) !important;
  font-weight: 750 !important;
  letter-spacing: -.02em;
  line-height: var(--uq-line-height-heading, 1.3) !important;
  margin: 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-text-fill-color: #fff !important;
  white-space: nowrap;
}

html[data-uq-theme] body:not(.pos-page) .content [data-uq-page-header].uq-compact-page-hero-compat[data-uq-header-standard="compact-v1"] :is(h1, h2, h3) {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  opacity: 1 !important;
}

/*
 * The application shell also assigns its legacy 58px header token and may add
 * uq-has-embedded-global-controls after page load.  Lock the runtime-marked
 * compatibility header to the Compact Header v1 box model so those older,
 * later-loaded rules cannot shrink the hero or remove its right padding.
 */
html body:not(.pos-page) .content [data-uq-page-header].uq-compact-page-hero-compat[data-uq-header-standard="compact-v1"] {
  min-height: 80px !important;
  padding: 8px 28px !important;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-actions], [data-uq-page-header-actions]) {
  align-items: center;
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap !important;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
  max-width: min(58%, 900px);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-actions], [data-uq-page-header-actions]) .uq-header-command-strip {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-actions], [data-uq-page-header-actions]) .btn {
  background: rgba(255, 255, 255, .97) !important;
  border-color: rgba(255, 255, 255, .88) !important;
  color: #086552 !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-actions], [data-uq-page-header-actions]) .btn:hover,
html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-actions], [data-uq-page-header-actions]) .btn:focus-visible {
  background: #eafbf6 !important;
  border-color: #d5f5eb !important;
  color: #064e42 !important;
}

.uq-compact-page-guidance {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(10, 128, 104, .16);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(9, 82, 70, .06);
  color: var(--bs-body-color, #23323f);
  margin: -6px 0 16px;
  padding: 12px 16px;
}

.uq-compact-page-guidance > :last-child {
  margin-bottom: 0 !important;
}

@media (max-width: 767.98px) {
  html body [data-uq-page-header]:not(.uq-compact-page-hero):has([data-uq-header-title], [data-uq-page-header-title]):has([data-uq-header-actions], [data-uq-page-header-actions]) {
    align-items: flex-start !important;
    border-radius: 16px !important;
    flex-wrap: wrap !important;
    min-height: 0 !important;
    padding: 14px 16px !important;
  }

  html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-title], [data-uq-page-header-title]),
  html body [data-uq-page-header]:not(.uq-compact-page-hero) :is([data-uq-header-actions], [data-uq-page-header-actions]) {
    margin-left: 0;
    max-width: 100%;
    width: 100%;
  }

  html body:not(.pos-page) .content [data-uq-page-header].uq-compact-page-hero-compat[data-uq-header-standard="compact-v1"] {
    min-height: 0 !important;
    padding: 14px 16px !important;
  }


  .uq-compact-page-guidance {
    border-radius: 12px;
    margin-top: -8px;
    padding: 10px 12px;
  }
}

.uq-sticky-context-bar {
  --uq-sticky-context-height: 52px;
  --uq-sticky-context-top: 8px;
  box-sizing: border-box;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: var(--uq-sticky-context-top);
  transform: translateY(-8px);
  transition: opacity .16s ease, transform .16s ease;
  visibility: hidden;
  z-index: 1042;
}

.uq-sticky-context-bar.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.uq-sticky-context-bar__inner {
  align-items: center;
  backdrop-filter: blur(12px);
  background: var(--uq-compact-page-hero-background, linear-gradient(112deg, #0a8068 0%, #0a8068 71%, #176b62 100%));
  background-color: var(--uq-compact-page-hero-background-color, #0a8068);
  border: 1px solid rgba(255, 255, 255, .22);
  border-left: 4px solid rgba(255, 255, 255, .78);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(9, 82, 70, .16);
  box-sizing: border-box;
  display: flex;
  gap: 12px;
  height: var(--uq-sticky-context-height);
  justify-content: space-between;
  min-width: 0;
  padding: 6px 8px 6px 10px;
  width: 100%;
}

.uq-sticky-context-bar__identity {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 9px;
  min-width: 0;
}

.uq-sticky-context-bar__back:empty,
.uq-sticky-context-bar__actions:empty {
  display: none;
}

.uq-sticky-context-bar__back :is(.uq-compact-page-hero__back, [data-uq-page-back], [data-uq-mobile-page-back]) {
  align-items: center;
  background: #e8fbf7 !important;
  border-color: #a9d9cd !important;
  border-radius: 50% !important;
  box-shadow: none;
  box-sizing: border-box;
  color: #08735f !important;
  display: inline-flex !important;
  flex-basis: 36px;
  height: 36px;
  inset: auto !important;
  justify-content: center;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  transform: none !important;
  width: 36px;
}

.uq-sticky-context-bar__back :is(.uq-compact-page-hero__back, [data-uq-page-back], [data-uq-mobile-page-back]) > i {
  line-height: 1;
}

.uq-sticky-context-bar__title {
  color: #fff;
  flex: 0 1 auto;
  font-size: calc(17px * var(--uniqq-ui-scale, 1));
  font-weight: 800;
  line-height: var(--uq-line-height-heading, 1.3);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uq-sticky-context-bar__status {
  align-items: center;
  background: #fff7e6;
  border: 1px solid #f1d095;
  border-radius: 999px;
  color: #8a5a08;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: calc(12px * var(--uniqq-ui-scale, 1));
  font-weight: 700;
  gap: 5px;
  min-height: 28px;
  padding: 3px 9px;
  white-space: nowrap;
}

.uq-sticky-context-bar__status[hidden] {
  display: none !important;
}

.uq-sticky-context-bar__status::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 6px;
  width: 6px;
}

.uq-sticky-context-bar__actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  justify-content: flex-end;
  max-width: min(68%, 920px);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.uq-sticky-context-bar__actions .uq-header-command-strip {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
}

html body .uq-sticky-context-bar__actions .uq-header-command-strip .btn,
html body .uq-sticky-context-bar__actions > .btn,
html[data-uq-theme] body:not(.pos-page) .uq-sticky-context-bar[data-uq-sticky-context-bar] .uq-sticky-context-bar__actions .uq-header-command-strip .btn,
html[data-uq-theme] body:not(.pos-page) .uq-sticky-context-bar[data-uq-sticky-context-bar] .uq-sticky-context-bar__actions > .btn {
  align-items: center;
  background: rgba(255, 255, 255, .97) !important;
  border-color: rgba(255, 255, 255, .88) !important;
  color: #086552 !important;
  display: inline-flex;
  font-weight: 750 !important;
  justify-content: center;
  min-height: 38px;
  white-space: nowrap;
}

html body .uq-sticky-context-bar__actions .uq-header-command-strip .btn:hover,
html body .uq-sticky-context-bar__actions .uq-header-command-strip .btn:focus-visible,
html body .uq-sticky-context-bar__actions > .btn:hover,
html body .uq-sticky-context-bar__actions > .btn:focus-visible,
html[data-uq-theme] body:not(.pos-page) .uq-sticky-context-bar[data-uq-sticky-context-bar] .uq-sticky-context-bar__actions .uq-header-command-strip .btn:hover,
html[data-uq-theme] body:not(.pos-page) .uq-sticky-context-bar[data-uq-sticky-context-bar] .uq-sticky-context-bar__actions .uq-header-command-strip .btn:focus-visible,
html[data-uq-theme] body:not(.pos-page) .uq-sticky-context-bar[data-uq-sticky-context-bar] .uq-sticky-context-bar__actions > .btn:hover,
html[data-uq-theme] body:not(.pos-page) .uq-sticky-context-bar[data-uq-sticky-context-bar] .uq-sticky-context-bar__actions > .btn:focus-visible {
  background: #eafbf6 !important;
  border-color: #d5f5eb !important;
  color: #064e42 !important;
}

.uq-sticky-context-bar__actions .uq-context-help-trigger {
  background: rgba(255, 255, 255, .12) !important;
  border-color: rgba(255, 255, 255, .34) !important;
  color: #fff !important;
}

@media (max-width: 767.98px) {
  .uq-sticky-context-bar {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: 8px !important;
    right: 8px !important;
    top: auto;
    width: auto !important;
    z-index: 1044;
  }

  .uq-sticky-context-bar__inner {
    border-left-width: 1px;
    border-top: 1px solid rgba(255, 255, 255, .22);
    height: 56px;
    padding: 6px 8px;
  }

  .uq-sticky-context-bar__status {
    display: none;
  }

  .uq-sticky-context-bar__title {
    font-size: calc(15px * var(--uniqq-ui-scale, 1));
  }

  .uq-sticky-context-bar__actions {
    max-width: 62%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .uq-sticky-context-bar {
    transition: none;
  }
}

@media print {
  .uq-sticky-context-bar {
    display: none !important;
  }
}
-bar {
    transition: none;
  }
}

@media print {
  .uq-sticky-context-bar {
    display: none !important;
  }
}
