/* Убираем отступы по краям страницы */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Убираем горизонтальный скролл */
}

/* Основные стили */
.table-container {
    /* margin: 20px; */
    margin: 0; /* Убираем отступы */
    padding: 0;
    width: 100vw; /* Ширина на весь экран */
    overflow-x: auto; /* Добавляем горизонтальный скролл, если таблица шире экрана */
}

.table-custom {
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.table-custom th, .table-custom td {
/*    border: 1px solid #a2a2a2; */
    border: 1px solid #737373;
    padding: 8px;
/*    color: black !important; */
}

.table-custom tr.status-up {
    background: #d4edda;
}

.table-custom tr.status-down {
    background: #f8d7da;
}

.status-warning {
    background-color: #fff3cd !important;
} /* Желтый для DYING GASP */

.status-info { 
    background-color: #e2e3e5 !important;
} /* Серый для информационных логов */

.table-custom thead th {
    background: #778898;
    color: #ffffff !important;
    text-align: center;
}

/* Стиль для модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 530px;
    position: relative; /* Чтобы кнопка закрытия была внутри */
}

/* Стили для кнопки с тремя полосками */
.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 24px;
    width: 30px;
    padding: 0;
}

.menu-btn .lines {
    background: #000;
    height: 3px;
    width: 100%;
}

.menu-btn:hover .lines {
    background: #0074d9;
}

.menu-actions, .confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-actions button, .confirm-actions button {
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
}

#label-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 16px;
}

/* Кнопки для модальных окон */
.modal-btn {
    background-color: #7066e0;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-btn:hover {
    background-color: #4c40c4;
}

.modal-btn-download {
    background-color: #28a745;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-btn-download:hover {
    background-color: #218838;
}

.modal-btn-filtered {
    background-color: #007bff;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-btn-filtered:hover {
    background-color: #0056b3;
}

.modal-btn-delete {
    background-color: #dd3333;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-btn-delete:hover {
    background-color: #c62e2e;
}


/* Кнопка закрытия */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    font-weight: bold;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.close-btn:hover {
    background-color: darkred;
}

.close-btn:focus {
    outline: none; /* Убираем рамку при фокусе */
}

/* Заголовки модалок: резервируем место справа под крестик, чтобы текст не залезал под него */
.modal-content > h2,
.modal-content > h3 {
    padding-right: 42px;
    box-sizing: border-box;
}

/* Стили для модального окна справки */
#help-content {
    width: 100%;
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #ddd;
    resize: vertical;
    min-height: 300px;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

#help-content[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

#save-help-btn {
    background-color: #7066e0;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#save-help-btn:hover {
    background-color: #4c40c4;
}

#mac-vendor-modal {
    display: none;
    position: absolute;
    background-color: white;
    border: 1px solid #ccc;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-size: 14px;
    max-width: 300px;
    word-wrap: break-word;
    border-radius: 5px;
    text-align: center;
}

/* Стили для иконки "глазика" */
.mac-lookup-icon {
    cursor: pointer;
    margin-left: 10px;
    font-size: 16px;
}

.mac-lookup-icon:hover {
    opacity: 0.7;
}

/* Стили для иконки "обновления данных" */
.mac-actions {
    display: inline-flex;
    gap: 8px;
    vertical-align: middle;
}

.mac-refresh-icon {
    cursor: pointer;
    transition: transform 0.3s;
}

.mac-refresh-icon:hover {
    transform: rotate(360deg);
}

/* Стили таблиц */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
  }
  th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: centre;
  }
  th {
    background-color: #0074d9;
    color: white;
    font-weight: bold;
    height: 40px;
  }
  td {
    font-size: 14px;
    height: 25px;
    text-align: center;
    font-family: Arial, sans-serif;
  }
  .admin-editable {
    cursor: pointer;
  } 
  .gray-text {
    color: gray;
  }
  tbody tr:nth-child(odd) {
    background-color: white;
    color: black;
  }
  tbody tr:nth-child(even) {
    background-color: #f2f2f2;
    color: black;
  }
  .editable[disabled] {
    color: black;
    pointer-events: none;
    text-decoration: none;
  }


/* Стиль выбора устройства */
/* Стили для выпадающего списка устройств */
#device-select {
    background-color: #343a40 !important; /* Цвет фона как у навбара */
    border: none !important; /* Убираем рамку */
    color: rgba(255,255,255,.75) !important; /* Цвет текста как в меню */
    cursor: pointer;
/*    margin-left: 15px; */
    padding: 8px 30px 8px 15px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    border-radius: 4px;
}

