/* ================================
   style.css (ОБЪЕДИНЁННАЯ ВЕРСИЯ)
   /home/to_denis_moroz/oksana/oksana/static/css/style.css
   ================================ */
.draggable-block.audio {
  position: absolute;
  /* раз у нас draggable */
  display: inline-block;
  /* чтобы не занимал всю строку */
  width: auto;
  /* пусть подстраивается под контент */
  height: auto;
  /* то же самое по высоте */
  overflow: visible !important;
  /* нужно, чтобы крестик мог вылезти за границы */
  box-sizing: content-box;
  /* на всякий случай, чтобы padding не раздувал ширину */
  padding: 10px;
  background-color: #ffdfdf;
  /* Более яркий розовый фон */
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.draggable-block.audio audio {
  width: 200px;
  margin-top: 5px;
  margin-bottom: 5px;
  border-radius: 4px;
}

.draggable-block.audio .element-title {
  margin-top: 1px;
  margin-bottom: 5px;
}

.draggable-block.audio p:not(.element-title) {
  margin-top: 0px;
  margin-bottom: 5px;
}

.delete-element-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 26px;
  height: 26px;
  background-color: #ff4444;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  z-index: 9999;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* Отключаем подсветку при нажатии на мобильных */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  /* Добавляем тень для отделения от фона */
}

.delete-element-btn:hover,
.delete-element-btn:active {
  background-color: #cc0000;
}



/* ==== (НОВОЕ) Стили для контейнера волны и canvas ==== */
.visualizer-container {
  width: 100%;
  height: 100px;
  background: #fff;
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
}

#audioVisualizer {
  width: 90%;
  height: 80px;
  background: #fff;
  border-radius: 4px;
}

@media (max-width: 576px) {
  .visualizer-container {
    height: 120px;
  }

  #audioVisualizer {
    height: 100px;
  }
}


/******************************************************
 *  ДИЗАЙН МОДАЛКИ АУДИО (micModal)
 ******************************************************/
.modal-audio {
  position: relative;
  /* чтобы крестик мог быть абсолютным */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* на десктопе ~400px ширина, но уже есть width:400px в .modal */
}

/* Красный крестик в правом верхнем углу */
.close-audio-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #ff4444;
  /* красный цвет */
  font-size: 1.4rem;
  cursor: pointer;
}

.close-audio-btn:hover {
  color: #cc0000;
}

/* Область "футера", где будет большая кнопка STOP */
.audio-footer {
  margin-top: auto;
  /* прижать к низу */
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.big-stop-btn {
  background: #ff4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0.8rem 1.5rem;
  width: 20vw;
  /* 1/5 экрана (на десктопе) */
  max-width: 200px;
  /* но не больше 200px */
}

.big-stop-btn:hover {
  background: #dd0000;
}

/* Адаптация под мобильные (пример @media до 576px) */
@media (max-width: 576px) {
  .modal-audio {
    width: 80vw !important;
    /* заполняем 80% экрана */
    height: 80vh !important;
    /* и 80% высоты */
    max-width: none;
    /* убираем max-width, чтобы не сжимался */
    max-height: none;
    /* убираем max-height */
  }

  .big-stop-btn {
    width: 60vw;
    /* на мобильном делаем кнопку чуть шире */
  }
}



/* Menu Settings */

nav ul li.has-submenu {
  position: relative;
  /* это важно */
}

nav ul li.has-submenu ul.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  /* Белый фон вместо синего */
  padding: 0;
  margin: 0;
  min-width: 200px;
  list-style: none;
  z-index: 9999;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 0 0 4px 4px;
}

nav ul li.has-submenu:hover ul.submenu {
  display: block;
}

nav ul li.has-submenu ul.submenu li a {
  color: #25324A;
  /* Темный текст вместо белого */
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  transition: background 0.2s;
}

nav ul li.has-submenu ul.submenu li a:hover {
  background: #f0f4f8;
  /* Светло-серый фон для ховера */
  color: #007bff;
}

