/* ═══════════════════════════════════════════
   SIDEBAR — Nav, brand, profile, mobile
   ═══════════════════════════════════════════ */
.sidebar {
  width: 260px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  z-index: 50;
  position: relative;
}
.sidebar::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background:
    radial-gradient(circle at 20% 20%, rgba(0,212,170,.22), transparent 32%),
    radial-gradient(circle at 80% 30%, rgba(96,165,250,.18), transparent 34%),
    radial-gradient(circle at 40% 75%, rgba(255,255,255,.06), transparent 28%);
}

.sidebar-top {
  padding: 18px 14px 12px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.brand-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 13px; font-weight: 600;
  color: #000;
  flex-shrink: 0;
}
.brand-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.brand-sub { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }

.new-chat {
  width: 100%;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  color: var(--accent);
  font-family: var(--font);
  font-size: 13px; font-weight: 500;
  padding: 8px 12px;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: all .2s;
}
.new-chat:hover { background: rgba(0,212,170,.2); }

.sidebar-nav { padding: 12px 8px; flex: 1; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }

.nav-section {
  font-family: var(--mono);
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-dim);
  padding: 10px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all .15s;
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: var(--surface2);
  color: var(--text);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-item .ni { font-size: 15px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.profile-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer; transition: background .15s;
}
.profile-card:hover { background: var(--surface2); }
.profile-photo {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4aa, #0088ff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #000;
  flex-shrink: 0; overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.04);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-name { font-size: 13px; font-weight: 600; color: var(--text); }
.profile-role { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }

/* ── MOBILE SIDEBAR OVERLAY & TOGGLE ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 40;
  opacity: 0;
  transition: opacity .3s;
}
.sidebar-overlay.visible { opacity: 1; }

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background .15s;
}
.mobile-toggle:hover { background: var(--surface2); }
.mobile-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all .3s;
}
