/* The navigation keeps a dark, readable surface beneath its glass highlights. */
.sidebar {
  --sidebar-divider-accent: #a38af6;
  --sidebar-divider-muted: rgba(212, 202, 244, .11);
  isolation: isolate;
  background: rgba(19, 20, 29, .96);
  border-right: 1px solid rgba(204, 192, 247, .19);
  box-shadow: inset 1px 0 rgba(255, 255, 255, .06), 10px 0 36px rgba(0, 0, 0, .16);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  backdrop-filter: blur(28px) saturate(145%);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar {
    background:
      linear-gradient(180deg, rgba(7, 8, 12, .68), transparent 190px),
      radial-gradient(ellipse at 0% 26%, rgba(163, 138, 246, .07), transparent 55%),
      radial-gradient(ellipse at 100% 78%, rgba(136, 172, 214, .055), transparent 48%),
      linear-gradient(155deg, rgba(28, 27, 39, .86), rgba(14, 15, 22, .88) 44%, rgba(20, 21, 30, .86));
  }
}

/* The edge reflections are decorative and never intercept menu clicks. */
.sidebar::before,
.sidebar::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.sidebar::before {
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(235, 227, 255, .28), rgba(235, 227, 255, .04) 70%, transparent);
}

.sidebar::after {
  top: 0;
  bottom: 0;
  right: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(235, 227, 255, .24), rgba(163, 138, 246, .04) 38%, rgba(195, 210, 244, .16) 82%, transparent);
}