/* Исправление отображения на мобильных устройствах */
@media (max-width: 768px) {
  nav ul li.has-submenu ul.submenu {
    position: static;
    width: 100%;
    display: none;
    box-shadow: none;
    background: #f0f4f8;
    /* Светло-серый фон для мобильного подменю */
    padding-left: 20px;
  }

  nav ul li.has-submenu.active ul.submenu {
    display: block;
  }

  nav ul li.has-submenu>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

/* Добавьте эти стили в ваш style.css */


/* Добавляем/Меняем стили, чтобы всё было маленькое и в 1 строку */

.no-wrap-toolbar {
  display: flex;
  align-items: flex-end;
  /* чтобы кнопки выровнялись по нижнему краю, если нужно */
  gap: 12px;
  flex-wrap: nowrap;
  /* запрещаем перенос */
  overflow-x: auto;
  /* если совсем не влезает – появится горизонтальная прокрутка */
  white-space: nowrap;
  /* чтобы label/select и кнопки не переносились */
}

.diagram-select-wrap {
  display: flex;
  flex-direction: column;
  /* label над селектором */
  margin-right: 8px;
  /* небольшой отступ справа */
}

.diagram-select-wrap label {
  font-size: 14px;
  color: #333;
  /* при желании */
  margin-bottom: 2px;
  /* чуть-чуть отступ */
}

.diagram-select-wrap select {
  font-size: 14px;
  padding: 4px 6px;
  min-width: 110px;
  /* можно увеличить/уменьшить */
}

/* Кнопки, чуть побольше */
.big-btn {
  font-size: 14px;
  padding: 4px 8px;
}

/* А теперь уменьшаем всё на узких экранах */
@media (max-width: 576px) {
  .no-wrap-toolbar {
    gap: 6px;
  }

  .diagram-select-wrap label {
    font-size: 12px;
  }

  .diagram-select-wrap select {
    font-size: 12px;
    padding: 2px 4px;
    min-width: 90px;
  }

  .big-btn {
    font-size: 12px;
    padding: 2px 6px;
  }
}



/* Пример: ставим flex-wrap:nowrap; чтобы не переносилось */
.compact-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  /* уменьшенный зазор */
  flex-wrap: nowrap;
  /* всё в одну строку */
}

/* Блок с label+select */
.diag-select-row {
  display: flex;
  align-items: center;
  gap: 3px;
  /* совсем маленький отступ */
}

/* Уменьшаем шрифт label */
.diag-label {
  font-size: 12px;
  font-weight: normal;
  /* можно сбросить "жирность", если хотим ещё компактнее */
  color: #444;
}

/* Уменьшаем select */
.diagram-select.diag-compact {
  padding: 2px 4px;
  font-size: 12px;
  min-width: 90px;
  /* чтобы не расползался */
}

/* Кнопки ещё меньше */
.btn-compact {
  font-size: 12px;
  padding: 4px 6px;
  gap: 3px;
  /* Можно ещё убавить border-radius, напр. 2px */
}

.btn-compact i {
  font-size: 14px;
}

/* При очень маленьком экране (320px) всё же может не влезать.
   Можно ещё уменьшать */
@media (max-width: 320px) {
  .compact-toolbar {
    gap: 3px;
  }

  .diagram-select.diag-compact {
    min-width: 70px;
  }

  .btn-compact {
    font-size: 11px;
    padding: 3px 5px;
  }

  .btn-compact i {
    font-size: 12px;
  }
}


/* Стили для чат-элемента */
.draggable-block.chat-summary {
  background: white;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 15px;
  position: absolute;
  min-width: 300px;
}

/* Кнопки управления */
.control-buttons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
}

.simple-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 13px;
  cursor: pointer;
}

.simple-btn:hover {
  background: #e5e5e5;
}

.close-btn {
  padding: 2px 6px;
  font-size: 16px;
  line-height: 1;
}

/* Основной контент */
.chat-main {
  margin-top: 5px;
}

.chat-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.lightning {
  color: #666;
  opacity: 0.7;
}

.new-chat {
  background: #5b51d8;
  color: white;
  border: none;
}

.k-button {
  background: #ff6b6b;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 13px;
}

.chat-title {
  font-size: 24px;
  font-weight: bold;
  margin: 15px 0;
  color: #333;
}

.user-info {
  display: flex;
  align-items: center;
  color: #25324A;
  font-size: 14px;
  margin-right: 20px;
  margin-left: 20px;
}

.user-info i {
  font-size: 18px;
  margin-right: 8px;
  color: #25324A;
}

.user-avatar {
  width: 30px;
  height: 30px;
  background: #f0f0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  color: #5b51d8;
  font-weight: 500;
}

