﻿/* App shell: one operational shell for all authenticated pages. */
.layout.app-shell {
  --app-sidebar-width: clamp(220px, 18vw, 280px);
  --app-page-window-width: 100%;
  --app-page-window-max-width: none;
  --app-page-window-margin-inline: 0;
  --gap-sm: 6px;
  --gap-md: 10px;
  --gap-lg: 12px;
  --control-height: 40px;
  display: grid;
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  transition: grid-template-columns 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.layout.app-shell.sidebar-pinned {
  grid-template-columns: 280px minmax(0, 1fr);
}

.layout.app-shell.app-shell-no-sidebar,
.layout.app-shell.work-position-mode {
  grid-template-columns: minmax(0, 1fr);
}

.shell-main {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

.layout.app-shell:not(.app-shell-no-sidebar):not(.work-position-mode) .shell-main {
  grid-column: 2;
}

.layout.app-shell.app-shell-no-sidebar .shell-main,
.layout.app-shell.work-position-mode .shell-main {
  grid-column: 1 / -1;
}

.layout.app-shell .content {
  width: var(--app-page-window-width);
  max-width: var(--app-page-window-max-width);
  margin-inline: var(--app-page-window-margin-inline);
  min-width: 0;
}

.layout.app-shell.work-position-mode .content {
  max-width: var(--app-page-window-max-width);
}

.layout.app-shell .content > * {
  min-width: 0;
}

.route-loading-panel {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: clamp(180px, 34vh, 300px);
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  text-align: center;
}

.route-loading-panel small {
  color: var(--muted);
}

.route-loading-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: route-loading-spin 0.8s linear infinite;
}

.layout.app-shell.is-route-transitioning .route-view {
  pointer-events: none;
}

@keyframes route-loading-spin {
  to { transform: rotate(360deg); }
}

.page-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: clamp(8px, 1vw, 12px) clamp(8px, 1.4vw, 12px);
}

