/* 1) Подключаем Inter из Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #1c2a45;        /* светлее, чем #0f1a2f */
  --fg: #eaeef5;
  --muted: #a5b3cc;
  --border: #2c3e5e;
  --accent: #4ea1ff;    /* чуть ярче акцент */
  --overlay: rgba(0, 0, 0, 0.6);

  --radius: 10px;
  --shadow: 0 4px 12px rgba(0,0,0,0.2);
  --shadow-hover: 0 6px 20px rgba(0,0,0,0.3);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2c3e5e;
    --fg: #eaeef5;
    --border: #1f2d4a;
    --muted: #9aa7c1;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-hover: 0 6px 20px rgba(0,0,0,0.4);
  }
}

* { box-sizing: border-box; }

html, body {
  
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #1c2a45 0%, #223654 100%);
  background-repeat: no-repeat;
  background-size: cover;
  
  margin: 0;
  padding: 0;

  /* 1) Интер шрифт */
  font-family: 'Inter', ui-sans-serif, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--fg);
  line-height: 1.4;
  transition: background-color 0.3s ease, color 0.3s ease;

  /* повторяем точечный паттерн, градиент растягиваем */
  background-repeat: repeat, no-repeat;
  background-size: 16px 16px, cover;
}

body.no-scroll { overflow: hidden; }

/* Улучшенное выравнивание и отступы для заголовков */
h1 {
  font-size: 28px;
  line-height: 1.12;
  font-weight: 700;
  margin: 18px 16px 6px;    /* сверху, по бокам, снизу */
  text-align: center;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  word-break: break-word;
  color: var(--fg);         /* использовать вашу переменную цвета */
}

/* Блок заголовка — аккуратно центрируем и отделяем от панели поиска */
.site-header {
  max-width: 1100px;
  margin: 6px auto 18px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  text-align: center;
  z-index: 1;
}

/* Заголовок сайта — более выразительный, но не громоздкий */
.site-title,
h1 {
  font-size: 28px;
  line-height: 1.08;
  font-weight: 700;
  margin: 0;
  color: var(--fg);
  letter-spacing: -0.2px;
  word-break: break-word;
  text-rendering: optimizeLegibility;
}

/* Подзаголовок SEO — компактный, контрастный и адаптивный */
.seo-h2 {
  font-size: 14px;
  line-height: 1.3;
  margin: 0;
  color: var(--muted);
  max-width: 980px;
  padding: 0 8px;
}

/* Ссылка в SEO-подзаголовке — аккуратно, без подчёркивания */
.seo-h2 a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  margin-left: 8px;
}
.seo-h2 a:hover {
  text-decoration: underline;
}

/* Небольшая разделительная линия (опционально) */
.site-header::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  margin-top: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(78,161,255,0.95), rgba(78,161,255,0.4));
  opacity: 0.9;
}

/* Уменьшаем размер текста на очень маленьких экранах */
@media (max-width: 520px) {
  .site-title { font-size: 20px; }
  .seo-h2 { font-size: 13px; }
  .site-header::after { width: 48px; height: 1.6px; margin-top: 8px; }
}

/* Предотвращаем наложение top-bar и header (если top-bar фиксирован) */
.top-bar {
  position: relative;
  z-index: 2;
}

.top-bar {
  max-width: 1100px;
  margin: 0 auto 10px;
  padding: 0 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 16px;
  justify-content: center;
}

/* кнопки */
button {
  background: linear-gradient(135deg, var(--accent), #1b4db1);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease, filter 0.25s ease;
;
}
button:hover {
  filter: brightness(1.05);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
button:active {
  transform: translateY(1px) scale(0.98);
  transition: transform 0.05s ease;
}

.searchbar {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 420px;
}

#search-input {
  flex: 1 1 auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

/* анимации */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeOutDown {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(4px); }
}

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 92px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow: auto;
  z-index: 20;
  animation: fadeInUp 0.18s ease-out;
}
.suggestions.hidden { display: none; }

.suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.suggestion-item:hover { background: #f6f8fa; }
.suggestion-code { font-weight: 700; }
.suggestion-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Контейнер таблицы */
#table-wrap {
  max-width: 1200px;
  margin: 32px auto 24px auto;
  /* Убрать фон, рамку, padding и border-radius */
  background: none !important;
  color: inherit !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow-x: visible;
}

/* Сама таблица */
#parts-table {
  width: 100% !important;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 16px;
  table-layout: auto;
}

#parts-table th, #parts-table td {
  border: 1px solid #2a3a5a;
  padding: 8px 10px;
  text-align: left;
  word-break: break-word;
}

