.abonents-table {
  margin-bottom: 40px;
}

.contacts-table {
  width: 100%;
  border-collapse: separate;
  border: 1px solid var(--color-blue-200);
  border-spacing: 0;
  background: var(--color-white);
  overflow: hidden;
  table-layout: fixed;
  margin-top: 1.25rem;
  word-wrap: break-word;
}

.contacts-table thead {
  background-color: var(--color-blue-200);
  color: var(--color-white);
}

.contacts-table th,
.contacts-table td {
  padding: 12px 15px;
  box-sizing: border-box;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
}

.contacts-table__item-middle {
  text-align: center;
  vertical-align: middle;
}

.contacts-table th {
  text-align: center;
  vertical-align: middle;
  font-weight: 500;
  font-size: 1.05rem;
  padding: 12px 15px;
  letter-spacing: 0.5px;
  border: 1px solid var(--color-blue-100);
}

.contacts-table__dropdown {
  background-color: var(--color-blue-100);
  color: var(--color-white);
  cursor: pointer;
  transition: background 0.3s;
  font-weight: 600;
}

.dropdown-header {
  border: 1px solid var(--color-blue-200);
  border-top: none;
}

.contacts-table__dropdown:hover {
  background-color: var(--color-grey-100);
}

.contacts-table__dropdown .arrow {
  float: right;
  transition: transform 0.3s;
}

.contacts-table__dropdown.active .arrow {
  transform: rotate(180deg);
}

.contacts-table__dropdown span:first-child {
  font-size: 1em;
  color: var(--color-white);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.td-avatar {
  vertical-align: middle;
  width: 55px;
  padding: 6px;
  text-align: center;
}

.td-avatar img.avatar {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

.td-name a {
  color: var(--color-blue-200);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
  line-height: 1.3;
}

.td-name a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background-color: var(--color-blue-400);
  transition: width 0.3s ease;
}

.td-name a:hover {
  color: var(--color-blue-400);
}

.td-name a:hover::after {
  width: 100%;
}

.sub-row {
  display: none;
}

.contacts-title {
  margin-top: 1.25rem;
}

@media (max-width: 1024px) {
  .contacts-table th,
  .contacts-table td {
    font-size: 0.95rem;
    padding: 10px;
  }

  .avatar {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 768px) {
  .contacts-table {
    display: block;
    width: 100%;
  }
  .contacts-table tbody {
    display: inline-block;
    width: 100%;
  }

  .contacts-table thead {
    display: none;
  }

  .contacts-table tbody tr {
    display: inline-block;
    width: 100%;
    padding: 10px;
  }

  .contacts-table td {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: none;
    font-size: 0.95rem;
  }

  .contacts-table td::before {
    content: attr(data-label);
    font-weight: 600;
    text-align: left;
  }

  .contacts-table td:last-child {
    border-bottom: none;
  }

  .td-avatar {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .contacts-table td {
    align-items: flex-start;
    text-align: left;
  }
  .contacts-table td span {
    margin-right: 5px;
  }

  .avatar {
    width: 34px;
    height: 34px;
  }

  .td-name a {
    font-size: 0.9rem;
  }
}
