/* Ant-like look for TomSelect + icons + clear */

.ts-wrapper.antlike {
    --ant-border: #d9d9d9;
    --ant-border-hover: #4096ff;
    --ant-shadow: 0 0 0 2px rgba(64, 150, 255, 0.20);
    --ant-radius: 6px;
    --ant-height: 40px;
    --ant-font: 14px;
    --ant-icon: rgba(0,0,0,.45);
    --ant-icon-hover: rgba(0,0,0,.75);
  }

  /* Control */
  .ts-wrapper.antlike .ts-control {
    min-height: var(--ant-height);
    border: 1px solid var(--ant-border);
    border-radius: var(--ant-radius);
    padding: 4px 34px 4px 11px; /* right padding for icons */
    font-size: var(--ant-font);
    align-content: center !important;
    line-height: 1.5715;
    box-shadow: none;
    position: relative;
  }

  /* Hover */
  .ts-wrapper.antlike .ts-control:hover {
    border-color: var(--ant-border-hover);
  }

  /* Focus */
  .ts-wrapper.antlike.focus .ts-control,
  .ts-wrapper.antlike .ts-control:focus-within {
    border-color: var(--ant-border-hover);
    box-shadow: var(--ant-shadow);
  }

  /* Placeholder */
  .ts-wrapper.antlike .ts-control .placeholder {
    color: rgba(0, 0, 0, 0.45);
  }

  /* Dropdown */
  .ts-dropdown.antlike {
    border-radius: var(--ant-radius);
    border: 1px solid var(--ant-border);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
    padding: 4px;
    overflow: hidden;
  }

  /* Options */
  .ts-dropdown.antlike .option {
    border-radius: 4px;
    padding: 7px 12px;
    font-size: var(--ant-font);
  }
  .ts-dropdown.antlike .option:hover,
  .ts-dropdown.antlike .active {
    background: #e6f4ff;
  }

  /* ---------- ICONS (Chevron/Search) ---------- */

  /* remove default caret */
  .ts-wrapper.antlike .ts-control::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px !important;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    opacity: 1;
    pointer-events: none;
  }

  /* Chevron Down (default) */
  .ts-wrapper.antlike .ts-control::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='rgba(0,0,0,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }

  /* Open + searchable => Search icon */
  .ts-wrapper.antlike.is-open.is-searchable .ts-control::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='rgba(0,0,0,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M21 21l-4.3-4.3M10.8 18a7.2 7.2 0 1 1 0-14.4 7.2 7.2 0 0 1 0 14.4Z'/%3E%3C/svg%3E");
  }

  /* Open + NOT searchable => Chevron Up */
  .ts-wrapper.antlike.is-open:not(.is-searchable) .ts-control::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='rgba(0,0,0,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m18 15-6-6-6 6'/%3E%3C/svg%3E");
  }

  /* Hover icon a bit darker */
  .ts-wrapper.antlike:hover .ts-control::after {
    filter: brightness(0.75);
  }

  /* ---------- CLEAR BUTTON (×) ---------- */
  /* TomSelect clear_button plugin uses .clear-button */
  .ts-wrapper.antlike .clear-button {
    position: absolute;
    right: 34px !important; /* sits left of chevron/search */
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(0,0,0,.45);
    background: transparent;
    line-height: 1;
    font-size: 16px;
    padding: 0;
  }

  .ts-wrapper.antlike .clear-button:hover {
    color: rgba(0,0,0,.75);
    background: rgba(0,0,0,.04);
  }

  /* MULTI SELECT TAGS (Ant style) */
.ts-wrapper.antlike.multi .ts-control {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .ts-wrapper.antlike .item {
    /* background: #f0f5ff; */
    /* border: 1px solid #adc6ff; */
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
    /* color: #1d39c4; */
  }

  .ts-wrapper.antlike .item .remove {
    margin-left: 4px;
    cursor: pointer;
    color: rgba(0,0,0,.45);
  }

  .ts-wrapper.antlike .item .remove:hover {
    color: rgba(0,0,0,.75);
  }

  .ant-date-wrap{
    position: relative;
  }

  .ant-date-input{
    height: 35px;
    border-radius: 6px;
    border: 1px solid #d9d9d9;
    padding: 5px 15px 5px 25px; /* space for icons */
    font-size: 14px;
  }

  .ant-date-input:focus{
    border-color: #4096ff;
    box-shadow: 0 0 0 2px rgba(64,150,255,.2);
    outline: none;
  }

  .ant-date-icon,
  .ant-date-clear{
    position:absolute;
    top:50%;
    transform: translateY(-50%);
    width:18px;
    height:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    color: rgba(0,0,0,.45);
  }

  .ant-date-icon{ left: 5px; pointer-events:none; }
  .ant-date-clear{ right: 5px; cursor:pointer; border-radius:50%; }
  .ant-date-clear:hover{ background: rgba(0,0,0,.04); color: rgba(0,0,0,.75); }

  .ant-date-wrap.is-empty .ant-date-clear{ display:none; }

  /* Flatpickr popup look (optional slight Ant vibe) */
  .flatpickr-calendar{
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
    border: 1px solid #d9d9d9;
  }

  .flatpickr-calendar{ z-index: 20000 !important; }

  .ant-select-wrap select.form-select {
    visibility: hidden;
}

.ant-select-wrap.is-ready select.form-select {
    visibility: visible;
}

.ant-select-wrap .ts-wrapper + select.form-select,
.ant-select-wrap select.tomselected {
    visibility: hidden;
}
