#main-nav {
  min-height: 0;
  padding: 0 2px 14px;
}

.nav-group {
  margin: 1px 0;
}

.nav-module {
  min-height: 40px;
}

.nav-module b {
  flex: 1;
  font: 700 13px 'DM Sans', sans-serif;
}

.nav-module em {
  margin-left: auto;
  color: #789899;
  font-size: 13px;
  font-style: normal;
  transition: transform .18s ease;
}

.nav-group.open > .nav-module em {
  transform: rotate(180deg);
}

.nav-children {
  display: none;
  position: relative;
  margin: 1px 0 5px 19px;
  padding: 1px 0 3px 13px;
}

.nav-children::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: #355658;
}

.nav-group.open > .nav-children {
  display: block;
}

.nav-children .nav-item {
  min-height: 31px;
  padding: 6px 9px;
  color: #91abad;
  font-size: 11px;
  font-weight: 600;
}

.nav-children .nav-item:hover,
.nav-children .nav-item.active {
  background: #183537;
  color: #fff;
}

.nav-item.module-active {
  background: rgba(85, 217, 195, .08);
  color: #fff;
}

.nav-item.module-active > span {
  color: #65dcc9;
}

.nav-children .nav-item.active::before {
  left: -14px;
  top: 8px;
  bottom: 8px;
}

.nav-subgroup {
  margin: 3px 0 2px;
}

.nav-subgroup-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #87a4a5;
  font: 700 10px 'DM Sans', sans-serif;
  letter-spacing: .5px;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-subgroup-toggle:hover {
  background: #183537;
  color: #fff;
}

.nav-subgroup-toggle span {
  width: 17px;
  color: #55bdae;
  font-size: 9px;
}

.nav-subgroup-toggle em {
  margin-left: auto;
  font-style: normal;
  transition: transform .18s ease;
}

.nav-subgroup.open > .nav-subgroup-toggle em {
  transform: rotate(180deg);
}

.nav-subchildren {
  display: none;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px dashed #3a5b5c;
}

.nav-subgroup.open > .nav-subchildren {
  display: block;
}

.nav-subchildren .nav-item {
  min-height: 29px;
  padding-left: 8px;
  font-size: 10px;
}

.module-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid #dce9e7;
  border-radius: 12px;
  background: linear-gradient(125deg, #fff 0%, #f4fbf9 72%, #e3f5f0 100%);
}

.module-hero h2 {
  margin: 0 0 6px;
  font: 800 24px Manrope, sans-serif;
  letter-spacing: -.7px;
}