/* Стили при наведении */
#device-select:hover {
    color: #fff !important; /* Цвет как при ховере в меню */
    background-color: #484f56 !important;
}

/* Стили для открытого состояния */
#device-select:focus {
    box-shadow: none !important;
    background-color: #343a40 !important;
}

/* Стили для выпадающего списка */
#device-select option {
    background: #343a40 !important; /* Фон как у навбара */
    color: #fff !important; /* Цвет текста */
}

/* Стили для активного пункта в выпадающем списке */
#device-select option:checked {
    background-color: #484f56 !important;
}

/* Стили при наведении на пункты списка */
#device-select option:hover {
    background-color: #484f56 !important !important;
    color: #fff !important;
}

.nav-item {
    margin-right: 10px;
}

.form-select {
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.3s ease;
}


/* История сигнала */

.history-controls {
  margin: 5px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

#days-input {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
}

#show-history-btn {
  background: #007bff;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

#show-history-btn:hover {
  background: #0056b3;
}
#history-period-title {
  margin: 10px 0;
  font-size: 1.5em;
  color: #333;
}

/* Календарь */
.air-datepicker {
  z-index: 10000 !important;
  font-family: Arial, sans-serif;
  width: 320px;
}

.air-datepicker--content {
  padding: 10px;
}

.air-datepicker--buttons {
  border-top: 1px solid #ddd;
  padding: 10px;
  display: flex;
  gap: 10px;
}

.air-datepicker-button {
  background: #7066e0 !important;
  color: white !important;
  border-radius: 4px;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  flex-grow: 1;
  text-align: center;
}

@media (max-width: 768px) {
  .history-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  #date-range-input,
  #box-date-range-input {
    width: 100% !important;
    margin-right: 0 !important;
    font-size: 16px;
    height: 40px;
  }

  /* Применить и Сбросить — рядом друг с другом, делят ширину пополам */
  .history-controls .modal-btn-filtered,
  .history-controls .btn-secondary {
    flex: 1 1 0;
    width: auto;
    padding: 12px 10px;
    font-size: 15px;
    text-align: center;
  }

  /* Увеличим размер модального окна для мобилок */
  .modal-content {
    margin: 5% auto;
    width: 95%;
    max-width: none;
    padding: 15px;
  }
  
  /* Адаптируем заголовок */
  #history-period-title {
    font-size: 1.3em;
    margin: 5px 0;
  }

  /* "Скачать CSV" и "Показать сигнал всей ветки" — тоже рядом, если влезают */
  #signal-history-modal .modal-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  #signal-history-modal .modal-buttons br {
    display: none;
  }

  #download-csv-btn,
  #show-box-signal-btn {
    flex: 1 1 150px;
    width: auto;
    padding: 12px 10px;
    font-size: 14px;
  }
}

/* Стили для модалки обратной связи */
#feedback-modal .modal-content {
    max-width: 500px;
    padding: 20px;
}

#feedback-form .form-group {
    margin-bottom: 15px;
}

#problem-description {
    resize: vertical;
    min-height: 120px;
}

/* Поисковая строка */
#search-input {
    background-color: #343a40;
    border-color: #495057;
    color: white;
    transition: all 0.3s ease;
}

#search-input::placeholder {
    color: #6c757d;
}

#search-input:focus {
    background-color: #495057;
    border-color: #6c757d;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* Стиль для поиска в логах */
#logs-search-input {
    background-color: #343a40;
    border-color: #495057;
    color: white;
    transition: all 0.3s ease;
}

#logs-search-input::placeholder {
    color: #6c757d;
}

#logs-search-input:focus {
    background-color: #495057;
    border-color: #6c757d;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}


/* Желтый стиль для сигнала -28 и меньше */
/* Базовые стили для строк */
.even-row {
    background-color: #ffffff; /* Белый фон для четных строк */
}

.odd-row {
    background-color: #f2f2f2; /* Светло-серый фон для нечетных строк */
}

/* Анимация мигания для сигнальных ячеек */
.low-signal {
    animation: blink-signal 2s infinite;
    font-weight: bold !important;
}

