/* Стили для системы продаж */
#sales-list-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sales-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e5e7eb;
  flex-wrap: wrap;
  gap: 20px;
}

.sales-title h2 {
  margin: 0 0 5px 0;
  font-size: 2rem;
  color: #1f2937;
}

.sales-title p {
  margin: 0;
  color: #6b7280;
}

.auth-section {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.user-status {
  color: #374151;
  font-weight: 500;
}

/* Кнопки */
.btn {
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #1a73e8; /* Цвет кнопки "Войти" как на изображении */
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); /* Более мягкая тень */
  padding: 8px 16px; /* Уменьшенный padding для меньшего размера кнопки */
  font-size: 15px; /* Уточненный размер шрифта */
}

.btn-primary:hover:not(:disabled) {
  background-color: #176cdb; /* Темнее при наведении */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Чуть более выраженная тень при наведении */
}

.btn-secondary {
  background-color: #10b981;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #059669;
}

.btn-outline {
  background-color: transparent;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-outline:hover {
  background-color: #f9fafb;
}

/* Сетка продаж */
.sales-grid {
  display: grid;
  gap: 20px;
}

.sale-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
}

.sale-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sale-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  gap: 15px;
}

.sale-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #1f2937;
  flex: 1;
}

/* Статусы */
.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-planned {
  background-color: #fef3c7;
  color: #92400e;
}

.status-progress {
  background-color: #dbeafe;
  color: #1e40af;
}

.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

.status-cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

.sale-description {
  color: #6b7280;
  margin-bottom: 15px;
  line-height: 1.5;
}

.sale-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
  font-size: 0.875rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #6b7280;
}

.meta-label {
  font-weight: 500;
}

.sale-actions {
  margin-bottom: 15px;
}

.auth-notice {
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 12px;
  margin-top: 15px;
}

.auth-notice p {
  margin: 0;
  color: #92400e;
  font-size: 0.875rem;
}

/* Детали продажи */
.sale-details {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.specifications h4,
.documents h4 {
  color: #065f46;
  margin: 0 0 10px 0;
  font-size: 1rem;
}

.specifications p {
  color: #047857;
  margin: 0 0 15px 0;
  line-height: 1.5;
}

.document-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-item {
  background-color: white;
  border: 1px solid #bbf7d0;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #047857;
  cursor: pointer;
  transition: all 0.2s;
}

.document-item:hover:not(:disabled) {
  background-color: #f0fdf4;
  transform: translateY(-1px);
}

.document-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Модальные окна */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  width: 90%;
  max-width: 400px; /* Уменьшил max-width для соответствия скриншоту */
  max-height: 90vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 800px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  color: #1f2937;
}

.close {
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
}

.close:hover {
  color: #374151;
}

.modal-body {
  padding: 20px;
}

.modal-footer-links {
  margin-top: 20px;
  text-align: center;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.modal-footer-links p {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #555;
}

.modal-footer-links a {
  color: #0073aa; /* WordPress blue */
  text-decoration: none;
  font-weight: 500;
}

.modal-footer-links a:hover {
  text-decoration: underline;
}

/* Формы */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #374151;
}

.required {
  color: #ef4444;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c8dafa; /* Мягкая рамка */
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: #e8f0fe; /* Светло-голубой фон */
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1a73e8; /* Синяя рамка при фокусе */
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2); /* Мягкая синяя тень при фокусе */
}

.form-group input.error {
  border-color: #ef4444;
}

.form-help {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.error-text {
  color: #ef4444;
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 20px;
  flex-wrap: wrap;
}

.form-note {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

/* Сообщения */
#login-message,
#buyer-register-message,
#forgot-password-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  font-size: 14px;
}

.success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #bbf7d0;
}

.error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.no-sales {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.no-sales h3 {
  color: #374151;
  margin-bottom: 10px;
}

/* Стили для переключения видимости пароля */
.password-group {
  position: relative;
}

.password-group input {
  padding-right: 40px; /* Место для иконки */
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%; /* Центрируем по вертикали относительно родителя */
  transform: translateY(-50%); /* Корректируем для собственной высоты */
  cursor: pointer;
  display: flex; /* Используем flexbox для центрирования SVG внутри */
  align-items: center; /* Центрируем SVG по вертикали */
  height: 100%; /* Занимаем всю высоту родителя для центрирования */
}

.password-toggle .password-icon {
  width: 20px; /* Размер иконки */
  height: 20px; /* Размер иконки */
  stroke: #6b7280; /* Цвет иконки */
}

/* Адаптивность */
@media (max-width: 768px) {
  .sales-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sale-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .sale-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-content {
    margin: 20px;
    width: calc(100% - 40px);
  }

  .auth-section {
    width: 100%;
    justify-content: flex-start;
  }

  .document-list {
    flex-direction: column;
  }

  .password-toggle {
    top: 50%; /* Сохраняем позиционирование для мобильных */
  }
}
