.secondary-sidebar {
  width: 220px;
  height: 100vh;
  background: #0d0d1f;
  border-right: 1px solid #1e1e3a;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.75rem;
  gap: 0.75rem;
  overflow-y: auto;
  transition: width 0.25s ease;

  &.collapsed {
    width: 44px;
    padding: 1.25rem 0.5rem;
    overflow: hidden;
  }
}

.collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;

  &:hover { color: white; background: #1f2937; }
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: color 0.2s;
  width: fit-content;

  &:hover { color: white; }
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  padding: 0 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions-row {
  display: flex;
  gap: 0.4rem;
}

.btn-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, filter 0.15s;

  &.primary   { background: #6c63ff; color: white; }
  &.primary:hover { background: #5a52e0; }
  &.secondary { background: #2a2a3d; color: #d1d5db; }
  &.secondary:hover { background: #363650; }
}

.tree {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.tree-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: transparent;
  border: none;
  color: #d1d5db;
  font-size: 0.82rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;

  &:hover { background: #1f2937; }
  &.action { color: #6b7280; font-style: italic; }
  &.action:hover { color: #a5b4fc; background: #1f2937; }

  .tree-item-meta {
    margin-left: auto;
    font-size: 0.72rem;
    color: #6b7280;
    flex-shrink: 0;
  }
}

.item-icon {
  display: inline-flex;
  align-items: center;
  color: #a5b4fc;
  flex-shrink: 0;
  margin-right: 0.1rem;
}

.chevron-zone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  cursor: pointer;
  color: #6b7280;

  &:hover { background: #374151; color: white; }
}

.tree-children {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}


/* --- Bottom panel (ex: Templates) ------------------------------------- */
.bottom-panel {
  border-top: 1px solid #1e1e3a;
  padding-top: 0.5rem;
  margin-top: auto; /* colle en bas de la sidebar flex */
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;

  &:hover { background: #1f2937; }

  .panel-title { letter-spacing: 0.02em; }
}

.panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.panel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  color: #d1d5db;
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;

  &:hover { background: #1f2937; }

  &.action {
    color: #6b7280;
    font-style: italic;
  }
  &.action:hover { color: #a5b4fc; }

  .panel-item-meta {
    font-size: 0.72rem;
    color: #6b7280;
    flex-shrink: 0;
  }
}