@keyframes blink-signal {
    0% { background-color: #ecec53; } /* смутно-желтый */
    50% { background-color: inherit; } /* Возврат к исходному цвету строки */
    100% { background-color: #ecec53; } /* смутно-желтый */
}

/* Стили для информации о коммутаторе */
/* Общий контейнер для информации о коммутаторе и портах EPON */
#switch-and-pon-container {
    display: none; /* По умолчанию скрыт */
    margin-bottom: 20px;
    background: #f2f2f2;
    border: 1px solid #dee2e6;
    border-radius: 5px;
/*    padding: 15px; */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Информация о коммутаторе */
.switch-info-container {
    margin-bottom: 15px;
}

.switch-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.info-label {
    font-weight: bold;
    color: #495057;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.info-value {
    color: #212529;
    font-size: 0.95rem;
    word-break: break-word;
    line-height: 1.4;
}

/* Таблица портов EPON */
.pon-ports-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.table-responsive {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

#pon-ports-table {
    min-width: 600px;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#pon-ports-table th,
#pon-ports-table td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #737373;
}

#pon-ports-table th {
    background-color: #778898;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
}

#pon-ports-table tr:nth-child(even) {
/*    background-color: #f8f9fc; */
    background-color: #f2f2f2; 
}

.btn-refresh-port {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    padding: 4px;
    transition: transform 0.2s;
}

.btn-refresh-port:hover {
    color: #3498db;
    transform: scale(1.1);
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .switch-info-grid {
        grid-template-columns: 1fr;
    }

    .info-item {
        padding: 8px;
    }

    .info-label, .info-value {
        font-size: 0.85rem;
    }

    #pon-ports-table {
        min-width: 100%;
    }

    #pon-ports-table th,
    #pon-ports-table td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
}
/* Переопределение Bootstrap кнопки btn-info */
#switch-info-btn.btn-info {
    margin-left: 5px;
    color: #fff; /* цвет текста */
    background-color: #343a40; /* фон */
    font-weight: bold;
    border: none;       /* убирает рамку */
    border-color: transparent; /* на всякий случай, если Bootstrap задаёт цвет */
    padding: 8px 16px;
    border-radius: 22px;
}

#switch-info-btn.btn-info:hover {
    color: #fff;
    background-color: #484f56;
    border: none;
    border-color: transparent;
}
#switch-info-btn.btn-info:focus,
#switch-info-btn.btn-info:active,
#switch-info-btn.btn-info:focus-visible {
    outline: none;
    box-shadow: none; /* убирает голубое свечение Bootstrap */
}

/* Стили для модального окна статуса ONU */
#onu-status-modal .modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#onu-status-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
/*    background: #f8f9fa; */
    background: #d3d3d3;
    border-radius: 8px 8px 0 0;
}

#onu-status-modal .modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

/* Обёртка заголовка (слева) */
#onu-status-modal .onu-status-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

/* Обёртка S/N (десктоп) + крестика закрытия (справа) */
#onu-status-modal .onu-status-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

#onu-status-modal .onu-status-sn {
    font-size: 13px;
    color: #666;
    font-family: monospace;
    white-space: nowrap;
}

/* На ПК показываем S/N только в правом блоке рядом с крестиком */
#onu-status-modal .onu-status-sn-mobile {
    display: none;
}

#onu-status-modal .modal-body {
    padding: 20px;
    color: #333;
    background: white;
    border-radius: 0 0 8px 8px;
}

@media (max-width: 768px) {
    /* На мобилках прячем десктопный S/N и показываем его в скобках под заголовком */
    #onu-status-modal .onu-status-sn-desktop {
        display: none;
    }

    #onu-status-modal .onu-status-title-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    #onu-status-modal .onu-status-sn-mobile {
        display: block;
    }

    #onu-status-modal .onu-status-sn-mobile::before {
        content: "(";
    }

    #onu-status-modal .onu-status-sn-mobile::after {
        content: ")";
    }
}

/* Анимация мигания для кнопки отложенных операций */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Стили для кнопок в таблице отложенных операций */
.btn-retry, .btn-remove {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    margin: 0 2px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.btn-retry:hover {
    background-color: #e8f5e8;
}

.btn-remove:hover {
    background-color: #ffe8e8;
}

/* Стиль для бейджа с количеством операций */
#pending-operations-count {
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8em;
    margin-left: 2px;
}

/* Стили для модального окна нововведений */
#news-modal .modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#news-modal .modal-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#news-modal .modal-body {
    background: white;
    color: #333;
    margin: 10px;
    border-radius: 5px;
}

#news-modal .modal-footer {
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

#news-understood-btn {
    background: #4CAF50;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

#news-understood-btn:hover {
    background: #45a049;
}

#dont-show-again {
    margin-right: 8px;
}


/* Стили для кнопок в таблице EPON портов */
.btn-refresh-port, .btn-history-port {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 5px 8px;
  margin: 0 2px;
  border-radius: 3px;
  transition: all 0.2s;
}