.message-area {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

.message-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.submit-arrow {
  background: none;
  border: none;
  color: #5b51d8;
  font-size: 18px;
  cursor: pointer;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.action-btn {
  padding: 6px 12px;
  border: 1px solid #5b51d8;
  border-radius: 15px;
  background: white;
  color: #5b51d8;
  font-size: 13px;
  cursor: pointer;
}

/* Диалоги */
.mini-dialog {
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.dialog-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.dialog-btn.cancel {
  background: #999;
  color: white;
}

.dialog-btn.delete {
  background: #ff4444;
  color: white;
}

.dialog-btn.confirm {
  background: #44cc44;
  color: white;
}

/* Маркеры изменения размера */
.resize-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #9d8ff7;
  border: 1px solid white;
  border-radius: 50%;
}

.top-left {
  top: -4px;
  left: -4px;
  cursor: nw-resize;
}

.top-right {
  top: -4px;
  right: -4px;
  cursor: ne-resize;
}

.bottom-left {
  bottom: -4px;
  left: -4px;
  cursor: sw-resize;
}

.bottom-right {
  bottom: -4px;
  right: -4px;
  cursor: se-resize;
}

.chat-summary {
  background: white !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  padding: 15px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  min-width: 300px !important;
  min-height: 400px !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  color: #333 !important;
}

.chat-summary .chat-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 15px !important;
  padding: 0 5px !important;
}

.chat-summary .chat-controls {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.chat-summary .chat-title {
  font-size: 18px !important;
  margin: 0 !important;
  color: #333 !important;
}

.chat-summary .switch-icon {
  color: #666 !important;
  opacity: 0.5 !important;
}

.chat-summary .chat-btn {
  all: unset;
  cursor: pointer !important;
  font-size: 14px !important;
}

.chat-summary .new-chat-btn {
  background: #5b51d8 !important;
  color: white !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
}

.chat-summary .letter-k {
  background: #ff6b6b !important;
  color: white !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
}

.chat-summary .chat-content {
  flex: 1 !important;
  margin: 20px 0 !important;
  min-height: 100px !important;
}

.chat-summary .user-message {
  display: flex !important;
  gap: 10px !important;
  margin-bottom: 15px !important;
}

.chat-summary .user-avatar {
  width: 30px !important;
  height: 30px !important;
  background: #f0f0f0 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.chat-summary .message-content {
  flex: 1 !important;
}

.chat-summary .username {
  color: #5b51d8 !important;
  font-weight: 500 !important;
  margin-bottom: 5px !important;
}

.chat-summary .message-text {
  color: #333 !important;
  line-height: 1.5 !important;
}

.chat-summary .chat-footer {
  margin-top: auto !important;
}

.chat-summary .message-input {
  display: flex !important;
  gap: 10px !important;
  margin-bottom: 15px !important;
}

.chat-summary .message-input input {
  flex: 1 !important;
  padding: 10px !important;
  border: 1px solid #ddd !important;
  border-radius: 6px !important;
  font-size: 14px !important;
}

.chat-summary .send-btn {
  color: #5b51d8 !important;
  font-size: 18px !important;
}

.chat-summary .action-buttons {
  display: flex !important;
  gap: 10px !important;
}

.chat-summary .action-btn {
  padding: 8px 15px !important;
  border: 1px solid #5b51d8 !important;
  border-radius: 20px !important;
  color: #5b51d8 !important;
}

.chat-summary .element-controls {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  display: flex !important;
  gap: 8px !important;
  z-index: 1500 !important;
}

.chat-summary .rename-control {
  background: #666 !important;
  color: white !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
}

.chat-summary .close-control {
  color: #666 !important;
  font-size: 20px !important;
  padding: 0 6px !important;
}

.chat-summary .close-control:hover {
  color: #333 !important;
}

.chat-summary .mini-dialog {
  position: absolute !important;
  background: white !important;
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  padding: 8px 12px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  z-index: 2000 !important;
  display: none;
  flex-direction: column !important;
  gap: 8px !important;
  font-size: 14px !important;
}

.chat-summary .dialog-buttons {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

.chat-summary .cancel-btn {
  background: #999 !important;
  color: white !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
}

.chat-summary .delete-btn {
  background: #e33 !important;
  color: white !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
}

.chat-summary .rename-btn {
  background: #3c3 !important;
  color: white !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
}

.chat-summary .mini-dialog input[type="text"] {
  padding: 4px 6px !important;
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  width: 200px !important;
}

/* Основные стили элемента */
.draggable-block.chat-summary {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-width: 300px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  position: relative;
  color: #333;
}

/* Элементы управления */
.element-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 1500;
}

.control-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.rename-control {
  background: #666;
  color: white;
}

.close-control {
  background: transparent;
  color: #666;
  font-size: 20px;
  line-height: 1;
  padding: 0 6px;
}

/* Маркеры изменения размера */
.resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: transparent;
  z-index: 1000;
}

.resize-handle::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: #9d8ff7;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #9d8ff7;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.top-left {
  top: -8px;
  left: -8px;
  cursor: nw-resize;
}

.top-right {
  top: -8px;
  right: -8px;
  cursor: ne-resize;
}

.bottom-left {
  bottom: -8px;
  left: -8px;
  cursor: sw-resize;
}

.bottom-right {
  bottom: -8px;
  right: -8px;
  cursor: se-resize;
}

/* Рамка при наведении и изменении размера */
.resizable::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px dashed #9d8ff7;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.resizable:hover::after,
.resizable.resizing::after {
  opacity: 1;
}






/* =========== RESET / BASE =========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  /* margin-top: 60px; - удалено, теперь padding-top задается в menu.css */
  background-color: #25324A;
  /* тот же цвет, что у футера */
  color: #ffffff;
  min-height: 100vh;
  margin: 0;
}

/* Кнопки тулбара, иконки */
.toolbar-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: background-color 0.2s;
}

.toolbar-btn:hover {
  background-color: #eee;
  border-radius: 8px;
}

.toolbar-btn i {
  font-size: 1.4rem;
  color: #666;
  border: none !important;
  background: none !important;
  margin: 0;
  padding: 0;
}

