/* Tom Select — CoreUI 主题适配 */

/* 基础覆写：与 CoreUI form-select 保持一致 */
.ts-wrapper .ts-control {
  border: 1px solid #d8dbe0;
  border-radius: 0.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  background-color: #fff;
  color: rgba(44, 56, 74, 1);
  min-height: auto;
}

.ts-wrapper .ts-control > input {
  font-size: inherit;
  line-height: inherit;
}

/* focus 状态 */
.ts-wrapper.focus .ts-control {
  border-color: #9589e5;
  box-shadow: 0 0 0 0.25rem rgba(88, 86, 214, 0.25);
}

/* 下拉面板 */
.ts-wrapper .ts-dropdown {
  background-color: #fff;
  border: 1px solid #d8dbe0;
  border-radius: 0.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ts-wrapper .ts-dropdown .ts-dropdown-content .option {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: rgba(44, 56, 74, 1);
}

.ts-wrapper .ts-dropdown .ts-dropdown-content .option.active {
  background-color: rgba(88, 86, 214, 0.1);
  color: #5856d6;
}

.ts-wrapper .ts-dropdown .ts-dropdown-content .option.selected {
  background-color: #5856d6;
  color: #fff;
}

/* 紧凑变体（对应 form-select-sm） */
.ts-wrapper.ts-sm .ts-control {
  padding: 0.25rem 0.5rem;
  font-size: 0.76563rem;
  border-radius: 0.2rem;
}

.ts-wrapper.ts-sm .ts-dropdown .ts-dropdown-content .option {
  padding: 0.25rem 0.5rem;
  font-size: 0.76563rem;
}

/* 清除按钮 */
.ts-wrapper .ts-control > .item {
  line-height: inherit;
}

/* Dark mode */
[data-coreui-theme="dark"] .ts-wrapper .ts-control {
  background-color: #1a1e26;
  border-color: #3a3f4b;
  color: rgba(255, 255, 255, 0.87);
}

[data-coreui-theme="dark"] .ts-wrapper.focus .ts-control {
  border-color: #9589e5;
}

[data-coreui-theme="dark"] .ts-wrapper .ts-dropdown {
  background-color: #232a34;
  border-color: #3a3f4b;
}

[data-coreui-theme="dark"] .ts-wrapper .ts-dropdown .ts-dropdown-content .option {
  color: rgba(255, 255, 255, 0.87);
}

[data-coreui-theme="dark"] .ts-wrapper .ts-dropdown .ts-dropdown-content .option.active {
  background-color: rgba(88, 86, 214, 0.2);
  color: #b3b0f5;
}

[data-coreui-theme="dark"] .ts-wrapper .ts-dropdown .ts-dropdown-content .option.selected {
  background-color: #5856d6;
  color: #fff;
}
