/* Only the desktop client search component; its controls keep their own handlers. */
client-search-form .nw-clients-filter-card {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 24px;
  border: 1px solid #dce3eb;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 49, 77, .04);
}
client-search-form .nw-clients-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 24px;
  align-items: start;
}
client-search-form .nw-clients-filter-field {
  min-width: 0;
  width: 100%;
}
client-search-form .nw-clients-filter-field > *:not(input):not(select):not(label):not(.loading),
client-search-form .nw-clients-filter-field .btn-group {
  display: block;
  width: 100% !important;
  min-width: 0;
}
client-search-form .nw-clients-filter-card .nw-clients-filter-field label {
  display: block;
  height: 18px;
  margin: 0 0 7px !important;
  padding: 0;
  font-family: Roboto, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  text-align: left;
  color: #8b959f;
}
client-search-form .nw-clients-filter-field input.w-control,
client-search-form .nw-clients-filter-field select.w-control,
client-search-form .nw-clients-filter-field .dropdown-button,
client-search-form .nw-clients-filter-field .nw-business__input {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 13px !important;
  border: 1px solid #cdd7e3 !important;
  border-radius: 4px !important;
  background: #fff;
  box-shadow: none;
  color: #333;
  font-size: 14px;
  line-height: 40px;
}
client-search-form .nw-clients-filter-field .nw-business__input { padding-right: 34px !important; }
client-search-form .nw-clients-filter-field .nw-business__hint:empty,
client-search-form .nw-clients-filter-field .nw-business__suggestion:empty { display: none; }
client-search-form .nw-clients-filter-field .dropdown-text {
  display: block;
  overflow: hidden;
  padding-right: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
client-search-form .nw-clients-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
}
client-search-form .nw-clients-filter-checks {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}
client-search-form .nw-clients-filter-checks .agreement-checkbox,
client-search-form .nw-clients-filter-checks .w-checkbox,
client-search-form .nw-clients-filter-checks .telegram-filter {
  flex: 0 0 auto;
  margin: 0 !important;
  white-space: nowrap;
}
client-search-form .nw-clients-filter-checks label {
  font-family: Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #333;
}
client-search-form .nw-clients-filter-checks .telegram-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 24px;
}
client-search-form .nw-clients-filter-checks .telegram-filter input { width: 18px; height: 18px; margin: 0; }
client-search-form .nw-clients-filter-checks .w-checkbox label { margin-bottom: 0; }
client-search-form .nw-clients-filter-footer > .clear {
  flex: 0 0 auto;
  height: 42px;
  margin: 0 0 0 auto !important;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  client-search-form .nw-clients-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  client-search-form .nw-clients-filter-footer { flex-wrap: wrap; }
  client-search-form .nw-clients-filter-checks { flex-wrap: wrap; gap: 16px 24px; }
}
@media (max-width: 600px) {
  client-search-form .nw-clients-filter-card { padding: 16px; }
  client-search-form .nw-clients-filter-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* Keep the existing Angular search binding, focus and manager access rules. */
client-search-form .nw-client-manager-search .btn-group {
  position: relative;
  height: 42px;
}
client-search-form .nw-client-manager-search .search-input {
  box-sizing: border-box;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  width: 100% !important;
  height: 46px !important;
  padding: 0 13px !important;
  margin: 0 !important;
  border: 1px solid #cdd7e3 !important;
  border-bottom-color: #e7edf3 !important;
  border-radius: 5px 5px 0 0 !important;
  background: #fff !important;
  color: #333;
  font: 14px Roboto, Arial, sans-serif;
  z-index: 1002;
}
client-search-form .nw-client-manager-search .search-input:focus {
  border-color: #48a9ef !important;
  box-shadow: inset 0 0 0 1px #48a9ef;
}
client-search-form .nw-client-manager-search .search-input[hidden] {
  display: none !important;
}
client-search-form .nw-client-manager-search .dropdown-menu {
  box-sizing: border-box;
  top: calc(100% + 50px) !important;
  left: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-height: 260px;
  margin: 0 !important;
  border: 1px solid #cdd7e3;
  border-top: 0;
  border-radius: 0 0 5px 5px !important;
  background: #fff;
  box-shadow: 0 6px 16px rgba(31, 49, 77, .12);
  z-index: 1001;
}
client-search-form .nw-client-manager-search .dropdown-text[hidden] {
  display: block !important;
}

/* Expanded filters extend the original card, retaining the compact controls. */
client-search-form .nw-filter-extra { order: 10; }
client-search-form .nw-filter-extra-start { grid-column-start: 1; }
client-search-form .nw-clients-filter-field > .nw-filter-range { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
client-search-form .nw-filter-toggle { display:block; margin:0 auto; padding:6px 18px; border:0; background:transparent; cursor:pointer; }
client-search-form .nw-filter-toggle img { width:20px; height:20px; object-fit:contain; transition:transform .15s; }
client-search-form .nw-filter-arrow-open { transform:rotate(180deg); }
client-search-form .nw-filter-expanded .nwnr-filter { order:20; }
client-search-form .nw-filter-expanded .nwtr-filter { order:21; }
client-search-form .nw-clients-filter-card .nwnr-filter > label { height:auto; }
client-search-form .nw-clients-filter-card .nwnr-filter select { margin-top:7px !important; font-size:14px; }
client-search-form .nw-filter-expanded .nwnr-filter { grid-column-start:1; }
@media (min-width:1101px) { client-search-form .nw-filter-expanded .nwnr-filter { grid-column-start:1; } }

/* Match the approved expanded mockup: uninterrupted four-column flow. */
client-search-form .nw-filter-expanded > .nw-filter-extra-start,
client-search-form .nw-filter-expanded > .nwnr-filter { grid-column-start:auto; }
client-search-form .nw-filter-expanded + .nw-clients-filter-footer {
  border-top:1px solid #e1e9f1;
  padding-top:20px;
  margin-top:28px;
}

/* Vertically center the address book inside the 42px search control. */
client-search-form .nw-clients-filter-card .nw-clients-filter-field.client-search.nw-tg-book-host > button.nw-tg-book-button {
  bottom:2px !important;
  top:auto !important;
  width:38px !important;
  transform:none !important;
}
/* One triangle for both native selects and Angular dropdowns. */
client-search-form .nw-clients-filter-card .nw-clients-filter-field select,
client-search-form .nw-clients-filter-card .dropdown-button .triangle {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23dadfe6' d='M0 0h12L6 12z'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;
  background-size:12px 12px !important;
}
client-search-form .nw-clients-filter-card .nw-clients-filter-field select {
  appearance:none !important;
  -webkit-appearance:none !important;
  background-position:right 13px center !important;
  padding-right:36px !important;
}
client-search-form .nw-clients-filter-card .dropdown-button { position:relative; }
client-search-form .nw-clients-filter-card .dropdown-button .triangle {
  position:absolute;right:13px;top:50%;
  width:12px;height:12px;font-size:0;line-height:0;
  background-position:center !important;
  transform:translateY(-50%);
}
client-search-form .nw-clients-filter-card .dropdown-button .triangle.up { transform:translateY(-50%) rotate(180deg); }