.page-layout.has-overview {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.page-layout__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  min-height: 74px;
  min-width: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.page-layout__heading {
  min-width: 0;
}

.page-layout__section {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 840;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
}

.page-layout__header h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(20px, 1.5vw, 25px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.08;
}

.page-layout__header p {
  max-width: 760px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.34;
}

.page-layout__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.page-layout__actions.is-empty {
  display: none;
}

.page-layout__content {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.page-layout__overview {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.page-layout-state {
  width: 100%;
}

.layout.app-shell.work-position-mode .sidebar,
.layout.app-shell.work-position-mode .sidebar-backdrop {
  display: none !important;
}

.topbar.topbar-no-sidebar .topbar-menu-button {
  display: none !important;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  align-self: start;
  z-index: 18;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 64px;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 96%, var(--bg));
  box-shadow: none;
  overflow: hidden;
  overscroll-behavior: contain;
  transition:
    width 260ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 260ms ease;
}

.layout.app-shell.sidebar-pinned .sidebar,
.layout.app-shell.sidebar-floating.sidebar-hovered .sidebar,
.layout.app-shell.sidebar-floating .sidebar:hover,
.layout.app-shell.sidebar-floating .sidebar:focus-within {
  width: 280px;
}

.layout.app-shell.sidebar-floating.sidebar-hovered .sidebar,
.layout.app-shell.sidebar-floating .sidebar:hover,
.layout.app-shell.sidebar-floating .sidebar:focus-within {
  box-shadow: 18px 0 38px rgb(0 0 0 / 0.24);
}

@media (min-width: 961px) {
  .layout.app-shell.sidebar-floating.sidebar-hovered .sidebar,
  .layout.app-shell.sidebar-floating .sidebar:hover,
  .layout.app-shell.sidebar-floating .sidebar:focus-within {
    align-self: stretch;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    border-bottom: 0;
    border-radius: 0;
  }

  .layout.app-shell.sidebar-floating.sidebar-hovered .side-nav,
  .layout.app-shell.sidebar-floating .sidebar:hover .side-nav,
  .layout.app-shell.sidebar-floating .sidebar:focus-within .side-nav {
    max-height: calc(100dvh - 78px);
  }
}

.sidebar-brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--gap-sm);
  align-items: start;
  margin: 0;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar-brand .brand {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
}

.sidebar-brand .meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sidebar-pin {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0;
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .sidebar-brand {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 12px 8px;
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .sidebar-brand-main,
.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-label,
.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-title::after,
.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-list {
  display: none;
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav {
  padding: 10px 7px;
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-button,
.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-title {
  justify-content: center;
  min-height: 48px;
  padding: 0;
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-section {
  border-color: transparent;
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-section.is-active {
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-section.has-badge {
  overflow: visible;
  border-color: transparent;
  background: transparent;
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-section.has-badge > .side-nav-title {
  position: relative;
  width: 44px;
  min-height: 44px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-section.is-active.has-badge > .side-nav-title {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-section.is-active.has-badge > .side-nav-title .side-nav-icon {
  color: var(--accent);
}

.layout.sidebar-floating:not(.sidebar-hovered) .sidebar:not(:hover):not(:focus-within) .side-nav-title .nav-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0 5px;
  border: 2px solid var(--panel);
  font-size: 10px;
  line-height: 1;
  transform: translate(34%, -20%);
  z-index: 1;
}

.side-nav-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.side-nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav-button.active .side-nav-icon,
.side-nav-section.is-active > .side-nav-title .side-nav-icon {
  color: var(--accent);
}

.sidebar-close {
  display: none;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 42%, transparent) transparent;
}

.side-nav-section {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
}

.side-nav-section + .side-nav-section {
  border-top: 1px solid var(--line);
}

.side-nav-section.is-active {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
}

.side-nav-section.has-badge {
  border-color: var(--line);
  background: transparent;
}

.side-nav-section.has-badge > .side-nav-title {
  background: transparent;
  box-shadow: none;
}

.side-nav-section.is-active.has-badge {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
}

.side-nav-section.is-active.has-badge > .side-nav-title {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-nav-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 11px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  list-style: none;
  text-transform: none;
}

.side-nav-title::-webkit-details-marker,
.topbar-menu summary::-webkit-details-marker,
.side-nav-details summary::-webkit-details-marker {
  display: none;
}

.side-nav-title::after {
  content: "›";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  transform: none;
}

.side-nav-section[open] > .side-nav-title::after {
  color: var(--accent);
  transform: rotate(90deg);
}

.side-nav-list {
  display: grid;
  gap: 3px;
  padding: 0 6px 6px;
}

.side-nav-button,
.side-nav-details summary,
.side-nav-details button,
.side-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  padding: 9px 11px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
}

.side-nav-home {
  border: 1px solid var(--line);
}

.side-nav-button:hover,
.side-nav-title:hover,
.side-nav-details summary:hover,
.side-nav-details button:hover,
.side-file-button:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--text);
}

.side-nav-button.active,
.side-nav-details[open] > summary {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  background: color-mix(in srgb, var(--accent) 15%, var(--panel));
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-nav-button .nav-badge {
  flex: 0 0 auto;
  margin-left: auto;
}

.side-nav-title .nav-badge {
  flex: 0 0 auto;
  margin-left: auto;
}

.sidebar-backdrop {
  display: none;
}

.side-nav-details {
  display: grid;
  gap: 3px;
}

.side-nav-details summary {
  cursor: pointer;
  list-style: none;
}

.side-nav-details button,
.side-file-button {
  padding-left: 18px;
  color: var(--muted);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 16;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--gap-md);
  min-width: 0;
  min-height: 68px;
  padding: 11px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 88%, var(--accent));
  background: color-mix(in srgb, var(--panel) 92%, var(--bg));
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.14);
  backdrop-filter: none;
}

.topbar-menu-button {
  display: none;
}

.topbar-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.topbar-title .brand {
  overflow: hidden;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title .meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .topbar-actions {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: auto;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.topbar-menu {
  position: relative;
  min-width: 0;
}

.topbar-menu summary {
  list-style: none;
}

.topbar-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--soft-panel) 72%, var(--panel));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
  padding: 8px 11px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.topbar-icon-button:hover,
.topbar-icon-button:focus-visible,
.topbar-menu[open] > .topbar-icon-button {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.05),
    0 8px 18px rgb(0 0 0 / 0.16);
}

.topbar-icon-button:active {
  transform: translateY(1px);
}

.topbar-icon-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 68%, transparent);
  outline-offset: 2px;
}

.topbar-action-icon,
.topbar-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.topbar-notification-icon {
  background: color-mix(in srgb, var(--red) 14%, var(--panel));
  color: color-mix(in srgb, var(--red) 58%, var(--text));
}

.topbar-avatar {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 20%, var(--panel));
  color: var(--text);
  font-size: 13px;
}

.topbar-action-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-action-caret {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  transition:
    transform 160ms ease,
    color 160ms ease,
    background-color 160ms ease;
}

