/* =========================================================
   NSRL CLIENT SIDEBAR + CLIENT PAGE THEME
   Palette: forest green / mint, distinct from admin teal.
   Scope: all rules are scoped to the client dashboard.
   ========================================================= */

html.nsrl-client-shell { --nsrl-client-sidebar-width: 256px; }
html.nsrl-client-shell.nsrl-client-rail { --nsrl-client-sidebar-width: 76px; }

/* Fixed sidebar rail: it stays in place while the dashboard page scrolls. */
#nsrl-cd-side {
  --nsrl-sidebar-width: 256px;
  --nsrl-sidebar-collapsed-width: 76px;
  --nsrl-accent: #35cbb7;
  --nsrl-accent-strong: #118875;
  --nsrl-sidebar-bg: #0b3d2a;
  --nsrl-sidebar-text: #edf7f1;
  --nsrl-sidebar-muted: #a7c1b4;
  --nsrl-sidebar-border: rgba(255,255,255,.12);
  position: fixed;
  z-index: 100032;
  top: var(--nsrl-client-top, 0px);
  bottom: 0;
  left: 0;
  width: var(--nsrl-client-sidebar-width, 256px);
  min-width: 0;
  max-width: 100vw;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
  transition: width .24s ease;
}

/* Offset the dashboard content to make room for the fixed rail. */
@media (min-width: 768px) {
  html.nsrl-client-shell body {
    padding-left: var(--nsrl-client-sidebar-width, 256px) !important;
    transition: padding-left .24s ease;
  }
}
#nsrl-cd-side *, #nsrl-cd-side *::before, #nsrl-cd-side *::after { box-sizing: border-box; }

#nsrl-cd-side .nsrl-ad-side {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  color: var(--nsrl-sidebar-text);
  background: var(--nsrl-sidebar-bg);
  border-right: 1px solid var(--nsrl-sidebar-border);
  transition: background .2s ease, color .2s ease;
}
#nsrl-cd-side .nsrl-ad-top {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 88px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--nsrl-sidebar-border);
}
#nsrl-cd-side .nsrl-ad-brand {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
#nsrl-cd-side .nsrl-ad-brand__mark {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: #073226;
  background: var(--nsrl-accent);
  font: 700 25px Georgia, serif;
}
#nsrl-cd-side .nsrl-ad-brand__text,
#nsrl-cd-side .nsrl-ad-me__txt { display: flex; flex-direction: column; min-width: 0; overflow: hidden; white-space: nowrap; }
#nsrl-cd-side .nsrl-ad-brand__name { font: 700 22px/1.1 Georgia, serif; }
#nsrl-cd-side .nsrl-ad-brand__sub { margin-top: 3px; color: var(--nsrl-accent); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; }

#nsrl-cd-side .nsrl-ad-iconbtn {
  display: inline-flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--nsrl-sidebar-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
#nsrl-cd-side .nsrl-ad-iconbtn:hover,
#nsrl-cd-side .nsrl-ad-iconbtn:focus-visible {
  color: var(--nsrl-accent);
  background: rgba(255,255,255,.08);
  border-color: var(--nsrl-sidebar-border);
}
#nsrl-cd-side .nsrl-ad-iconbtn:focus-visible,
#nsrl-cd-side .nsrl-ad-link:focus-visible { outline: 2px solid var(--nsrl-accent); outline-offset: 2px; }
#nsrl-cd-side .nsrl-ad-ico {
  display: block;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#nsrl-cd-side .nsrl-ad-scroll { flex: 1 1 auto; min-height: 0; padding: 14px 10px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
#nsrl-cd-side .nsrl-ad-nav__list { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; }
#nsrl-cd-side .nsrl-ad-nav__list li { min-width: 0; margin: 0; padding: 0; list-style: none; }
#nsrl-cd-side .nsrl-ad-label { padding: 17px 12px 7px !important; color: var(--nsrl-sidebar-muted); font-size: 11px; font-weight: 800; letter-spacing: 1.3px; }

