.sided__sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 290px;
  padding: var(--spacing-xl) var(--spacing-md) var(--spacing-4xl) var(--spacing-lg);
  background-color: #FBFAF8;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--spacing-3xs);
  box-shadow: inset 2px 4px 130px 18px rgba(0, 0, 0, 0.01);
  border-right: 1px solid var(--color-border-soft);
}

/* Only the pot list scrolls; every flex wrapper between it and the sidebar
   must be allowed to shrink below its content for that to happen. */
.sidebar__body,
.sidebar__pots,
.sidebar__pots__section {
  min-height: 0;
}

.sidebar__pots__list {
  min-height: 0;
  overflow-y: auto;
}

.sidebar__pot {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  background-color: var(--sidebar-pot-background, transparent);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--rounded-xs);
  transition: background-color 0.15s ease;

  &:hover {
    --sidebar-pot-background: var(--background-neutral);
  }

  &:active {
    --sidebar-pot-background: #F6F4F0;
    box-shadow: inset -8px 0px 20px 0px rgba(0, 0, 0, 0.03);
  }
}

.sidebar__pot--active {
  --sidebar-pot-background: #F6F4F0;
  box-shadow: inset -8px 0px 20px 0px rgba(0, 0, 0, 0.03);

  &:hover {
    --sidebar-pot-background: #F6F4F0;
    box-shadow: inset -8px 0px 20px 0px rgba(0, 0, 0, 0.03);
  }
}

.sidebar__pot-visual {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--rounded-3xs);
  background: var(
    --sidebar-pot-visual-gradient,
    linear-gradient(
      135deg,
      rgb(163 251 174 / 100%) 0%,
      rgb(196 214 110 / 75%) 32%,
      rgb(121 138 221 / 66%) 62%,
      rgb(152 46 228 / 57%) 100%
    )
  );
}

.sidebar__pot:nth-child(6n + 1) .sidebar__pot-visual {
  --sidebar-pot-visual-gradient: linear-gradient(
    135deg,
    rgb(163 251 174 / 100%) 0%,
    rgb(196 214 110 / 75%) 32%,
    rgb(121 138 221 / 66%) 62%,
    rgb(152 46 228 / 57%) 100%
  );
}

.sidebar__pot:nth-child(6n + 2) .sidebar__pot-visual {
  --sidebar-pot-visual-gradient: linear-gradient(
    135deg,
    rgb(255 227 171 / 100%) 0%,
    rgba(246, 250, 145, 0.82) 38%,
    rgba(237, 82, 209, 0.7) 68%,
    rgba(244, 185, 82, 0.62) 100%
  );
}

.sidebar__pot:nth-child(6n + 3) .sidebar__pot-visual {
  --sidebar-pot-visual-gradient: linear-gradient(
    135deg,
    rgb(180 246 255 / 100%) 0%,
    rgb(128 204 255 / 82%) 34%,
    rgba(183, 241, 102, 0.7) 66%,
    rgba(87, 191, 220, 0.62) 100%
  );
}

.sidebar__pot:nth-child(6n + 4) .sidebar__pot-visual {
  --sidebar-pot-visual-gradient: linear-gradient(
    135deg,
    rgb(255 214 214 / 100%) 0%,
    rgba(195, 106, 249, 0.82) 36%,
    rgb(255 147 201 / 70%) 68%,
    rgb(176 117 255 / 62%) 100%
  );
}

.sidebar__pot:nth-child(6n + 5) .sidebar__pot-visual {
  --sidebar-pot-visual-gradient: linear-gradient(
    135deg,
    rgb(200 255 209 / 100%) 0%,
    rgba(249, 185, 130, 0.82) 34%,
    rgb(111 204 227 / 70%) 66%,
    rgb(94 134 255 / 62%) 100%
  );
}

