/* Authenticated desktop workspace shell. Kept separate for reliable CDN versioning. */
.is-authenticated-app {
  --app-sidebar-width: 252px;
  --app-shell-ink: #12233f;
  --app-shell-muted: #69768b;
  --app-shell-line: #e5eaf1;
  --app-shell-blue: #0b4cad;
  background: #f6f8fb;
}

.app-mobile-shell,
.app-sidebar__mobile-close,
.app-sidebar-scrim {
  display: none;
}

.is-authenticated-app .app-sidebar__mobile-close {
  display: none !important;
}

.is-authenticated-app > .app-shell-nav {
  display: none !important;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1025;
  width: var(--app-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--app-shell-line);
  background: #fbfcfe;
  color: var(--app-shell-ink);
  padding: 1rem 0.75rem 0.8rem;
}

.app-sidebar__top {
  display: grid;
  gap: 0.75rem;
}

.app-sidebar__brand {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  padding: 0 0.45rem;
  color: #092958;
  font-size: 1.02rem;
  font-weight: 850;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.app-sidebar__brand:hover { color: #071d3c; }
.app-sidebar__brand img { width: 31px; height: 31px; object-fit: contain; }

.app-sidebar__workspace {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  min-width: 0;
  border: 1px solid var(--app-shell-line);
  border-radius: 11px;
  background: #fff;
  padding: 0.62rem;
  box-shadow: 0 4px 14px rgba(25, 48, 82, 0.035);
}

.app-sidebar__workspace-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #0b4cad, #12366c);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.app-sidebar__workspace-copy {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.app-sidebar__workspace-copy strong {
  overflow: hidden;
  color: #12233f;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar__eyebrow {
  margin-bottom: 0.12rem;
  color: #8490a3;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.app-sidebar__create {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid #0b4cad;
  border-radius: 9px;
  background: #0b4cad;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 780;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(11, 76, 173, 0.16);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.app-sidebar__create:hover,
.app-sidebar__create:focus {
  background: #083e8e;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(11, 76, 173, 0.22);
}

.app-sidebar__create svg { width: 17px; height: 17px; }

.app-sidebar__nav {
  display: grid;
  align-content: start;
  gap: 0.15rem;
  margin-top: 1.15rem;
}

.app-sidebar__label {
  margin: 0.55rem 0.5rem 0.28rem;
  color: #929daf;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.app-sidebar__link {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 0.68rem;
  border-radius: 8px;
  color: #526075;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 680;
  line-height: 1.2;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.app-sidebar__link svg { width: 18px; height: 18px; flex: 0 0 18px; }
.app-sidebar__link:hover,
.app-sidebar__link:focus { background: #f0f4f9; color: #16365e; }
.app-sidebar__link.is-active { background: #e8f0fc; color: #0a469e; }

.app-sidebar__link.is-active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 99px;
  background: #0b4cad;
  content: "";
}

.app-sidebar__subnav {
  position: relative;
  display: grid;
  gap: 0.08rem;
  margin: 0.08rem 0 0.38rem 1.25rem;
  padding: 0.18rem 0 0.18rem 0.72rem;
}

.app-sidebar__subnav::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  border-radius: 99px;
  background: #d9e3ee;
  content: "";
}

.app-sidebar__subnav-link {
  position: relative;
  min-height: 29px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  color: #718096;
  font-size: 0.72rem;
  font-weight: 680;
  line-height: 1.2;
  padding: 0.34rem 0.5rem;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.app-sidebar__subnav-link:hover,
.app-sidebar__subnav-link:focus {
  background: #f0f4f9;
  color: #24496d;
}

.app-sidebar__subnav-link.is-active {
  background: #edf3fb;
  color: #0b4cad;
  font-weight: 780;
}

.app-sidebar__subnav-link.is-active::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -0.75rem;
  width: 2px;
  border-radius: 99px;
  background: #0b4cad;
  content: "";
}

.app-sidebar__subnav-link.is-danger {
  color: #b5473c;
}

.app-sidebar__subnav-link.is-danger.is-active {
  background: #fff1f0;
  color: #b42318;
}

.app-sidebar__subnav-link.is-danger.is-active::before {
  background: #d92d20;
}

.app-sidebar__divider { height: 1px; margin: 0.8rem 0.5rem 0.25rem; background: var(--app-shell-line); }

.app-sidebar__project-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin: 0.1rem 0.35rem 0.3rem;
  color: #1c2f4b;
  font-size: 0.78rem;
}

.app-sidebar__project-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sidebar__project-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 99px; background: #35a177; box-shadow: 0 0 0 3px #e5f6ef; }
.app-sidebar__project-actions { display: grid; gap: .42rem; margin: .7rem .45rem 0; border-top: 1px solid var(--app-shell-line); padding-top: .7rem; }
.app-sidebar__project-action { display: inline-flex; align-items: center; justify-content: center; min-height: 2.15rem; border: 1px solid #cbd9e7; border-radius: 8px; background: #fff; color: #315879; font-size: .73rem; font-weight: 780; text-decoration: none; }
.app-sidebar__project-action:hover, .app-sidebar__project-action:focus { border-color: #98b4ce; background: #f4f8fc; color: #123f63; }
.app-sidebar__project-action.is-primary { border-color: #0a4f78; background: #0a4f78; color: #fff; }
.app-sidebar__project-action.is-primary:hover, .app-sidebar__project-action.is-primary:focus { border-color: #063a5b; background: #063a5b; color: #fff; }

.app-sidebar__bottom {
  display: grid;
  gap: 0.15rem;
  margin-top: auto;
  padding-top: 1rem;
}

.app-sidebar__account {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 0.52rem;
  margin-top: 0.45rem;
  border-top: 1px solid var(--app-shell-line);
  padding: 0.85rem 0.35rem 0;
}

.app-sidebar__account > a:not(.app-sidebar__notification) {
  min-width: 0;
  display: grid;
  color: #1d304d;
  line-height: 1.22;
  text-decoration: none;
}

.app-sidebar__account strong,
.app-sidebar__account > a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sidebar__account strong { font-size: 0.76rem; font-weight: 780; }
.app-sidebar__account > a > span { margin-top: 0.13rem; color: #7b8799; font-size: 0.64rem; }
.app-sidebar__account .identity-avatar { border: 0; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1); }

.app-sidebar__notification {
  border: 0;
  background: transparent;
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #68768a;
}

.app-sidebar__notification:hover { background: #edf2f8; color: #0b4cad; }
.app-sidebar__notification svg { width: 17px; height: 17px; }

.app-sidebar__notification.has-unread::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #e54d4d;
  content: "";
}

.app-layout-main {
  width: auto;
  min-height: 100vh;
  margin-left: var(--app-sidebar-width);
}

@media (min-width: 992px) {
  .is-authenticated-app > .app-shell-nav { display: none !important; }
}

@media (max-width: 991.98px) {
  .app-mobile-shell {
    position: sticky;
    top: var(--global-mobile-app-banner-offset, 0px);
    z-index: 1040;
    min-height: 58px;
    display: grid;
    grid-template-columns: 38px 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem;
    border-bottom: 1px solid #dfe5ed;
    background: rgba(255, 255, 255, 0.97);
    padding: 0.55rem 0.65rem;
    backdrop-filter: blur(14px);
  }

  .app-mobile-shell__button {
    position: relative;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #153252;
    padding: 0;
    text-decoration: none;
  }

  .app-mobile-shell__button:hover,
  .app-mobile-shell__button:focus {
    background: #edf3f8;
    color: #0b4cad;
  }

  .app-mobile-shell__button svg {
    width: 20px;
    height: 20px;
  }

  .app-mobile-shell__identity {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    text-decoration: none;
  }

  .app-mobile-shell__identity .identity-avatar {
    --identity-size: 31px;
    border: 0;
  }

  .app-mobile-shell__context {
    min-width: 0;
    display: grid;
    color: #142943;
    line-height: 1.12;
    text-decoration: none;
  }

  .app-mobile-shell__context strong,
  .app-mobile-shell__context span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-mobile-shell__context strong {
    font-size: 0.78rem;
    font-weight: 800;
  }

  .app-mobile-shell__context span {
    margin-top: 0.13rem;
    color: #7a8798;
    font-size: 0.64rem;
  }

  .app-mobile-shell__actions {
    display: flex;
    align-items: center;
    gap: 0.05rem;
  }

  .app-mobile-shell__notification.has-unread::after {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #e34848;
    content: "";
  }

  .app-sidebar {
    inset: 0 auto 0 0;
    z-index: 1080;
    width: min(332px, calc(100vw - 34px));
    min-height: 100dvh;
    display: flex;
    padding: 1rem 0.85rem 0.8rem;
    box-shadow: 22px 0 55px rgba(12, 29, 50, 0.2);
    transform: translateX(-105%);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
    visibility: hidden;
  }

  .mobile-sidebar-open .app-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .is-authenticated-app .app-sidebar__mobile-close {
    position: absolute;
    top: 0.8rem;
    right: 0.65rem;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: #edf2f7;
    color: #52647a;
    font-size: 1.15rem;
    line-height: 1;
  }

  .app-sidebar__brand {
    padding-right: 2.4rem;
  }

  .app-sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 1070;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(12, 23, 39, 0.48);
    padding: 0;
  }

  .app-sidebar-scrim:not([hidden]) {
    display: block;
  }

  .mobile-sidebar-open {
    overflow: hidden;
  }

  .app-layout-main { min-height: 0; margin-left: 0; }
}

.project-page-header {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 1180px);
  margin: 0 auto 1.5rem;
  padding: 1.35rem 1rem 1.8rem;
  text-align: center;
}
.project-page-header__content { min-width: 0; }
.project-page-header__eyebrow {
  color: #1b5c91;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.project-page-header h1 {
  max-width: 920px;
  margin: .35rem auto 0;
  color: #10233f;
  font-size: clamp(2.25rem, 4.4vw, 4rem);
  font-weight: 850;
  letter-spacing: -.055em;
  line-height: .98;
  text-wrap: balance;
}
.project-page-header p {
  max-width: 780px;
  margin: .75rem auto 0;
  color: #526b87;
  font-size: clamp(.92rem, 1.35vw, 1.05rem);
  line-height: 1.5;
  text-wrap: balance;
}
.project-page-header__context {
  display: inline-flex;
  margin-top: .8rem;
  border: 1px solid #ccdceb;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: #315879;
  font-size: .74rem;
  font-weight: 780;
  padding: .32rem .68rem;
}
.project-page-header > a {
  position: absolute;
  top: 1.35rem;
  right: 0;
  border: 1px solid #c9d7e5;
  border-radius: 8px;
  background: #fff;
  color: #315879;
  font-size: .73rem;
  font-weight: 750;
  padding: .48rem .68rem;
  text-decoration: none;
}
.project-page-header > a:hover, .project-page-header > a:focus { border-color: #9eb9d2; background: #f4f8fc; color: #0b4cad; }

.investigations-page .investigations-shell { width: min(100%, 1440px); max-width: 1440px; padding-top: .55rem !important; }
.investigations-page .investigations-card, .investigations-page .records-workbook-panel, .investigations-page .records-tools-card { border-radius: 11px; box-shadow: 0 10px 26px rgba(25,48,78,.05); }

@media (max-width: 991.98px) {
  .project-page-header { margin-bottom: 1rem; padding: 1rem .75rem 1.25rem; }
  .project-page-header h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .project-page-header > a { position: static; margin-top: .75rem; }
}

@media (max-width: 575.98px) {
  .project-page-header h1 { font-size: 2.15rem; }
  .project-page-header > a { width: 100%; text-align: center; }
  .investigations-page .investigations-shell { padding-inline: .75rem; }
}

.notifications-page .app-layout-main { background: #f5f7fa; }
.notifications-center { width: min(100% - 2rem, 980px); margin: 0 auto; padding: .5rem 0 3rem; }
.notifications-center > .d-flex:first-child { margin-bottom: 1rem !important; border-bottom: 1px solid #dfe6ee; padding: .45rem 0 1rem; }
.notifications-center h1 { color: #10233f; font-size: 1.75rem !important; font-weight: 830; letter-spacing: -.035em; }
.notifications-center > form.row { display: flex; align-items: end; gap: .55rem; margin: 0 0 .85rem !important; border: 1px solid #dfe6ee; border-radius: 10px; background: #fff; padding: .7rem; }
.notifications-center > form.row > div { width: auto; flex: 1 1 210px; padding: 0; }
.notifications-center .list-group { display: grid; gap: .6rem; }
.notifications-center .list-group-item { border: 1px solid #dfe6ee !important; border-radius: 11px !important; background: #fff; box-shadow: 0 7px 20px rgba(30,52,80,.04); }
.notifications-center .badge { border-radius: 999px; font-size: .62rem; font-weight: 760; }
.notifications-center .alert { border-radius: 11px; background: #fff; color: #6d7b8e; padding: 1.2rem; text-align: center; }
@media (max-width: 575.98px) {
  .notifications-center { width: calc(100% - 1.5rem); padding-top: .25rem; }
  .notifications-center > .d-flex:first-child { align-items: flex-start !important; }
  .notifications-center h1 { font-size: 1.4rem !important; }
  .notifications-center > form.row { display: grid; }
  .notifications-center > form.row > div { width: 100%; }
  .notifications-center .list-group-item { padding: .85rem !important; }
}

.workspace-page-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0 0 16px;
  color: #405c78;
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}

.workspace-page-back:hover {
  color: #0b4d75;
  text-decoration: none;
}

.records-anchor-target {
  display: block;
  position: relative;
  top: -18px;
  scroll-margin-top: 22px;
}