.module-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.module-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.module-link {
  min-height: 118px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.module-link:hover {
  border-color: #82cabd;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.module-link > span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-bottom: 11px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--teal);
  font-size: 16px;
}

.module-link b,
.module-link small {
  display: block;
}

.module-link b {
  margin-bottom: 4px;
  font: 700 12px Manrope, sans-serif;
}

.module-link small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.party-group-code {
  display: inline-flex;
  min-width: 36px;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid #bfe2da;
  border-radius: 11px;
  background: #edf9f5;
  color: #087867;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
}

@media (max-width: 1050px) {
  .module-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .module-hero { grid-template-columns: 1fr; }
  .module-links { grid-template-columns: 1fr; }
}

/* Sidebar appearance themes live in this always-served navigation stylesheet. */
:root {
  --sidebar-strong: #ffffff;
  --sidebar-text: #bdd0d0;
  --sidebar-muted: #9bb3b4;
  --sidebar-border: #2e4c4d;
  --sidebar-panel: rgba(255, 255, 255, 0.08);
  --sidebar-panel-border: rgba(255, 255, 255, 0.1);
  --sidebar-accent: #55d9c3;
  --sidebar-accent-deep: #1c6260;
}

html[data-sidebar-theme="midnight"] {
  --nav: #121a2b;
  --nav-soft: #25314a;
  --sidebar-strong: #ffffff;
  --sidebar-text: #c6d0e3;
  --sidebar-muted: #93a1bd;
  --sidebar-border: #34415c;
  --sidebar-panel: rgba(135, 157, 198, 0.11);
  --sidebar-panel-border: rgba(173, 192, 228, 0.14);
  --sidebar-accent: #78a8ff;
  --sidebar-accent-deep: #355fba;
}

html[data-sidebar-theme="forest"] {
  --nav: #163127;
  --nav-soft: #284c3d;
  --sidebar-strong: #fffef8;
  --sidebar-text: #c7dbd0;
  --sidebar-muted: #9bb9a8;
  --sidebar-border: #375848;
  --sidebar-panel: rgba(225, 242, 231, 0.09);
  --sidebar-panel-border: rgba(225, 242, 231, 0.13);
  --sidebar-accent: #79d79e;
  --sidebar-accent-deep: #2c8150;
}

html[data-sidebar-theme="light"] {
  --nav: #f7f1e7;
  --nav-soft: #e9dfcf;
  --sidebar-strong: #273534;
  --sidebar-text: #4f6461;
  --sidebar-muted: #748480;
  --sidebar-border: #d7cbb9;
  --sidebar-panel: rgba(255, 255, 255, 0.54);
  --sidebar-panel-border: rgba(76, 98, 93, 0.17);
  --sidebar-accent: #168f7d;
  --sidebar-accent-deep: #8bc8bb;
}

.sidebar {
  color: var(--sidebar-text);
  border-right-color: var(--sidebar-border);
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.sidebar::after {
  background: linear-gradient(var(--sidebar-accent), var(--sidebar-accent-deep) 50%, transparent);
}

.sidebar .brand,
.sidebar .company-switcher,
.sidebar .sidebar-foot b {
  color: var(--sidebar-strong);
}

.sidebar .company-switcher {
  background: var(--sidebar-panel);
  border-color: var(--sidebar-panel-border);
}

.sidebar .company-switcher small,
.sidebar .sidebar-foot small,
.sidebar .sidebar-theme-copy small,
.sidebar .nav-label {
  color: var(--sidebar-muted);
}

.sidebar .nav-item,
.sidebar .nav-item span,
.sidebar .sidebar-foot button {
  color: var(--sidebar-text);
}

.sidebar .nav-item:hover,
.sidebar .nav-item.active,
.sidebar .nav-item.module-active {
  color: var(--sidebar-strong);
}

.sidebar .nav-item.active span,
.sidebar .nav-item.module-active > span {
  color: var(--sidebar-accent);
}

.sidebar .nav-item.active::before {
  background: var(--sidebar-accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--sidebar-accent) 55%, transparent);
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-theme-control {
  display: flex;
  align-items: center;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(23, 33, 43, 0.07);
}

.sidebar-theme-control[hidden] {
  display: none;
}

.sidebar-theme-options {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-theme-options button {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.sidebar-theme-options button:hover {
  background: #f1f4f4;
}

.sidebar-theme-options button[data-selected="true"] {
  background: #eef3f2;
  box-shadow: inset 0 0 0 2px #687b79;
}

.sidebar-theme-options button:focus-visible {
  outline: 2px solid #168f7d;
  outline-offset: 2px;
}

.theme-swatch {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(10, 24, 25, 0.24);
}

.theme-swatch.teal { background: #10272b; }
.theme-swatch.midnight { background: #5267c8; }
.theme-swatch.forest { background: #287554; }
.theme-swatch.light { background: #f0dcc0; }

.sidebar .sidebar-foot {
  margin-top: 0;
  border-top-color: var(--sidebar-border);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

@media (max-width: 760px) {
  .sidebar-theme-control { padding: 4px; }
  .sidebar-theme-options { gap: 2px; }
  .sidebar-theme-options button { width: 21px; height: 21px; }
  .theme-swatch { width: 14px; height: 14px; }
}