#parts-table th:nth-child(1), #parts-table td:nth-child(1) { width: 100px; }
#parts-table th:nth-child(2), #parts-table td:nth-child(2) { width: 160px; }
#parts-table th:nth-child(3), #parts-table td:nth-child(3) { width: 500px; }
#parts-table th:nth-child(4), #parts-table td:nth-child(4) { width: 300px; }

#parts-table th {
  background: rgba(78,161,255,0.12);
  color: #4ea1ff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.2px;
}

#parts-table tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}

#parts-table img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #2a3a5a;
  background: #222c;
  display: block;
  margin: 0 auto;
}

.dataTables_wrapper {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: auto;
}

.dataTables_scrollBody {
  background: #1a2740 !important;
  color: #fff !important;
  min-height: 300px !important;
  max-height: 60vh !important;
}

/* Адаптация под мобильные */
@media (max-width: 1200px) {
  #table-wrap { max-width: 100vw; }
  #parts-table th:nth-child(3), #parts-table td:nth-child(3) { width: 220px; }
  #parts-table th:nth-child(4), #parts-table td:nth-child(4) { width: 120px; }
  #parts-table { font-size: 13px; }
}

/* Контейнер таблицы */
#table-wrap {
  max-width: 1100px;
  margin: 32px auto 24px auto;
  padding: 0 16px 16px 16px;
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 2px 8px #0002);
  background: var(--bg, #1a2740);
  color: var(--fg, #fff);
  overflow-x: auto;
}

#parts-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  color: var(--fg, #fff);
  font-size: 15px;
  margin: 0;
  table-layout: fixed;
}

#parts-table th, #parts-table td {
  border: 1px solid var(--border, #2a3a5a);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
  background: transparent;
  color: var(--fg, #fff);
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

#parts-table th:nth-child(1), #parts-table td:nth-child(1) { width: 90px; }
#parts-table th:nth-child(2), #parts-table td:nth-child(2) { width: 120px; }
#parts-table th:nth-child(3), #parts-table td:nth-child(3) { width: 340px; }
#parts-table th:nth-child(4), #parts-table td:nth-child(4) { width: 220px; }

#parts-table img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--border, #2a3a5a);
  background: #222c;
  display: block;
  margin: 0 auto;
}

@media (max-width: 900px) {
  #parts-table {
    min-width: 520px;
    font-size: 13px;
  }
  #parts-table th, #parts-table td {
    font-size: 12px;
    padding: 6px 4px;
    max-width: 120px;
  }
  #parts-table img {
    width: 60px;
    height: 44px;
  }
}

#table-wrap:hover { box-shadow: var(--shadow-hover); }

.hidden { display: none !important; }

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius);
}
.dataTables_wrapper .dataTables_filter { display: none; }

#parts-table img.thumb {
  width: 110px;
  height: 78px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: #f0f0f0;
}

/* модалка */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.modal.open { display: flex; }

.modal .modal-body {
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 8px;
}

/* Изображение во всю доступную область с сохранением пропорций */
.modal-content,
#modal-img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain; /* сохраняет пропорции */
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  cursor: zoom-out;
}

/* Когда браузер в полноэкранном режиме, убираем скругления */
:fullscreen .modal-content,
:-webkit-full-screen .modal-content {
  border-radius: 0;
  box-shadow: none;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
}

/* Мобильные мелочи */
@media (max-width: 520px) {
  .modal .modal-body { padding: 4px; }
  .modal-content { border-radius: 6px; }
}

/* контакты в модалке */
.contact-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.contact-actions a {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 4px;
  font-weight: 500;
  background: var(--accent);
  color: white;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease;
}
.contact-actions a:hover {
  opacity: 0.9;
  box-shadow: var(--shadow-hover);
}
.contact-actions.hidden { display: none !important; }

/* футер */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: white;
  padding: 8px 12px;
  font-size: 14px;
  display: flex;
  justify-content: center;
  gap: 20px;
  z-index: 1000;
}
.site-footer a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}
.site-footer a:hover { text-decoration: underline; }

/* адаптив */
@media (max-width: 560px) {
  #parts-table img.thumb { width: 90px; height: 64px; }
}

/* поиск с крестиком */
.search-wrapper {
  position: relative;
  flex: 1 1 auto;
}
.search-wrapper input {
  width: 100%;
  padding: 10px 30px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.clear-btn {
  position: absolute;
  right: 8px;
  /* вместо top:50% + transform: */
  top: 50%;
  margin-top: -9px;     /* - (height/2) */
  width: 18px;
  height: 18px;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  display: none;
  transition: color 0.2s ease;
  padding: 0;
}
.clear-btn:hover {
  color: var(--fg);
}

.purchase-note {
  max-width: 1100px;
  margin: 0 auto 8px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--muted);
}

