

/* region ── Sidebar user section ────────────────────────────────────────────── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
  white-space: nowrap;
}

.sidebar-user-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent2-faint);
  border: 1px solid var(--accent2-border);
  color: var(--accent2);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  padding: 0;
}
.sidebar-user-avatar:hover {
  background: rgba(71,200,255,0.2);
  border-color: rgba(71,200,255,0.5);
}

.sidebar-user-name {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-settings-btn {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1;
  transition: color 0.1s, background 0.1s;
}
.sidebar-user-settings-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}
/* endregion */

/* region ── Sidebar section labels ───────────────────────────────────────────── */
.sidebar-section {
  padding: 0.4rem 1rem 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
  border-bottom: 1px solid rgba(42,42,50,0.4);
  flex-shrink: 0;
}
/* endregion */

/* region ── Sidebar item badges ─────────────────────────────────────────────── */
.sidebar-item-badge {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.05em;
  padding: 1px 4px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-right: 0.25rem;
  white-space: nowrap;
}
.sidebar-item-badge.server {
  color: var(--accent2);
  border: 1px solid var(--accent2-border);
  background: var(--accent2-faint);
}
.sidebar-item-badge.local {
  color: var(--muted);
  border: 1px solid rgba(107,107,122,0.3);
}
.sidebar-item-badge.modified {
  color: var(--accent);
  border: 1px solid rgba(232,255,71,0.3);
  background: var(--accent-faint);
}

/* Push button — appears on active server project that has local changes */
.sidebar-item-push {
  flex-shrink: 0;
  padding: 0.65rem 0.5rem;
  font-size: 0.6rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.1s;
  background: none;
  border: none;
  cursor: pointer;
}
.sidebar-item:hover .sidebar-item-push { opacity: 1; }
.sidebar-item-push:hover { color: var(--text); }

.sidebar-empty {
  padding: 2rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

/* Sidebar toggle tab */
.sidebar-toggle {
  position: fixed;
  top: 50%;
  left: 240px;
  transform: translateY(-50%);
  z-index: 200;
  width: 14px;
  height: 48px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.5rem;
  transition: left 0.2s ease, background 0.1s;
}
.sidebar-toggle:hover { background: var(--surface); color: var(--text); }
.sidebar-toggle.collapsed { left: 0; }
/* endregion */


/* region ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, min-width 0.2s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-right: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
  white-space: nowrap;
}

.sidebar-header-actions {
  display: flex;
  gap: 0.4rem;
}

.sidebar-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-new-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background 0.1s;
  line-height: 1;
}
.sidebar-new-btn:hover { background: rgba(71,200,255,0.12); }

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-list::-webkit-scrollbar { width: 3px; }
.sidebar-list::-webkit-scrollbar-thumb { background: var(--border); }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid rgba(42,42,50,0.5);
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
  position: relative;
}
.sidebar-item:hover { background: var(--surface2); }
.sidebar-item.active {
  background: var(--accent-faint);
  border-left: 2px solid var(--accent);
}

.sidebar-item-name {
  flex: 1;
  padding: 0.65rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-item.active .sidebar-item-name { color: var(--accent); }

.sidebar-item-name-input {
  flex: 1;
  padding: 0.65rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text);
  background: var(--surface2);
  border: none;
  border-bottom: 1px solid var(--accent2);
  outline: none;
  min-width: 0;
}

.sidebar-item-del {
  flex-shrink: 0;
  padding: 0.65rem 0.75rem;
  color: var(--muted);
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s;
  background: none;
  border: none;
  cursor: pointer;
}
.sidebar-item:hover .sidebar-item-del { opacity: 1; }
.sidebar-item-del:hover { color: var(--danger); }
/* endregion */

/* region ── Theme toggle ─────────────────────────────────────────────────────── */
.sidebar-theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.sidebar-theme-label {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.theme-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  line-height: 1;
}
.theme-btn:hover {
  background: var(--surface2);
  color: var(--text);
}
.theme-btn.active {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent);
}
/* endregion */