.toolbar-btn:hover i {
  color: #000;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* =========== HEADER & NAV =========== */
.site-header {
  background: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  position: relative;
}

/* Logo styles */
.logo-area {
  display: flex;
  align-items: center;
  padding-right: 16px;
}

.logo img {
  height: 20px;
  width: auto;
}

/* User info styles */
.user-info {
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 14px;
  margin: 0 auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.user-info i {
  font-size: 20px;
  margin-right: 8px;
}

/* Мобильное меню - чекбокс */
.burger-checkbox {
  display: none;
}

/* Стили для бургер-иконки */
.burger {
  display: none;
  /* Скрываем на десктопе */
  width: 30px;
  height: 22px;
  position: relative;
  cursor: pointer;
  margin-left: auto;
  z-index: 1001;
}

.burger span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transition: .25s ease-in-out;
}

.burger span:nth-child(1) {
  top: 0px;
}

.burger span:nth-child(2) {
  top: 9px;
}

.burger span:nth-child(3) {
  top: 18px;
}

/* Анимация бургера при активации */
.burger-checkbox:checked~.burger span:nth-child(1) {
  top: 9px;
  transform: rotate(45deg);
}

.burger-checkbox:checked~.burger span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.burger-checkbox:checked~.burger span:nth-child(3) {
  top: 9px;
  transform: rotate(-45deg);
}

/* Основная навигация */
.main-nav {
  margin-left: auto;
  /* Прижимаем меню вправо */
}

.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav ul li {
  position: relative;
}

.main-nav ul li a {
  display: block;
  color: #25324A;
  text-decoration: none;
  padding: 0 15px;
  line-height: 60px;
  font-size: 14px;
  transition: color 0.2s;
}

.main-nav ul li a:hover {
  background-color: rgba(37, 50, 74, 0.1);
}

/* Подменю */
.has-submenu {
  position: relative;
}

.submenu {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  background: #1a273e;
  min-width: 200px;
  z-index: 1010;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border-radius: 0 0 4px 4px;
}

.has-submenu:hover .submenu {
  display: block;
}

.submenu li {
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.submenu li:last-child {
  border-bottom: none;
}

.submenu li a {
  display: block;
  padding: 10px 15px;
  line-height: normal;
  color: white;
  font-size: 14px;
}

.submenu li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #007bff;
}

/* Стили для мобильных устройств */
@media (max-width: 768px) {
  .burger {
    display: block;
    /* Показываем бургер на мобильных */
  }

  .main-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #25324A;
    display: none;
    /* Прячем меню по умолчанию */
    overflow-y: auto;
    z-index: 999;
  }

  /* Показываем меню при активации чекбокса */
  .burger-checkbox:checked~.main-nav {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
  }

  .main-nav ul li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .main-nav ul li a {
    padding: 15px;
    line-height: normal;
  }

  /* Подменю на мобильных */
  .submenu {
    position: static;
    display: none;
    width: 100%;
    box-shadow: none;
    background: #1a273e;
    padding-left: 15px;
  }

  /* ИСПРАВЛЕНО: Отменяем hover эффект ТОЛЬКО на мобильных */
  @media (max-width: 768px) {
    .has-submenu:hover .submenu {
      display: none !important;
    }
  }

  .has-submenu.active .submenu {
    display: block;
  }

  /* Иконка стрелки для подменю */
  .submenu-toggle i {
    transition: transform 0.3s;
  }

  .has-submenu.active .submenu-toggle i {
    transform: rotate(180deg);
  }

  /* Стили для языкового селектора */
  .lang-select {
    padding: 15px;
  }

  .lang-select select {
    width: 100%;
    padding: 8px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
}

/* =========== MAIN (общие страницы) =========== */
.site-main {
  padding: 10px 1rem;
  margin-top: 60px;
  /* Отступ под фиксированную шапку */
  background-color: #f2f2f2;
  min-height: calc(100vh - 120px);
}

/* Пример для dashboard, user mgmt и т.д. */
.dashboard-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 15px;
  margin-top: 70px;
}

.dashboard-header {
  background-color: #fff;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.dashboard-nav {
  padding: 0 10px;
}

.dashboard-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dashboard-nav ul li {
  margin: 0;
}

.dashboard-nav ul li a {
  display: block;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.dashboard-nav ul li a:hover,
.dashboard-nav ul li a.active {
  color: #0077cc;
  border-bottom-color: #0077cc;
}

.dashboard-content {
  background-color: #f8f9fa;
  border-radius: 0 0 8px 8px;
  padding: 20px;
}

.report-block {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .dashboard-nav ul {
    flex-direction: column;
  }

  .dashboard-nav ul li a {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
  }

  .dashboard-nav ul li:last-child a {
    border-bottom: none;
  }

  .dashboard-content {
    padding: 15px;
  }

  .dashboard-container {
    padding: 10px;
    margin-top: 60px;
  }
}

/* =========== FOOTER =========== */
.site-footer {
  background-color: #25324A;
  padding: 1rem 0;
  text-align: center;
}

.site-footer .footer-container p {
  margin: 0;
  color: #fff;
}

/* =========== MODAL (логин, add user...) =========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  /* Убираем flex-центрирование */
  /* align-items: center; */
  /* justify-content: center; */
  z-index: 1100;
}