.modal.fade-in { animation: fadeInUp 0.25s ease-out; }

.cards-wrap {
  max-width: 600px; /* уменьшили ширину области карточек */
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* всегда две карточки в ряд */
  gap: 16px;
  transition: opacity 1.2s, visibility 1.2s, transform 1.2s;
  opacity: 1;
  visibility: visible;
}

.card {
  max-width: 240px;      /* уменьшили ширину карточки */
  min-height: 280px;     /* уменьшили высоту карточки */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  margin: 0 auto;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;     /* уменьшили внутренние отступы */
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  color: var(--fg);
  box-sizing: border-box;      /* обязательно! */
}

.card-img {
  max-width: 210px;   /* было 140px, стало в 1,5 раза больше */
  height: 120px;      /* было 80px, стало в 1,5 раза больше */
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f0f0f0;
  margin-bottom: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.card-code,
.card-title {
  word-break: break-word;      /* перенос длинных слов */
  overflow-wrap: anywhere;     /* перенос по любой точке */
  text-align: center;
  white-space: normal;         /* разрешаем перенос строк */
  max-width: 100%;             /* не выходить за пределы карточки */
  overflow: hidden;
  display: block;
}

.card-code {
  font-size: 15px;       /* вернули прежний размер */
  font-weight: 500;
  color: #fff;         /* белый цвет */
  margin-bottom: 4px;
  text-align: center;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);   /* вернули акцентный цвет */
  margin-bottom: 4px;
  text-align: center;
}

.card-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;   /* уменьшили отступ */
  text-align: center;
  min-height: 18px;     /* ещё меньше высота */
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-button {
  margin-top: auto;
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, filter 0.2s ease;
}

.card-button:hover {
  box-shadow: var(--shadow-hover);
  filter: brightness(1.1);
}

/* Стилизация пагинации DataTables */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--fg) !important;
  background: none !important;
  border: none !important;
  padding: 6px 10px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  color: var(--accent) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: var(--radius);
}

/* ========== Override DataTables pagination ========== */
#parts-table_wrapper .dataTables_paginate .paginate_button {
  color: var(--fg) !important;
  background: none !important;
  border: none !important;
  padding: 6px 10px;
  font-weight: 500;
}

#parts-table_wrapper .dataTables_paginate .paginate_button:hover {
  color: var(--accent) !important;
  background: rgba(255,255,255,0.1) !important;
  border-radius: var(--radius);
}

/* Активная страница */
#parts-table_wrapper .dataTables_paginate .paginate_button.current {
  color: white !important;
  background: var(--accent) !important;
}

/* Делает выплывающую подсказку непрозрачной */
.suggestions {
  background-color: var(--bg);
}

/* Подсветка строки в подсказках для тёмной темы */
.suggestion-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Индикатор загрузки */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}

.loading-spinner span {
  width: 18px;
  height: 18px;
  border: 3px solid var(--muted);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Анимация вращения */
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#results {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height 1.2s cubic-bezier(.4,0,.2,1), opacity 1.2s;
}

#results.open {
  opacity: 1;
}

.table-wrap {
  width: 100%;
  margin-top: 20px;
}

.hidden {
  display: none !important;
}

.table-wrap {
  width: 100%;
  margin-top: 20px;
}

/* Упрощённое переключение без анимации */
.results {
  display: none; /* По умолчанию скрыт */
  background-color: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.results.open {
  display: block;
}

.note {
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--muted);
}

/* ------------------------------------------------------------------------
   Подсветка строки, выбранной из подсказок
------------------------------------------------------------------------- */
#parts-table tbody tr.highlight {
  animation: fadeHighlight 2s ease-out forwards;
}

/* ключевые кадры для плавного угасания */
@keyframes fadeHighlight {
  from {
    background-color: rgba(78, 161, 255, 0.3);  /* оттенок вашего --accent с прозрачностью */
  }
  to {
    background-color: transparent;
  }
}

.cards-wrap,
#table-wrap {
  transition: opacity 1.2s, visibility 1.2s;
  opacity: 1;
  visibility: visible;
}

.cards-wrap.hidden,
#table-wrap.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0s; /* убрали задержку для более плавного старта */
}

.cards-wrap.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(30px); /* плавный сдвиг вниз при скрытии */
  transition-delay: 0s;
}