.btn-refresh-port:hover {
  background-color: rgba(0, 123, 255, 0.2);
  transform: scale(1.1);
}

.btn-history-port:hover {
  background-color: rgba(108, 117, 125, 0.2);
  transform: scale(1.1);
}

/* Контейнер для кнопок действий */
td:last-child {
  text-align: center;
  white-space: nowrap;
}

/* Стили для спиннера загрузки */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Стили для модального окна истории */
#port-diag-history-modal .modal-content {
  max-width: 90%;
  margin: 5% auto;
}

#port-diag-history-table-body tr:hover {
  background-color: #f5f5f5;
}


/* NEW! NEW! NEW! */
/* Стили для истории событий ONU */
.history-online {
    background-color: #e8f5e8 !important;
    color: #155724;
    border-left: 4px solid #28a745;
}

.history-offline {
    background-color: #fde8e8 !important;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.history-warning {
    background-color: #fff8e1 !important;
    color: #856404;
    border-left: 4px solid #ffc107;
}

#onu-history-container {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
    background-color: #e6e6e6;
/*    background-color: #343a40; /* Темный фон контейнера */
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

#onu-history-container:hover {
/*    background-color: #484f56; /* Темнее при наведении */
}

/* Стили для кнопки истории */
#onu-history-btn {
    width: 100%;
    font-weight: bold;
    background-color: #343a40;
    color: white;
    border: 1px solid #495057;
    padding: 10px;
/*    border-radius: 5px; */
    border-radius: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: none;
}

#onu-history-btn:hover {
    background-color: #484f56;
    color: white;
}

/* Стили для таблицы истории */
#onu-history-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: transparent;
}

#onu-history-container thead th {
    background-color: #778898 !important;
    color: white;
    text-align: center;
    padding: 10px;
    border: 1px solid #5a6268;
    font-weight: bold;
}

#onu-history-container tbody td {
    padding: 8px 10px;
    border: 1px solid #5a6268;
    color: black;
}

#onu-history-container tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

#onu-history-container tbody tr:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    #onu-history-container {
        padding: 5px;
    }

    #onu-history-container thead th,
    #onu-history-container tbody td {
        padding: 6px 8px;
        font-size: 14px;
    }
}

/* Плавная анимация появления/скрытия */
#onu-history-container {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Стили для заголовка с кнопкой и поиском (02-12-25) */
/* Базовые стили для всего поискового блока */
.search-panel {
    margin: 15px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    max-inline-size: 380px;
}

.search-type-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    white-space: nowrap;
}

.search-type-toggle input[type="radio"] {
    display: none;
}

.search-type-toggle label {
    cursor: pointer;
    color: #495057;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s;
    user-select: none;
    font-size: 14px;
}

.search-type-toggle input[type="radio"]:checked + label {
    background: #007bff;
    color: white;
}

.search-type-toggle label:hover {
    background: #dee2e6;
}

.search-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.search-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

.search-button {
    background: #343a40;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.search-button:hover {
    background: #484f56;
}

/* Десктопная версия */
@media (min-width: 769px) {
    .header-controls .top-section {
        display: flex;
        align-items: center;
        gap: 20px;
        margin: 15px;
    }
    
    .header-controls .mobile-search {
        display: none !important;
    }
    
    .header-controls .desktop-search {
        flex: 1;
    }
    
    #switch-info-btn {
        white-space: nowrap;
    }
    
    .search-box {
        gap: 8px;
    }
    
    .search-input {
        width: 250px;
    }
}

/* Мобильная версия */
@media (max-width: 768px) {
    .header-controls .top-section {
        margin: 15px;
    }
    
    .header-controls .desktop-search {
        display: none !important;
    }
    
    .header-controls .mobile-search {
        margin: 15px;
    }
    
    .header-controls .search-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-type-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .search-input,
    .search-button {
        width: 100%;
    }
    
    /* Когда контейнер открыт, добавляем отступ для поиска */
    #switch-and-epon-container[style*="display: block"] + .mobile-search {
        margin-top: 20px;
    }
}

/* Кнопка переключения информации о коммутаторе */
#switch-info-btn.btn-info {
    margin-left: 5px;
    color: #fff;
    background-color: #343a40;
    font-weight: bold;
    border: none;
    padding: 8px 16px;
    border-radius: 22px;
}

#switch-info-btn.btn-info:hover {
    color: #fff;
    background-color: #484f56;
    border: none;
}

#switch-info-btn.btn-info:focus,
#switch-info-btn.btn-info:active,
#switch-info-btn.btn-info:focus-visible {
    outline: none;
    box-shadow: none;
}