.topbar-menu[open] > .topbar-icon-button .topbar-action-caret {
  transform: rotate(180deg);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.topbar-profile-button {
  justify-content: flex-start;
  max-width: 220px;
}

.topbar-profile-button .topbar-action-label {
  max-width: 126px;
}

.topbar .notify-button {
  position: relative;
}

.topbar .notify-button.has-unread {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 11%, var(--panel));
}

.topbar .notify-button .nav-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 2;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 2px 6px;
  border: 2px solid color-mix(in srgb, var(--panel) 94%, var(--bg));
  font-size: 10px;
  line-height: 1;
}

.topbar-menu[open] > .topbar-dropdown {
  z-index: 34;
}

.topbar-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 34;
  display: grid;
  gap: 10px;
  box-sizing: border-box;
  width: min(420px, calc(100vw - 24px));
  max-height: min(560px, calc(100dvh - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 96%, var(--bg));
  color: var(--text);
  box-shadow: 0 18px 42px rgb(0 0 0 / 0.28);
  overflow: auto;
  overscroll-behavior: contain;
}

details:not([open]) > .topbar-dropdown {
  display: none !important;
}

.profile-dropdown {
  width: min(300px, calc(100vw - 24px));
}

.topbar-dropdown-head {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--line);
}

.topbar-dropdown-head strong,
.topbar-dropdown-head span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-dropdown-head strong {
  font-size: 15px;
  line-height: 1.2;
}

.topbar-dropdown-head span {
  color: var(--muted);
  font-size: 13px;
}

.notification-dropdown {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
}

.notification-dropdown .topbar-dropdown-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 8px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--soft-panel) 68%, transparent);
}

.notification-dropdown .topbar-dropdown-head strong {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
}

.notification-dropdown .topbar-dropdown-head span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 132px;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: color-mix(in srgb, var(--accent) 64%, var(--text));
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
}

.topbar-notification-tabs,
.topbar-dropdown-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
}

.notification-dropdown .topbar-notification-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 38%, var(--panel));
}

.topbar-notification-tabs button,
.topbar-dropdown-actions button,
.profile-dropdown button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: color-mix(in srgb, var(--soft-panel) 82%, transparent);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.notification-dropdown .topbar-notification-tabs button {
  min-height: 40px;
  padding: 7px 8px;
  border-radius: 7px;
  font-weight: 900;
}

.notification-dropdown .topbar-notification-tabs button.is-active {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}

.topbar-notification-tabs button:hover,
.topbar-dropdown-actions button:hover,
.profile-dropdown button:hover,
.topbar-notification-tabs button:focus-visible,
.topbar-dropdown-actions button:focus-visible,
.profile-dropdown button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
}

.profile-dropdown button.danger {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
  background: color-mix(in srgb, var(--red) 14%, var(--panel));
  color: color-mix(in srgb, var(--red) 30%, var(--text));
}

.topbar-notification-list {
  display: grid;
  grid-auto-rows: max-content;
  gap: 8px;
  align-content: start;
  min-width: 0;
  min-height: 0;
  max-height: min(360px, max(120px, calc(100dvh - 260px)));
  padding-right: 1px;
  overflow: auto;
  overscroll-behavior: contain;
}

.topbar-notification-item {
  --notification-dropdown-tone: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0 10px;
  align-content: start;
  align-items: start;
  min-width: 0;
  width: 100%;
  min-height: 66px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-left: 0;
  border-radius: var(--radius);
  padding: 10px 11px 10px 9px;
  background: color-mix(in srgb, var(--soft-panel) 70%, transparent);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.topbar-notification-item::before {
  display: block;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: stretch;
  width: 3px;
  height: auto;
  min-height: 0;
  border-radius: 999px;
  background: var(--notification-dropdown-tone);
  content: "";
}

.topbar-notification-item.notification-severity-critical,
.topbar-notification-item.notification-severity-danger {
  --notification-dropdown-tone: var(--red);
  background: color-mix(in srgb, var(--red) 7%, var(--soft-panel));
}

.topbar-notification-item.notification-severity-warning {
  --notification-dropdown-tone: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 8%, var(--soft-panel));
}

.topbar-notification-item:hover,
.topbar-notification-item:focus-visible {
  border-color: color-mix(in srgb, var(--notification-dropdown-tone) 38%, var(--line));
  background: color-mix(in srgb, var(--notification-dropdown-tone) 9%, var(--panel));
}