.sidebar__pot:nth-child(6n + 6) .sidebar__pot-visual {
  --sidebar-pot-visual-gradient: linear-gradient(
    135deg,
    rgb(247 239 189 / 100%) 0%,
    rgba(245, 228, 99, 0.82) 36%,
    rgba(85, 246, 238, 0.7) 67%,
    rgba(106, 67, 237, 0.62) 100%
  );
}

/* Lets a title made of one long word be clipped by the line clamp below
   instead of widening the row. */
.sidebar__pot__text {
  min-width: 0;
}

.sidebar__pot__title {
  font-weight: var(--font-weight-semibold);
  color: var(--interactive-primary);
  display: -webkit-box;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;  
  overflow: hidden;
}

.sidebar__pot__status {
  width: 10px;
  height: 10px;
  border-radius: var(--rounded-full);
  background-color: var(--interactive-primary);
}

.sidebar__pot__status--success {
  background-color: var(--active-green);
}

.sidebar__pot__status--danger {
  background-color: #E08A8A;
}

.sidebar__new-fund-btn {
  background-color: white;
  border: 1px solid var(--color-border-soft);
  color: #284D23;
  font-weight: var(--font-weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--spacing-2xs);
  padding: var(--spacing-md) var(--spacing-md);
  border-radius: var(--rounded-xs);
  transition: background-color 0.15s ease;

  &:hover {
    background-color: var(--background-neutral);
  }
}


.sidebar__new-fund-btn svg, .sidebar__link svg {
  height: 24px;
  width: 24px;
  max-width: initial;
  stroke-width: 1.75;
}

.sidebar__link {
  color: var(--interactive-primary);
  font-weight: var(--font-weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--spacing-2xs);
  padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-xs);
  border-radius: var(--rounded-xs);
  transition: background-color 0.15s ease;

  &:hover {
    background-color: var(--background-neutral);
  }
}

.sided__main {
  margin-left: 290px;
  padding: var(--spacing-xl) var(--spacing-4xl) var(--spacing-4xl) var(--spacing-5xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3xl);
}

.sided__main__header__title {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
}

.sided__main__header__title__text {
  font-size: var(--unit-32);
  line-height: 40px;
  font-weight: var(--font-weight-bold);
  display: -webkit-box;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;  
  overflow: hidden;
  gap: 2px;
}

.sided__main__header__title__status {
  font-size: var(--unit-12);
}

.sided__main__header__title__status--success {
  color: #4F8F2C;
}

.sided__main__header__title__status--danger {
  color: #982626;
}

.sided__main__content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  flex: 3;
}

.sided__main__sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  flex: 2;
}


@media (max-width: 1200px) {
  .sided__sidebar {
    visibility: hidden;
    padding: var(--spacing-sm);
    height: 100dvh;
    overflow-y: auto;
    width: 100%;
    justify-content: flex-start;
    gap: var(--spacing-3xl);
    z-index: var(--z-sidebar);
    transform: translateX(-100%);
    /* Closing: accelerate out, quicker than open; visibility flips once offscreen */
    transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1), visibility 0s 0.2s;
  }

  .sided__sidebar.active {
    visibility: visible;
    transform: translateX(0);
    /* Opening: start fast, decelerate into place; visibility flips instantly */
    transition: transform 0.25s cubic-bezier(0, 0, 0.2, 1), visibility 0s;
  }

  body:has(.sided__sidebar.active) {
    overflow: hidden;
  }

  /* The whole sidebar scrolls here, so nothing shrinks. */
  .sidebar__body,
  .sidebar__pots,
  .sidebar__pots__section,
  .sidebar__pots__list {
    min-height: auto;
  }

  .sidebar__pots__list {
    overflow-y: visible;
  }

  .sided__main {
    margin-left: 0;
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-4xl) var(--spacing-sm);
    gap: var(--spacing-lg);
  }

  .sided__main__header__title {
    gap: var(--spacing-2xs);
  }

  .sided__main__header__title__text {
    font-size: var(--unit-18);
    line-height: 18px;
    margin-top: 2px;
  }
}
