/* ── Portal sidebar: SaaS dashboard design ───────────────────────────────────────
   Shared by the admin panel and the therapist portal (montherapy.pk/assets/portal/), loaded by
   their includes/header.php when ADMIN_SIDEBAR_STYLE / PORTAL_SIDEBAR_STYLE is 'saas'. Every
   rule is scoped to .sidebar.sb-saas, so 'classic' brings back the old sidebar untouched. */

.sidebar.sb-saas {
  --sb-ink: #1f2b1a;
  --sb-text: #445040;
  --sb-muted: #8b9586;
  --sb-line: #edf0ea;
  --sb-hover: #f4f7f1;
  --sb-active: #eaf2e4;
  --sb-accent: #556F44;
  --sb-accent-dark: #3f5532;
  background: #fff;
  border-right: 1px solid var(--sb-line);
  box-shadow: none;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  scrollbar-color: #d5dccf transparent;
}
.sidebar.sb-saas::-webkit-scrollbar { width: 6px; background: transparent; }
.sidebar.sb-saas::-webkit-scrollbar-thumb { background: #d5dccf; border-radius: 6px; }

.sidebar.sb-saas .sidebar-nav {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Section labels */
.sidebar.sb-saas .sidebar-nav .nav-heading {
  margin: 18px 12px 6px;
  color: var(--sb-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sidebar.sb-saas .sidebar-nav > .nav-heading:first-child { margin-top: 4px; }
.sidebar.sb-saas .sidebar-nav hr { display: none; }

/* Links */
.sidebar.sb-saas .sidebar-nav .nav-item { margin-bottom: 2px; }
.sidebar.sb-saas .sidebar-nav .nav-link,
.sidebar.sb-saas .sidebar-nav .nav-link.collapsed {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--sb-text);
  font-family: Inter, 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  transition: background .15s, color .15s;
}
.sidebar.sb-saas .sidebar-nav .nav-link .lc-ic {
  width: 18px;
  height: 18px;
  margin-right: 11px;
  color: var(--sb-muted);
  stroke-width: 1.9;
  transition: color .15s;
}
.sidebar.sb-saas .sidebar-nav .nav-link:hover {
  background: var(--sb-hover);
  color: var(--sb-ink);
}
.sidebar.sb-saas .sidebar-nav .nav-link:hover .lc-ic { color: var(--sb-accent); }

/* Current page (the link without .collapsed) */
.sidebar.sb-saas .sidebar-nav .nav-link:not(.collapsed) {
  background: var(--sb-active);
  color: var(--sb-accent-dark);
  font-weight: 700;
}
.sidebar.sb-saas .sidebar-nav .nav-link:not(.collapsed) .lc-ic { color: var(--sb-accent); }
.sidebar.sb-saas .sidebar-nav .nav-link:not(.collapsed)::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sb-accent);
}
/* An open dropdown group is not a page: keep it light */
.sidebar.sb-saas .sidebar-nav .nav-link[data-bs-toggle="collapse"]:not(.collapsed) {
  background: var(--sb-hover);
  color: var(--sb-ink);
  font-weight: 600;
}
.sidebar.sb-saas .sidebar-nav .nav-link[data-bs-toggle="collapse"]:not(.collapsed)::before { display: none; }

.sidebar.sb-saas .sidebar-nav .nav-link .lc-chev {
  width: 15px;
  height: 15px;
  margin-right: 0;
  color: var(--sb-muted);
}

/* Dropdown groups (Blogs, Legal Pages) */
.sidebar.sb-saas .sidebar-nav .nav-content {
  margin: 2px 0 6px 21px;
  padding: 2px 0 2px 10px;
  border-left: 1px solid var(--sb-line);
}
.sidebar.sb-saas .sidebar-nav .nav-content a {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--sb-text);
  font-size: 13px;
  font-weight: 500;
}
.sidebar.sb-saas .sidebar-nav .nav-content a .lc-ic {
  width: 15px;
  height: 15px;
  margin-right: 9px;
  color: var(--sb-muted);
}
.sidebar.sb-saas .sidebar-nav .nav-content a:hover,
.sidebar.sb-saas .sidebar-nav .nav-content a.active {
  background: var(--sb-hover);
  color: var(--sb-ink);
}
.sidebar.sb-saas .sidebar-nav .nav-content a:hover .lc-ic { color: var(--sb-accent); }

/* Live Support unread count as a pill on the right */
.sidebar.sb-saas .sidebar-nav .nav-link > span { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.sidebar.sb-saas .msg_unseen_counter {
  position: static;
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #df5593;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  top: auto;
}

/* Log out and the signed-in user at the bottom */
.sidebar.sb-saas .sidebar-nav .sb-logout { margin-top: auto; padding-top: 14px; }
.sidebar.sb-saas .sidebar-nav .sb-logout .nav-link:hover { background: #fdecef; color: #b3261e; }
.sidebar.sb-saas .sidebar-nav .sb-logout .nav-link:hover .lc-ic { color: #b3261e; }
.sidebar.sb-saas .sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--sb-line);
  border-radius: 12px;
  background: #fafbf8;
}
.sidebar.sb-saas .sb-user-av {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--sb-accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar.sb-saas .sb-user-av img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.sidebar.sb-saas .sb-user-info { min-width: 0; display: flex; flex-direction: column; }
.sidebar.sb-saas .sb-user-info b {
  color: var(--sb-ink);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar.sb-saas .sb-user-info i {
  color: var(--sb-muted);
  font-size: 11px;
  font-style: normal;
}
