/* Left sidebar navigation. Loaded after styles.css; replaces the old top bar (.topbar rules there are now unused). */
/* Sidebar layout: the nav sits in a left column, whatever holds it becomes a two-column grid. */
.route:has(> .sidebar), .route > div:has(> .sidebar) {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; min-height: 100vh;
}
.route:has(> .sidebar) > :not(.sidebar), .route > div:has(> .sidebar) > :not(.sidebar) { grid-column: 2; min-width: 0; }
.route:has(> div > .sidebar) > .legal-foot { margin-left: 232px; }
.sidebar {
  grid-column: 1; grid-row: 1 / span 40;
  position: sticky; top: 0; z-index: 10; height: 100vh;
  display: flex; flex-direction: column; gap: 28px; padding: 22px 14px 16px;
  background: var(--surface); border-right: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 10px; }
.brand-logo { display: block; height: 20px; width: auto; }
.login-header .brand-logo { height: 22px; }
.brand-name { font: 700 15px/1 var(--head); }
.brand-sep { width: 1px; height: 16px; background: var(--line); }
.brand-product { font: 500 15px/1 var(--head); color: var(--muted); }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 600; color: var(--muted);
  border-left: 2px solid transparent;
}
.sidenav a:hover { color: var(--ink); background: var(--surface-2); }
.sidenav a.on { color: var(--ink); background: var(--surface-2); border-left-color: var(--ochre); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 10px; }
.side-actions { display: flex; align-items: center; gap: 6px; margin-left: -8px; }
.user-email { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 899px) {
  .route:has(> .sidebar), .route > div:has(> .sidebar) { display: block; min-height: 0; }
  .route:has(> div > .sidebar) > .legal-foot { margin-left: 0; }
  .sidebar {
    position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap;
    gap: 6px 14px; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line-soft);
  }
  .brand { padding: 0; }
  .sidenav { flex-direction: row; gap: 4px; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .sidenav::-webkit-scrollbar { display: none; }
  .sidenav a { white-space: nowrap; padding: 6px 10px; border-left: 0; border-bottom: 2px solid transparent; border-radius: var(--radius-sm); }
  .sidenav a.on { border-bottom-color: var(--ochre); }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding: 0; }
  .side-actions { margin-left: 0; }
  .side-foot .eyebrow, .user-email { display: none; }
}
