.contact-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.contact-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.contact-stat-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.contact-stat-top span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.contact-stat-card h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.contact-stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.contact-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 17px;
}

.icon-blue {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.icon-green {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.icon-purple {
  background: rgba(168, 85, 247, 0.12);
  color: #9333ea;
}

.contact-main-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 24px;
}

.contact-form-card,
.contact-list-card {
  padding: 22px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-field label {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.contact-field textarea {
  resize: vertical;
  min-height: 110px;
}

.contact-form-actions {
  display: flex;
  justify-content: flex-start;
}

.contact-form-message {
  min-height: 20px;
  font-size: 0.92rem;
  color: var(--muted);
}

.contact-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.contact-search-wrap {
  width: 100%;
  max-width: 280px;
}

.contact-search-wrap input {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-item {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.contact-item:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.18);
}

.contact-item-main {
  flex: 1;
  min-width: 0;
}

.contact-item-main h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.contact-item-main p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-word;
}

.contact-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}

.contact-item-actions {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}

.contact-delete-btn {
  border: none;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.contact-delete-btn:hover {
  transform: translateY(-1px);
  background: rgba(239, 68, 68, 0.18);
}

.contact-empty-box {
  text-align: center;
  padding: 28px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.contact-empty-box i {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 10px;
}

.contact-empty-box p {
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 1000px) {
  .contact-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .contact-stats-grid {
    grid-template-columns: 1fr;
  }

  .contact-form-grid {
    grid-template-columns: 1fr;
  }

  .contact-list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-search-wrap {
    max-width: 100%;
  }

  .contact-item {
    flex-direction: column;
  }

  .contact-item-actions {
    align-items: stretch;
  }

  .contact-delete-btn {
    width: 100%;
  }
}