.modal-overlay.active {
  display: block;
  /* Меняем flex на block */
}

.modal {
  background: #fff;
  /* Возвращаем */
  color: #333;
  /* Возвращаем */
  padding: 2rem;
  /* Возвращаем */
  border-radius: 0.75rem;
  /* Возвращаем */
  width: 90%;
  /* Возвращаем */
  max-width: 400px;
  /* Возвращаем */
  /* position: relative; */
  /* Убираем это правило, чтобы Bootstrap мог использовать position: fixed */
  /* Возвращаем */
  /* Остальные стандартные стили Bootstrap не дублируем, если они там есть */
}

.close-btn {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-content .form-group {
  margin-bottom: 1rem;
}

.modal-content label {
  display: block;
  margin-bottom: 0.3rem;
  color: #333;
}

.submit-btn {
  background-color: #25324A;
  color: #fff;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem;
}

.submit-btn:hover {
  background-color: #1f2e3f;
}

/* =========== USER MANAGEMENT STYLES =========== */
.users-container {
  background: #ffffff;
  color: #333;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.add-user-btn {
  background-color: #7FB069;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.add-user-btn:hover {
  background-color: #6a9558;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-card {
  background: #fff;
  color: #333;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.user-left {
  flex: 1;
}

.user-name {
  font-size: 1.1rem;
  font-weight: 500;
}

.user-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.role-select {
  min-width: 120px;
  padding: 0.3rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.status-toggle {
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.8rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
  background-color: #adb5bd;
  color: #fff;
}

.status-toggle.active {
  background-color: #28a745;
}

.status-toggle.inactive {
  background-color: #6c757d;
}

.btn-toggle,
.btn-delete {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
}

.btn-toggle:hover {
  background: #e1e1e1;
}

.btn-delete {
  background: #dc3545;
  color: #fff;
  border: none;
}

.btn-delete:hover {
  background: #c82333;
}

/* Панель с permissions */
.permissions-panel {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
}

.permissions-panel.active {
  display: block;
}

.permission-group {
  margin-bottom: 1.5rem;
}

.group-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.permission-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: #333;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.permission-toggle.active {
  background: #28a745;
  color: #fff;
  border-color: #28a745;
}

/* Loader */
.loader {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid #e0e0e0;
  border-top-color: #7FB069;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* =========== RESPONSIVE (Header, etc) =========== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 60px;
    right: 0;
    background-color: #25324A;
    width: 200px;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  .user-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .user-right {
    width: 100%;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .role-select {
    width: 100%;
  }
}

/* =========== KNOWLEDGE-BASE (Диаграммы) =========== */
.knowledge-container {
  position: relative;
  width: 100%;
  min-height: 80vh;
  display: flex;
  background: #f7f7f7;
  z-index: 1;
}

/* Левая панель */
.left-toolbar {
  width: 60px;
  background: #fff;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0;
  gap: 1rem;
  z-index: 10;
}

/* Правая панель */
.right-toolbar {
  width: 60px;
  background: #fff;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0;
  gap: 1rem;
  z-index: 10;
}

/* Центральная часть (прокрутка) */
.main-content {
  flex: 1;
  position: relative;
  overflow: auto;
  padding: 1rem;
  color: #000;
}

/* (Старые) .draggable-block */
.draggable-block {
  position: absolute;
  z-index: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  cursor: move;
  user-select: none;
  color: #333;
  margin-bottom: 0.5rem;
}

/* (Новые) .draggable + .block-header + .block-content */
.draggable {
  position: absolute;
  border: 1px solid #ccc;
  background: #fff;
  cursor: move;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: #333;
  user-select: none;
  min-width: 120px;
}

.block-header {
  background: #eee;
  border-bottom: 1px solid #ccc;
  padding: 4px 6px;
  font-weight: bold;
  font-size: 14px;
  color: #333;
}

.block-content {
  padding: 6px;
  font-size: 13px;
  color: #333;
}

/* Connection points */
.connection-point {
  width: 14px;
  height: 14px;
  border: 2px solid #444;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #888;
  cursor: pointer;
}

.connection-point.left {
  left: -7px;
}

.connection-point.right {
  right: -7px;
}

.connection-point.connected {
  background: #44dd44;
}

/* Connection line (стрелка) */
.connection-line {
  stroke-dasharray: 6 3;
  stroke: #666;
  stroke-width: 2;
  fill: none;
}

/* Лейблы */
.connection-control {
  position: absolute;
  background: #fff;
  border: 1px solid #666;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: #333;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.connection-control .delete-btn {
  background: none;
  border: none;
  color: #ff4444;
  font-size: 16px;
  cursor: pointer;
}

.connection-control .delete-btn:hover {
  background: #ffeaea;
  border-radius: 4px;
}

/* Ошибки */
.error-popup {
  position: absolute;
  background: #fff;
  color: #e33;
  border: 1px solid #e33;
  border-radius: 4px;
  padding: 8px 24px 8px 8px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease;
  z-index: 2000;
}

.error-popup .close-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #e33;
}

@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);
  }
}

