/* Application frame: the footer spans the shell, independently of page content. */
body {
  --shell-sidebar-width: 232px;
  --shell-gutter: 32px;
}
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
  margin-left: var(--shell-sidebar-width);
  transition: margin-left 0.16s ease;
}
.app-shell > .topbar {
  flex-shrink: 0;
  padding-inline: var(--shell-gutter);
}
.app-shell > .content {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1550px;
  margin: 0 auto;
  padding: 32px var(--shell-gutter);
}
.app-shell > .content-footer,
.staff .app-shell > .content-footer {
  display: block;
  width: 100%;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  background: #fff;
  font-size: 11px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1550px;
  margin: 0 auto;
  padding: 18px var(--shell-gutter);
}
.footer-inner nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}
.staff .footer-inner {
  padding-bottom: 30px;
}
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.skip-link {
  left: calc(var(--shell-sidebar-width) + 16px);
}
.sidebar {
  width: var(--shell-sidebar-width);
  padding: 18px 14px 14px;
  transition:
    width 0.16s ease,
    transform 0.16s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px;
  margin-bottom: 22px;
  flex-shrink: 0;
}
.sidebar .brand {
  min-width: 0;
}
.sidebar .brand-logo {
  width: 144px;
  max-width: 100%;
}
.sidebar .brand-symbol {
  display: none;
}
.sidebar .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: #d6d6da;
  background: transparent;
}
.sidebar .mobile-close {
  display: none;
}
.sidebar .icon-button:hover,
.sidebar .icon-button:focus-visible {
  background: #ffffff13;
  color: #fff;
}
.sidebar nav {
  flex: 1;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sidebar .nav-link {
  gap: 11px;
  padding: 11px 12px;
  min-height: 44px;
  line-height: 1.45;
  font-size: 12px;
}
.sidebar .nav-link svg {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
}
.sidebar .nav-link.active {
  color: #fff;
  background: #ffffff12;
  box-shadow: inset 3px 0 #c78146;
}
.sidebar .nav-link.active svg {
  color: #e5b58c;
}
.sidebar .nav-link:focus-visible {
  background: #ffffff1c;
}
.sidebar-bottom {
  padding-top: 12px;
  margin-top: 16px;
  border-top: 1px solid #ffffff0e;
  flex-shrink: 0;
}
.sidebar-tooltip {
  position: fixed;
  z-index: 100;
  padding: 9px 12px;
  border-radius: 7px;
  background: #292c30;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 6px 20px #1b20221f;
  pointer-events: none;
  max-width: 240px;
}
.sidebar-tooltip[hidden] {
  display: none;
}
html:not(.js) .menu-toggle,
html:not(.js) .sidebar-mode-toggle,
html:not(.js) .mobile-close {
  display: none;
}

/* Home uses scoped, observed counts rather than a global healthy indicator. */
.home-dashboard {
  display: grid;
  gap: 24px;
}
.home-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.home-stat {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.home-stat-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.home-stat-heading svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
  flex-shrink: 0;
}
.home-stat > strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 29px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.6px;
}
.home-stat > small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.home-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.home-section-heading h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.3px;
}
.home-section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.home-section-heading > .text-link {
  font-size: 12px;
}
.home-products,
.home-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.home-product {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 12px #1c252903;
}
.home-product > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.home-product-icon,
.home-shortcut-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fbf1e6;
  color: var(--accent);
  border-radius: 11px;
  width: 44px;
  height: 44px;
}
.home-product-icon svg {
  width: 23px;
  height: 23px;
}
.home-mbsrs .home-product-icon {
  background: #f0f1f2;
  color: #42474c;
}
.home-product-title h2 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.8px;
  margin: 5px 0 8px;
}
.home-product-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 46ch;
}
.home-product-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}
.home-product-facts dt {
  font-size: 11px;
  color: var(--muted);
}
.home-product-facts dd {
  margin: 7px 0 0;
  font-size: 23px;
  line-height: 1.2;
  font-weight: 600;
}
.home-product-facts dd small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
  margin-top: 5px;
}
.home-context-note {
  color: var(--muted);
  font-size: 11px;
  margin: -5px 0 0;
}
.home-product-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: auto;
}
.home-product-actions .text-link {
  font-size: 12px;
}
.home-bottom-grid > .panel {
  min-width: 0;
  padding: 24px;
}
.home-shortcut {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.home-shortcut:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.home-shortcut > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.home-shortcut strong,
.home-activity-list strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
}
.home-shortcut small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.home-shortcut > svg {
  width: 17px;
  color: var(--muted);
  flex-shrink: 0;
}
.home-shortcut:hover strong,
.home-shortcut:focus-visible strong {
  color: var(--accent);
}
.home-shortcut-icon {
  width: 35px;
  height: 35px;
  border-radius: 9px;
  background: #f6f7f8;
  color: #727a82;
}
.home-shortcut-icon svg {
  width: 18px;
  height: 18px;
}
.home-activity-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.home-activity-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0 0 18px;
}
.home-activity-list li:last-child {
  padding-bottom: 0;
}
.home-activity-dot {
  width: 7px;
  height: 7px;
  margin: 5px 0 0 4px;
  border-radius: 50%;
  background: #cda27e;
  flex-shrink: 0;
}
.home-activity-list time {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.home-activity > .text-link {
  font-size: 12px;
}
.home-empty {
  color: var(--muted);
  padding: 25px 0;
  font-size: 12px;
}
@media (min-width: 901px) {
  body[data-sidebar-mode="normal"] .menu-toggle,
  body[data-sidebar-mode="compact"] .menu-toggle {
    display: none;
  }
  body[data-sidebar-mode="compact"] {
    --shell-sidebar-width: 76px;
  }
  body[data-sidebar-mode="compact"] .sidebar {
    padding-inline: 10px;
  }
  body[data-sidebar-mode="compact"] .sidebar-brand {
    flex-direction: column;
    gap: 10px;
    padding: 0;
  }
  body[data-sidebar-mode="compact"] .sidebar .brand-logo,
  body[data-sidebar-mode="compact"] .sidebar .nav-label,
  body[data-sidebar-mode="compact"] .sidebar .nav-count {
    display: none;
  }
  body[data-sidebar-mode="compact"] .sidebar .brand-symbol {
    display: block;
    width: 30px;
    height: 30px;
  }
  body[data-sidebar-mode="compact"] .sidebar .nav-link {
    justify-content: center;
    padding: 12px 0;
  }
  body[data-sidebar-mode="hidden"] {
    --shell-sidebar-width: 0px;
  }
  body[data-sidebar-mode="hidden"] .sidebar {
    width: 232px;
    transform: translateX(-100%);
  }
}
@media (max-width: 1150px) {
  .home-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  body {
    --shell-sidebar-width: 0px;
    --shell-gutter: 22px;
  }
  .sidebar {
    width: min(296px, calc(100vw - 32px));
  }
  .sidebar .sidebar-mode-toggle {
    display: none;
  }
  .sidebar .mobile-close {
    display: inline-flex;
    width: 40px;
    height: 40px;
  }
  html:not(.js) .sidebar {
    position: relative;
    width: 100%;
    transform: none;
    min-height: auto;
  }
}
@media (max-width: 760px) {
  .home-products,
  .home-bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 650px) {
  body {
    --shell-gutter: 16px;
  }
  .app-shell > .topbar {
    padding-inline: 12px;
  }
  .topbar .breadcrumb {
    display: none;
  }
  .org-switch select {
    width: clamp(118px, 40vw, 180px);
    max-width: 180px;
    min-width: 0;
  }
  .app-shell > .content {
    padding-top: 25px;
  }
  .home-dashboard {
    gap: 20px;
  }
  .home-metrics {
    gap: 12px;
  }
  .home-stat {
    padding: 16px;
  }
  .home-stat-heading {
    font-size: 11px;
  }
  .home-stat > strong {
    font-size: 26px;
  }
  .home-stat > small {
    font-size: 10px;
  }
  .home-product,
  .home-bottom-grid > .panel {
    padding: 21px;
  }
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
  .footer-inner nav {
    gap: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .app-shell {
    transition: none;
  }
}
