/* Shared header finish, loaded after page styles. Business content is untouched. */
:root {
  --crm-header-height: 62.7px; /* 66px × 0.95 */
  --crm-header-fill: linear-gradient(105deg, #eff3fa, #fbfcfe 48%, #f2eff8);
  --crm-header-shadow: 0 5px 20px rgba(59, 72, 99, .08), inset 0 -1px 0 rgba(255, 255, 255, .85);
}

/* The existing content offset follows this variable, including when the menu opens. */
body {
  --swegga-compact-header-height: var(--crm-header-height) !important;
}

html body:is(.page-index, .page-tasks, .page-financial-calendar, .page-costing, .page-access, .page-pulse, .page-finance, .warehouse-page) :is(.page-top-title.page-header, .wh-page-header) {
  height: var(--crm-header-height) !important;
  min-height: var(--crm-header-height) !important;
  background: var(--crm-header-fill) !important;
  border-bottom: 1px solid #c8d1e0 !important;
  box-shadow: var(--crm-header-shadow) !important;
}

/* Keep the title underline, but remove stray strokes and page-specific glow. */
html body :is(.page-header, .wh-page-header)::before,
html body :is(.page-header, .wh-page-header)::after,
html body .page-header__decor::after,
html body .page-header:not([data-page-type="pulse"]):not([data-page-type="cost"]):not([data-page-type="finance"]) .page-header__decor {
  display: none !important;
}

html body .page-header[data-page-type="cost"] .page-header__decor {
  display: block !important;
  clip-path: none !important;
  opacity: 1 !important;
}

html body .page-header[data-page-type="finance"] .page-header__decor {
  display: block !important;
  clip-path: none !important;
  opacity: 1 !important;
}

html body :is(.page-header__underline, .wh-page-header-line) {
  display: block !important;
  width: 97px;
  height: 3px;
  margin: 6px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f6bff, #7b4dff 52%, #f05acd);
  box-shadow: 0 7px 20px rgba(123, 77, 255, .2);
}

html body.page-finance {
  padding-top: calc(var(--crm-header-height) + 16px) !important;
}

html body.warehouse-page {
  padding-top: calc(var(--crm-header-height) + 18px) !important;
}

@media (max-width: 900px) {
  :root {
    --crm-header-height: 55.1px; /* 58px × 0.95 */
  }

  /* Finance and logistics previously keep the desktop header at this breakpoint. */
  body:is(.page-finance, .warehouse-page) {
    --crm-header-height: 62.7px;
  }
}

@media (max-width: 700px) {
  body.warehouse-page {
    --crm-header-height: 55.1px;
  }

  html body.warehouse-page {
    padding-top: calc(var(--crm-header-height) + 14px) !important;
  }
}
