/* ══════════════════════════════════
   SIDEBAR — polished with logo
══════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width); height: 100dvh;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  display: none; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0; position: fixed;
  top: 0; right: 0;
  z-index: var(--z-topbar);
  transform: translateX(100%);
  transition: transform var(--ease-slow);
  box-shadow: -4px 0 24px rgba(15,23,42,.08);
}
.sidebar.open { display: flex; transform: translateX(0); }

/* Header */
.sidebar__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg-sidebar);
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; }
.sidebar__logo-img {
  width: 34px; height: 34px;
  object-fit: contain; border-radius: 8px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(37,99,235,.2));
}
.sidebar__brand-text { display: flex; flex-direction: column; gap: 1px; }
.sidebar__app-name {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary); line-height: 1.2;
  letter-spacing: -.01em;
}
.sidebar__version {
  font-size: 10px; color: var(--text-muted);
  font-weight: 500; letter-spacing: .02em;
}
.sidebar__close-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); border-radius: var(--radius);
  transition: background var(--ease);
}
.sidebar__close-btn:hover { background: var(--gray-100); }

/* Nav */
.sidebar__nav {
  flex: 1; padding: 10px 10px;
  display: flex; flex-direction: column; gap: 1px;
  overflow-y: auto;
}
.sidebar__nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13.5px; font-weight: 500;
  transition: all var(--ease); min-height: 44px;
  position: relative; text-decoration: none;
}
.sidebar__nav-item:hover {
  background: var(--gray-100); color: var(--text-primary);
}
.sidebar__nav-item.active {
  background: var(--primary-50); color: var(--primary);
  font-weight: 600;
}
.sidebar__nav-item.active::before {
  content: '';
  position: absolute; right: 0; top: 22%; bottom: 22%;
  width: 3px; background: var(--primary);
  border-radius: 999px 0 0 999px;
}
.sidebar__nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0; stroke-width: 1.8;
}
.sidebar__divider {
  height: 1px; background: var(--border);
  margin: 6px 4px;
}

/* Footer */
.sidebar__footer {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--gray-50);
}
[data-theme="dark"] .sidebar__footer { background: transparent; }
.sidebar__user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

@media (min-width: 768px) {
  .sidebar {
    display: flex; position: static;
    transform: none; box-shadow: none; height: auto;
  }
}
