/* ──────────────────────────────────────────────────────────────
   Sidebar — 240px expanded, 60px collapsed.
   Brand at top, scrollable nav with grouped sections, collapse toggle at bottom.
   Source: docs/handoff/src/admin-shell.jsx + DESIGN-SYSTEM 5.4
   ────────────────────────────────────────────────────────────── */

.wt-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--wt-sidebar-bg);
  border-right: 1px solid var(--wt-sidebar-border);
  color: var(--wt-sidebar-fg);
  transition: width 180ms ease;
  overflow: hidden;
}
.wt-sidebar.is-collapsed { width: 60px; }

/* ── Brand ─────────────────────────────────────────────── */
.wt-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--wt-sidebar-border);
  flex-shrink: 0;
  height: 56px;
  box-sizing: border-box;
}
.wt-sidebar.is-collapsed .wt-sidebar-brand {
  padding: 14px 0;
  justify-content: center;
}
.wt-sidebar-brand-logo {
  width: 24px; height: 24px;
  flex-shrink: 0;
}
.wt-sidebar-brand-text {
  font-family: var(--wt-font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--wt-sidebar-fg);
  white-space: nowrap;
  overflow: hidden;
}
.wt-sidebar-brand-text .accent { color: var(--wt-primary); }
.wt-sidebar-brand-badge {
  font-family: var(--wt-font);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  background: color-mix(in oklch, var(--wt-warning) 22%, transparent);
  color: var(--wt-warning);
  margin-left: 2px;
}
.wt-sidebar.is-collapsed .wt-sidebar-brand-text,
.wt-sidebar.is-collapsed .wt-sidebar-brand-badge { display: none; }

/* ── Nav scroll area ───────────────────────────────────── */
.wt-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--wt-sidebar-border) transparent;
}
.wt-sidebar-nav::-webkit-scrollbar { width: 6px; }
.wt-sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--wt-sidebar-border);
  border-radius: 3px;
}
.wt-sidebar-nav::-webkit-scrollbar-track { background: transparent; }

/* ── Group ─────────────────────────────────────────────── */
.wt-sidebar-group { margin-bottom: 14px; }
.wt-sidebar-group:last-child { margin-bottom: 0; }

.wt-sidebar-group-title {
  padding: 6px 16px 4px;
  font-family: var(--wt-font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--wt-sidebar-muted);
  white-space: nowrap;
  overflow: hidden;
}
.wt-sidebar-group-divider {
  display: none;
  height: 1px;
  background: var(--wt-sidebar-border);
  margin: 6px 12px;
}
.wt-sidebar.is-collapsed .wt-sidebar-group-title { display: none; }
.wt-sidebar.is-collapsed .wt-sidebar-group-divider { display: block; }

/* ── Item ──────────────────────────────────────────────── */
.wt-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 14px 7px 12px;
  border: none;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--wt-sidebar-muted);
  cursor: pointer;
  font-family: var(--wt-font);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.wt-sidebar-item:hover {
  background: var(--wt-sidebar-hover);
  color: var(--wt-sidebar-fg);
}
.wt-sidebar-item.is-active {
  background: var(--wt-sidebar-hover);
  color: var(--wt-sidebar-fg);
  font-weight: 600;
  border-left-color: var(--wt-primary);
}
.wt-sidebar-item.is-active svg {
  color: var(--wt-primary);
}
.wt-sidebar-item svg {
  flex-shrink: 0;
  width: 14px; height: 14px;
  color: inherit;
}
.wt-sidebar-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wt-sidebar-item-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--wt-sidebar-border);
  color: var(--wt-sidebar-fg);
  flex-shrink: 0;
}
.wt-sidebar-item.is-active .wt-sidebar-item-badge {
  background: var(--wt-primary);
  color: white;
}

/* Collapsed: center item, hide label, show tooltip on hover */
.wt-sidebar.is-collapsed .wt-sidebar-item {
  padding: 8px 0;
  justify-content: center;
  border-left-width: 0;
}
.wt-sidebar.is-collapsed .wt-sidebar-item.is-active {
  border-left-width: 0;
  position: relative;
}
.wt-sidebar.is-collapsed .wt-sidebar-item.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--wt-primary);
  border-radius: 0 2px 2px 0;
}
.wt-sidebar.is-collapsed .wt-sidebar-item-label,
.wt-sidebar.is-collapsed .wt-sidebar-item-badge { display: none; }

.wt-sidebar.is-collapsed .wt-sidebar-item::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--wt-card);
  color: var(--wt-fg);
  border: 1px solid var(--wt-border);
  padding: 4px 8px;
  border-radius: var(--wt-r-sm);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms;
  z-index: 50;
  box-shadow: var(--wt-shadow);
}
.wt-sidebar.is-collapsed .wt-sidebar-item:hover::after { opacity: 1; }

/* ── Footer (collapse toggle) ──────────────────────────── */
.wt-sidebar-foot {
  border-top: 1px solid var(--wt-sidebar-border);
  padding: 8px;
  flex-shrink: 0;
}
.wt-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--wt-sidebar-muted);
  cursor: pointer;
  font-family: var(--wt-font);
  font-size: 12px;
  transition: background 0.12s, color 0.12s;
}
.wt-sidebar-toggle:hover {
  background: var(--wt-sidebar-hover);
  color: var(--wt-sidebar-fg);
}
.wt-sidebar-toggle svg {
  width: 13px; height: 13px;
  transition: transform 180ms ease;
  flex-shrink: 0;
}
.wt-sidebar.is-collapsed .wt-sidebar-toggle {
  justify-content: center;
  padding: 8px;
}
.wt-sidebar.is-collapsed .wt-sidebar-toggle-label { display: none; }
.wt-sidebar.is-collapsed .wt-sidebar-toggle svg { transform: rotate(180deg); }