/* Кнопка закрытия модалки — стандарт: правый верхний угол */
.modal .close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1100;
  background: rgba(0,0,0,0.45);
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Более крупная область клика на мобильных */
@media (max-width: 520px) {
  .modal .close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    font-size: 26px;
  }
}

/* Скрываем футер при открытой модалке (body.no-scroll добавляется в openModal) */
body.no-scroll .site-footer {
  display: none !important;
}

.dataTables_wrapper {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: auto;
}

#parts-table th:nth-child(1),
#parts-table td:nth-child(1) {
  width: 80px;
  min-width: 60px;
  max-width: 100px;
}
#parts-table th:nth-child(2),
#parts-table td:nth-child(2) {
  width: 120px;
  min-width: 80px;
  max-width: 160px;
}
#parts-table th:nth-child(3),
#parts-table td:nth-child(3) {
  width: 320px;
  min-width: 120px;
  max-width: 400px;
}
#parts-table th:nth-child(4),
#parts-table td:nth-child(4) {
  width: 200px;
  min-width: 80px;
  max-width: 300px;
}

.dataTables_scrollBody {
  background: var(--bg, #1a2740) !important;
  color: var(--fg, #fff) !important;
  min-height: 200px !important;
  max-height: 60vh !important;
}

/* Стили для DataTables под тему сайта */
.dataTables_wrapper {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
}

.dataTables_length, .dataTables_filter {
  color: var(--fg);
  margin-bottom: 10px;
}

.dataTables_length select, .dataTables_filter input {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px;
}

#parts-table {
  background: var(--bg);
  color: var(--fg);
}

#parts-table th {
  background: rgba(78,161,255,0.12); /* Акцентный фон для заголовков */
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

#parts-table td {
  border-bottom: 1px solid var(--border);
}

#parts-table tr:nth-child(even) {
  background: rgba(255,255,255,0.02);
}

#parts-table tr:hover {
  background: rgba(78,161,255,0.1); /* Hover с акцентом */
}

.dataTables_paginate .paginate_button {
  color: var(--fg) !important;
  background: none !important;
  border: none !important;
  padding: 6px 10px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.dataTables_paginate .paginate_button:hover {
  color: var(--accent) !important;
  background: rgba(255,255,255,0.05) !important;
  border-radius: var(--radius);
}

.dataTables_paginate .paginate_button.current {
  color: white !important;
  background: var(--accent) !important;
  border-radius: var(--radius);
}

.dataTables_paginate .paginate_button.disabled {
  color: var(--muted) !important;
}

.dataTables_info {
  color: var(--muted);
  margin-top: 10px;
}

/* Адаптация под мобильные */
@media (max-width: 768px) {
  .dataTables_wrapper {
    overflow-x: auto;
  }
  #parts-table th, #parts-table td {
    padding: 6px;
    font-size: 13px;
  }
  #parts-table img {
    max-width: 50px;
    max-height: 50px;
  }
}

/* Улучшенные стили для селекта в DataTables */
.dataTables_length select {
  background: var(--bg); /* Тёмный фон */
  color: var(--fg); /* Светлый текст */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px;
  appearance: none; /* Убираем дефолт стрелку для кастомизации */
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23eaeef5" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); /* Кастом стрелка вниз */
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.dataTables_length select option {
  background: var(--bg); /* Тёмный фон для опций */
  color: var(--fg); /* Светлый текст для опций */
}

.dataTables_length select option:hover {
  background: rgba(78,161,255,0.1); /* Hover с акцентом */
  color: var(--accent);
}

/* Усиление скрытия для предотвращения наложения */
.cards-wrap.hidden,
#table-wrap.hidden {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* Позиционирование контейнеров */
.cards-wrap,
#table-wrap {
  position: relative;
  z-index: 0;
}

/* Упрощённое переключение без анимации (обновлённое) */
.results {
  display: none; /* По умолчанию скрыт */
  background-color: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.results.open {
  display: block;
}

/* Стили для селекта (обновлённые с !important для перезаписи) */
.dataTables_length select {
  background: var(--bg) !important; /* Тёмный фон */
  color: var(--fg) !important; /* Светлый текст */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23eaeef5" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.dataTables_length select option {
  background: var(--bg) !important;
  color: var(--fg) !important;
}

.dataTables_length select option:hover {
  background: rgba(78,161,255,0.1) !important;
  color: var(--accent) !important;
}

#table-wrap {
  padding-bottom: 80px !important; /* или другое подходящее значение */
}

.dataTables_length {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
}
.table-total-inline {
  font-size: 15px;
  color: #4ea1ff;
  margin-left: 24px;
  white-space: nowrap;
}