:root{--ts-pr-clear-button:0;--ts-pr-caret:0;--ts-pr-min:.75rem}.ts-wrapper.single .ts-control,.ts-wrapper.single .ts-control input{cursor:pointer}.ts-control{padding-right:max(var(--ts-pr-min),var(--ts-pr-clear-button) + var(--ts-pr-caret))!important}
.ts-wrapper.plugin-drag_drop.multi>.ts-control>div.ui-sortable-placeholder{box-shadow:inset 0 0 12px 4px #fff;visibility:visible!important;background:#0000000f!important;border:0!important}.ts-wrapper.plugin-drag_drop .ui-sortable-placeholder:after{content:"!";visibility:hidden}.ts-wrapper.plugin-drag_drop .ui-sortable-helper{box-shadow:0 2px 5px #0003}

/* اصلاح پوزیشن و استایل چک‌باکس‌ها در tom-select dropdown */
.plugin-checkbox_options .option {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  gap: 8px;
}

.plugin-checkbox_options .option input {
  position: relative;
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #777; /* رنگ اصلی برای چک‌باکس (اختیاری) */
  flex-shrink: 0;
}

.plugin-checkbox_options .option label {
  display: inline-block;
  margin: 0;
  cursor: pointer;
  flex: 1;
  color: #1f2937;
  font-size: 14px;
}

/* استایل hover برای بهتر دیده شدن */
.plugin-checkbox_options .option:hover {
  background-color: #f3f4f6;
}

/* استایل برای حالت checked/unchecked */
.plugin-checkbox_options .option input:checked + label {
  font-weight: 500;
  color: #777;
}

.plugin-clear_button{--ts-pr-clear-button:1em}

/* حالت عادی (لایت مود) */
.plugin-clear_button .clear-button {
    cursor: pointer;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 2px;
    transform: translateY(-50%);
    border-radius: 0.5rem;
    background: #e0e0e0 !important;
    color: #333333 !important;
    margin-left: 0 !important;
    z-index: 5;
    transition: all 0.2s ease;
    border: none;
    padding: 2px 6px;
    font-size: 12px;
}

/* حالت دارک مود */
.dark .plugin-clear_button .clear-button {
    background: #3d3d3d !important;
    color: #e5e5e5 !important;
}

.plugin-clear_button.form-select .clear-button,.plugin-clear_button.single .clear-button{left:max(var(--ts-pr-caret),8px)}
.plugin-clear_button.focus.has-items .clear-button,.plugin-clear_button:not(.disabled):hover.has-items .clear-button{opacity:1}
.ts-wrapper .dropdown-header{background:#f8f8f8;border-bottom:1px solid #d0d0d0;border-radius:3px 3px 0 0;padding:10px 8px;position:relative}
.ts-wrapper .dropdown-header-close{color:#303030;opacity:.4;margin-top:-12px;line-height:20px;position:absolute;top:50%;right:8px;font-size:20px!important}
.ts-wrapper .dropdown-header-close:hover{color:#000}.plugin-dropdown_input.focus.dropdown-active .ts-control{box-shadow:none;border:1px solid #d0d0d0}
.plugin-dropdown_input .dropdown-input{box-shadow:none;background:0 0;border:0 solid #d0d0d0;border-bottom-width:1px;width:100%;padding:8px;display:block}.plugin-dropdown_input .items-placeholder{width:100%;box-shadow:none!important;border:0!important}.plugin-dropdown_input.dropdown-active .items-placeholder,.plugin-dropdown_input.has-items .items-placeholder{display:none!important}.ts-wrapper.plugin-input_autogrow.has-items .ts-control>input{min-width:0}.ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control>input{flex:none;min-width:4px}
.ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control>input::-moz-placeholder{color:#0000}
.ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control>input::placeholder{color:#0000}.ts-dropdown.plugin-optgroup_columns .ts-dropdown-content{display:flex}.ts-dropdown.plugin-optgroup_columns .optgroup{border-top:0;border-right:1px solid #f2f2f2;flex-grow:1;flex-basis:0;min-width:0}.ts-dropdown.plugin-optgroup_columns .optgroup:last-child{border-right:0}.ts-dropdown.plugin-optgroup_columns .optgroup:before{display:none}.ts-dropdown.plugin-optgroup_columns .optgroup-header{border-top:0}.ts-wrapper.plugin-remove_button .item{align-items:center;display:inline-flex;padding-right:0!important}
.ts-wrapper.plugin-remove_button .item .remove{box-sizing:border-box;color:inherit;vertical-align:middle;border-radius:0 2px 2px 0;padding:0 6px;text-decoration:none;display:inline-block}
.ts-wrapper.plugin-remove_button .item .remove:hover{background:#0000000d}
.ts-wrapper.plugin-remove_button.disabled .item .remove:hover{background:0 0}.ts-wrapper.plugin-remove_button .remove-single{font-size:23px;position:absolute;top:0;right:0}
.ts-wrapper.plugin-remove_button:not(.rtl) .item .remove{border-left:1px solid #d0d0d0;margin-left:6px}
.ts-wrapper.plugin-remove_button:not(.rtl) .item.active .remove{border-left-color:#cacaca}
.ts-wrapper.plugin-remove_button:not(.rtl).disabled .item .remove{border-left-color:#fff}
.ts-wrapper.plugin-remove_button.rtl .item .remove{border-right:1px solid #d0d0d0;margin-right:6px}
.ts-wrapper.plugin-remove_button.rtl .item.active .remove{border-right-color:#cacaca}
.ts-wrapper.plugin-remove_button.rtl.disabled .item .remove{border-right-color:#fff}.ts-wrapper{position:relative}
.ts-control,.ts-control input,.ts-dropdown{font-smoothing:inherit;color:#303030;font-family:inherit;font-size:13px;line-height:18px}
.ts-control,.ts-wrapper.single.input-active .ts-control{cursor:text;background:#fff}

.ts-control{
    box-shadow:none;
    box-sizing:border-box;
    z-index:1;
    border:1px solid #d0d0d0;
    border-radius: 0.5rem;
    width:100%;
    max-width: 100%;
    padding: 0 8px;
    min-height: 40px;
    height: 40px;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    display:flex;
    position:relative;
    overflow: hidden;
}

.ts-wrapper.multi.has-items .ts-control{padding:6px 8px 3px}
.full .ts-control{background-color:#fff}.disabled .ts-control,.disabled .ts-control *{cursor:default!important}.focus .ts-control{box-shadow:none}.ts-control>*{vertical-align:baseline;display:inline-block}
.ts-wrapper.multi .ts-control>div{color:#303030;cursor:pointer;background:#f2f2f2;border:0 solid #d0d0d0;margin:0 3px 3px 0;padding:2px 6px}
.ts-wrapper.multi .ts-control>div.active{color:#303030;background:#e8e8e8;border:0 solid #cacaca}
.ts-wrapper.multi.disabled .ts-control>div,.ts-wrapper.multi.disabled .ts-control>div.active{color:#7d7d7d;background:#fff;border:0 solid #fff}
.ts-control>input{flex:auto;min-width:7rem;box-shadow:none!important;line-height:inherit!important;text-indent:0!important;-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important;background:0 0!important;border:0!important;max-width:100%!important;min-height:0!important;max-height:none!important;margin-right: 0.5rem;padding:0!important;display:inline-block!important}.ts-control>input::-ms-clear{display:none}.ts-control>input:focus{outline:none!important}.has-items .ts-control>input{margin:0 4px!important}.ts-control.rtl{text-align:right}.ts-control.rtl.single .ts-control:after{left:15px;right:auto}.ts-control.rtl .ts-control>input{margin:0 4px 0 -2px!important}
.disabled .ts-control{opacity:.5;background-color:#fafafa}.input-hidden .ts-control>input{opacity:0;position:absolute;left:-10000px}
.ts-dropdown{box-sizing:border-box;z-index:10;background:#fff;border:1px solid #d0d0d0;border-top:0;border-radius:0 0 3px 3px;width:100%;margin:.25rem 0 0;position:absolute;top:100%;left:0;box-shadow:0 1px 3px #0000001a}.ts-dropdown [data-selectable]{cursor:pointer;overflow:hidden}
.ts-dropdown [data-selectable] .highlight{background:#7da8d033;border-radius:1px}.ts-dropdown .create,.ts-dropdown .no-results,.ts-dropdown .optgroup-header,.ts-dropdown .option{padding:5px 8px}.ts-dropdown .option,.ts-dropdown [data-disabled],.ts-dropdown [data-disabled] [data-selectable].option{cursor:inherit;opacity:.5}.ts-dropdown [data-selectable].option{cursor:pointer;opacity:1}.ts-dropdown .optgroup:first-child .optgroup-header{border-top:0}
.ts-dropdown .optgroup-header{color:#303030;cursor:default;background:#fff}
/* ========== LIGHT MODE - hover و active در لیست کشویی ========== */
.ts-dropdown .active {
  color: #222222;
  background-color: #d5e4f0;
}

.ts-dropdown .active.create {
  color: #222222;
}
.ts-dropdown .create{color:#30303080}.ts-dropdown .spinner{width:30px;height:30px;margin:5px 8px;display:inline-block}
.ts-dropdown .spinner:after{content:" ";border:5px solid #d0d0d0;border-color:#d0d0d0 #0000;border-radius:50%;width:24px;height:24px;margin:3px;animation:1.2s linear infinite lds-dual-ring;display:block}@keyframes lds-dual-ring{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.ts-dropdown-content{overflow-scrolling:touch;scroll-behavior:smooth;max-height:200px;overflow:hidden auto}.ts-hidden-accessible{clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important;width:1px!important;padding:0!important;position:absolute!important;overflow:hidden!important}

/* Dark mode version for Tom Select (prefix with .dark) */
.dark .ts-wrapper.plugin-drag_drop.multi>.ts-control>div.ui-sortable-placeholder{box-shadow:inset 0 0 12px 4px rgba(0,0,0,0.5);visibility:visible!important;background:#ffffff0f!important;border:0!important}
.dark .ts-wrapper .dropdown-header{background:#2b2b2b;border-bottom:1px solid #444;border-radius:3px 3px 0 0;padding:10px 8px;position:relative}
.dark .ts-wrapper .dropdown-header-close{color:#ccc;opacity:.4;margin-top:-12px;line-height:20px;position:absolute;top:50%;right:8px;font-size:20px!important}
.dark .ts-wrapper .dropdown-header-close:hover{color:#fff}
.dark .plugin-dropdown_input.focus.dropdown-active .ts-control{box-shadow:none;border:1px solid #555}
.dark .plugin-dropdown_input .dropdown-input{box-shadow:none;background:0 0;border:0 solid #555;border-bottom-width:1px;width:100%;padding:8px;display:block}
.dark .ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control>input::-moz-placeholder{color:#0000}
.dark .ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control>input::placeholder{color:#0000}
.dark .ts-wrapper.plugin-remove_button .item .remove{box-sizing:border-box;color:inherit;vertical-align:middle;border-radius:0 2px 2px 0;padding:0 6px;text-decoration:none;display:inline-block}
.dark .ts-wrapper.plugin-remove_button .item .remove:hover{background:#ffffff0d}
.dark .ts-wrapper.plugin-remove_button.disabled .item .remove:hover{background:0 0}
.dark .ts-wrapper.plugin-remove_button:not(.rtl) .item.active .remove{border-left-color:#777}
.dark .ts-wrapper.plugin-remove_button:not(.rtl).disabled .item .remove{border-left-color:#333}
.dark .ts-wrapper.plugin-remove_button.rtl .item .remove{border-right:1px solid #555;margin-right:6px}
.dark .ts-wrapper.plugin-remove_button.rtl .item.active .remove{border-right-color:#777}
.dark .ts-wrapper.plugin-remove_button.rtl.disabled .item .remove{border-right-color:#333}
.dark .ts-control,.dark .ts-control input,.dark .ts-dropdown{font-smoothing:inherit;color:#e0e0e0;font-family:inherit;font-size:13px;line-height:18px}
.dark .ts-control,.dark .ts-wrapper.single.input-active .ts-control{cursor:text;background:#2b2b2b}

.dark .ts-control{box-shadow:none;box-sizing:border-box;z-index:1;border:1px solid #555;border-radius: 0.5rem;flex-wrap:wrap;width:100%;padding: 0 8px;min-height: 40px;height: 40px;align-items: center;flex-wrap: nowrap;text-overflow: ellipsis;white-space: nowrap;display:flex;position:relative;overflow:hidden}

.dark .full .ts-control{background-color:#2b2b2b}
.dark .ts-wrapper.multi .ts-control>div{color:#e0e0e0;cursor:pointer;background:#3a3a3a;border:0 solid #555;margin:0 3px 3px 0;padding:2px 6px}
.dark .ts-wrapper.multi .ts-control>div.active{color:#e0e0e0;background:#4a4a4a;border:0 solid #777}
.dark .ts-wrapper.multi.disabled .ts-control>div,.dark .ts-wrapper.multi.disabled .ts-control>div.active{color:#888;background:#2b2b2b;border:0 solid #444}
.dark .ts-control>input{flex:auto;min-width:7rem;box-shadow:none!important;line-height:inherit!important;text-indent:0!important;-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important;background:0 0!important;border:0!important;max-width:100%!important;min-height:0!important;max-height:none!important;padding:0!important;display:inline-block!important}
.dark .disabled .ts-control{opacity:.5;background-color:#2a2a2a}
.dark .ts-dropdown{box-sizing:border-box;z-index:10;background:#2b2b2b;border:1px solid #555;border-top:0;border-radius:0 0 3px 3px;width:100%;margin:.25rem 0 0;position:absolute;top:100%;left:0;box-shadow:0 1px 3px #0000004d}
.dark .ts-dropdown [data-selectable] .highlight{background:#7da8d033;border-radius:1px}
.dark .ts-dropdown .optgroup-header{color:#ccc;cursor:default;background:#2b2b2b}
/* ========== DARK MODE - hover و active در لیست کشویی ========== */
.dark .ts-dropdown .active {
  color: #ffffff;
  background-color: #4a5568;
}

.dark .ts-dropdown .active.create {
  color: #ffffff;
}
.dark .ts-dropdown .create{color:#e0e0e080}
.dark .ts-dropdown .spinner:after{content:" ";border:5px solid #555;border-color:#555 transparent;border-radius:50%;width:24px;height:24px;margin:3px;animation:1.2s linear infinite lds-dual-ring;display:block}
@keyframes lds-dual-ring{0%{transform:rotate(0)}to{transform:rotate(1turn)}}
.dark .ts-wrapper.plugin-remove_button:not(.rtl) .item .remove{border-left:1px solid #555;margin-left:6px}


/* ========== LIGHT MODE - آیتم‌های تگ داخل فیلد ========== */
.ts-wrapper .ts-control > div {
  color: #333333;
  background: #e0e0e0;
  border: 0 solid #cccccc;
  margin: 0 3px 3px 0;
  padding: 2px 6px;
}

/* ========== DARK MODE - آیتم‌های تگ داخل فیلد ========== */
.dark .ts-wrapper .ts-control > div {
  color: #e5e5e5;
  background: #3d3d3d;
  border: 0 solid #555555;
  margin: 0 3px 3px 0;
  padding: 2px 6px;
}

/* حالت active تگ */
.dark .ts-wrapper .ts-control > div.active {
  color: #e5e5e5;
  background: #03030336;         /* روشن‌تر - تگ فعال */
  border: 0 solid #777;
}

/* تگ‌های غیرفعال */
.dark .ts-wrapper.disabled .ts-control > div,
.dark .ts-wrapper.disabled .ts-control > div.active {
  color: #888;
  background: #252525;         /* رنگ تگ غیرفعال */
  border: 0 solid #444;
}