/* Reusable nested resizable sidebar layout — nav uses main-sidebar__nav-btn */

.nested-sidebar-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--cdb-bg, hsl(0 0% 98%));
}

.nested-sidebar-layout__row {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.nested-sidebar__aside {
  flex-shrink: 0;
  align-self: stretch;
  width: var(--nested-sidebar-width, 200px);
  min-width: 160px;
  max-width: 280px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--cdb-sidebar-bg);
  border-right: 1px solid var(--cdb-sidebar-border);
  position: relative;
}

.nested-sidebar__header {
  flex-shrink: 0;
  height: 45px;
  min-height: 45px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--cdb-sidebar-border);
}

.nested-sidebar__back {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--cdb-primary);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 4px;
  text-align: left;
  transition: color 0.12s;
}

.nested-sidebar__back:hover {
  color: var(--cdb-primary-hover);
}

.nested-sidebar__back iconify-icon {
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 0.12s;
}

.nested-sidebar__back:hover iconify-icon {
  transform: translateX(-2px);
}

.nested-sidebar__back span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nested-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nested-sidebar__nav .main-sidebar__nav-btn {
  border-radius: 8px;
}

.nested-sidebar__nav .main-sidebar__nav-btn.active {
  border-right: none;
}

.nested-sidebar__resizer {
  width: 6px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  transition: background 0.12s;
  align-self: stretch;
}

.nested-sidebar__resizer:hover,
.nested-sidebar__resizer.is-dragging {
  background: hsl(221 83% 53% / 0.25);
}

.nested-sidebar__main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 80px 48px;
  box-sizing: border-box;
  background: var(--cdb-bg, hsl(0 0% 98%));
}

.nested-sidebar-panel {
  display: none;
  width: 100%;
  max-width: min(960px, 100%);
}

.nested-sidebar-panel.active {
  display: block;
}

.nested-sidebar-layout.nested-sidebar-resizing,
.profile-settings.nested-sidebar-resizing {
  user-select: none;
}

.community-editor-header__left {
  gap: 8px;
}

.community-editor-back {
  border: none;
  background: transparent;
  color: var(--cdb-muted);
  border-radius: 6px;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.community-editor-back:hover {
  color: var(--cdb-primary);
  background: var(--cdb-sidebar-hover);
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--cdb-card);
  border: 1px solid var(--cdb-border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 4px 10px -4px hsl(220 8.9% 15% / 0.06);
}

.member-row__main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.member-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--cdb-border);
  background: hsl(220 14% 96%);
}

.member-avatar__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--cdb-primary);
  background: hsl(221 83% 53% / 0.1);
}

.member-row__body {
  flex: 1;
  min-width: 0;
}

.member-row__body strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--cdb-fg);
}

.member-row__meta {
  display: block;
  font-size: 12px;
  color: var(--cdb-muted);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .nested-sidebar-layout__row {
    flex-direction: column;
  }

  .nested-sidebar__aside {
    width: 100% !important;
    max-width: none;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--cdb-sidebar-border);
  }

  .nested-sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
  }

  .nested-sidebar__resizer {
    display: none;
  }

  .nested-sidebar__main {
    padding: 20px 16px 32px;
  }
}
