/* ZaPotente Contacts UX v1 — scoped to the user contact tab only.
   Keeps all existing PHP, JS event handlers, data and admin styles intact. */
body.theme-user.layout-sidebar #tab-contacts {
  --zp-ct-gap: clamp(12px, 1.05vw, 20px);
  --zp-ct-control: 44px;
  min-width: 0;
}
body.theme-user.layout-sidebar #tab-contacts > .panel {
  min-width: 0;
  padding: clamp(16px, 1.25vw, 26px) !important;
  margin-bottom: 16px !important;
}
body.theme-user.layout-sidebar #tab-contacts .panel-header {
  min-height: 46px;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  text-align: left !important;
  padding-bottom: 12px !important;
  margin-bottom: 10px !important;
}
body.theme-user.layout-sidebar #tab-contacts .panel-header > span:first-child {
  font-size: clamp(15px, .92vw, 18px) !important;
  font-weight: 650 !important;
  letter-spacing: -.015em;
  line-height: 1.45 !important;
  color: var(--text-main, #f3f4f6) !important;
  text-align: left !important;
}
body.theme-user.layout-sidebar #tab-contacts .panel-desc {
  font-size: clamp(13px, .79vw, 15px) !important;
  line-height: 1.6 !important;
  margin: 0 0 15px !important;
}
body.theme-user.layout-sidebar #tab-contacts .input-label {
  font-size: clamp(12px, .71vw, 14px) !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin-bottom: 7px !important;
}
body.theme-user.layout-sidebar #tab-contacts .input-row:has(#new-list-name),
body.theme-user.layout-sidebar #tab-contacts .input-row:has(#contact-target-list) {
  display: grid !important;
  min-width: 0;
  align-items: end !important;
  gap: var(--zp-ct-gap) !important;
  width: 100%;
}
body.theme-user.layout-sidebar #tab-contacts .input-row:has(#new-list-name) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
body.theme-user.layout-sidebar #tab-contacts .input-row:has(#contact-target-list) {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
body.theme-user.layout-sidebar #tab-contacts .input-row:has(#new-list-name) > .form-card,
body.theme-user.layout-sidebar #tab-contacts .input-row:has(#contact-target-list) > .form-card {
  box-sizing: border-box;
  min-width: 0 !important;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  align-self: stretch !important;
}
body.theme-user.layout-sidebar #tab-contacts :is(
  #new-list-name, #new-list-desc, #contact-target-list, #contact-name,
  #contact-phone, #contact-email
) {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: var(--zp-ct-control) !important;
  height: var(--zp-ct-control) !important;
  margin: 0 !important;
  padding: 9px 12px !important;
  font-size: clamp(14px, .79vw, 16px) !important;
  line-height: 1.4 !important;
  text-overflow: ellipsis;
}
body.theme-user.layout-sidebar #tab-contacts :is(#new-list-name, #new-list-desc, #contact-name, #contact-phone, #contact-email)::placeholder {
  opacity: 1 !important;
  color: #8e95a3 !important;
}
body.theme-user.layout-sidebar #tab-contacts .input-row:has(#new-list-name) > .btn,
body.theme-user.layout-sidebar #tab-contacts .input-row:has(#contact-target-list) > .btn {
  grid-column: 1 / -1;
  justify-self: end;
  min-height: var(--zp-ct-control) !important;
  width: auto !important;
  min-width: 142px;
  padding: 10px 18px !important;
  font-size: 14px !important;
  font-weight: 600;
  white-space: nowrap;
  margin: 0 !important;
}
body.theme-user.layout-sidebar #tab-contacts .panel-header .btn {
  font-size: 13px !important;
  min-height: 38px;
  padding: 8px 12px !important;
}
body.theme-user.layout-sidebar #tab-contacts .panel-header:has(#filter-contact-list) {
  align-items: center !important;
}
body.theme-user.layout-sidebar #tab-contacts .panel-header:has(#filter-contact-list) > div {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  max-width: 100%;
}
body.theme-user.layout-sidebar #tab-contacts :is(#filter-contact-list, #filter-contact-optout) {
  width: auto !important;
  min-width: 200px !important;
  max-width: 100% !important;
  height: 42px !important;
  padding: 9px 36px 9px 12px !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.theme-user.layout-sidebar #tab-contacts #filter-contact-optout {
  min-width: 265px !important;
}
body.theme-user.layout-sidebar #tab-contacts .panel:has(#contacts-body) {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
body.theme-user.layout-sidebar #tab-contacts .panel:has(#contacts-body) table {
  min-width: 740px;
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px !important;
}
body.theme-user.layout-sidebar #tab-contacts .panel:has(#contacts-body) :is(th, td) {
  padding: 12px 14px !important;
  vertical-align: middle;
  line-height: 1.5 !important;
}
body.theme-user.layout-sidebar #tab-contacts #contact-lists-container {
  font-size: 13px !important;
  line-height: 1.5;
  min-height: 20px;
}
/* Desktop nav remains available in the standard menu; hide redundant shortcut. */
@media (min-width: 981px) {
  body.theme-user.layout-sidebar .header-actions > .zp-listas-shortcut-desktop {
    display: none !important;
  }
}
@media (min-width: 2000px) {
  body.theme-user.layout-sidebar #tab-contacts .panel-desc {font-size: 16px !important;}
  body.theme-user.layout-sidebar #tab-contacts .input-label {font-size: 14px !important;}
  body.theme-user.layout-sidebar #tab-contacts .panel:has(#contacts-body) table {font-size: 15px !important;}
}
@media (max-width: 1350px) {
  body.theme-user.layout-sidebar #tab-contacts .input-row:has(#contact-target-list) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 700px) {
  body.theme-user.layout-sidebar #tab-contacts .input-row:has(#new-list-name),
  body.theme-user.layout-sidebar #tab-contacts .input-row:has(#contact-target-list) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.theme-user.layout-sidebar #tab-contacts .input-row:has(#new-list-name) > .btn,
  body.theme-user.layout-sidebar #tab-contacts .input-row:has(#contact-target-list) > .btn {
    width: 100% !important;
    justify-self: stretch;
  }
  body.theme-user.layout-sidebar #tab-contacts .panel-header:has(#filter-contact-list) > div {
    justify-content: stretch !important;
    width: 100%;
  }
  body.theme-user.layout-sidebar #tab-contacts :is(#filter-contact-list, #filter-contact-optout) {
    flex: 1 1 230px;
    min-width: 0 !important;
    width: 100% !important;
  }
  body.theme-user.layout-sidebar #tab-contacts .panel:has(#contacts-body) {padding-bottom: 18px !important;}
}
