/* NarrowVision Portal Shell v2 — Phase 2
 * Global navigation/header presentation only.
 */
#dashboard .nv-shell-v2 {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

#dashboard .nv-sidebar-v2 {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 252px;
  height: 100vh;
  flex: 0 0 252px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 14px 20px;
  border-right: 1px solid rgba(77, 92, 124, .35);
  background:
    linear-gradient(180deg, rgba(16, 23, 43, .98), rgba(13, 20, 37, .97)),
    radial-gradient(circle at 20% 0, rgba(118, 82, 235, .12), transparent 42%);
  box-shadow: 14px 0 34px rgba(2, 6, 18, .14);
  backdrop-filter: blur(18px);
}

#dashboard .nv-sidebar-v2 .small-brand {
  position: relative;
  min-height: 176px;
  display: flex;
  align-items: center;
  padding: 6px 8px 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(76, 91, 121, .28);
}

#dashboard .nv-sidebar-v2 .small-brand .brand-logo {
  display: block;
  width: 156px;
  max-width: calc(100% - 8px);
  height: auto;
  max-height: none;
  margin: 0;
}

#dashboard .nv-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  overflow: visible;
}

#dashboard .nv-sidebar-v2 .nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 43px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #aab7d0;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

#dashboard .nv-sidebar-v2 .nav:hover {
  border-color: rgba(94, 109, 145, .22);
  background: rgba(54, 70, 105, .34);
  color: #edf2ff;
}

#dashboard .nv-sidebar-v2 .nav.active {
  border-color: rgba(151, 120, 255, .26);
  background:
    linear-gradient(90deg, rgba(108, 76, 205, .30), rgba(52, 53, 91, .46));
  color: #f7f4ff;
  box-shadow: inset 3px 0 0 var(--nv-accent);
}

#dashboard .nv-sidebar-v2 .nav.active::after {
  content: '';
  position: absolute;
  right: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b99cff;
  box-shadow: 0 0 12px rgba(185, 156, 255, .75);
}

#dashboard .nv-nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  color: #7f90b3;
}

#dashboard .nv-nav-icon svg {
  display: block;
  width: 19px;
  height: 19px;
}

#dashboard .nav:hover .nv-nav-icon,
#dashboard .nav.active .nv-nav-icon {
  color: #b99cff;
}

#dashboard .nv-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashboard .nv-portal-v2 {
  width: calc(100% - 252px);
  max-width: none;
  padding: 0 34px 34px;
}

#dashboard .nv-topbar-v2 {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 70px;
  margin: 0 -2px;
  padding: 12px 2px 13px;
  border-bottom: 1px solid rgba(64, 79, 108, .23);
  background:
    linear-gradient(180deg, rgba(11, 16, 32, .94), rgba(11, 16, 32, .82) 76%, rgba(11, 16, 32, 0));
  backdrop-filter: blur(18px);
}

#dashboard .nv-topbar-v2::after {
  content: '';
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: linear-gradient(90deg, rgba(116, 87, 232, .20), rgba(87, 108, 178, .14), transparent 82%);
  pointer-events: none;
}

#dashboard .nv-header-identity {
  min-width: 0;
  margin-right: auto;
}

#dashboard .nv-header-identity:not(.customer-identity) {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(68, 84, 115, .28);
  border-radius: 9px;
  background: rgba(20, 29, 49, .58);
  color: #bac6dc;
  font-size: 12px;
}

#dashboard .customer-identity.nv-header-identity {
  gap: 2px;
}

#dashboard .customer-identity.nv-header-identity .customer-identity-org {
  color: #f0f3fd;
  font-size: 13px;
  font-weight: 750;
}

#dashboard .customer-identity.nv-header-identity .customer-identity-person {
  color: #8f9db8;
  font-size: 11px;
}

#dashboard .nv-topbar-v2 .nv-language-bar {
  margin-left: auto;
}

#dashboard .nv-header-logout {
  min-height: 36px;
  padding: 8px 11px;
  border-color: rgba(72, 88, 120, .48);
  background: rgba(26, 37, 60, .70);
  font-size: 12px;
}

