/*
 * Sidebar and topbar are fixed; only the content column scrolls. That keeps the
 * kanban board's own horizontal scroll from fighting the page.
 */
.app_shell {
  display: grid;
  min-height: 100vh;
  grid-template:
    "sidebar topbar" var(--topbar-height)
    "sidebar content" minmax(0, 1fr)
    / var(--sidebar-width) minmax(0, 1fr);
}

.app_shell__sidebar {
  position: sticky;
  top: 0;
  overflow-y: auto;
  height: 100vh;
  border-right: var(--border-width) solid var(--color-border);
  background-color: var(--color-surface);
  grid-area: sidebar;
}

.app_shell__topbar {
  position: sticky;
  z-index: var(--z-sticky);
  top: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-6);
  border-bottom: var(--border-width) solid var(--color-border);
  background-color: var(--color-surface);
  grid-area: topbar;
}

.app_shell__content {
  min-width: 0;
  padding: var(--space-6);
  grid-area: content;
}

/* Full-bleed for the kanban board, which manages its own padding. */
.app_shell__content--flush {
  padding: 0;
}

@media (width <= 60rem) {
  .app_shell {
    grid-template:
      "topbar" var(--topbar-height)
      "content" minmax(0, 1fr)
      / minmax(0, 1fr);
  }

  .app_shell__sidebar {
    display: none;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--topbar-height);
  padding: 0 var(--space-4);
  border-bottom: var(--border-width) solid var(--color-border-subtle);
  color: var(--color-text);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
}

.brand__mark {
  display: inline-flex;
  flex-shrink: 0;
}

.brand__logo {
  width: var(--space-6);
  height: var(--space-6);
}

.brand__logo--dark,
:root[data-theme="dark"] .brand__logo--light {
  display: none;
}

:root[data-theme="dark"] .brand__logo--dark {
  display: block;
}

.nav_group {
  padding: var(--space-4) var(--space-2) 0;
}

.nav_group__label {
  padding: 0 var(--space-2) var(--space-2);
  color: var(--color-text-subtle);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.nav_item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.nav_item:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-text);
}

.nav_item--active {
  background-color: var(--color-primary-subtle);
  color: var(--color-primary-text);
}

.nav_item__icon {
  width: 1.125rem;
  flex-shrink: 0;
  font-size: var(--text-md);
  text-align: center;
}

/* Unread/queue counts. Pushed right, and muted until there's something in it. */
.nav_item__count {
  margin-left: auto;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  background-color: var(--color-surface-sunken);
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.nav_item__count--attention {
  background-color: var(--color-danger);
  color: var(--color-text-inverse);
}

/* A per-client color chip, so the sidebar client list is scannable. */
.client_dot {
  width: var(--dot-size);
  height: var(--dot-size);
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background-color: var(--color-text-subtle);
}

.page_header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.page_header__title {
  font-size: var(--text-2xl);
}

.page_header__subtitle {
  margin-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-base);
}
