/* =============================================================================
   Africa Conglomerate Dashboard — Sidebar styles
   All colours are sourced from theme.css variables — do not hardcode hex here.
   Layout / positioning lives in dashboard_base.html.
   ============================================================================= */

/* ── Sidebar shell ────────────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}

/* ── Sidebar header ──────────────────────────────────────────────────────── */
.sidebar-header {
  border-bottom: 1px solid var(--sidebar-header-border);
  background: var(--sidebar-header-bg);
  color: var(--sidebar-header-text);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── Nav shell ───────────────────────────────────────────────────────────── */
.sidebar-nav {
  width: 100%;
  padding: 0.5rem 0;
  /* Reserve scrollbar gutter so nav content never shifts when scrollbar appears */
  overflow-x: hidden;
}

.nav-section {
  margin-bottom: 0.25rem;
}

/* ── Section header (collapsible button) ─────────────────────────────────── */
.nav-section-header {
  width: 100%;
  background: none;
  border: none;
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}

.nav-section-header:hover {
  background: var(--sidebar-section-hover-bg);
  color: var(--sidebar-text);
}

.nav-section-title {
  color: inherit;
}

/* ── Collapse chevron ────────────────────────────────────────────────────── */
.nav-section-chevron {
  font-size: 0.8rem;
  color: inherit;           /* matches section label colour */
  transition: transform 0.2s ease, opacity 0.15s;
  flex-shrink: 0;
  opacity: 0.7;
  margin-right: 0.25rem;    /* pulls chevron away from right edge */
}

/* Rotate when collapsed */
.nav-section-header[aria-expanded="false"] .nav-section-chevron {
  transform: rotate(-90deg);
}

/* ── Section items ───────────────────────────────────────────────────────── */
.nav-section-items {
  padding: 0.15rem 0 0.5rem 0;
}

.nav-section-items.collapsed {
  display: none;
}

/* ── Nav links (scoped to sidebar only — avoids clobbering Bootstrap .nav-tabs) */
.sidebar-nav .nav-link {
  display: block;
  padding: 0.45rem 1rem 0.45rem 1.5rem;
  font-size: 0.875rem;
  color: var(--sidebar-link);
  text-decoration: none;
  border-radius: 0;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-link-hover-bg);
  color: var(--sidebar-link-hover-text);
  border-left-color: var(--sidebar-link-accent);
}

/* Active/current link */
.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link[aria-current="page"] {
  background: var(--sidebar-link-active-bg);
  color: var(--sidebar-link-active-text);
  border-left-color: var(--sidebar-link-accent);
}

/* Disabled/muted link */
.sidebar-nav .nav-link.text-muted,
.sidebar-nav span.nav-link {
  color: var(--sidebar-link-disabled);
  cursor: default;
  border-left-color: transparent;
}

/* ── Dashboard main content area ─────────────────────────────────────────── */
.dashboard-main {
  flex: 1;
  padding: 2rem;
  background: var(--dashboard-main-bg);
  min-height: 100vh;
}
