.login-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 30px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
  width: 300px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* --- Навигация --- */
.fixed-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #f8f9fa;
  padding: 12px 20px;
  border-bottom: 1px solid #ccc;
  z-index: 1000;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.fixed-navbar a {
  text-decoration: none;
  color: #007bff;
  margin-right: 20px;
  font-weight: 500;
}

.fixed-navbar a:hover {
  text-decoration: underline;
}

.navbar-spacer {
  flex-grow: 1;
}

.fixed-navbar button {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.fixed-navbar button:hover {
  background-color: #c82333;
}

/* --- Основной отступ --- */
body {
  margin-top: 70px;
  overflow-x: auto;
  font-family: sans-serif;
}

/* --- Таблицы --- */
table {
  border-collapse: collapse;
  margin: 0;
  width: 100%; /* обязательно */
  /*table-layout: fixed; /* желательно, чтобы ширина колонок не прыгала */
}

th, td {
  border: 1px solid #ddd;
  padding: 4px 8px;
  white-space: nowrap;
  text-align: left;
  vertical-align: middle;
}

/* --- Вводы в таблицах --- */
td input[type="text"],
td input[type="date"],
td input:not([type]) {
  padding: 3px 5px;
  font-size: 14px;
  width: auto;
  min-width: 1ch;
  max-width: 100%;
  box-sizing: content-box;
  border: 1px solid #ccc;
  background-color: white;
}

td input.email-cell {
  width: 100%;
  max-width: none;
}


/* --- Кнопки --- */
button {
  padding: 5px 10px;
  margin: 2px;
  cursor: pointer;
}

button:hover {
  background-color: #e9ecef;
}

/* --- Контейнер таблиц --- */
.table-container {
  overflow-x: auto;
  display: block;
  max-width: 100%;
}

/* --- Сайдбар --- */
.sidebar {
  width: 200px;
  background-color: #f1f1f1;
  padding: 15px;
  border-right: 1px solid #ccc;
  height: calc(100vh - 45px);
  position: fixed;
  top: 45px;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar .welcome {
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

.sidebar a {
  display: block;
  padding: 10px;
  background: #ffffff;
  text-decoration: none;
  color: #007bff;
  border-radius: 4px;
}

.sidebar a:hover {
  background-color: #e9ecef;
}

.main-dashboard-content {
  margin-left: 220px;
  padding: 20px;
  flex-grow: 1;
}

/* --- Общий стиль модалок --- */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: none;
  width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

/* --- Заголовок модалки --- */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f0f0f0;
  border-bottom: 1px solid #ccc;
  padding: 8px 12px;
  margin: -20px -20px 10px -20px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

#modalTitle,
#terminalModalTitle {
  font-size: 18px;
  font-weight: bold;
  user-select: none;
}

/* --- Кнопка закрытия (крестик) --- */
.close-btn,
.close {
  font-size: 20px;
  font-weight: bold;
  color: #555;
  cursor: pointer;
  margin-left: auto;
  padding-left: 16px;
}

.close-btn:hover,
.close:hover {
  color: #000;
}

/* --- Вводы и подписи в модалке --- */
.modal form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal label {
  font-weight: normal;
  font-size: 14px;
}

.modal input[type="text"] {
  height: 32px;
  padding: 6px 8px;
  line-height: 1.2;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-sizing: border-box;
  width: 100%;
}

/* --- Кнопки в модалке --- */
.modal button {
  margin-right: 10px;
  padding: 5px 10px;
}

/* --- Модалки driver/truck/chassis/unit (устаревшие) --- */
#driverModal,
#truckModal,
#chassisModal,
#unitModal {
  display: none;
  background: white;
  border: 1px solid #333;
  padding: 20px;
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

#driverModal input,
#truckModal input,
#chassisModal input,
#unitModal input,
#driverModal select,
#truckModal select,
#chassisModal select,
#unitModal select {
  margin: 4px 0;
  padding: 6px;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

.hours-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#contextMenu li:hover {
  background-color: #f1f1f1;
}

.table-scroll-wrapper {
  max-height: 1000px; /* можно настроить под высоту экрана */
  overflow-y: auto;
  border: 1px solid #ccc;
  position: relative;
}

/* фиксируем заголовки таблицы */
.table-scroll-wrapper thead th {
  position: sticky;
  top: 0;
  background-color: #f0f0f0;
  z-index: 2;
  border-bottom: 2px solid #999;
}

#driversTable th:first-child,
#driversTable td:first-child {
  width: 50px;
  text-align: center;
}

.fixed-input {
  width: 120px;
  padding: 4px 6px;
  font-size: 14px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  background-color: white;
}

.fixed-input:disabled {
  background-color: transparent;
  border: none;
  padding-left: 0;
}

.row-selected td {
  background-color: #e0f3ff !important;
}

#driversTable tbody tr:hover td {
  background-color: #f2f2f2;
}

.custom-context li {
  padding: 8px 12px;
  cursor: pointer;
}
.custom-context li:hover {
  background: #f0f0f0;
}

.tire-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
}

.tire-diagram input {
  width: 80px;
  font-size: 13px;
}

.axle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.wheel-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wheel {
  width: 30px;
  height: 60px;
  background: #555;
  border-radius: 4px;
}

.axle-label {
  font-weight: bold;
  font-size: 18px;
  padding: 0 12px;
  color: #333;
}

.wide-email-input {
  width: 300px;
  padding: 4px 6px;
  font-size: 14px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  background-color: white;
}

.wide-email-input:disabled {
  background-color: transparent;
  border: none;
  padding-left: 0;
}

#driversTable th:nth-child(19),
#driversTable td:nth-child(19) {
  width: 300px;
}

.unit-box {
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  background-color: #fdfdfd;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.05);
}

tr.highlighted {
  background-color: #fffcba !important;
  transition: background-color 0.5s ease;
}

.unit-box:first-child {
  background-color: #fff8e1;
  border: 1px solid #f7c948;
}