/* ── client-select custom dropdown ───────────────────────── */
.client-select { position: relative; }

/* Trigger button — mirrors Bootstrap .form-select */
.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  padding: .375rem .75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.cs-trigger.cs-sm {
  padding: .25rem .5rem;
  font-size: .875rem;
  border-radius: .25rem;
}
.cs-trigger:focus,
.cs-open .cs-trigger {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}
.cs-trigger.cs-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 .25rem rgba(220, 53, 69, .25);
}
.cs-trigger:disabled,
.cs-trigger[aria-disabled="true"] {
  background-color: #e9ecef;
  opacity: 1;
  cursor: default;
  pointer-events: none;
}

.cs-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-placeholder { color: #6c757d; }

.cs-arrow {
  font-size: .75rem;
  color: #6c757d;
  flex-shrink: 0;
  transition: transform .15s;
}
.cs-open .cs-arrow { transform: rotate(180deg); }

/* Panel */
.cs-panel {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 1050;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
  overflow: hidden;
}

/* Search */
.cs-search-wrap {
  padding: .5rem;
  border-bottom: 1px solid #f0f0f0;
}
.cs-search {
  display: block;
  width: 100%;
  padding: .3rem .6rem;
  font-size: .875rem;
  border: 1px solid #dee2e6;
  border-radius: .25rem;
  outline: none;
  box-sizing: border-box;
}
.cs-search:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
}

/* Lists */
.cs-list {
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .45rem .75rem;
  font-size: .9rem;
  cursor: pointer;
  user-select: none;
}
.cs-item:hover { background: #f8f9fa; }
.cs-item.cs-selected { background: #e7f1ff; font-weight: 500; }

.cs-arrow-right { font-size: .7rem; color: #adb5bd; flex-shrink: 0; }
.cs-parent-hint { font-size: .78rem; color: #adb5bd; }

/* Subsidiary panel header */
.cs-subs-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .75rem;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-size: .875rem;
  font-weight: 600;
}
.cs-back {
  background: none;
  border: none;
  padding: 0;
  font-size: .8rem;
  color: #0d6efd;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-shrink: 0;
  line-height: 1;
}
.cs-back:hover { text-decoration: underline; }
.cs-subs-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #495057;
}

/* "Select parent directly" row */
.cs-item-self {
  font-style: italic;
  color: #6c757d;
  border-bottom: 1px solid #f0f0f0;
  font-size: .85rem;
}
.cs-item-self:hover { background: #f8f9fa; }

.cs-empty { padding: .75rem; font-size: .875rem; color: #adb5bd; text-align: center; }
