/* ======== Карточки ======== */
.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 24px; /* немного компактнее */
  margin-bottom: 22px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

/* ======== Формы ======== */
label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 14px;
  color: #1e293b;
}
.input {
  width: 100%;
  max-width: 100%; /* не вылезает за пределы колонки */
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #ffffff;
  box-sizing: border-box; /* чтобы padding не увеличивал ширину */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* длинные тексты не ломают макет */
}
.input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* ======== Макеты ======== */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px; /* чуть меньше для компактности */
}
.col {
  flex: 1 1 260px; /* минимальная ширина колонки + гибкость */
  max-width: 100%;
}

/* Адаптивность для маленьких экранов */
@media (max-width: 768px) {
  .row {
    flex-direction: column;
    gap: 15px;
  }
}

/* ======== Переключатель режимов ======== */
.mode-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}
.mode-selector label {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease;
}
.mode-selector input {
  margin-right: 6px;
}
.mode-selector label:hover,
.mode-selector input:checked + label {
  background: #e2e8f0;
}

/* ======== Список контактов ======== */
#contactsList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.contact-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.contact-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.contact-card h4 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 16px;
  color: #1e293b;
}
.contact-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
