:root {
  --content-section-gap: 20px;
}

.sidebar {
  overflow: hidden;
}

.sidebar .brand,
.sidebar-footer {
  flex: 0 0 auto;
}

.sidebar nav {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 5px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(137, 170, 167, 0.55) transparent;
  scrollbar-width: thin;
}

.sidebar nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(137, 170, 167, 0.45);
}

.sidebar nav::-webkit-scrollbar-thumb:hover {
  background: rgba(137, 170, 167, 0.72);
}

/* The menu button hides or shows the sidebar on wide screens too; the choice is remembered per device. */
.menu-button {
  display: block;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 8px;
}

@media screen and (min-width: 761px) {
  .app-shell {
    transition: grid-template-columns 0.2s ease;
  }

  .sidebar {
    transition: transform 0.2s ease, visibility 0.2s;
  }

  html[data-sidebar="collapsed"] .app-shell {
    grid-template-columns: 0 1fr;
  }

  html[data-sidebar="collapsed"] .sidebar {
    visibility: hidden;
    transform: translateX(-100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell,
  .sidebar {
    transition: none;
  }
}

.page-navigation {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  margin-bottom: 18px;
  color: var(--muted);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(204, 218, 218, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(24, 56, 64, 0.05);
  cursor: pointer;
  font-weight: 700;
}

.back-button:hover {
  border-color: #9db7b6;
  color: var(--primary);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  font-weight: 650;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 7px;
  color: #9aacb2;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs [aria-current="page"] span {
  max-width: min(42vw, 420px);
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-flow {
  display: flex;
  flex-direction: column;
  gap: var(--content-section-gap);
  min-width: 0;
}

.content-flow > .page-header,
.content-flow > .metric-grid,
.content-flow > .dashboard-grid,
.content-flow > .subnav,
.content-flow > .toolbar,
.content-flow > .card,
.content-flow > .workflow-bar,
.content-flow > .board-controls,
.content-flow > .queue-metrics {
  margin-top: 0;
  margin-bottom: 0;
}

.dashboard-grid,
.metric-grid {
  gap: var(--content-section-gap);
}

@media (max-width: 760px) {
  :root {
    --content-section-gap: 16px;
  }

  .page-navigation {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }

  .back-button span {
    display: none;
  }

  .back-button {
    flex: 0 0 34px;
    width: 34px;
    padding: 6px;
  }

  .breadcrumbs {
    min-height: 34px;
  }
}

@media print {
  .page-navigation {
    display: none !important;
  }
}

/* Sign-in page: link back to the public website. */
.login-website {
  display: block;
  width: fit-content;
  margin-bottom: 28px;
  color: inherit;
  font-weight: 600;
  opacity: 0.78;
}

.login-website:hover {
  color: inherit;
  opacity: 1;
}