#nsrl-cd-side .nsrl-ad-link {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 13px;
  overflow: hidden;
  color: var(--nsrl-sidebar-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
#nsrl-cd-side .nsrl-ad-link__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nsrl-cd-side .nsrl-ad-link:hover { color: var(--nsrl-sidebar-text); background: rgba(255,255,255,.07); }
#nsrl-cd-side .nsrl-ad-link.is-active { color: #073226; background: var(--nsrl-accent); border-color: rgba(255,255,255,.24); font-weight: 750; }
#nsrl-cd-side .nsrl-ad-link.is-active .nsrl-ad-ico { color: #073226; }

#nsrl-cd-side .nsrl-ad-foot { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; min-width: 0; padding: 12px 10px; border-top: 1px solid var(--nsrl-sidebar-border); }
#nsrl-cd-side .nsrl-ad-me { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; padding: 5px; color: inherit; background: transparent; border: 0; border-radius: 10px; text-align: left; }
#nsrl-cd-side .nsrl-ad-me__av { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 1px solid var(--nsrl-sidebar-border); border-radius: 50%; color: #d9faf3; background: rgba(255,255,255,.09); font-size: 12px; font-weight: 800; }
#nsrl-cd-side .nsrl-ad-me__name { overflow: hidden; color: var(--nsrl-sidebar-text); font-size: 12px; font-weight: 750; text-overflow: ellipsis; }
#nsrl-cd-side .nsrl-ad-me__role { margin-top: 3px; color: var(--nsrl-sidebar-muted); font-size: 11px; }
#nsrl-cd-side .nsrl-ad-ico--moon { display: none; }

/* Collapsed layout: keep a narrow, stable rail; hide all text labels. */
#nsrl-cd-side.is-collapsed { width: var(--nsrl-sidebar-collapsed-width); }
#nsrl-cd-side #nsrl-ad-side.is-collapsed .nsrl-ad-top { flex-direction: column; justify-content: center; gap: 10px; padding: 12px 6px; }
#nsrl-cd-side #nsrl-ad-side.is-collapsed .nsrl-ad-brand { flex: 0 0 auto; justify-content: center; width: 100%; }
#nsrl-cd-side #nsrl-ad-side.is-collapsed .nsrl-ad-brand__text,
#nsrl-cd-side #nsrl-ad-side.is-collapsed .nsrl-ad-link__text,
#nsrl-cd-side #nsrl-ad-side.is-collapsed .nsrl-ad-label,
#nsrl-cd-side #nsrl-ad-side.is-collapsed .nsrl-ad-me__txt { display: none !important; }
#nsrl-cd-side #nsrl-ad-side.is-collapsed .nsrl-ad-scroll { padding: 14px 7px; }
#nsrl-cd-side #nsrl-ad-side.is-collapsed .nsrl-ad-link { justify-content: center; gap: 0; padding: 12px 0; }
#nsrl-cd-side #nsrl-ad-side.is-collapsed .nsrl-ad-foot { flex-wrap: wrap; justify-content: center; padding: 10px 5px; }
#nsrl-cd-side #nsrl-ad-side.is-collapsed .nsrl-ad-me { flex: 0 0 100%; justify-content: center; padding: 5px 0; }

/* Light theme: dashboard-wide tokens are exposed on <html>. */
html[data-nsrl-theme="light"] {
  --nsrl-page-bg: #f3f7f5;
  --nsrl-card-bg: #ffffff;
  --nsrl-page-text: #172b22;
  --nsrl-page-muted: #6b8075;
  --nsrl-page-border: #dfe9e3;
}
html[data-nsrl-theme="dark"] {
  --nsrl-page-bg: #0d1712;
  --nsrl-card-bg: #14221a;
  --nsrl-page-text: #edf5f0;
  --nsrl-page-muted: #a0b2a7;
  --nsrl-page-border: #26382e;
}
html[data-nsrl-theme="light"] #nsrl-cd-side {
  --nsrl-sidebar-bg: #f0f8f4;
  --nsrl-sidebar-text: #16372a;
  --nsrl-sidebar-muted: #668174;
  --nsrl-sidebar-border: rgba(11,61,42,.13);
}
html[data-nsrl-theme="light"] #nsrl-cd-side .nsrl-ad-brand__sub { color: #118875; }
html[data-nsrl-theme="light"] #nsrl-cd-side .nsrl-ad-link.is-active { color: #073b2b; background: #9be9d8; border-color: #7ddac6; }
html[data-nsrl-theme="light"] #nsrl-cd-side .nsrl-ad-me__name { color: #173c2d; }
html[data-nsrl-theme="light"] #nsrl-cd-side .nsrl-ad-me__av { color: #0b5b45; background: #dcefe5; border-color: #c9e2d5; }
html[data-nsrl-theme="dark"] #nsrl-cd-side .nsrl-ad-ico--sun { display: none; }
html[data-nsrl-theme="dark"] #nsrl-cd-side .nsrl-ad-ico--moon { display: block; }

/* Optional: apply these tokens to the real main-content wrapper by adding
   class="nsrl-client-main" to that Elementor container. */
