/* ── Sidebar — ARKAN Design System v2 ────────────────────────── */
/* Layered on top of main.css sidebar section. Overrides              */
/* hardcoded values with design tokens and upgrades visual density.   */

/* ── Container ───────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}

/* ── Brand area ──────────────────────────────────────────────── */
.sidebar__brand {
  height: 56px;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.sidebar__brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

.sidebar__brand-tag {
  font-size: 9px;
  font-weight: var(--font-medium);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Section group header ────────────────────────────────────── */
.sb-group__header {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-5) var(--space-4) var(--space-1);
  height: auto;
  background: transparent;
  border-radius: 0;
  width: 100%;
  margin: 0;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.sb-group__header:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent-primary) 5%, transparent);
}
.sb-group__header--has-active {
  color: var(--sidebar-accent) !important;
}

/* Chevron rotation */
.sb-group__chevron {
  opacity: 0.6;
  transition: transform 0.22s ease, opacity 0.15s ease;
}
.sb-group--open .sb-group__chevron {
  transform: rotate(90deg);
  opacity: 0.9;
}

/* Active indicator dot on closed group */
.sb-group__active-dot {
  background: var(--sidebar-accent);
  box-shadow: none;
}

/* ── Nav items ───────────────────────────────────────────────── */
.sidebar__list {
  padding: 2px var(--space-2);
  list-style: none;
}

.sidebar__item { margin-bottom: 1px; }

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 40px;
  padding: 0 var(--space-3);
  margin: 0 var(--space-1);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--sidebar-text);
  text-decoration: none;
  position: relative;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
  overflow: visible;
}

.sidebar__link:hover {
  background: color-mix(in srgb, var(--accent-primary) 7%, transparent);
  color: var(--sidebar-text-hover);
}

.sidebar__link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  font-weight: var(--font-semibold);
}

.sidebar__link.active .sidebar__icon {
  color: var(--sidebar-accent);
  filter: none;
}

.sidebar__link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Active left pip — clean, no glow */
.sidebar__active-pip {
  position: absolute;
  left: calc(-1 * var(--space-1) - 1px);
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--sidebar-accent);
  box-shadow: none;
}

/* Icon */
.sidebar__icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

/* Label */
.sidebar__label {
  font-size: var(--text-base);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Profile footer ──────────────────────────────────────────── */
.sidebar__profile {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 12px var(--space-4);
}

.sb-prof-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.sb-prof-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 1px;
}

.sb-prof-dot {
  background: var(--status-success);
  border: 2px solid var(--bg-secondary);
  box-shadow: none;
}

.sb-prof-btn {
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.sb-prof-btn:hover {
  color: var(--status-danger);
  background: var(--status-danger-bg);
}

/* ── Collapse button ─────────────────────────────────────────── */
.sb-collapse-btn {
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}
.sb-collapse-btn:hover {
  background: var(--accent-surface);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ── Scrollbar in nav body ───────────────────────────────────── */
.sidebar__nav-body::-webkit-scrollbar { width: 4px; }
.sidebar__nav-body::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav-body::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 99px;
}
.sidebar__nav-body::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ── Section label (pinned sections) ────────────────────────── */
.sb-pinned-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: 0.10em;
  color: var(--text-muted);
  opacity: 0.7;
  padding: var(--space-5) var(--space-4) var(--space-1);
  display: block;
}
