:host {
  display: block;
}

.side-menu {
  display: grid;
  gap: 14px;
  padding: 20px 18px;
  position: sticky;
  top: 24px;
  border: 1px solid var(--card-frame);
  border-radius: var(--radius-2xl);
  background:
    linear-gradient(180deg, rgba(253, 252, 249, 0.98), rgba(246, 241, 232, 0.95)),
    linear-gradient(180deg, rgba(19, 71, 112, 0.04), transparent 24%);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.side-menu__brand,
.side-menu__brand-copy,
.side-menu__section,
.side-menu__nav,
.side-menu__session,
.side-menu__tree {
  display: grid;
  gap: 6px;
}

.side-menu__brand {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.side-menu__brand-copy h2 {
  margin: 0;
  font-size: clamp(1.16rem, 1.25vw, 1.48rem);
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.side-menu__copy,
.side-menu__helper,
.side-menu__session span,
.nav-node__link span,
.nav-child span {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.side-menu__governance {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 12%, var(--line));
  background: linear-gradient(180deg, rgba(248, 243, 235, 0.92), rgba(255, 255, 255, 0.84));
}

.side-menu__snapshot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.snapshot-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--card-frame);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.snapshot-card strong {
  font-size: 1.08rem;
  line-height: 1.35;
}

.side-menu__section--features {
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.side-menu__link,
.nav-node__link,
.nav-child {
  display: grid;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.side-menu__link {
  padding: 10px 12px 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--card-frame);
  background: rgba(255, 255, 255, 0.76);
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.side-menu__link::after,
.nav-node__link::after,
.nav-child::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.32) 48%, transparent 100%);
  opacity: 0;
  transform: translateX(-22%);
  pointer-events: none;
  transition: opacity 180ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.side-menu__link:hover,
.side-menu__link.active {
  transform: translateY(-1px);
  border-color: var(--card-frame-strong);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(20, 30, 48, 0.08);
}

.side-menu__link.active {
  box-shadow:
    inset 3px 0 0 var(--brand-secondary),
    0 12px 28px rgba(20, 30, 48, 0.08);
}

.side-menu__link:hover::after,
.nav-node__link:hover::after,
.nav-child:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.side-menu__link:focus-visible,
.nav-node__link:focus-visible,
.nav-child:focus-visible,
.nav-node__toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand-secondary) 58%, white);
  outline-offset: 2px;
}

.side-menu__link--feature {
  background: rgba(247, 243, 235, 0.92);
}

.nav-node {
  --nav-tone: var(--brand-secondary);
  --nav-tone-soft: rgba(191, 146, 63, 0.12);
  display: grid;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid var(--card-frame-soft);
  background: rgba(255, 255, 255, 0.62);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.nav-node--open,
.nav-node--active {
  border-color: var(--card-frame-strong);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(20, 30, 48, 0.08);
}

.nav-node__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.nav-node__link {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 180ms ease, transform 180ms ease, box-shadow 220ms ease, color 180ms ease;
  position: relative;
  overflow: hidden;
}

.nav-node__link strong,
.nav-child strong,
.side-menu__link strong {
  font-size: 0.9rem;
  line-height: 1.3;
  font-weight: 800;
}

.nav-node__copy,
.nav-child__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nav-node__copy strong,
.nav-node__copy span,
.nav-child__copy strong,
.nav-child__copy span,
.side-menu__link strong,
.side-menu__link span {
  overflow-wrap: anywhere;
}

.nav-node__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-primary) 28%, white), color-mix(in srgb, var(--brand-primary) 14%, rgba(255, 255, 255, 0.94)));
  border: 1px solid var(--card-frame-strong);
  color: color-mix(in srgb, var(--brand-primary) 82%, black 18%);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.nav-node__link:hover,
.nav-node__link.active {
  background: linear-gradient(180deg, rgba(247, 243, 235, 0.98), rgba(255, 255, 255, 0.95));
  transform: translateY(-1px);
  box-shadow: inset 3px 0 0 var(--nav-tone), 0 8px 18px rgba(20, 30, 48, 0.05);
}

.nav-node__link:hover .nav-node__icon,
.nav-node__link.active .nav-node__icon {
  border-color: var(--card-frame-strong);
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-primary) 36%, white), color-mix(in srgb, var(--brand-primary) 20%, rgba(247, 243, 235, 0.96)));
}

.nav-node__toggle {
  width: 30px;
  height: 30px;
  border: 1px solid var(--card-frame);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 220ms ease, box-shadow 180ms ease;
}

.nav-node__toggle:hover {
  background: rgba(247, 243, 235, 0.98);
  border-color: var(--card-frame-strong);
  box-shadow: 0 6px 14px rgba(20, 30, 48, 0.06);
  transform: translateY(-1px);
}

.nav-node__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-node--open .nav-node__chevron {
  transform: rotate(180deg);
}

.nav-node__children {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0.65;
  transition: grid-template-rows 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
}

.nav-node__children--open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.nav-node__children-inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 6px;
  padding: 2px 2px 4px 10px;
}

.nav-child {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-radius: 10px;
  background: rgba(247, 243, 235, 0.62);
  border: 1px solid var(--card-frame-soft);
  transition: border-color 180ms ease, background 180ms ease, transform 200ms ease, box-shadow 200ms ease, color 180ms ease;
}

.nav-child::before {
  content: '';
  position: absolute;
  inset-inline-start: -8px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: rgba(25, 35, 58, 0.16);
}

.nav-child__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--nav-tone) 80%, white);
  margin-top: 6px;
  box-shadow: 0 0 0 4px var(--nav-tone-soft);
}

.nav-child:hover,
.nav-child.active {
  transform: translate3d(0, -1px, 0);
  border-color: color-mix(in srgb, var(--nav-tone) 20%, rgba(25, 35, 58, 0.14));
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 20px rgba(20, 30, 48, 0.06);
}

.nav-child.active {
  box-shadow: inset 3px 0 0 var(--nav-tone), 0 10px 20px rgba(20, 30, 48, 0.06);
}

.side-menu__session {
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.eyebrow,
.meta-label {
  display: block;
  margin: 0;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.66rem;
}

:host-context(.rtl) .nav-node__link:hover,
:host-context(.rtl) .nav-node__link.active,
:host-context(.rtl) .side-menu__link.active,
:host-context(.rtl) .nav-child.active {
  box-shadow: inset -3px 0 0 var(--nav-tone), 0 10px 20px rgba(20, 30, 48, 0.06);
}

.cashline-logo {
  display: block;
  height: auto;
  object-fit: contain;
}

.cashline-logo--compact {
  width: 172px;
  min-width: 172px;
}

@media (max-width: 1240px) {
  .side-menu {
    position: static;
  }
}

@media (max-width: 720px) {
  .side-menu {
    padding: 16px;
  }

  .side-menu__snapshot {
    grid-template-columns: 1fr;
  }

  .cashline-logo--compact {
    width: 146px;
    min-width: 146px;
  }

  .nav-node__link,
  .nav-child {
    grid-template-columns: 1fr;
  }

  .nav-node__icon,
  .nav-child__dot {
    display: none;
  }
}
