/* ── Sidebar header ─────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 58px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-eyebrow {
  display: block;
  font-family: var(--font-base);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

/* Sidebar close button */
#sidebar-toggle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition);
  flex-shrink: 0;
}
#sidebar-toggle:hover { color: var(--text-primary); }

/* Float toggle (sidebar collapsed) */
#toggle-float {
  display: none;
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 60;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: color var(--transition);
  box-shadow: var(--shadow-md);
}
#toggle-float:hover { color: var(--accent); }
#app.sidebar-collapsed #toggle-float { display: flex; }

/* ── Search ─────────────────────────────── */
.sidebar-search {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}

.sidebar-search input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-base);
  transition: border-color var(--transition);
}
.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search input:focus { border-color: var(--accent); outline: none; }

/* Search results */
#search-results {
  position: absolute;
  top: 100%;
  left: var(--space-4);
  right: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
#search-results.hidden { display: none; }

.search-result-item {
  display: flex;
  flex-direction: column;
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-secondary); }

.search-result-name {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 500;
}
.search-result-category {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1px;
}
.search-no-results {
  padding: var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── Navigation ─────────────────────────── */
#main-nav {
  flex: 1;
  padding: var(--space-3) 0 var(--space-6);
  overflow-y: auto;
}
.nav-list {
  display: flex;
  flex-direction: column;
}

/* Direct links */
.nav-item > .nav-link {
  display: block;
  padding: var(--space-2) var(--space-4);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-family: var(--font-base);
  transition: color var(--transition), background var(--transition);
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item > .nav-link:hover { color: var(--text-primary); }
.nav-item > .nav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

/* Category section label */
.nav-category { display: flex; flex-direction: column; }

.category-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4) var(--space-1);
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.category-toggle-label {
  font-size: var(--text-xs);
  font-family: var(--font-base);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition);
}
.category-toggle:hover .category-toggle-label { color: var(--text-secondary); }

.category-arrow {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  margin-left: var(--space-2);
}
.nav-category.expanded .category-arrow { transform: rotate(90deg); }

/* Collapsible items */
.category-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.nav-category.expanded .category-items { max-height: 600px; }

.category-items .nav-link {
  display: block;
  padding: var(--space-1) var(--space-4) var(--space-1) var(--space-6);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-base);
  transition: color var(--transition), background var(--transition);
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-items .nav-link:hover { color: var(--text-secondary); }
.category-items .nav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

/* Separator */
.nav-separator {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) var(--space-4);
}
