/* Sidebar
   The console app navigation: a brand header, grouped nav items with icons and
   an active state, and a user block with a sign-out action. Pair with
   .dp-shell to lay it out beside the main content. Best used under the console
   theme (data-theme="console"). Colour and type come from tokens.css. */

/* App shell: sidebar beside scrolling content */
.dp-shell {
  display: flex;
  align-items: stretch;
  min-height: 100%;
  background: var(--dp-bg);
}

.dp-shell-main {
  flex: 1;
  min-width: 0;
  padding: var(--dp-space-8);
  overflow: auto;
}

.dp-sidebar {
  display: flex;
  flex-direction: column;
  width: 16rem;
  flex: none;
  padding: var(--dp-space-4);
  background: var(--dp-surface);
  border-right: 1px solid var(--dp-border);
}

/* Header: wordmark and collapse control */
.dp-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--dp-space-2) var(--dp-space-2) var(--dp-space-5);
}

.dp-sidebar-logo {
  display: inline-flex;
  color: var(--dp-brand-purple, var(--dp-navy));
}

.dp-sidebar-logo svg {
  height: 30px;
  width: auto;
  display: block;
}

.dp-sidebar-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius-full);
  background: var(--dp-surface);
  color: var(--dp-text-muted);
  cursor: pointer;
}

.dp-sidebar-collapse:hover {
  background: var(--dp-surface-soft);
}

/* Nav */
.dp-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.dp-nav-item {
  display: flex;
  align-items: center;
  gap: var(--dp-space-3);
  min-height: 2.5rem;
  padding: 0 var(--dp-space-3);
  border-radius: var(--dp-radius-md);
  color: var(--dp-text-muted);
  font-size: var(--dp-text-sm);
  font-weight: var(--dp-weight-regular);
  text-decoration: none;
  cursor: pointer;
}

.dp-nav-item svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}

.dp-nav-item:hover {
  background: var(--dp-surface-soft);
}

.dp-nav-item[data-active] {
  background: var(--dp-surface-soft);
  color: var(--dp-navy);
  font-weight: var(--dp-weight-bold);
}

.dp-nav-item .dp-nav-beta {
  margin-left: auto;
}

/* Small beta tag */
.dp-nav-beta {
  font-size: 9px;
  font-weight: var(--dp-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dp-beta-text, #665400);
  background: var(--dp-beta-bg, #ffed99);
  padding: 2px 5px;
  border-radius: var(--dp-radius-xs);
  line-height: 1;
}

/* Group label with a collapse chevron, with a divider above */
.dp-nav-group {
  display: flex;
  align-items: center;
  gap: var(--dp-space-2);
  margin: var(--dp-space-2) calc(-1 * var(--dp-space-4)) 0;
  padding: var(--dp-space-4) var(--dp-space-4) var(--dp-space-1);
  border-top: 1px solid var(--dp-border);
  font-size: var(--dp-text-xs);
  font-weight: var(--dp-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dp-text-subtle);
}

.dp-nav-group svg {
  width: 0.875rem;
  height: 0.875rem;
  flex: none;
}

/* Collapsed group: a clickable row with a right chevron */
.dp-nav-group[data-collapsed] {
  cursor: pointer;
}

.dp-nav-group[data-collapsed]:hover {
  color: var(--dp-text-muted);
}

/* User block */
.dp-sidebar-foot {
  display: flex;
  align-items: center;
  gap: var(--dp-space-3);
  padding-top: var(--dp-space-4);
  margin-top: var(--dp-space-2);
  border-top: 1px solid var(--dp-border);
}

.dp-sidebar-user {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.dp-sidebar-user-name {
  font-size: var(--dp-text-sm);
  font-weight: var(--dp-weight-bold);
  color: var(--dp-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dp-sidebar-user-org {
  font-size: var(--dp-text-xs);
  color: var(--dp-text-muted);
}

.dp-sidebar-foot .dp-btn {
  margin-left: auto;
}