.topbar-notification-title {
  display: grid;
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.topbar-notification-title,
.topbar-notification-message {
  grid-column: 2;
}

.topbar-notification-title strong,
.topbar-notification-message {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-notification-title strong {
  max-width: 100%;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
  white-space: nowrap;
}

.topbar-notification-title small {
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.notification-dropdown .topbar-dropdown-actions button {
  min-height: 44px;
  border-color: color-mix(in srgb, var(--line) 86%, transparent);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  font-weight: 900;
}

.notification-detail-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, var(--soft-panel));
}

.notification-detail-section > header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.notification-detail-section h3 {
  margin: 0;
  font-size: 0.92rem;
}

.notification-detail-message {
  padding: 14px 12px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notification-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.notification-detail-grid .table-detail-field {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft-panel);
}

@media (max-width: 640px) {
  .notification-detail-grid {
    grid-template-columns: 1fr;
  }
}

.topbar-notification-message {
  display: -webkit-box;
  grid-row: 2;
  margin-top: 3px;
  color: color-mix(in srgb, var(--muted) 84%, var(--text));
  font-size: 12px;
  font-weight: 650;
  line-height: 1.32;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.topbar-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.content.content--wide {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin-right: 0;
  margin-left: 0;
}

.content.content--wide .table {
  width: 100%;
}

@media (max-width: 960px) {
  .page-layout {
    padding: 12px;
  }

  .page-layout__header {
    min-height: auto;
    align-items: start;
  }

  .page-layout__header h1 {
    font-size: clamp(20px, 6vw, 24px);
  }
}

@media (max-width: 720px) {
  .page-layout__header {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .page-layout__actions {
    justify-content: stretch;
  }

  .page-layout__actions > * {
    flex: 1 1 auto;
  }
}

.layout.app-shell > .app-sidebar.sidebar {
  grid-column: 1;
  position: sticky;
  inset: auto;
  top: 0;
  z-index: 18;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: var(--app-sidebar-width);
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 96%, var(--bg));
  color: var(--text);
  overflow: hidden;
  box-shadow: none;
}

.layout.app-shell > .main-content.shell-main {
  grid-column: 2;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.layout.app-shell .page-container.content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.app-sidebar-brand {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--line);
}

.app-sidebar-brand strong {
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-brand span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 12px 10px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 42%, transparent) transparent;
}

.app-sidebar-link {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.app-sidebar-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-link:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--text);
}

.app-sidebar-link.is-active {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 15%, var(--panel));
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}

@media (max-width: 860px) {
  .layout.app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .layout.app-shell > .app-sidebar.sidebar {
    position: sticky;
    grid-column: 1;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .layout.app-shell > .main-content.shell-main {
    grid-column: 1;
  }

  .app-sidebar-brand {
    padding: 12px 14px 8px;
  }

  .app-sidebar-nav {
    display: flex;
    gap: 6px;
    padding: 8px 10px 10px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .app-sidebar-link {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 10px;
  }

  .layout.app-shell .page-container.content {
    padding: 0;
  }
}

/* Restored sidebar polish from the collected shell, scoped to the current app shell. */
.layout.app-shell {
  --sidebar-bg-polish: var(--bg);
  --sidebar-brand-bg-polish: color-mix(in srgb, var(--panel) 82%, var(--bg));
  --sidebar-surface-polish: var(--soft-panel);
  --sidebar-active-polish: color-mix(in srgb, var(--accent) 17%, var(--panel));
  --sidebar-line-polish: var(--line);
  --sidebar-line-strong-polish: color-mix(in srgb, var(--accent) 62%, var(--line));
  --sidebar-text-polish: var(--text);
  --sidebar-muted-polish: var(--muted);
  --sidebar-accent-polish: var(--accent);
  --sidebar-danger-polish: var(--red);
}

.layout.app-shell > .app-sidebar.sidebar {
  border-right-color: var(--sidebar-line-polish);
  background: var(--sidebar-bg-polish);
}

.layout.app-shell.sidebar-pinned {
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
}

.layout.app-shell.sidebar-pinned > .app-sidebar.sidebar {
  width: var(--app-sidebar-width);
}

.layout.app-shell .app-sidebar-brand.sidebar-brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px;
  padding: 16px;
  border-bottom-color: var(--sidebar-line-polish);
  background: var(--sidebar-brand-bg-polish);
}

.layout.app-shell .sidebar-brand .brand {
  color: var(--sidebar-text-polish);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
}

.layout.app-shell .sidebar-brand .meta {
  color: var(--sidebar-muted-polish);
  font-size: 13px;
  font-weight: 750;
}

.layout.app-shell .sidebar-pin {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border: 1px solid var(--sidebar-line-polish);
  border-radius: var(--radius);
  padding: 0;
  background: color-mix(in srgb, var(--sidebar-surface-polish) 78%, transparent);
  color: var(--sidebar-text-polish);
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.layout.app-shell .sidebar-pin:hover,
.layout.app-shell .sidebar-pin:focus-visible {
  border-color: color-mix(in srgb, var(--sidebar-accent-polish) 46%, var(--sidebar-line-polish));
  background: color-mix(in srgb, var(--sidebar-accent-polish) 11%, var(--sidebar-bg-polish));
  color: var(--sidebar-accent-polish);
}

.layout.app-shell .app-sidebar-nav.side-nav {
  grid-auto-rows: max-content;
  align-content: start;
  gap: 6px;
  padding: 14px 10px 18px;
  scrollbar-color: color-mix(in srgb, var(--sidebar-muted-polish) 36%, transparent) transparent;
}

.layout.app-shell .app-sidebar-link.side-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--sidebar-text-polish);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.15;
}

