/* ===== SIDEBAR ===== */
#sidebar {
  width: 200px;
  height: 100%;
  z-index: 10;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  transition: background 0.2s;
}

#sidebar::-webkit-scrollbar {
  width: 4px;
}

#sidebar::-webkit-scrollbar-track {
  background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* Search */
.search-wrap {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.search-box {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23484f58' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
}

.search-box::placeholder {
  color: var(--text-muted);
}

.search-box:focus {
  border-color: var(--accent);
  background-color: var(--surface-hover);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  padding: 8px 0 24px;
}

.sidebar-section {
  padding: 0;
  margin-bottom: 2px;
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 0;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.15s;
  user-select: none;
}

.sidebar-title:hover {
  color: var(--text-secondary);
}

.arrow {
  font-size: 10px;
  opacity: 0.75;
  transition: transform 0.2s;
  font-style: normal;
}

.sidebar-list {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  position: relative;
}

.sidebar-link::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.15s;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--accent-subtle);
}

.sidebar-link:hover::before {
  background: var(--accent);
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-subtle);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar-link.active::before {
  background: var(--accent);
}