/* Разные цвета для старых/новых draggable-block */
.draggable-block.microphone {
  background-color: #ffeef0;
}

.draggable-block.image {
  background-color: #eef;
}

.draggable-block.video {
  background-color: #ffe;
}

.draggable-block.text {
  background-color: #efe;
}

.draggable-block.chatgpt {
  background-color: #ffe4ff;
}

.draggable-block.globe {
  background-color: #e9ffe8;
}

.draggable-block.document {
  background-color: #fef3e8;
}

/* Адаптация под мобильный */
@media (max-width: 768px) {
  .knowledge-container {
    flex-direction: column;
    height: auto;
  }

  .left-toolbar,
  .right-toolbar {
    width: 100%;
    height: 60px;
    flex-direction: row;
    border: none;
    border-bottom: 1px solid #ddd;
    justify-content: center;
  }

  .right-toolbar {
    order: 2;
    border-top: 1px solid #ddd;
  }

  .main-content {
    order: 1;
    width: 100%;
    height: 60vh;
  }
}

/* ==== АУДИО ЭЛЕМЕНТЫ И ИХ КОМПОНЕНТЫ ==== */

/* Стили для кнопок заметок и транскрибации */
.toggle-notes-btn,
.toggle-transcript-btn {
  margin-top: 5px;
  width: 100%;
  text-align: center;
  cursor: pointer;
  padding: 8px 0;
  font-size: 14px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease;
  color: #333;
  font-family: inherit;
}

.toggle-notes-btn:hover,
.toggle-transcript-btn:hover,
.toggle-notes-btn:active,
.toggle-transcript-btn:active {
  background-color: #e0e0e0;
}

/* Стили для панелей */
.notes-panel,
.transcript-panel {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  padding: 10px;
  display: none;
  position: fixed;
  z-index: 999999;
  max-height: 80vh;
  overflow-y: auto;
}

.notes-container-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 200px;
  position: relative;
  margin-top: 5px;
}

.transcript-panel {
  top: 30px;
  background-color: #f0f8ff;
}

/* Стили для редакторов */
.notes-editor,
.transcript-editor {
  width: 100%;
  min-height: 150px;
  border: 1px solid #ccc;
  padding: 8px;
  margin-bottom: 10px;
  z-index: 1000000;
  position: relative;
  background-color: white;
  color: #333;
}

.notes-editor {
  background-color: #f9f9f9;
}

.transcript-editor {
  background-color: #f0f8ff;
}

/* Стили для тулбара редактора заметок */
.notes-toolbar {
  display: flex;
  margin-bottom: 10px;
  z-index: 100000;
  position: relative;
}

.notes-toolbar button {
  margin-right: 5px;
  padding: 2px 8px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  z-index: 100000;
}

.notes-toolbar button:hover {
  background-color: #e0e0e0;
}

.format-btn {
  min-width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.format-bold {
  font-weight: bold;
}

.format-italic {
  font-style: italic;
}

.format-underline {
  text-decoration: underline;
}

.format-list {
  font-size: 18px;
}

/* Стили для кнопки переименования */
.rename-btn {
  position: absolute;
  top: 0px;
  right: 25px;
  padding: 3px 6px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  color: #333;
  text-transform: lowercase;
  z-index: 100;
}

.rename-btn:hover {
  background-color: #e0e0e0;
}

/* Стили для диалога переименования */
.rename-dialog {
  display: none;
  position: fixed;
  background-color: white;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  width: 220px;
  max-width: 100%;
  pointer-events: all;
}

.rename-input {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
  z-index: 100000;
  position: relative;
  pointer-events: auto !important;
  /* Убеждаемся, что мышь работает */
  cursor: text !important;
  /* Явно указываем курсор как текстовый */
}

.rename-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rename-dialog button {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  flex-grow: 1;
  min-width: 60px;
  transition: background-color 0.2s;
}

.confirm-rename-btn {
  background-color: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.confirm-rename-btn:hover {
  background-color: #45a049;
}

.cancel-btn {
  background-color: #f1f1f1;
}

.cancel-btn:hover {
  background-color: #e7e7e7;
}

/* Медиа-запросы для адаптивного дизайна */
@media (max-width: 768px) {

  .notes-panel,
  .transcript-panel {
    max-width: 90vw;
    /* Не шире 90% ширины viewport */
    left: 0;
    top: 70px;
    width: 200px;
  }

  .toggle-notes-btn,
  .toggle-transcript-btn {
    padding: 10px 0;
    /* Увеличиваем область нажатия */
    font-size: 16px;
    /* Увеличиваем текст для удобства */
  }

  .delete-element-btn {
    width: 40px;
    /* Увеличиваем размер на мобильных */
    height: 40px;
    font-size: 20px;
  }

  /* Добавляем прозрачную область вокруг кнопки удаления для увеличения зоны тапа */
  .delete-element-btn::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: -1;
  }

  .draggable-block.audio audio {
    width: 100%;
    /* Полная ширина на мобильных */
  }

  .rename-dialog {
    width: 200px;
    padding: 15px;
  }

  .rename-input {
    padding: 10px;
    font-size: 16px;
    /* Больший шрифт на мобильных */
  }

  .rename-dialog button {
    padding: 10px;
    font-size: 16px;
    /* Больший шрифт на мобильных */
  }
}

.notes-header,
.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
  color: #333;
}

