 /* Основные стили */
 body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background-color: #f4f4f9;
  color: #333;
}
h2, h3 {
  color: #555;
}
form {
  margin-bottom: 20px;
  padding: 15px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}
label {
  font-weight: bold;
}
select, input[type="text"], input[type="button"] {
  margin: 10px 0;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  width: 100%;
}
input[type="button"] {
  background: #007bff;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}
input[type="button"]:hover {
  background: #0056b3;
}
#results {
  margin-top: 20px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin-bottom: 10px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}
th, td {
  padding: 12px 15px;
  text-align: left;
  border: 1px solid #ddd;
}
th {
  background: #007bff;
  color: white;
  cursor: pointer;
  position: relative;
}
th.sort-asc::after {
  content: " ▲";
  position: absolute;
  right: 10px;
}
th.sort-desc::after {
  content: " ▼";
  position: absolute;
  right: 10px;
}
tr:nth-child(even) {
  background-color: #f9f9f9;
}
tr:hover {
  background-color: #f1f1f1;
  cursor: pointer;
}
.details-container {
  padding: 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin: 0 auto;
}
.field-group {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #f9f9f9;
}
.field-group .edit-icon {
  margin-right: 10px;
  cursor: pointer;
  color: #007bff;
  font-size: 18px;
}
.field-group .edit-icon:hover {
  color: #0056b3;
}
.field-group p {
  margin: 0;
  flex-grow: 1;
  display: flex;
  align-items: center;
}
.field-group p strong {
  margin-right: 10px;
  width: 200px; /* Фиксированная ширина для заголовков */
}
.editable-input, .editable-select {
  width: 100%;
  padding: 5px;
  font-size: 14px;
  border: 1px solid #007bff;
  border-radius: 5px;
}
.save-btn {
  padding: 5px 10px;
  margin-left: 10px;
  background-color: #28a745;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.save-btn:hover {
  background-color: #218838;
}
.action-buttons {
  text-align: center;
  margin-top: 20px;
}
button {
  padding: 10px 15px;
  border: none;
  background: #007bff;
  color: white;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  margin-right: 10px;
}
button:hover {
  background: #0056b3;
}
.record-count {
  margin-bottom: 10px;
  font-weight: bold;
}

/* Стиль для сообщений об ошибках */
.error-message {
  color: #dc3545;
  font-weight: bold;
  margin-top: 10px;
}

/* Modal Styles */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 30%;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
}
.modal-content {
  background-color: #fefefe;
  margin: 10% auto; /* 10% from the top and centered */
  padding: 20px;
  border: 1px solid #888;
  width: 50%; /* Could be more or less, depending on screen size */
  border-radius: 10px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
}
.modal-display a {
  color: #007bff;
  text-decoration: none;
}
.modal-display a:hover {
  text-decoration: underline;
}
.modal-buttons {
  text-align: right;
  margin-top: 20px;
}
.modal-buttons button {
  padding: 8px 12px;
  margin-left: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}
.modal-buttons .close-modal-btn {
  background-color: #dc3545;
  color: white;
}
.modal-buttons .close-modal-btn:hover {
  background-color: #c82333;
}