/* === Базовые стили === */
body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background: #f7f7f7;
  color: #212529;
}

h1 {
  color: #1b4332;
  margin-bottom: 20px;
}

h2 {
  color: #2d6a4f;
  margin-top: 30px;
  margin-bottom: 10px;
}

/* === Карточки === */
.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* === Формы и поля === */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.row > * {
  margin-right: 8px;
  margin-bottom: 5px;
}

.row > *:last-child {
  margin-right: 0;
}

input, select {
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

/* === Кнопки === */
button {
  padding: 6px 12px;
  background: #2d6a4f;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

button:hover {
  background: #1b4332;
}

button.secondary {
  background: #6c757d;
}

button.secondary:hover {
  background: #565e64;
}

/* === Кнопки в карточках действий === */
.actions {
  margin-top: 8px;
}

.actions button {
  background: #40916c;
}

.actions button:hover {
  background: #1b4332;
}

/* === Фильтры === */
.filters {
  margin-bottom: 20px;
}

/* === Вспомогательные === */
.muted {
  color: #6c757d;
  font-size: 0.9rem;
}

/* === Чат === */
#chatBox {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
  padding: 10px;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.message {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.3;
  animation: fadeIn 0.2s ease-in;
}

.message.user {
  align-self: flex-end;
  background: #d8f3dc;
  border: 1px solid #b7e4c7;
}

.message.ai {
  align-self: flex-start;
  background: #edf2fb;
  border: 1px solid #cdd9ed;
}

.message.error {
  align-self: center;
  background: #f8d7da;
  border: 1px solid #f5c2c7;
  color: #842029;
}

/* === Анимации === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