/* 29-01-2026 23-28 */
/* Стили для информационного блока VLAN */
#vlan-info {
    border-left: 4px solid #28a745;
    font-family: 'Courier New', monospace;
}

/* Стили для поля ввода VLAN */
#vlan-input {
    font-size: 16px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    transition: border-color 0.3s;
}

#vlan-input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    outline: none;
}

/* Стиль для кнопки изменения VLAN */
.modal-btn {
    background-color: #28a745 !important;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-btn:hover {
    background-color: #218838 !important;
}


/* NEW2 NEW2 NEW2 29-06-2026 */
#edit-vlan-config-btn-in-modal:hover {
    background-color: #0d6efd;
    color: white;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

#edit-vlan-config-btn-in-modal {
    border: 1px solid #0d6efd;
    color: #0d6efd;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* NEW NEW NEW NEWVLAN!! */
/* ===== VLAN CONFIG MODAL FIX ===== */

#vlan-config-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    overflow-y: auto;
}

#vlan-config-modal .modal-content {
    background-color: #ffffff;
    box-sizing: border-box;
    padding: 15px;
    margin: 5vh auto;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
}

@media (max-width: 768px) {
    #vlan-config-modal .modal-content {
        width: 100%;
        height: 100%;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }
}

#vlan-config-content {
    width: 100%;
    min-height: 200px;
    max-height: 50vh;
    resize: vertical;
}

#vlan-config-modal > .modal-content > div[style*="display: flex"] {
    flex-wrap: wrap;
    gap: 10px;
}

#vlan-config-modal button {
    white-space: nowrap;
}

/* Стили сортировки */
th.sortable {
    cursor: pointer;
}
th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Легкая подсветка при наведении */
}

/* --- Стили для кнопки MikroTik --- */
.mikrotik-arp-btn {
    display: none; /* Скрыто по умолчанию */
    cursor: pointer;
    font-size: 1.1em;
    margin-left: 5px;
}
.mikrotik-arp-btn:hover {
    filter: brightness(1.2);
}
/* Показываем кнопку только если фича включена */
body.mikrotik-enabled .mikrotik-arp-btn {
    display: inline-block;
}

/* Кнопка обновления базы SN */
.refresh-sn-btn {
    padding: 8.5px 6px;
    font-size: 1em;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s;
}
.refresh-sn-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.refresh-sn-btn.spinning {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { display: inline-block; transform: rotate(0deg); }
    to   { display: inline-block; transform: rotate(360deg); }
}

/* =========================================================
   БОКСЫ (ВЕТКИ): блок в модалке заметок + модалка управления
   ========================================================= */

.subscriber-meta-block {
    background: #f8f9fa;
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.subscriber-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.subscriber-meta-row:last-child {
    margin-bottom: 0;
}

.subscriber-meta-row label {
    flex: 0 0 130px;
    font-weight: 600;
    font-size: 0.9em;
    color: #495057;
}

.subscriber-meta-row input[type="date"] {
    flex: 1;
    max-width: 200px;
}

.subscriber-box-row {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: center;
}

.subscriber-box-row select {
    flex: 1;
}

.btn-manage-boxes {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.85em;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.btn-manage-boxes:hover {
    background-color: #565e64;
}

.box-form-container {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 14px;
    margin-top: 12px;
}

.box-form-container h5 {
    margin-bottom: 10px;
    font-size: 1.05em;
}

/* =========================================================
   ГРАФИК ИСТОРИИ СИГНАЛА (canvas)
   ========================================================= */

#signal-history-modal .modal-content,
#box-signal-modal .modal-content {
    max-width: 700px;
}

.signal-chart-wrap {
    position: relative;
    height: 220px;
    margin: 15px 0 5px;
    transition: height 0.15s ease, margin 0.15s ease;
}

/* Когда данных за период нет — почти схлопываем график, но оставляем небольшой
   отступ перед кнопками, чтобы они не "прилипали" к таблице */
.signal-chart-wrap.is-empty {
    height: 0;
    margin: 12px 0 0;
    overflow: hidden;
}

/* =========================================================
   ПОЛОСКА УРОВНЯ СИГНАЛА (модалка "Сигнал по боксу")
   ========================================================= */

.signal-bar-wrap {
    width: 100%;
    height: 5px;
    background: #e9ecef;
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.signal-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Bootstrap не имеет "оранжевого" текстового класса по умолчанию — добавляем сами */
.text-orange {
    color: #fd7e14 !important;
}