.nsrl-client-main {
  min-width: 0;
  color: var(--nsrl-page-text, inherit);
  background: var(--nsrl-page-bg, transparent);
  transition: color .2s ease, background .2s ease;
}
.nsrl-client-main .nsrl-card,
.nsrl-client-main .nsrl-dashboard-card,
.nsrl-client-main .nsrl-panel {
  color: var(--nsrl-page-text, inherit);
  background: var(--nsrl-card-bg, #fff);
  border-color: var(--nsrl-page-border, #e5e7eb);
}

@media (max-width: 767px) {
  html.nsrl-client-shell { --nsrl-client-sidebar-width: 76px; }
  html.nsrl-client-shell.nsrl-client-mobile-expanded { --nsrl-client-sidebar-width: min(280px, 86vw); }
  html.nsrl-client-shell body { padding-left: 76px !important; }
  html.nsrl-client-shell.nsrl-client-mobile-expanded body { padding-left: min(280px, 86vw) !important; }

  #nsrl-cd-side { --nsrl-sidebar-width: 76px; }
  #nsrl-cd-side:not(.mobile-expanded) { width: 76px; }
  #nsrl-cd-side:not(.mobile-expanded) #nsrl-ad-side .nsrl-ad-brand__text,
  #nsrl-cd-side:not(.mobile-expanded) #nsrl-ad-side .nsrl-ad-link__text,
  #nsrl-cd-side:not(.mobile-expanded) #nsrl-ad-side .nsrl-ad-label,
  #nsrl-cd-side:not(.mobile-expanded) #nsrl-ad-side .nsrl-ad-me__txt { display: none !important; }
  #nsrl-cd-side:not(.mobile-expanded) #nsrl-ad-side .nsrl-ad-top { flex-direction: column; justify-content: center; padding: 12px 6px; }
  #nsrl-cd-side:not(.mobile-expanded) #nsrl-ad-side .nsrl-ad-link { justify-content: center; padding: 12px 0; }
  #nsrl-cd-side:not(.mobile-expanded) #nsrl-ad-side .nsrl-ad-foot { flex-wrap: wrap; justify-content: center; padding: 10px 5px; }
  #nsrl-cd-side:not(.mobile-expanded) #nsrl-ad-side .nsrl-ad-me { flex: 0 0 100%; justify-content: center; }
  #nsrl-cd-side .nsrl-ad-collapse { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #nsrl-cd-side, #nsrl-cd-side * { transition-duration: 0s !important; }
}


/* ===== Compact admin-inspired rail refinements ===== */
/* The rail stays fixed; the document body remains visible beside it. */
#nsrl-cd-side .nsrl-ad-side {
  height: 100%;
}
#nsrl-cd-side .nsrl-ad-top {
  min-height: 82px;
}
#nsrl-cd-side .nsrl-ad-scroll {
  overscroll-behavior: contain;
}
#nsrl-cd-side .nsrl-ad-link.is-active {
  color: #0b3d2a;
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
#nsrl-cd-side .nsrl-ad-link.is-active .nsrl-ad-ico {
  color: #0b3d2a;
}
#nsrl-cd-side .nsrl-ad-brand__mark {
  background: #ffffff;
  color: #0b3d2a;
  border-radius: 11px;
}
#nsrl-cd-side .nsrl-ad-iconbtn {
  flex-shrink: 0;
}
#nsrl-cd-side.is-collapsed {
  width: 76px;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-top {
  min-height: 118px;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  padding: 24px 8px 10px;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-brand {
  flex: 0 0 40px;
  width: 42px;
  height: 40px;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-brand__mark {
  width: 42px;
  height: 40px;
  flex-basis: 42px;
  border-radius: 11px;
  font-size: 22px;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-top .nsrl-ad-collapse {
  width: 36px;
  height: 32px;
  flex-basis: 32px;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-scroll {
  padding: 12px 12px;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-nav__list {
  gap: 5px;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-link {
  min-height: 48px;
  width: 52px;
  margin: 0 auto;
  justify-content: center;
  padding: 12px 0;
  border-radius: 12px;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-link.is-active {
  background: #ffffff;
  color: #0b3d2a;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-foot {
  flex-direction: column;
  gap: 8px;
  padding: 12px 8px 14px;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-me {
  flex: 0 0 auto;
  width: 42px;
  justify-content: center;
  padding: 0;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-me__av {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}
#nsrl-cd-side.is-collapsed #nsrl-ad-side #nsrl-theme-toggle-btn {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}
@media (max-width: 767px) {
  #nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-top {
    min-height: 100px;
  }
  #nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-scroll {
    padding: 10px 7px;
  }
  #nsrl-cd-side.is-collapsed #nsrl-ad-side .nsrl-ad-link {
    width: 48px;
  }
}