.layout.app-shell .app-sidebar-link.side-nav-button:not(.active):not(.side-nav-home) {
  border-color: transparent;
  background: transparent;
}

.layout.app-shell .app-sidebar-section.side-nav-section {
  display: grid;
  grid-template-rows: auto;
  box-sizing: border-box;
  min-width: 0;
  border-color: var(--sidebar-line-polish);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--sidebar-bg-polish) 84%, transparent);
  overflow: hidden;
}

.layout.app-shell .app-sidebar-section.side-nav-section.is-active {
  border-color: color-mix(in srgb, var(--sidebar-accent-polish) 42%, var(--sidebar-line-polish));
  background: color-mix(in srgb, var(--sidebar-accent-polish) 5%, var(--sidebar-bg-polish));
}

.layout.app-shell .app-sidebar-section > .side-nav-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--gap-sm);
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--sidebar-text-polish);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.15;
}

.layout.app-shell .app-sidebar-section > .side-nav-title:hover {
  border-color: color-mix(in srgb, var(--sidebar-accent-polish) 42%, var(--sidebar-line-polish));
  background: color-mix(in srgb, var(--sidebar-accent-polish) 8%, var(--sidebar-bg-polish));
  color: var(--sidebar-text-polish);
}

.layout.app-shell .app-sidebar-section.is-active > .side-nav-title {
  background: color-mix(in srgb, var(--sidebar-accent-polish) 8%, transparent);
  box-shadow: inset 3px 0 0 var(--sidebar-accent-polish);
}

.layout.app-shell .app-sidebar-section > .side-nav-title::after {
  flex: 0 0 24px;
  margin-left: auto;
  width: 24px;
  height: 24px;
  background: color-mix(in srgb, var(--sidebar-muted-polish) 13%, transparent);
  color: var(--sidebar-muted-polish);
  transition:
    color 180ms ease,
    transform 180ms ease,
    background-color 180ms ease;
}

.layout.app-shell .app-sidebar-section[open] > .side-nav-title::after {
  color: var(--sidebar-accent-polish);
}

.layout.app-shell .app-sidebar-section .side-nav-list {
  gap: 4px;
  padding: 0 6px 7px;
}

.layout.app-shell .app-sidebar-link.side-nav-child {
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  color: color-mix(in srgb, var(--sidebar-text-polish) 88%, var(--sidebar-muted-polish));
  font-size: 15px;
  font-weight: 800;
}

.layout.app-shell .app-sidebar-link.side-nav-home {
  border-color: var(--sidebar-line-polish);
}

.layout.app-shell .app-sidebar-link.side-nav-button:hover {
  border-color: color-mix(in srgb, var(--sidebar-accent-polish) 42%, var(--sidebar-line-polish));
  background: color-mix(in srgb, var(--sidebar-accent-polish) 8%, var(--sidebar-bg-polish));
  color: var(--sidebar-text-polish);
}

.layout.app-shell .app-sidebar-link.side-nav-button:focus-visible,
.layout.app-shell .app-sidebar-section > .side-nav-title:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sidebar-accent-polish) 70%, transparent);
  outline-offset: 2px;
}

