/*
 * Общие стили для TMS MVP.
 * Цветовая схема мягкая, с акцентом на читаемость и простоту.
 * Используются CSS-переменные для лёгкого изменения темы.
 */

:root {
  --primary: #007bff;
  --danger: #e63946;
  --background: #f7f7f7;
  --nav-bg: #1e1e2d;
  --nav-text: #ffffff;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
}

body {
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--background);
  color: #333;
}

/* Навигационная панель */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--nav-bg);
  padding: 1rem 2rem;
}

.nav-left a,
.logout-form button {
  margin-right: 1rem;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-left a {
  color: #ffffff;
  background-color: var(--primary);
}

.nav-left a:hover {
  background-color: #0056b3;
}

.logout-form button {
  color: #ffffff;
  background-color: var(--danger);
}

.logout-form button:hover {
  background-color: #c2182b;
}

.content {
  padding: 2rem;
}

.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: #777;
}

/* Разделы */
.form-container,
.dashboard,
.depot-page,
.vehicle-page,
.orders-page {
  max-width: 600px;
  margin: 0 auto;
}

/* Карточки форм */
.form-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background-color: var(--card-bg);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-card input,
.form-card select {
  padding: 0.5rem;
  border: 2px solid #c0c0c0;
  border-radius: 4px;
  font-size: 1rem;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.form-card input:focus,
.form-card select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.25), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-card input:hover:not(:focus),
.form-card select:hover:not(:focus) {
  border-color: #909090;
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  background-color: var(--primary);
  color: #fff;
  border: none;
  transition: background 0.2s;
}

.btn:hover {
  background-color: #0056b3;
}

/* Create/Import actions - Green */
.btn.create,
.btn.primary {
  background-color: #2ecc71;
}

.btn.create:hover,
.btn.primary:hover {
  background-color: #27ae60;
}

/* Edit actions - Blue */
.btn.edit {
  background-color: #3498db;
}

.btn.edit:hover {
  background-color: #2980b9;
}

/* Delete actions - Red */
.btn.delete,
.btn.danger {
  background-color: #e74c3c;
}

.btn.delete:hover,
.btn.danger:hover {
  background-color: #c0392b;
}

/* Secondary/Cancel actions - Gray */
.btn.secondary {
  background-color: #6c757d;
}

.btn.secondary:hover {
  background-color: #5a6268;
}

/* Группа кнопок на dashboard */
.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Таблицы */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.data-table th {
  background-color: #f0f0f0;
  font-weight: 600;
}

/* Уведомления */
#alerts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

.alert {
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  animation: fadein 0.3s, fadeout 0.3s 2.7s;
}

.alert.success {
  background-color: #28a745;
}

.alert.error {
  background-color: #dc3545;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeout {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* Delete button styling */
.btn-delete {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  background-color: var(--danger);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-delete:hover {
  background-color: #c2182b;
}

/* Edit button styling - blue like .btn.edit */
.btn-edit {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  background-color: #3498db;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
  margin-right: 4px;
}

.btn-edit:hover {
  background-color: #2980b9;
}