/* Shared global navigation. Business pages must not restyle primary or secondary menus. */
.sidebar { font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif; }
.nav-item-group { display: grid; gap: 7px; }
.main-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(8, 20, 36, 0.18), rgba(18, 32, 58, 0.06));
  color: #d8e6ff;
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.14);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 7px auto 7px 0;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  transition: background 160ms ease, box-shadow 160ms ease, width 160ms ease;
}

.nav-item:hover {
  border-color: rgba(0, 229, 255, 0.72);
  background:
    linear-gradient(90deg, rgba(0, 229, 255, 0.14), rgba(124, 58, 237, 0.14) 52%, rgba(255, 43, 214, 0.08)),
    rgba(7, 17, 31, 0.72);
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.18),
    0 0 22px rgba(0, 229, 255, 0.22),
    inset 0 0 18px rgba(0, 229, 255, 0.1);
  transform: translateX(2px);
}

.nav-item:focus-visible {
  outline: 0;
  border-color: rgba(121, 127, 255, 0.92);
  box-shadow:
    0 0 0 2px rgba(121, 127, 255, 0.32),
    0 0 24px rgba(0, 229, 255, 0.25);
}

.nav-item svg {
  color: #20e7ff;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.42));
  transition: color 160ms ease, filter 160ms ease, transform 160ms ease;
}

.nav-item:hover svg {
  color: #79f7ff;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.72));
  transform: scale(1.05);
}

.nav-item.active {
  border-color: rgba(174, 73, 255, 0.82);
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.96) 0%, rgba(83, 57, 255, 0.86) 46%, rgba(255, 43, 214, 0.66) 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.22),
    0 0 22px rgba(168, 85, 247, 0.56),
    0 12px 30px rgba(79, 70, 229, 0.34),
    inset 0 0 20px rgba(255, 255, 255, 0.11);
}

.nav-item.active::before {
  width: 3px;
  background: #00e5ff;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.92);
}

.nav-item.active svg {
  color: #ffffff;
  filter:
    drop-shadow(0 0 10px rgba(0, 229, 255, 0.82))
    drop-shadow(0 0 16px rgba(255, 43, 214, 0.38));
}

.formal-settings-shell .nav-item {
  min-height: 44px;
  border-radius: 9px;
  padding: 0 11px;
  color: #d8e6ff;
  font-size: 14px;
}

.formal-settings-shell .nav-item svg {
  color: #20e7ff;
}

.formal-settings-shell .nav-item.active {
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.96) 0%, rgba(83, 57, 255, 0.86) 46%, rgba(255, 43, 214, 0.66) 100%);
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.22),
    0 0 22px rgba(168, 85, 247, 0.56),
    0 12px 30px rgba(79, 70, 229, 0.34),
    inset 0 0 20px rgba(255, 255, 255, 0.11);
}

.nav-item.disabled {
  cursor: not-allowed;
  opacity: 0.46;
  filter: saturate(0.4);
}

.nav-stage.debug-stage { color: #fbbf24; }

.nav-stage {
  margin-left: auto;
  display: none;
  color: #79f7ff;
  font-size: 10px;
}


/* Shared secondary navigation. Do not apply primary nav-item skins to children. */
.crm-sidebar-subnav {
  --crm-subnav-u: 1px;
  display: grid;
  gap: calc(4 * var(--crm-subnav-u));
  margin: calc(8 * var(--crm-subnav-u)) 0 calc(8 * var(--crm-subnav-u)) calc(20 * var(--crm-subnav-u));
}
.crm-sidebar-subnav > a, .crm-sidebar-subnav > span {
  display: flex;
  align-items: center;
  min-height: calc(33 * var(--crm-subnav-u));
  padding: 0 calc(16 * var(--crm-subnav-u));
  border: 0;
  border-radius: calc(6 * var(--crm-subnav-u));
  color: #98a7ba;
  font-size: calc(12 * var(--crm-subnav-u));
  font-weight: 600;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
  text-shadow: none;
  box-shadow: none;
}
.crm-sidebar-subnav > a:hover { color: #dce9ff; background: #202b3b; }
.crm-sidebar-subnav > a[aria-current="page"] {
  color: #dce9ff;
  background: #273d64;
  box-shadow: inset calc(3 * var(--crm-subnav-u)) 0 #70a0ff;
}
.crm-sidebar-subnav > a:focus-visible { outline: 2px solid #70a0ff; outline-offset: 2px; }
.crm-sidebar-subnav > span[aria-disabled="true"] { opacity: .5; }

@media (max-width: 1100px) { .main-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .main-nav { grid-template-columns: 1fr; } }