.notes-header span,
.transcript-header span {
  font-weight: bold;
  color: #333;
}

.close-notes-btn,
.close-transcript-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-notes-btn:hover,
.close-transcript-btn:hover {
  background-color: #eee;
  color: #333;
}

/* Стили для контейнера соединений */
.connections-container {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: 10000 !important;
}

/* Стили для SVG соединений */
svg.connection {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* Стили для метки соединения */
.connection-label {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 12px;
  pointer-events: none;
  z-index: 51;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Стили для кнопки удаления соединения */
.connection-delete-btn {
  position: absolute;
  background-color: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  z-index: 52;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.connection-delete-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* ЭКСТРЕННЫЕ СТИЛИ ДЛЯ ПОРТОВ - с самым высоким приоритетом */
.input-port,
.output-port {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10000 !important;
  position: absolute !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  top: 50% !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  transform: translateY(-50%) !important;
  border: 3px solid #FFFFFF !important;
}

.input-port {
  background-color: #FF0000 !important;
  left: -10px !important;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.8) !important;
}

.output-port {
  background-color: #0000FF !important;
  right: -10px !important;
  box-shadow: 0 0 10px rgba(0, 0, 255, 0.8) !important;
}

/* SVG-контейнер с фиксированным позиционированием */
#connections-svg {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: 1000 !important;
}

/* Экстренные стили для соединений */
.connection-line {
  stroke: #FF0000 !important;
  stroke-width: 3 !important;
  fill: none !important;
}

/* Mobile menu styles */
.burger-checkbox {
  display: none;
}

.burger {
  display: none;
  width: 30px;
  height: 20px;
  position: relative;
  cursor: pointer;
  z-index: 1003;
  margin-left: auto;
}

.burger span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: #25324A;
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transition: .25s ease-in-out;
}

.burger span:nth-child(1) {
  top: 0;
}

.burger span:nth-child(2) {
  top: 8px;
}

.burger span:nth-child(3) {
  top: 16px;
}

/* Burger animation */
.burger-checkbox:checked~.burger span:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}

.burger-checkbox:checked~.burger span:nth-child(2) {
  opacity: 0;
}

.burger-checkbox:checked~.burger span:nth-child(3) {
  top: 8px;
  transform: rotate(-45deg);
}

/* Main navigation */
.main-nav {
  background: #FFFFFF;
  z-index: 1002;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav ul li {
  margin: 0;
}

.main-nav ul li>a {
  color: #FFFFFF;
  text-decoration: none;
  padding: 11px 24px;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.2s;
}

.main-nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Submenu styles */
.has-submenu {
  position: relative;
}

.has-submenu>a {
  background: transparent;
}

.has-submenu>a i {
  transition: transform 0.3s;
  font-size: 14px;
  margin-left: 5px;
}

.submenu {
  display: none;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  background: #FFFFFF !important;
  min-width: 200px !important;
  border-radius: 0 0 4px 4px !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
  z-index: 9999 !important;
}

/* DESKTOP: Hover и клик работают */
@media (min-width: 769px) {
  .has-submenu:hover .submenu,
  .has-submenu.active .submenu {
    display: block !important;
  }
}

/* MOBILE: Только клик */
@media (max-width: 768px) {
  .has-submenu.active .submenu {
    display: block !important;
  }
}

.submenu li a {
  padding: 12px 16px;
  color: #111827 !important;
  font-size: 15px !important;
  font-weight: normal !important;
  background: #FFFFFF;
}

.submenu li a:hover {
  background-color: #F3F4F6 !important;
}

/* Language selector */
.lang-select {
  padding: 16px 24px;
  border-top: 1px solid #E5E7EB;
  width: 100%;
}

.lang-select select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background: #FFFFFF;
  color: #111827;
  font-size: 15px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
}

/* Mobile styles */
@media (max-width: 768px) {
  .burger {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1F2937;
    display: none;
    overflow-y: auto;
  }

  .main-nav.active {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    width: 100%;
  }

  .main-nav ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
  }

  .main-nav ul li>a {
    padding: 15px 20px;
    width: 100%;
    color: #FFFFFF;
  }

  .has-submenu .submenu {
    position: static;
    width: 100%;
    box-shadow: none;
    border-radius: 0;
    background: #161E2E;
  }

  .has-submenu:hover .submenu {
    display: none;
  }

  .has-submenu.active .submenu {
    display: block;
  }

  .has-submenu.active>a i {
    transform: rotate(180deg);
  }

  .submenu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .submenu li:last-child {
    border-bottom: none;
  }

  .submenu li a {
    padding: 12px 20px 12px 40px;
    color: #E5E7EB !important;
    background: transparent !important;
  }

  .submenu li a:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
  }
}