#dashboard .nv-mobile-menu,
#dashboard .nv-mobile-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--nv-border);
  border-radius: var(--nv-radius-sm);
  background: rgba(25, 36, 60, .86);
  color: var(--nv-text);
}

#dashboard .nv-mobile-menu svg,
#dashboard .nv-mobile-close svg {
  width: 20px;
  height: 20px;
}

#dashboard .nv-nav-backdrop {
  display: none;
}

@media (max-width: 1100px) {
  #dashboard .nv-sidebar-v2 {
    width: 228px;
    flex-basis: 228px;
  }

  #dashboard .nv-portal-v2 {
    width: calc(100% - 228px);
    padding-inline: 24px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.nv-nav-open {
    overflow: hidden;
  }

  #dashboard .nv-shell-v2 {
    display: block;
  }

  #dashboard .nv-sidebar-v2 {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 120;
    width: min(84vw, 304px);
    height: 100dvh;
    padding: 15px 13px 24px;
    border-right: 1px solid rgba(98, 113, 150, .50);
    transform: translateX(-104%);
    transition: transform 190ms ease;
    box-shadow: 22px 0 60px rgba(0, 0, 0, .42);
  }

  body.nv-nav-open #dashboard .nv-sidebar-v2 {
    transform: translateX(0);
  }

  #dashboard .nv-sidebar-v2 .small-brand {
    min-height: 158px;
    margin-bottom: 10px;
    padding: 4px 4px 14px 7px;
  }

  #dashboard .nv-sidebar-v2 .small-brand .brand-logo {
    width: 144px;
    max-width: calc(100% - 52px);
  }

  #dashboard .nv-mobile-close {
    display: inline-flex;
    margin-left: auto;
    border-color: transparent;
    background: transparent;
  }

  #dashboard .nv-mobile-menu {
    display: inline-flex;
    flex: 0 0 auto;
  }

  #dashboard .nv-nav-groups {
    display: flex;
    overflow: visible;
    gap: 18px;
  }

  #dashboard .nv-sidebar-v2 .nav {
    width: 100%;
    white-space: normal;
  }

  #dashboard .nv-portal-v2 {
    width: 100%;
    max-width: none;
    padding: 0 18px 24px;
  }

  #dashboard .nv-topbar-v2 {
    min-height: 62px;
    padding: 10px 0 11px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  #dashboard .nv-header-identity {
    flex: 1 1 auto;
    overflow: hidden;
  }

  #dashboard .nv-header-identity:not(.customer-identity) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #dashboard .customer-identity.nv-header-identity {
    min-width: 0;
  }

  #dashboard .customer-identity.nv-header-identity .customer-identity-org,
  #dashboard .customer-identity.nv-header-identity .customer-identity-person {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #dashboard .nv-topbar-v2 .nv-language-caption {
    display: none;
  }

  #dashboard .nv-topbar-v2 .nv-language-bar {
    margin-left: 0;
  }

  #dashboard .nv-header-logout {
    flex: 0 0 auto;
    padding-inline: 9px;
  }

  #dashboard .nv-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: block;
    visibility: hidden;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(3, 7, 18, .66);
    opacity: 0;
    pointer-events: none;
    transition: opacity 170ms ease, visibility 170ms ease;
    backdrop-filter: blur(3px);
  }

  body.nv-nav-open #dashboard .nv-nav-backdrop {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 520px) {
  #dashboard .nv-portal-v2 {
    padding-inline: 14px;
  }

  #dashboard .nv-header-logout {
    font-size: 0;
    width: 38px;
    min-width: 38px;
    padding: 0;
  }

  #dashboard .nv-header-logout::before {
    content: '↗';
    font-size: 17px;
    transform: rotate(180deg);
  }

  #dashboard .nv-topbar-v2 .nv-language-bar {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  #dashboard .nv-sidebar-v2,
  #dashboard .nv-nav-backdrop {
    transition-duration: .01ms;
  }
}

@media (forced-colors: active) {
  #dashboard .nv-sidebar-v2,
  #dashboard .nv-topbar-v2 {
    background: Canvas;
    border-color: CanvasText;
  }
}
