/* Цвета и базовые стили */
body {
  margin: 0;
  padding: 20px;
  background-color: #dbe9d5; /* светло-зеленый фон страницы */
  font-family: Georgia, serif;
  color: #f0f9eb;
}

/* Контейнер страницы */
.container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: #5a6b5a; /* темно-зеленый фон основного блока */
  padding: 20px 30px 40px 30px;
  box-sizing: border-box;
  border-radius: 4px;
}

/* Заголовок */
h1 {
  font-style: italic;
  font-weight: 700;
  font-size: 2.5rem;
  text-align: center;
  margin: 0 0 20px 0;
  color: #c9d9c2; /* светло-зеленый */
}

/* Навигация с кнопками */
nav {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

nav button {
  flex: 1 1 100px;
  background-color: #6e866e;
  border: none;
  color: #c9d9c2;
  font-style: italic;
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 0;
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s;
}

nav button:hover {
  background-color: #8aa38a;
}

nav > button::after {
  content: "▲";
  font-size: 0.8rem;
  margin-left: 6px;
  vertical-align: middle;
}

/* Поле поиска */
.search-container {
  flex-grow: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 220px;
}

.search-container input[type="text"] {
  width: 200px;
  padding: 8px 12px;
  border: none;
  border-radius: 2px 0 0 2px;
  font-size: 1rem;
  font-family: Georgia, serif;
  outline: none;
}

.search-container button {
  width: 20px;
  padding: 8px 0;
  border-radius: 0 2px 2px 0;
  cursor: pointer;
  color: #c9d9c2;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.search-container button:hover {
  background-color: #8aa38a;
}

/* Иконка лупы */
.search-container button svg {
  fill: currentColor;
  width: 18px;
  height: 18px;
}

/* Блок с текстом под навигацией */
.description {
  color: #e3e9db;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Таблица */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: #f7fbf2;
  color: #526952;
  font-size: 0.9rem;
}

thead tr {
  background-color: #8ca793;
  color: #f7fbf2;
}

thead th {
  padding: 10px 8px;
  border: 1px solid #5a6b5a;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

tbody td {
  border: 1px solid #5a6b5a;
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  min-width: 80px;
}

/* Нумерация и заголовок № */
thead th:first-child {
  width: 40px;
}

thead th:nth-child(2) {
  width: 90px;
}

thead th:nth-child(3) {
  width: 160px;
  text-align: center;
  padding-left: 12px;
}

.table-wrapper {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #5a6b5a;
  border-radius: 4px;
  background-color: #f7fbf2;
}

nav {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-item {
  position: relative;
  flex: 1 1 100px;
}

/* Кнопки навигации */
.nav-item > button {
  width: 100%;
  background-color: #6e866e;
  border: none;
  color: #c9d9c2;
  font-style: italic;
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 0;
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-item > button:hover,
.nav-item > button.active {
  background-color: #8aa38a;
}

.nav-item:first-child::after {
  content: "";
}

/* Стрелочка справа */
.nav-item > button::after {
  content: "▲";
  font-size: 0.8rem;
  margin-left: 6px;
  vertical-align: middle;
  transition: transform 0.3s;
}

/* Поворот стрелочки при активном подменю */
.nav-item > button.active::after {
  transform: rotate(180deg);
}

/* Подменю */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #6e866e;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  min-width: 160px;
  display: none;
  flex-direction: column;
  z-index: 1000;
}

/* Показать подменю */
.submenu.show {
  display: flex;
}

/* Ссылки в подменю */
.submenu a {
  color: #c9d9c2;
  text-decoration: none;
  padding: 8px 12px;
  font-style: italic;
  font-weight: 600;
  font-size: 0.9rem;
  border-top: 1px solid #5a6b5a;
  transition: background-color 0.3s;
}

.submenu a:first-child {
  border-top: none;
}

.submenu a:hover {
  background-color: #8aa38a;
}

/* Ссылки в подменю */
.dropdown-submenu {
  color: #c9d9c2;
  text-decoration: none;
  padding: 8px 0px;
  font-style: italic;
  font-weight: 600;
  font-size: 0.9rem;
  border-top: 1px solid #5a6b5a;
  transition: background-color 0.3s;
}

.sdropdown-submenu:first-child {
  border-top: none;
}

.dropdown-submenu:hover {
  background-color: #8aa38a;
}

/* Стили для контейнера вложенного меню */
.dropdown-submenu {
  position: relative;
}

/* Вложенное подменю (скрыто по умолчанию) */
.submenu.nested {
  position: absolute;
  top: 0;
  left: 100%; /* Позиционирует вложенное меню справа */
  background-color: #6e866e;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  min-width: 160px;
  display: none;
  flex-direction: column;
  z-index: 100;
}

/* Показать вложенное подменю при наведении на родительский пункт */
.dropdown-submenu:hover .submenu.nested {
  display: flex;
}

/* Ссылки во вложенном подменю */
.submenu.nested a {
  color: #c9d9c2;
  text-decoration: none;
  padding: 8px 12px;
  font-style: italic;
  font-weight: 600;
  font-size: 0.9rem;
  border-top: 1px solid #5a6b5a;
  transition: background-color 0.3s;
}

.submenu.nested a:first-child {
  border-top: none;
}

.submenu a:hover {
  background-color: #8aa38a;
}

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu::after {
  content: "❯";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #c9d9c2;
  pointer-events: none;
}

/* Поиск справа */
.search-container {
  flex-grow: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 220px;
}

#pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#totalDisplay {
text-align: center;        /* Центрируем текст, как пагинацию */
  margin-bottom: 10px;      /* Отступ снизу, чтобы разделить с кнопками (как margin-top у #pagination) */
  margin-top: 20px;
  font-size: 1rem;          /* Тот же размер шрифта, что и у кнопок */
  color: #6e866e;            /* Основной цвет текста, совпадает с background кнопок и текстом active */
  font-weight: 600;          /* Жирный шрифт, как у кнопок */
  font-family: inherit;      /* Наследуем шрифт от родителя (если он задан) */
  padding: 0;                /* Без paddings, чтобы не было лишнего пространства */
  line-height: 1.5;    
}


.page-button {
  background-color: #6e866e;
  border: none;
  color: #c9d9c2;
  font-style: italic;
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 15px;
  margin: 0 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.page-button:hover {
  background-color: #8aa38a;
}

.page-button.active {
  background-color: #8aa38a; /* Цвет для активной страницы */
}

.text-description {
  text-align: justify;
  text-indent: 30px;
  margin-bottom: 10px;
}

.text-description2 {
  text-align: center;
  margin-bottom: 10px;
}

.nav-item > a {
  width: 100%;
  background-color: #6e866e;
  border: none;
  color: #c9d9c2;
  font-style: italic;
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 0;
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-family: Arial;
}

.nav-item > a:hover,
.nav-item > a.active {
  background-color: #8aa38a;
}

.nav-item > a:focus {
  outline: 2px solid #c9d9c2;
  outline-offset: 2px;
}