/* Desktop styles */
@media (min-width: 769px) {
  .main-nav {
    display: block;
    position: static;
    background: transparent;
  }

  .main-nav ul {
    display: flex;
    align-items: center;
  }

  .main-nav ul li {
    border: none;
  }
}

/* Добавляем кнопку для опасных действий (удаление и т.д.) */
.danger-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.danger-btn:hover {
  background-color: #bd2130;
  color: white;
  text-decoration: none;
}

.danger-btn i {
  margin-right: 8px;
}

.danger-zone .warning-text {
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 20px;
}

.danger-zone .case-summary {
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  background-color: #f9f9f9;
}

.danger-zone .action-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

/* Стили для новостного блока */
.news-card,
.news-item {
  margin-bottom: 25px;
  padding: 15px;
  background-color: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.news-card h3,
.news-item h3,
.news-header h3 {
  color: #1F2937;
  /* Темный цвет заголовка */
  margin-top: 0;
  margin-bottom: 10px;
}

.news-card a,
.news-item a,
.news-header a {
  color: #1F2937;
  /* Темный цвет ссылок */
  text-decoration: none;
}

.news-date,
.news-short,
.news-excerpt {
  color: #4B5563;
  /* Темно-серый цвет текста */
  margin-bottom: 10px;
  font-size: 14px;
}

.news-short,
.news-excerpt,
.news-full-text,
.news-card p,
.news-item p {
  color: #1F2937;
  /* Темный цвет основного текста */
  line-height: 1.5;
}

.read-more-btn,
.news-read-more {
  color: #2563EB;
  /* Синий цвет для кнопки Read more */
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
  margin-top: 10px;
}

.read-more-btn:hover,
.news-read-more:hover {
  text-decoration: underline;
}

/* Заголовок блока новостей */
h2.news-title,
.container h2 {
  color: #1F2937;
  /* Темный цвет заголовка блока */
  margin-bottom: 20px;
}

/* Стили для таблицы кейсов */
.table-cases {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.table-cases th,
.table-cases td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #E5E7EB;
  color: #1F2937;
  /* Тёмный цвет текста */
}

.table-cases th {
  font-weight: 600;
  background-color: #F9FAFB;
  color: #111827;
  /* Почти чёрный цвет для заголовков */
}

.table-cases tr:hover {
  background-color: #F9FAFB;
}

.table-cases a {
  color: #2563EB;
  text-decoration: none;
}

.table-cases a:hover {
  text-decoration: underline;
}

.empty-table {
  text-align: center;
  padding: 20px;
  color: #6B7280;
  font-style: italic;
}

/* Стили для статусов кейсов */
.case-stage {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  min-width: 80px;
}

.case-stage-new {
  background-color: #DEF7EC;
  color: #03543E;
}

.case-stage-in_progress {
  background-color: #E1EFFE;
  color: #1E429F;
}

.case-stage-done {
  background-color: #E1E1E1;
  color: #1F2937;
}

.case-stage-closed {
  background-color: #FEE2E2;
  color: #991B1B;
}

.case-stage-archived {
  background-color: #e5e7eb;
  color: #4b5563;
}

/* Стили для кнопок действий в таблице */
.actions-column {
  white-space: nowrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  color: #4B5563;
  margin: 0 2px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background-color: #F3F4F6;
  color: #1F2937;
  border-color: #D1D5DB;
}

/* Стили для заголовка и кнопки добавления */
.cases-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.cases-header h2 {
  color: #1F2937;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background-color: #1F2937;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
}

.submit-btn:hover {
  background-color: #111827;
}

.submit-btn i {
  margin-right: 8px;
}

/* Стили для информации об архиве */
.archive-actions {
  margin-bottom: 20px;
  padding: 12px 16px;
  background-color: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 4px;
  color: #1E429F;
}

/* Стили для мобильных устройств */
@media (max-width: 768px) {

  .table-cases th,
  .table-cases td {
    padding: 8px;
  }

  .cases-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .table-cases {
    font-size: 14px;
  }

  .btn-icon {
    width: 28px;
    height: 28px;
  }
}

/* Добавляем стили специально для delete modal */
.modal.mini-dialog#deleteModal {
  width: 300px;
  max-width: 80%;
  /* Используем абсолютное позиционирование для центрирования */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Убираем margin: auto */
  /* margin: auto; */
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.dialog-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.dialog-btn.cancel {
  background: #999;
  color: white;
}

.dialog-btn.delete {
  background: #ff4444;
  color: white;
}

.dialog-btn.confirm {
  background: #44cc44;
  color: white;
}

/* Global Styles */

body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  color: #333;
}

main.site-main {
  padding-top: 60px;
  /* Account for fixed header */
}

/* ... other global styles ... */

main.site-main {
  padding-top: 10px !important;
}