/* NurseLink Credentials Page Repair v64.8.5 */

html[data-nl6485-credentials="1"] {
  --nl6485-content-width: calc(100vw - var(--nl6484-topbar-left, 264px) - 48px);
}

/* Hard-anchor the viewport-level topbar host on Credentials. */
html[data-nl6485-credentials="1"] #nl6484-topbar-host {
  position: fixed !important;
  top: 0 !important;
  left: var(--nl6484-topbar-left, 122px) !important;
  right: 0 !important;
  bottom: auto !important;
  transform: none !important;
  margin: 0 !important;
  z-index: 9500 !important;
}

/* Prevent any stale page fragment from showing once marked by JS. */
html[data-nl6485-credentials="1"] [data-nl6485-stale-fragment="1"] {
  display: none !important;
  visibility: hidden !important;
}

/* Normalize the real Credentials page container. */
html[data-nl6485-credentials="1"] [data-nl6485-credentials-root="1"] {
  width: min(100%, var(--nl6485-content-width)) !important;
  max-width: var(--nl6485-content-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* Remove duplicated top gaps left by earlier shell/page patches. */
html[data-nl6485-credentials="1"] [data-nl6485-credentials-main="1"] {
  padding-top: var(--nl6484-topbar-height, 64px) !important;
  margin-top: 0 !important;
  box-sizing: border-box !important;
  min-height: 100vh;
}

/* First credentials block should not inherit giant route spacing. */
html[data-nl6485-credentials="1"] [data-nl6485-credentials-root="1"] > :first-child {
  margin-top: 0 !important;
}

/* Keep cards/tables inside dashboard width. */
html[data-nl6485-credentials="1"] [data-nl6485-credentials-root="1"] table,
html[data-nl6485-credentials="1"] [data-nl6485-credentials-root="1"] [role="table"] {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Avoid page-wide horizontal overflow. */
html[data-nl6485-credentials="1"] body {
  overflow-x: hidden !important;
}

@media (max-width: 1100px) {
  html[data-nl6485-credentials="1"] {
    --nl6485-content-width: calc(100vw - 180px);
  }
}

@media (max-width: 900px) {
  html[data-nl6485-credentials="1"] {
    --nl6485-content-width: calc(100vw - 24px);
  }

  html[data-nl6485-credentials="1"] #nl6484-topbar-host {
    left: 0 !important;
    width: 100% !important;
  }

  html[data-nl6485-credentials="1"] [data-nl6485-credentials-root="1"] {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }
}