.sidebar .brand small { color: #b0adbf; }
.sidebar .section-label { color: #a3a2b5; }
.sidebar .workspace-nav { border-top-color: var(--sidebar-divider-accent); }
:root[data-theme="light"] .sidebar { --sidebar-divider-muted: var(--line); }

/* Section dividers adapted from the user's two-color underline reference. */
.sidebar .category-nav,
.sidebar .admin-menu-section {
  position: relative;
  border-top: 1px solid var(--sidebar-divider-muted);
  padding-top: 14px;
}
.sidebar .category-nav::before,
.sidebar .admin-menu-section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 30%;
  border-top: 1px solid var(--sidebar-divider-accent);
  pointer-events: none;
}

.sidebar .nav-item,
.sidebar .tree-select {
  position: relative;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #c7c8d3;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
  -webkit-tap-highlight-color: rgba(163, 138, 246, .16);
}

/* Rounded menu plates: light catches the upper edge of the selected surface. */
.sidebar .nav-item::after,
.sidebar .tree-select::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(241, 235, 255, .4), transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.sidebar .nav-item.active {
  color: #f4f0ff;
  border-color: rgba(190, 169, 255, .29);
  background: linear-gradient(115deg, rgba(163, 138, 246, .23), rgba(211, 199, 255, .085) 60%, rgba(163, 138, 246, .07));
  box-shadow: inset 0 1px rgba(255, 255, 255, .07), inset 2px 0 rgba(194, 171, 255, .8), 0 4px 14px rgba(0, 0, 0, .15);
}

.sidebar .tree-select.selected {
  color: #f2effb;
  border-color: rgba(190, 169, 255, .29);
  background: linear-gradient(115deg, rgba(163, 138, 246, .22), rgba(163, 138, 246, .06));
  border-color: color-mix(in srgb, var(--category-accent, #A38AF6) 35%, transparent);
  background: linear-gradient(115deg, color-mix(in srgb, var(--category-accent, #A38AF6) 24%, transparent), rgba(235, 228, 255, .045));
  box-shadow: inset 0 1px rgba(255, 255, 255, .065), inset 2px 0 var(--category-accent, #A38AF6), 0 3px 12px rgba(0, 0, 0, .14);
}

.sidebar .nav-item.active::after,
.sidebar .tree-select.selected::after { opacity: 1; }

.sidebar .nav-trailing,
.sidebar .tree-number,
.sidebar .count { color: #a8a7ba; }

.sidebar .nav-item.active .nav-trailing,
.sidebar .nav-item.active .count,
.sidebar .tree-select.selected .tree-number { color: #e5dbff; }

.sidebar .accent-count {
  border: 1px solid rgba(190, 169, 255, .16);
  background: rgba(163, 138, 246, .14);
  color: #dccfff;
}

/* Keep the pending count readable on both themes and on the selected menu. */
#sidebar .bnto-badge-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: #c92d3a;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
#sidebar .bnto-badge-number[hidden] { display: none; }

.sidebar .category-nav .tree-row:hover { background: transparent; }
.sidebar .category-nav .tree-caret-toggle { color: #a3a2b5; }
.sidebar .tree-name-section b { color: #e6e0f5; }
.sidebar .tree-full-name { color: #c0becd; }
.sidebar .category-nav .root-divider { border-top-color: var(--sidebar-divider-muted); }
.sidebar .category-nav { scrollbar-color: rgba(180, 163, 221, .3) transparent; }

.sidebar .admin-menu-toggle {
  border-radius: 8px;
  transition: background .18s ease, color .18s ease;
}

.sidebar .source-status {
  border-top-color: rgba(212, 202, 244, .12);
  color: #dedce8;
}

.sidebar .source-status small { color: #a09dae; }
.sidebar .status-pulse { box-shadow: 0 0 9px rgba(139, 215, 178, .2); }

.sidebar .profile {
  border: 1px solid rgba(216, 205, 250, .12);
  border-radius: 12px;
  margin-top: 3px;
  padding-left: 8px;
  padding-right: 8px;
  background: linear-gradient(115deg, rgba(230, 220, 255, .065), rgba(230, 220, 255, .025));
  box-shadow: inset 0 1px rgba(255, 255, 255, .045), 0 3px 12px rgba(0, 0, 0, .1);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.sidebar .profile .avatar {
  border: 1px solid rgba(221, 210, 255, .18);
  background: linear-gradient(145deg, rgba(188, 166, 250, .25), rgba(188, 166, 250, .1));
  color: #efe8ff;
}

.sidebar .profile .more { color: #aaa5bc; }

@media (hover: hover) and (pointer: fine) {
  .sidebar .nav-item:hover,
  .sidebar .tree-select:hover {
    color: #f4f1fb;
    border-color: rgba(219, 207, 255, .15);
    background: linear-gradient(110deg, rgba(219, 207, 255, .11), rgba(219, 207, 255, .035));
    box-shadow: inset 0 1px rgba(255, 255, 255, .055), 0 3px 10px rgba(0, 0, 0, .09);
  }
  .sidebar .nav-item:hover::after,
  .sidebar .tree-select:hover::after { opacity: .65; }
  .sidebar .nav-item.active:hover {
    border-color: rgba(202, 184, 255, .39);
    background: linear-gradient(115deg, rgba(163, 138, 246, .28), rgba(211, 199, 255, .12) 60%, rgba(163, 138, 246, .09));
    box-shadow: inset 0 1px rgba(255, 255, 255, .09), inset 2px 0 rgba(194, 171, 255, .9), 0 4px 16px rgba(0, 0, 0, .17);
  }
  .sidebar .tree-select.selected:hover {
    border-color: color-mix(in srgb, var(--category-accent, #A38AF6) 48%, transparent);
    background: linear-gradient(115deg, color-mix(in srgb, var(--category-accent, #A38AF6) 29%, transparent), rgba(235, 228, 255, .07));
    box-shadow: inset 0 1px rgba(255, 255, 255, .09), inset 2px 0 var(--category-accent, #A38AF6), 0 4px 14px rgba(0, 0, 0, .15);
  }
  .sidebar .admin-menu-toggle:hover,
  .sidebar .tree-caret-toggle:hover { color: #f4f0ff; background: rgba(219, 207, 255, .085); }
  .sidebar .profile:hover {
    border-color: rgba(216, 205, 250, .24);
    background: linear-gradient(115deg, rgba(230, 220, 255, .105), rgba(230, 220, 255, .04));
    box-shadow: inset 0 1px rgba(255, 255, 255, .075), 0 4px 16px rgba(0, 0, 0, .13);
  }
}

.sidebar :is(.nav-item, .tree-select, .tree-caret-toggle, .admin-menu-toggle, .profile):focus-visible {
  outline: 2px solid #d8c9ff;
  outline-offset: -2px;
}

@media (max-width: 740px) {
  .sidebar { border-radius: 0 20px 20px 0; }
  .sidebar::after { top: 20px; bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar :is(.nav-item, .tree-select, .admin-menu-toggle, .profile),
  .sidebar .nav-item::after,
  .sidebar .tree-select::after { transition: none; }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .sidebar { background: #171820; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sidebar .nav-item.active { background: #39304e; }
  .sidebar .tree-select.selected { background: #30313e; }
}

@media (forced-colors: active) {
  .sidebar { background: Canvas; border-color: CanvasText; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sidebar::before, .sidebar::after, .sidebar .nav-item::after, .sidebar .tree-select::after { display: none; }
  .sidebar .nav-item.active, .sidebar .tree-select.selected { outline: 2px solid Highlight; outline-offset: -2px; }
}

.task-list-nav-icon{color:#a38af6}.task-list-nav-icon svg{display:block;width:19px;height:19px}