.layout.app-shell .app-sidebar-link.side-nav-button.active,
.layout.app-shell .app-sidebar-link.side-nav-button.is-active {
  border-color: color-mix(in srgb, var(--sidebar-accent-polish) 74%, var(--sidebar-line-polish));
  background: var(--sidebar-active-polish);
  color: var(--sidebar-text-polish);
  box-shadow: inset 3px 0 0 var(--sidebar-accent-polish);
}

.layout.app-shell .side-nav-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: var(--radius);
  color: var(--sidebar-text-polish);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.layout.app-shell .app-sidebar-link.side-nav-button.active .side-nav-icon,
.layout.app-shell .app-sidebar-link.side-nav-button.is-active .side-nav-icon {
  color: var(--sidebar-accent-polish);
}

.layout.app-shell .side-nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1025px) {
  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) {
    width: 64px;
  }

  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) .app-sidebar-brand.sidebar-brand {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 12px 8px;
  }

  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) .sidebar-brand-main,
  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) .side-nav-label,
  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) .side-nav-title::after,
  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) .side-nav-list {
    display: none;
  }

  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) .app-sidebar-nav.side-nav {
    padding: 10px 7px;
  }

  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) .app-sidebar-link.side-nav-button,
  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) .app-sidebar-section > .side-nav-title {
    justify-content: center;
    min-height: 48px;
    padding: 0;
  }

  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) .app-sidebar-section.side-nav-section {
    border-color: transparent;
    background: transparent;
  }

  .layout.app-shell.sidebar-floating:not(.sidebar-hovered) > .app-sidebar.sidebar:not(:hover):not(:focus-within) .app-sidebar-section.side-nav-section.is-active {
    border-color: color-mix(in srgb, var(--sidebar-accent-polish) 28%, transparent);
  }
}

@media (max-width: 860px) {
  .layout.app-shell,
  .layout.app-shell.sidebar-pinned,
  .layout.app-shell.sidebar-floating {
    grid-template-columns: minmax(0, 1fr);
  }

  .layout.app-shell.sidebar-pinned > .app-sidebar.sidebar,
  .layout.app-shell.sidebar-floating > .app-sidebar.sidebar,
  .layout.app-shell > .app-sidebar.sidebar {
    position: sticky;
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-line-polish);
  }

  .layout.app-shell.sidebar-pinned > .main-content.shell-main,
  .layout.app-shell.sidebar-floating > .main-content.shell-main,
  .layout.app-shell > .main-content.shell-main {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .layout.app-shell .topbar.topbar-unified {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    z-index: 40;
    min-height: 0;
    padding: 10px 12px;
    box-shadow: 0 8px 18px rgb(0 0 0 / 0.16);
  }

  .layout.app-shell .topbar .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .layout.app-shell .topbar .topbar-menu,
  .layout.app-shell .topbar .topbar-menu > summary {
    width: 100%;
    min-width: 0;
  }

  .layout.app-shell .topbar .topbar-icon-button {
    min-height: 44px;
    padding: 8px 10px;
  }

  .layout.app-shell .topbar .topbar-profile-button {
    max-width: none;
  }

  .layout.app-shell .topbar .topbar-profile-button .topbar-action-label {
    max-width: 100%;
  }

  .layout.app-shell .topbar :where(.topbar-action-label, .topbar-icon-button > span, .topbar-profile-menu > summary > span) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .layout.app-shell .topbar :where(.topbar-action-icon, .topbar-avatar) {
    min-width: 24px;
    width: 24px;
    height: 24px;
    min-height: 24px;
    overflow: visible;
  }

  .layout.app-shell .topbar .topbar-action-caret {
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
  }

  .layout.app-shell .topbar .topbar-menu[open] > .topbar-dropdown {
    position: fixed;
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 16px);
  }

  .layout.app-shell .app-sidebar-brand.sidebar-brand {
    padding: 12px 14px 8px;
  }

  .layout.app-shell .app-sidebar-nav.side-nav {
    display: grid;
    grid-auto-rows: max-content;
    align-content: start;
    gap: 6px;
    max-height: min(42dvh, 340px);
    padding: 8px 10px 10px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .layout.app-shell .app-sidebar-link.side-nav-button {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
  }

  .layout.app-shell .app-sidebar-section.side-nav-section {
    width: 100%;
    min-width: 0;
  }

  .layout.app-shell .app-sidebar-section > .side-nav-title {
    min-height: 40px;
    padding: 8px 10px;
  }

  .layout.app-shell .app-sidebar-link.side-nav-child {
    min-height: 38px;
  }
}


