/* sidebar.css
   Uses variables from static/colors.css
   ------------------------------------- */

:root{
  --topbar-h: 48px;   /* match your Nav height */
  --sidebar-w: 260px; /* sidebar column width */
}

/* --- Sidebar column (left rail) --- */
.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: var(--space-4) var(--space-3);

  /* key layout fixes */
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: auto;

  /* fix width so content renders to the right, not under */
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  max-width: var(--sidebar-w);

  display: flex;
  flex-direction: column;
}
/* Root UL */
.sidebar .menu-root {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

/* Links */
.nav-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.nav-item:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
}

.nav-item.active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-weight: 500;
}

/* Icons + labels */
.nav-item .icon {
  width: 1.25rem;
  text-align: center;
}
.nav-item .label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Collapsible Sections */
.collapsible-section {
  margin-top: .25rem;
}

.collapsible-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .55rem .75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.collapsible-header:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
}

.collapsible-header .chevron {
  margin-left: auto;
  font-size: .8rem;
  opacity: .7;
}

/* Sub-items */
.sub-items {
  list-style: none;
  margin: .25rem 0 .5rem .75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.sub-items .nav-item {
  font-size: .95rem;
  padding: .45rem .65rem;
}

/* Section link (optional header link) */
.section-link {
  margin: .25rem 0 .25rem 1.25rem;
}
.section-link .nav-item {
  font-size: .9rem;
  padding: .4rem .6rem;
  opacity: .9;
}

/* Updated badge example */
.updated-badge {
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 999px;
  font-size: .65rem;
  padding: .1rem .5rem;
  margin-left: .5rem;
}
