/* ==========================================================================
   Layout: the signed-in shell (navy sidebar and content column) and the
   page header every page starts with. The public header is in site.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   App shell: navy sidebar + content column
   -------------------------------------------------------------------------- */

/* Less the environment banner above it, so a short page doesn't scroll by the banner's height */
.app-shell {
  min-height: calc(100vh - var(--env-banner-height));
}

.app-body {
  display: flex;
  min-width: 0;
  min-height: calc(100vh - var(--env-banner-height));
  flex-direction: column;
}

.app-main {
  width: 100%;
  flex: 1 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

/* Wide enough that tables and charts use a large monitor; text keeps its own line length limits */
.app-main > :where(.row, .card, .table-responsive, .alert, form, h1, h2, h3, p, .page-shell, .container, .container-fluid) {
  max-width: 2000px;
  margin-right: auto;
}

.app-topbar {
  position: sticky;
  top: var(--env-banner-height);
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  background: var(--sidebar-bg);
  padding: .5rem 1rem;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-target);
  height: var(--tap-target);
  border: 1px solid var(--sidebar-line);
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
  font-size: 1.35rem;
}

.sidebar-toggle:hover {
  background: var(--sidebar-hover);
}

.app-sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
}

/* Below the desktop width the sidebar is a drawer, opened from the top bar (ui.js).
   Without script it stays in the page above the content, so the links are still there. */
@media (max-width: 991.98px) {
  .js .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    width: min(288px, 86vw);
    box-shadow: 0 0 40px rgba(0, 0, 0, .35);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .25s ease-in-out, visibility 0s linear .25s;
  }

  .js .app-sidebar.is-open {
    transform: none;
    visibility: visible;
    transition: transform .25s ease-in-out;
  }

  .js .sidebar-scroll {
    overscroll-behavior: contain;
  }
}

@media (max-width: 991.98px) and (prefers-reduced-motion: reduce) {
  .js .app-sidebar,
  .js .app-sidebar.is-open {
    transition: none;
  }
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(19, 26, 43, .55);
}

/* Behind an open drawer the page doesn't scroll */
.has-open-drawer {
  overflow: hidden;
}

.sidebar-inner {
  display: flex;
  height: 100%;
  flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.15rem 1.1rem 1rem;
}

.sidebar-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: .25rem .75rem 1rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-decoration: none;
}

.app-brand img {
  border-radius: 7px;
  background: #fff;
}

.app-brand small {
  display: block;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: 0;
}

.app-brand:hover,
.app-brand:focus {
  color: var(--ink);
}

.app-brand.is-dark,
.app-brand.is-dark:hover,
.app-brand.is-dark:focus {
  color: #fff;
}

.app-brand.is-dark small {
  color: #8d96aa;
}

.app-brand.is-dark img {
  padding: 3px;
}

.sidebar-close {
  color: #fff;
}

.sidebar-close:hover {
  background: var(--sidebar-hover);
}

.sidebar-org {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .25rem .5rem;
  margin: 0 .1rem 1.1rem;
  border: 1px solid var(--sidebar-line);
  border-radius: var(--radius);
  background: var(--sidebar-hover);
  color: #fff;
  padding: .6rem .7rem;
  text-decoration: none;
}

.sidebar-org:hover,
.sidebar-org:focus {
  border-color: #3a4560;
  background: var(--sidebar-active);
  color: #fff;
}

.sidebar-org-label {
  grid-column: 1;
  color: #8d96aa;
  font-size: .74rem;
  font-weight: 500;
  line-height: 1;
}

.sidebar-org-name {
  grid-column: 1;
  overflow: hidden;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-org i {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #8d96aa;
}

.sidebar-group-label {
  margin: 1.1rem .65rem .35rem;
  color: #7c869b;
  font-size: .76rem;
  font-weight: 600;
}

/* Administration folds open from its label */
.sidebar-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius);
  list-style: none;
  padding: .35rem 0;
}

.sidebar-group > summary::-webkit-details-marker {
  display: none;
}

.sidebar-group > summary::after {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E");
  content: "";
  width: .75rem;
  height: .75rem;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.sidebar-group[open] > summary::after {
  transform: rotate(180deg);
}

.sidebar-group > summary:hover {
  color: #fff;
}

.sidebar-subgroup-label {
  margin: .6rem .65rem .25rem;
  color: #7c869b;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  border-radius: var(--radius);
  color: var(--sidebar-ink);
  font-size: .925rem;
  font-weight: 500;
  padding: .5rem .65rem;
  text-decoration: none;
}

.sidebar-link i {
  width: 1.1rem;
  color: #8d96aa;
  font-size: 1.02rem;
  text-align: center;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-link:hover i {
  color: #fff;
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.sidebar-link.active::before {
  content: "";
  position: absolute;
  top: .45rem;
  bottom: .45rem;
  left: -.75rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--signal-on-dark);
}

.sidebar-link.active i {
  color: var(--signal-on-dark);
}

.sidebar-foot {
  border-top: 1px solid var(--sidebar-line);
  padding: .75rem;
}

.sidebar-user {
  display: flex;
  width: 100%;
  align-items: center;
  gap: .65rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
  padding: .45rem .5rem;
  text-align: left;
}

.sidebar-user:hover,
.sidebar-user:focus-visible,
.sidebar-user[aria-expanded="true"] {
  background: var(--sidebar-hover);
}

.sidebar-user .user-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: .9rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user i {
  color: #8d96aa;
}

.user-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--signal);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
}

/* The account menu opens upwards from the foot of the sidebar */
.sidebar-foot {
  position: relative;
}

.sidebar-foot .menu {
  right: .75rem;
  bottom: calc(100% - .25rem);
  left: .75rem;
}

@media (min-width: 992px) {
  .app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .app-sidebar {
    position: sticky;
    top: var(--env-banner-height);
    height: calc(100vh - var(--env-banner-height));
  }

  .app-main {
    padding: 2rem 2.25rem 3rem;
  }
}


/* --------------------------------------------------------------------------
   Page header
   -------------------------------------------------------------------------- */

.page-shell {
  width: 100%;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.page-header > div:first-child {
  min-width: 0;
  max-width: 820px;
}

.page-eyebrow {
  margin-bottom: .3rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
}

/* Where a page sits under Domains, in place of a back button */
.page-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}

.page-breadcrumb a {
  color: var(--signal);
  text-decoration: none;
}

.page-breadcrumb a:hover {
  text-decoration: underline;
}

.page-breadcrumb .icon {
  font-size: .7rem;
}

.page-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.12;
}

.page-subtitle {
  max-width: 68ch;
  margin: .45rem 0 0;
  color: var(--muted);
  font-size: .975rem;
}

.page-subtitle + .page-subtitle {
  margin-top: .2rem;
  color: var(--ink-3);
  font-weight: 500;
}

