/* css/style.css */
/* FontAwesome 6 Free — Solid (weight 900) */
@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("../webfonts/fa-solid-900.woff2") format("woff2"),
       url("../webfonts/fa-solid-900.ttf")   format("truetype");
}

/* FontAwesome 6 Free — Regular (weight 400) */
@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../webfonts/fa-regular-400.woff2") format("woff2"),
       url("../webfonts/fa-regular-400.ttf")   format("truetype");
}

/* FontAwesome 6 Brands */
@font-face {
  font-family: "Font Awesome 6 Brands";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../webfonts/fa-brands-400.woff2") format("woff2"),
       url("../webfonts/fa-brands-400.ttf")   format("truetype");
}

/* Глобальный сброс синей вспышки при тапе на мобильных (iOS Safari / Android Chrome) */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* отключаем overscroll (iOS/Chrome) */
  overscroll-behavior: none;
  /* темная цветовая схема для нативных скроллбаров (Firefox, Safari) */
  color-scheme: dark;
}

#map {
  width: 100vw; height: 100vh;
  /* touch-action: none — браузер не перехватывает тач-жесты для прокрутки страницы;
     OL получает все события без задержки и конкуренции */
  touch-action: none;
  /* Фон пока тайлы не загружены (loading state) */
  background: #272727;
}

#map {
  position: absolute;
  top: 0;
  left: 50px;
  right: 0;
  bottom: 0;
  /* Убираем CSS transition с left/top — во время пана OL может менять позицию карты,
     а transition вызывал CSS анимацию поверх тач-движения → видимые рывки */
  /* transition: left 0.3s ease, top 0.3s ease; */
}

/* ── Статусная панель ── */
#status-bar {
  position: fixed;
  left: 50px;
  right: 0;
  bottom: 0;
  height: 24px;
  background: rgba(8,12,8,0.55);
  border-top: 1px solid #2a3e2a;
  display: flex;
  align-items: center;
  padding: 0 10px;
  z-index: 5000;
  font-size: 11px;
  font-family: monospace;
  color: #7a9a7a;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#status-bar .sb-item {
  padding: 0 8px;
  line-height: 24px;
  color: #9aba9a;
  transition: color 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#status-bar .sb-item:first-child { padding-left: 4px; }
#status-bar .sb-sep {
  color: #3a5a3a;
  padding: 0 2px;
  flex-shrink: 0;
}
#status-bar .sb-online {
  color: #7aaa7a;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
#status-bar .sb-col-left {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
#status-bar .sb-col-center {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 0 8px;
}
#status-bar .sb-col-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* GPU-слой для плавного тач-скролла карты */
.ol-viewport {
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  /* Явный touch-action на canvas-контейнере OL — исключаем browser scroll */
  touch-action: none;
  /* Фон под canvas OL — показывается пока тайлы грузятся */
  background: #272727;
}

/* Компактная панель инструментов */
#toolbar-panel {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50px;
  background: #1a1f1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 5px;
  z-index: 6000;
  box-shadow: 2px 0 8px rgba(0,0,0,0.4);
  border-right: 2px solid #3d5a3d;
  /* position:fixed уже изолирует тулбар от document flow;
     contain:layout paint убрано — ломает flex-wrap на мобильных */
}

.toolbar-icon-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: #7a9a7a;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  /* transition:all задействует GPU-слой для всех свойств при hover; конкретные свойства = меньше слоёв */
  transition: background 0.2s, color 0.2s;
}

.toolbar-icon-btn i {
  font-size: 18px;
  color: inherit;
  transition: color 0.2s;
}

.toolbar-icon-btn:hover {
  background: rgba(107,155,107,0.2);
  color: #6b9b6b;
}

/* Отключаем hover для кнопок с явными inline стилями */
#quick-grid-btn:hover,
#quick-trajectories-btn:hover {
  background: inherit !important;
  color: inherit !important;
}

.toolbar-separator {
  width: 30px;
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin: 5px 0;
}

.draw-icon-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: #7a9a7a;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}

.draw-icon-btn:hover {
  background: rgba(107,155,107,0.2);
  color: #6b9b6b;
}

#layer-dropdown,
#user-dropdown {
  position: fixed;
  display: none;
  background: #1a1f1a;
  border: 1px solid #3d5a3d;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  z-index: 10000;
  min-width: 150px;
  contain: layout paint; /* изолируем дропдауны layout от карты */
}

.layer-option-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: #1a1f1a;
  color: #b8c5b8;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}

.layer-option-btn:hover {
  background: rgba(107,155,107,0.2);
}

#user-info {
  font-size: 12px;
  color: white;
  text-align: center;
  padding: 5px;
}

/* Когда sidebar открыт */
body.sidebar-open #map {
  left: 330px;
}
/* статусбар всегда полноширинный — поверх левой панели */
body.sidebar-open #status-bar {
  left: 330px;
}

/* Когда sidebar свернут (старое правило) */
body.sidebar-collapsed #map {
  left: 50px;
}

.layer-switcher {
  position: absolute; top: 10px; right: 10px; /* Ближе к краю */
  background: rgba(255,255,255,0.5);
  padding: 15px; border-radius: 4px;
  z-index: 1000;
}

.layer-switcher:hover {
  background-color: white; /* Изменяем цвет фона на желтый */
}

.layer-switcher-2 {
    background: rgba(255,255,255,0.2);
    font-family: Impact;
    font-size: 14px;
}

.name {
    width: calc(100vw - 20px); /* По умолчанию полная ширина с отступами */
    left: 10px; /* По умолчанию у края экрана */
    top: 10px;
    height: 5vh;
    position: fixed; /* вместо absolute */
    transition: left 0.3s ease, width 0.3s ease; /* Плавный переход */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    z-index: 1000;
    font-family: Impact;
    font-size: 28px;
    text-shadow: 2px 2px 5px rgba(255,255,255,0.9);
}

/* Когда оси включены (не нужно, т.к. оси вверху и справа) */
/* body.axes-visible .name {
    width: calc(100vw - 40px);
    left: 30px;
} */

/* Когда оси включены - нижние элементы (не нужно, т.к. оси вверху и справа) */
/* body.axes-visible #mouse-position {
    bottom: 25px !important;
} */

/* body.axes-visible #objects-counter {
    bottom: 25px !important;
    left: 30px !important;
} */

/* body.axes-visible #delete-all-container {
    bottom: 25px !important;
    left: 30px !important;
} */

.draw-toolbar {
    position: fixed; /* вместо absolute */
    top: 10px;
    left: 10px; /* По умолчанию у края экрана */
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.5);
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: left 0.3s ease; /* Плавный переход */
}

/* Когда оси включены (не нужно, т.к. оси вверху и справа) */
/* body.axes-visible .draw-toolbar {
    left: 30px;
} */

.draw-toolbar button {
  background: none;
  border: none;
  padding: 10px;
  font-size: 18px;
  color: #333;
  cursor: pointer;
  transition: background .2s, color .2s;
  outline: none;
}

.draw-toolbar button:focus {
  outline: none;
  border: none;
}

.draw-toolbar button svg {
  display: block;
}

.draw-toolbar button:hover {
  background: #eef;
}

.draw-toolbar button.active {
  background: #0066cc !important;
  color: #fff !important;
  border-radius: 4px;
}

.draw-toolbar button.active svg {
  color: #fff !important;
}

/* Группа кнопок с подменю */
.toolbar-group {
  position: relative;
}

.geometry-submenu {
  position: absolute;
  left: 100%;
  top: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.95);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  margin-left: 5px;
}

.geometry-submenu button {
  background: none;
  border: none;
  padding: 10px;
  font-size: 18px;
  color: #333;
  cursor: pointer;
  transition: background .2s, color .2s;
  outline: none;
}

.geometry-submenu button:hover {
  background: #eef;
}

.geometry-submenu button.active {
  background: #0066cc;
  color: #fff;
  border-radius: 4px;
}

/* базовые стили панели (тулбар и окно свойств) */
.panel {
  display: flex;
  flex-direction: column;
  background: rgba(26,31,26,0.95);
  border: 1px solid #3d5a3d;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  padding: 8px;
  z-index: 10001;
  color: #b8c5b8;
}

/* специфично для позиционирования окна свойств */
.panel.property-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none; /* изначально скрыто */
  flex-direction: column;
  width: 420px;
  max-height: 90vh;
  box-sizing: border-box;
  background: rgba(26,31,26,0.98) !important;
  border: 2px solid #3d5a3d !important;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(61,90,61,0.3);
  padding: 18px;
  z-index: 10003;
}

/* Скроллируемая область внутри панели свойств */
.panel.property-popup .props-scroll-area {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  margin: 0 -4px;
  padding: 0 4px;
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.5);
}

.panel.property-popup .props-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.panel.property-popup .props-scroll-area::-webkit-scrollbar-track {
  background: rgba(26, 31, 26, 0.5);
  border-radius: 4px;
}

.panel.property-popup .props-scroll-area::-webkit-scrollbar-thumb {
  background: #4a6a4a;
  border-radius: 4px;
}

.panel.property-popup .props-scroll-area::-webkit-scrollbar-thumb:hover {
  background: #6b9b6b;
}

.panel.property-popup h3 {
  color: #b8c5b8 !important;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.panel.property-popup label {
  color: #8aaa8a !important;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel.property-popup input[type="text"],
.panel.property-popup input[type="number"],
.panel.property-popup input[type="date"],
.panel.property-popup input[type="datetime-local"],
.panel.property-popup select,
.panel.property-popup textarea {
  background: rgba(15,20,15,0.7) !important;
  border: 1px solid #3d5a3d !important;
  color: #d0e0d0 !important;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  transition: all 0.2s;
  box-sizing: border-box;
}

.panel.property-popup select {
  padding: 7px 10px !important;
  cursor: pointer;
  appearance: auto;
}

.panel.property-popup select:focus {
  outline: none;
  border-color: #6b9b6b !important;
  box-shadow: 0 0 0 2px rgba(107,155,107,0.2);
  background: rgba(20,25,20,0.8) !important;
}

.panel.property-popup input:focus,
.panel.property-popup textarea:focus {
  outline: none;
  border-color: #6b9b6b !important;
  box-shadow: 0 0 0 2px rgba(107,155,107,0.2);
  background: rgba(20,25,20,0.8) !important;
}

.panel.property-popup input[type="color"] {
  background: rgba(15,20,15,0.7) !important;
  border: 1px solid #3d5a3d !important;
  border-radius: 4px;
  cursor: pointer;
}

.panel.property-popup button#close-props {
  background: transparent !important;
  border: none;
  color: #7a9a7a !important;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
}

.panel.property-popup button#close-props:hover {
  color: #ff6b6b !important;
  transform: rotate(90deg);
}

.panel.property-popup button#save-desc {
  background: #4a6a4a !important;
  border: 1px solid #6b9b6b !important;
  color: #d0e0d0 !important;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.panel.property-popup button#save-desc:hover {
  background: #5a7a5a !important;
  border-color: #7aab7a !important;
  box-shadow: 0 4px 12px rgba(107,155,107,0.3);
  transform: translateY(-1px);
}

.panel.property-popup button#save-desc:active {
  transform: translateY(0);
}

/* панель вывода текущих координат курсора */
/* Скрыта на десктопе — координаты отображаются в нижней статус-панели */
#mouse-position { display: none !important; }

#mouse-position.legacy-visible {
  position: absolute;
  bottom: 10px; /* По умолчанию у нижнего края */
  right: 10px;
  padding: 4px 8px;
  transition: bottom 0.3s ease; /* Плавный переход */
  background: rgba(26,31,26,0.9);
  border: 1px solid #3d5a3d;
  border-radius: 3px;
  font-size: 11px;
  z-index: 10000;
  color: #b8c5b8;
  font-family: 'Courier New', monospace;
}

/* Красивое уведомление об ошибке */
.notification-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.notification-box {
  background: linear-gradient(135deg, rgba(26,31,26,0.98) 0%, rgba(20,25,20,0.98) 100%);
  border: 2px solid #d32f2f;
  border-radius: 8px;
  padding: 24px 32px;
  max-width: 400px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.8), 0 0 20px rgba(211,47,47,0.3);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notification-box .notification-icon {
  text-align: center;
  font-size: 48px;
  margin-bottom: 16px;
  color: #d32f2f;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.notification-box .notification-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.notification-box .notification-message {
  text-align: center;
  font-size: 14px;
  color: #b8c5b8;
  margin-bottom: 24px;
  line-height: 1.5;
}

.notification-box .notification-button {
  display: block;
  width: 100%;
  background: #d32f2f;
  border: 1px solid #ff6b6b;
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notification-box .notification-button:hover {
  background: #b71c1c;
  border-color: #d32f2f;
  box-shadow: 0 4px 12px rgba(211,47,47,0.4);
  transform: translateY(-1px);
}

.notification-box .notification-button:active {
  transform: translateY(0);
}

/* Вариации уведомлений */
.notification-box.success {
  border-color: #4a7a4a;
  box-shadow: 0 12px 48px rgba(0,0,0,0.8), 0 0 20px rgba(74,122,74,0.3);
}

.notification-box.success .notification-icon {
  color: #6fbf6f;
}

.notification-box.success .notification-title {
  color: #7aab7a;
}

.notification-box.success .notification-button {
  background: #4a6a4a;
  border-color: #6b9b6b;
}

.notification-box.success .notification-button:hover {
  background: #5a7a5a;
  border-color: #7aab7a;
  box-shadow: 0 4px 12px rgba(107,155,107,0.4);
}

.notification-box.info {
  border-color: #4a6a8a;
  box-shadow: 0 12px 48px rgba(0,0,0,0.8), 0 0 20px rgba(74,106,138,0.3);
}

.notification-box.info .notification-icon {
  color: #74b9ff;
}

.notification-box.info .notification-title {
  color: #74b9ff;
}

.notification-box.info .notification-button {
  background: #3d5a7a;
  border-color: #5a7a9a;
}

.notification-box.info .notification-button:hover {
  background: #4d6a8a;
  border-color: #6a8aaa;
  box-shadow: 0 4px 12px rgba(90,122,154,0.4);
}

.highlight-digit {
  font-size: 140% !important;
  display: inline-block !important;
  font-weight: 700 !important;
  color: #8fc78f !important;
  font-family: 'Courier New', monospace !important;
  line-height: 1 !important;
  text-shadow: 0 0 4px rgba(143, 199, 143, 0.5) !important;
  padding: 0 1px !important;
  letter-spacing: 0.5px !important;
}

/* Скрываем заголовок по умолчанию */
#map-header {
  display: none;
}

/* Стиль кнопки тулбара (пример, под ваши классы) */
.toolbar-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.2em;
  padding: 4px;
  color: #444;
}
.toolbar-btn:hover {
  color: #000;
}

#header-toggle-container {
  position: absolute;
  top: 70px;      /* сместить вниз при необходимости */
  right: 10px;    /* отступ от правого края */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.5);
  padding: 4px;
  border-radius: 4px;
  z-index: 1000;
}

/* Все кнопки в контейнере одинаковой ширины */
#header-toggle-container button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Сброс стандартных стилей кнопки, только иконка */
#toggle-header-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  color: #444;
  outline: none;
}
#toggle-header-btn:hover {
  color: #000;
}

/* дополнительный лёгкий hover-эффект */
.toolbar-btn:hover i {
  color: #0056b3;
}

.toolbar-btn {
  background: transparent;
  border: none;
  padding: 1px;
  cursor: pointer;
  color: #444;
}
.toolbar-btn:hover {
  color: #000;
}

.icon-img {
  width: 1em;
  height: 1em;
  vertical-align: middle;
}

/* Отдельно подстроим кнопку фильтра (если нужно) */
#toggle-date-filter-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  color: #444;
  padding: 4px;
}
#toggle-date-filter-btn:hover {
  color: #000;
}

/* Кнопка координатной сетки */
#toggle-grid-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  color: #444;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
}
#toggle-grid-btn:hover {
  color: #000;
  opacity: 1;
}
#toggle-grid-btn.active {
  color: #007bff;
  opacity: 1;
  background: rgba(0,123,255,0.1);
  border-radius: 4px;
}

/* Кнопка поиска */
#toggle-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  color: #444;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}
#toggle-search-btn:hover {
  color: #000;
  opacity: 1;
}
#toggle-search-btn.active {
  color: #007bff;
  opacity: 1;
}

/* Кнопка траекторий */
#toggle-trajectories-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  color: #444;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
}
#toggle-trajectories-btn:hover {
  color: #000;
  opacity: 1;
}
#toggle-trajectories-btn.active {
  color: #007bff;
  opacity: 1;
  background: rgba(0,123,255,0.1);
  border-radius: 4px;
}

/* Панель календаря */
#date-filter-panel {
  position: absolute;
  top: 145px;      /* чуть ниже контейнера кнопок */
  right: 10px;
  width: 260px;
  background: rgba(255,255,255,0.5);
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 12px;
  z-index: 1000;
  display: none;  /* по умолчанию скрыта */
}

/* Шапка календаря (месяц + стрелки) */
#date-filter-panel .calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
#date-filter-panel .calendar-header button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}
#date-filter-panel .calendar-header span {
  font-size: 14px;
  font-weight: 600;
}

/* Сетка дней недели и дат */
#date-filter-panel .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  user-select: none;
  margin-bottom: 8px;
}
#date-filter-panel .calendar-grid div {
  font-size: 12px;
  padding: 4px 0;
}

/* Ячейки дат */
#date-filter-panel .day-cell {
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
}
#date-filter-panel .day-cell:hover {
  background: #eef;
}
/* Выделение начала */
#date-filter-panel .day-cell.start {
  background: #cce5ff;
}
/* Выделение конца */
#date-filter-panel .day-cell.end {
  background: #007bff;
  color: #fff;
}
/* Промежуток */
#date-filter-panel .day-cell.in-range {
  background: #e6f2ff;
}

/* Кнопки Apply/Clear */
#date-filter-panel > div:last-child {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
#date-filter-panel > div:last-child button {
  border: none;
  border-radius: 4px;
  font-size: 13px;
  padding: 4px 8px;
  cursor: pointer;
  transition: background 0.15s;
}
#apply-filter {
  background: #007bff;
  color: #fff;
}
#apply-filter:hover {
  background: #0056b3;
}
#clear-filter {
  background: #f0f0f0;
  color: #333;
}
#clear-filter:hover {
  background: #e0e0e0;
}

/* по умолчанию панель скрыта */
#date-filter-panel {
  display: none;
}
/* когда у панели есть класс .visible — показываем flex */
#date-filter-panel.visible {
  display: flex !important;
}

/* Новая панель фильтра */
#filter-panel {
  position: fixed;
  /* Позиция будет установлена через JavaScript динамически */
  width: 320px;
  background: rgba(26, 31, 26, 0.98);
  border: 3px solid #6b9b6b;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.9);
  z-index: 99999;
  max-height: 90vh;
  overflow-y: auto;
  contain: layout paint;
}

/* Стили скроллбара для панели фильтра */
#filter-panel::-webkit-scrollbar {
  width: 8px;
}

#filter-panel::-webkit-scrollbar-track {
  background: rgba(26, 31, 26, 0.5);
  border-radius: 4px;
}

#filter-panel::-webkit-scrollbar-thumb {
  background: #4a6a4a;
  border-radius: 4px;
}

#filter-panel::-webkit-scrollbar-thumb:hover {
  background: #6b9b6b;
}

/* Для Firefox */
#filter-panel {
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.5);
}

/* Скроллбар в панели поиска населённых пунктов */
#geo-search-results::-webkit-scrollbar {
  width: 6px;
}

#geo-search-results::-webkit-scrollbar-track {
  background: rgba(26, 31, 26, 0.5);
  border-radius: 3px;
}

#geo-search-results::-webkit-scrollbar-thumb {
  background: #4a6a4a;
  border-radius: 3px;
}

#geo-search-results::-webkit-scrollbar-thumb:hover {
  background: #6b9b6b;
}

/* Для Firefox */
#geo-search-results {
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.5);
}

#filter-panel .calendar-grid div {
  padding: 4px 2px;
  cursor: default;
}

#filter-panel .day-cell {
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s;
  padding: 6px 4px;
  color: #b8c5b8;
}

#filter-panel .day-cell:hover {
  background: rgba(107, 155, 107, 0.3);
  color: #d0e0d0;
}

#filter-panel .day-cell.start,
#filter-panel .day-cell.end {
  background: #4a6a4a;
  color: #d0e0d0;
  font-weight: 600;
}

#filter-panel .day-cell.in-range {
  background: rgba(107, 155, 107, 0.2);
  color: #b8c5b8;
}

#filter-panel #apply-filter:hover {
  background: #5a7a5a;
}

#filter-panel #reset-filter:hover {
  background: #7f8c8d;
}

#delete-all-container {
  position: fixed;
  bottom: 10px; /* По умолчанию у нижнего края */
  left: 10px; /* По умолчанию у левого края */
  z-index: 9999;
  transition: bottom 0.3s ease, left 0.3s ease; /* Плавный переход */
}

#delete-all-btn {
  background: rgba(255,255,255,0.5);
  border: 1px solid #c0c0c0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: box-shadow 0.2s, background 0.2s;
  cursor: pointer;
}

#delete-all-btn:hover {
  background: #ffeaea;
  box-shadow: 0 4px 12px rgba(255,50,50,0.18);
  border-color: #fa6565;
}

#delete-all-btn i {
  color: #c0392b;
}

body.webview #map {
  width: 100vw !important;
  height: 100vh !important;
  min-width: 100vw;
  min-height: 100vh;
}

/* Панель поиска объектов */
#search-panel {
  position: fixed !important;
  top: 70px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 380px !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
  background: rgba(255,255,255,0.5) !important; /* Полупрозрачный фон как у других элементов */
  border: 1px solid rgba(204,204,204,0.8) !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important; /* Тень как у панели инструментов */
  backdrop-filter: blur(4px) !important; /* Размытие фона */
  padding: 0 !important;
  z-index: 2147483647 !important;
  display: none !important;
  pointer-events: auto !important;
  contain: layout paint;
}

#search-panel.visible {
  display: block !important;
  z-index: 2147483647 !important;
}

/* Эффект при наведении - делаем фон менее прозрачным */
#search-panel:hover {
  background: rgba(255,255,255,0.75) !important;
  transition: background 0.2s ease !important;
}

.search-header {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 4px 20px !important;
  border-bottom: 1px solid rgba(238,238,238,0.6) !important;
  background: rgba(248,249,250,0.3) !important;
  border-radius: 6px 6px 0 0 !important;
  backdrop-filter: blur(2px) !important;
}

.search-header h3 {
  margin: 0;
  font-size: 15px;
  color: #333;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}



.search-content {
  padding: 8px 20px !important;
  background: rgba(255,255,255,0.1);
}

.search-group {
  margin-bottom: 10px;
}

.search-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #444;
  font-size: 13px;
  text-shadow: 0 1px 1px rgba(255,255,255,0.6);
}

.search-group input, .search-group select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(221,221,221,0.7);
  border-radius: 4px;
  font-size: 13px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(2px);
  transition: all 0.2s ease;
}

.search-group input:focus, .search-group select:focus {
  outline: none;
  border-color: rgba(0,123,255,0.8);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
  transform: scale(1.01);
}

.search-group input::placeholder {
  color: rgba(108,117,125,0.8);
  font-style: italic;
}

.coords-input {
  display: grid;
  grid-template-columns: 1fr 1fr 80px;
  gap: 8px;
}

.date-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-input span {
  color: #666;
}

.search-actions {
  padding: 8px 20px !important;
  border-top: 1px solid rgba(238,238,238,0.6);
  background: rgba(248,249,250,0.2);
  display: flex;
  gap: 10px !important;
  border-radius: 0 0 6px 6px;
}

.btn-primary, .btn-secondary {
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  backdrop-filter: blur(2px);
}

.btn-primary {
  background: rgba(0,123,255,0.9);
  color: white;
  border-color: rgba(0,123,255,0.3);
  flex: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-primary:hover {
  background: rgba(0,86,179,0.95);
  border-color: rgba(0,86,179,0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.btn-secondary {
  background: rgba(108,117,125,0.8);
  color: white;
  border-color: rgba(108,117,125,0.3);
  flex: 0 0 auto;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-secondary:hover {
  background: rgba(84,91,98,0.9);
  border-color: rgba(84,91,98,0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(108,117,125,0.3);
}

.search-results {
  border-top: 1px solid rgba(238,238,238,0.6);
  max-height: 300px;
  overflow-y: auto;
  background: rgba(255,255,255,0.05);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 20px !important;
  background: rgba(248,249,250,0.4);
  border-bottom: 1px solid rgba(238,238,238,0.5);
  font-size: 12px;
  color: #555;
  font-weight: 500;
  text-shadow: 0 1px 1px rgba(255,255,255,0.6);
  backdrop-filter: blur(2px);
}

.results-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
}

#prev-result, #next-result {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(221,221,221,0.6);
  width: 22px;
  height: 22px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(2px);
}

#prev-result:hover:not(:disabled), #next-result:hover:not(:disabled) {
  background: rgba(233,236,239,0.8);
  border-color: rgba(0,123,255,0.4);
  transform: scale(1.05);
}

#prev-result:disabled, #next-result:disabled {
  color: rgba(204,204,204,0.8);
  cursor: not-allowed;
  background: rgba(248,249,250,0.3);
}

.results-list {
  padding: 8px 0;
}

.result-item {
  padding: 10px 20px !important;
  border-bottom: 1px solid rgba(240,240,240,0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(1px);
}

.result-item:hover {
  background: rgba(248,249,250,0.6);
  transform: translateX(2px);
}

.result-item.active {
  background: rgba(227,242,253,0.7);
  border-left: 3px solid rgba(33,150,243,0.8);
  box-shadow: inset 0 0 8px rgba(33,150,243,0.1);
}

.result-item .result-title {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  margin-bottom: 2px;
}

.result-item .result-description {
  color: #666;
  font-size: 12px;
  margin-bottom: 2px;
  max-height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-item .result-coords {
  color: #888;
  font-size: 11px;
  font-family: 'Courier New', monospace;
}

/* Подсветка найденных объектов */
.search-highlight {
  animation: searchPulse 2s infinite;
}

@keyframes searchPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ========================================
   КОМПАС (ol.control.Rotate)
   ======================================== */
.ol-rotate {
  position: fixed !important;
  top: auto !important;
  bottom: 80px !important;  /* над кнопками зума */
  right: 8px !important;
  left: auto !important;
  background: transparent !important;
  padding: 0 !important;
}
.ol-rotate .ol-rotate-reset {
  width: 36px !important;
  height: 36px !important;
  background: rgba(12, 17, 12, 0.88) !important;
  border: 1px solid #4a6a4a !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
  color: #c07070 !important;          /* красный — "север" */
  font-size: 18px !important;
  line-height: 36px !important;
  text-align: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.2s, border-color 0.2s !important;
}
.ol-rotate .ol-rotate-reset:hover {
  background: rgba(61, 90, 61, 0.8) !important;
  border-color: #6b9b6b !important;
  color: #d0e0d0 !important;
}
/* Стрелка вращается вместе с картой автоматически через transform в OL */
.ol-rotate .ol-rotate-reset .ol-compass {
  display: block !important;
  font-style: normal !important;
  font-size: 20px !important;
  line-height: 1 !important;
}

/* Оси координат */
#coordinate-axes {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  pointer-events: none !important;
  z-index: 10 !important; /* Очень низкий приоритет - под всеми элементами интерфейса */
  contain: layout paint style; /* изолируем от layout карты — браузер не пересчитывает внешнее дерево */
  transition: opacity 0.2s ease; /* плавное появление/исчезновение меток при пане */
}

/* Горизонтальная ось вверху */
#horizontal-axis {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 20px !important;
  background: transparent !important;
  display: flex !important;
  align-items: flex-end !important;
  padding-bottom: 0px !important;
}

/* Вертикальная ось справа */
#vertical-axis {
  position: absolute !important;
  top: 0px !important; /* Не перекрываем горизонтальную ось */
  bottom: 0 !important;
  right: 0 !important;
  width: 24px !important;
  background: transparent !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  padding-left: 2px !important;
}

/* Граница горизонтальной оси, сдвинутая под метки */
#horizontal-axis::after {
  display: none !important;
}

/* Граница вертикальной оси, сдвинутая под метки */
#vertical-axis::after {
  display: none !important;
}

/* Отметки на осях */
/* Отметки на осях */
.axis-mark {
  position: absolute !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #8fc78f !important;
  background: rgba(26, 31, 26, 0.92) !important;
  padding: 2px 5px !important;
  border-radius: 3px !important;
  border: 1px solid #4a6a4a !important;
  white-space: nowrap !important;
  z-index: 11 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

/* Отметки на горизонтальной оси */
#horizontal-axis .axis-mark {
  top: 0 !important;
  transform: translateX(-50%) !important; /* Центрируем метку - центр на линии */
}

/* Отметки на вертикальной оси */
#vertical-axis .axis-mark {
  right: 0 !important;
  transform: translateY(-50%) !important; /* Центрируем метку - центр на линии */
}

/* Деления на осях */
.axis-tick {
  display: none !important;
}

/* Деления на горизонтальной оси */
#horizontal-axis .axis-tick {
  width: 1px !important;
  height: 5px !important;
  bottom: 14px !important; /* Позиционируем на черной линии */
}

/* Деления на вертикальной оси */
#vertical-axis .axis-tick {
  height: 1px !important;
  width: 5px !important;
  right: 2px !important; /* Позиционируем на черной линии */
}

/* Угловой элемент в левом нижнем углу */
#axis-corner {
  display: none !important;
}

/* ========================================
   МОДАЛЬНОЕ ОКНО ВЫБОРА ДРОНА
   ======================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(240, 240, 240, 0.8);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #7f8c8d;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #2c3e50;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(240, 240, 240, 0.5);
  display: flex;
  justify-content: flex-end;
}

/* Секция поиска дрона */
.drone-search-section {
  margin-bottom: 20px;
}

.drone-search-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #2c3e50;
}

#drone-search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #bdc3c7;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

#drone-search-input:focus {
  outline: none;
  border-color: #3498db;
}

.drone-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ecf0f1;
  border-radius: 6px;
  margin-top: 10px;
  background: white;
}

.drone-item {
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid #ecf0f1;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s;
}

.drone-item:hover {
  background-color: #ecf0f1;
}

.drone-item:last-child {
  border-bottom: none;
}

.drone-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  flex-shrink: 0;
}

.drone-info {
  flex: 1;
}

.drone-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 2px;
}

.drone-meta {
  font-size: 12px;
  color: #7f8c8d;
}

/* Разделитель */
.divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
  color: #95a5a6;
  font-size: 14px;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #ddd;
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

/* Секция создания дрона */
.drone-create-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drone-create-section label {
  font-weight: 500;
  color: #2c3e50;
}

#new-drone-name,
#new-drone-type {
  padding: 10px 12px;
  border: 1px solid #bdc3c7;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

#new-drone-name:focus,
#new-drone-type:focus {
  outline: none;
  border-color: #3498db;
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-secondary:active {
  transform: scale(0.98);
}

#create-new-drone {
  margin-top: 5px;
}

/* ========== СТИЛИ ДЛЯ АДМИНСКИХ МОДАЛЬНЫХ ОКОН ========== */

.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.admin-modal-content {
  background: linear-gradient(135deg, rgba(26,31,26,0.98) 0%, rgba(20,25,20,0.98) 100%);
  border: 3px double #3d5a3d;
  border-radius: 12px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8), 0 0 20px rgba(61,90,61,0.3);
  animation: slideDown 0.3s ease;
}

.admin-modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #2d3a2d 0%, #1f2a1f 100%);
  border-bottom: 2px solid #3d5a3d;
  color: #d0e0d0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* Контролы (поиск + кнопки), вынесенные в шапку модала */
/* ── Контролы (поиск + кнопки), вынесенные в шапку модала ── */
.modal-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Нормальный режим: зелёная кнопка создать */
.modal-header-controls .toolbar-btn.create {
  background: #1c3a1c;
  border: 1px solid #3a6a3a;
  color: #80cc80;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 32px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transform: none;
  box-sizing: border-box;
}
.modal-header-controls .toolbar-btn.create:hover {
  background: #234e23;
  border-color: #5a8a5a;
  color: #a0e0a0;
}

/* Нормальный режим: поле поиска в шапке */
.modal-header-controls input[type="text"] {
  padding: 0 12px;
  border: 1px solid #3d5a3d;
  border-radius: 4px;
  font-size: 13px;
  background: rgba(15,20,15,0.7);
  color: #d0e0d0;
  height: 32px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.modal-header-controls input[type="text"]:focus {
  outline: none;
  border-color: #6b9b6b;
  box-shadow: 0 0 6px rgba(107,155,107,0.3);
}
.modal-header-controls input[type="text"]::placeholder {
  color: #7a9a7a;
}

/* Нормальный режим: чекбокс-лейбл */
.modal-header-controls label {
  font-size: 13px;
  color: #9ab09a;
  cursor: pointer;
  white-space: nowrap;
}

/* В ACP-режиме кнопки шапки скрываются глобально — перебиваем */
.admin-modal.acp-active .modal-header-controls button {
  display: inline-flex !important;
  height: 26px !important;
  width: auto !important;
  padding: 0 10px !important;
  font-size: 11px !important;
  align-items: center !important;
  gap: 5px !important;
  border-radius: 4px !important;
  transform: none !important;
}
/* ACP: цвет зелёной кнопки */
.admin-modal.acp-active .modal-header-controls .toolbar-btn.create {
  background: #1c3a1c !important;
  border: 1px solid #3a6a3a !important;
  color: #80cc80 !important;
}
.admin-modal.acp-active .modal-header-controls .toolbar-btn.create:hover {
  background: #234e23 !important;
  border-color: #5a8a5a !important;
  color: #a0e0a0 !important;
}
.admin-modal.acp-active .modal-header-controls input[type="text"] {
  height: 26px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  min-width: 100px !important;
  box-sizing: border-box !important;
  background: rgba(10,15,10,0.8) !important;
  border: 1px solid #3d5a3d !important;
  color: #d0e0d0 !important;
}
.admin-modal.acp-active .modal-header-controls label {
  font-size: 11px !important;
  color: #9ab09a !important;
}
.admin-modal.acp-active .admin-modal-header { justify-content: flex-start !important; }

.admin-modal-header h2 {
  margin: 0;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b8c5b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.admin-modal-header h2 i {
  color: #6b9b6b;
}

.admin-modal-header button {
  background: none;
  border: none;
  color: #7a9a7a;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-modal-header button:hover {
  color: #ff6b6b;
  transform: rotate(90deg);
}

.admin-modal-toolbar {
  padding: 16px 24px;
  background: rgba(15,20,15,0.5);
  border-bottom: 1px solid #3d5a3d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-modal-toolbar .btn-success {
  background: #4a6a4a;
  color: #d0e0d0;
  border: 1px solid #6b9b6b;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.admin-modal-toolbar .btn-success:hover {
  background: #5a7a5a;
  border-color: #7aab7a;
  box-shadow: 0 4px 12px rgba(107,155,107,0.3);
  transform: translateY(-1px);
}

.admin-modal-toolbar .btn-secondary {
  background: #3d4a3d;
  color: #b8c5b8;
  border: 1px solid #4d5a4d;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.admin-modal-toolbar .btn-secondary:hover {
  background: #4d5a4d;
  border-color: #5d6a5d;
}

/* Кнопка режима технического обслуживания */
/* По умолчанию скрыта — JS показывает только super_admin */
#maintenance-mode-btn {
  display: none !important;
}

#maintenance-mode-btn:hover {
  background: #5a3810 !important;
  border-color: #a07030 !important;
}
#maintenance-mode-btn.active {
  background: #6a2008 !important;
  border-color: #c03010 !important;
  color: #ff8060 !important;
}
#maintenance-mode-btn.active #maint-btn-icon {
  animation: spin-maint 2s linear infinite;
}
@keyframes spin-maint { to { transform: rotate(360deg); } }

.admin-modal-toolbar input[type="text"] {
  padding: 10px 16px;
  border: 1px solid #3d5a3d;
  border-radius: 6px;
  width: 250px;
  font-size: 14px;
  background: rgba(15,20,15,0.7);
  color: #d0e0d0;
  transition: all 0.2s;
}

.admin-modal-toolbar input[type="text"]:focus {
  outline: none;
  border-color: #6b9b6b;
  box-shadow: 0 0 8px rgba(107,155,107,0.3);
}

.admin-modal-toolbar input[type="text"]::placeholder {
  color: #7a9a7a;
}

.admin-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: rgba(10,15,10,0.3);
}

/* Скроллбар модала аналитики */
#analytics-modal .admin-modal-content::-webkit-scrollbar {
  width: 8px;
}

#analytics-modal .admin-modal-content::-webkit-scrollbar-track {
  background: rgba(26, 31, 26, 0.5);
  border-radius: 4px;
}

#analytics-modal .admin-modal-content::-webkit-scrollbar-thumb {
  background: #4a6a4a;
  border-radius: 4px;
}

#analytics-modal .admin-modal-content::-webkit-scrollbar-thumb:hover {
  background: #6b9b6b;
}

/* Для Firefox */
#analytics-modal .admin-modal-content {
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.5);
}

/* Военный стиль для scrollbar */
.admin-modal-body::-webkit-scrollbar {
  width: 12px;
}

.admin-modal-body::-webkit-scrollbar-track {
  background: rgba(26,31,26,0.6);
  border-left: 1px solid #3d5a3d;
}

.admin-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a6a4a, #3d5a3d);
  border-radius: 6px;
  border: 1px solid #6b9b6b;
}

.admin-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6b9b6b, #4a6a4a);
}

/* Скроллбар в модале редактирования пользователя */
.edit-modal-body::-webkit-scrollbar {
  width: 8px;
}

.edit-modal-body::-webkit-scrollbar-track {
  background: #0d1a0d;
  border-radius: 4px;
}

.edit-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a6a4a, #3d5a3d);
  border-radius: 4px;
  border: 1px solid #2a4a2a;
}

.edit-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6b9b6b, #4a6a4a);
}
#db-types-container::-webkit-scrollbar {
  width: 10px;
}

#db-types-container::-webkit-scrollbar-track {
  background: rgba(26,31,26,0.6);
  border-radius: 4px;
  border: 1px solid #2d3a2d;
}

#db-types-container::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a6a4a, #3d5a3d);
  border-radius: 4px;
  border: 1px solid #6b9b6b;
}

#db-types-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6b9b6b, #4a6a4a);
}

/* Для Firefox */
#db-types-container {
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.6);
}

/* Военный стиль для scrollbar в контейнере параметров объектов (панель БД) */
#db-additional-params-container::-webkit-scrollbar {
  width: 6px;
}

#db-additional-params-container::-webkit-scrollbar-track {
  background: rgba(26,31,26,0.6);
  border-radius: 4px;
}

#db-additional-params-container::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a6a4a, #3d5a3d);
  border-radius: 4px;
  border: 1px solid #6b9b6b;
}

#db-additional-params-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6b9b6b, #4a6a4a);
}

/* Для Firefox */
#db-additional-params-container {
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.6);
}

/* Военный стиль для scrollbar в модальном окне группы */
#group-icon-grid::-webkit-scrollbar,
#group-object-types-container::-webkit-scrollbar {
  width: 10px;
}

#group-icon-grid::-webkit-scrollbar-track,
#group-object-types-container::-webkit-scrollbar-track {
  background: rgba(26,31,26,0.6);
  border-radius: 4px;
  border: 1px solid #2d3a2d;
}

#group-icon-grid::-webkit-scrollbar-thumb,
#group-object-types-container::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a6a4a, #3d5a3d);
  border-radius: 4px;
  border: 1px solid #6b9b6b;
}

#group-icon-grid::-webkit-scrollbar-thumb:hover,
#group-object-types-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6b9b6b, #4a6a4a);
}

/* Для Firefox */
#group-icon-grid,
#group-object-types-container {
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.6);
}

/* Военный стиль для scrollbar в окне Управление иконками */
#icons-grid-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#icons-grid-scroll::-webkit-scrollbar-track {
  background: rgba(26,31,26,0.6);
  border-radius: 4px;
  border: 1px solid #2d3a2d;
}

#icons-grid-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a6a4a, #3d5a3d);
  border-radius: 4px;
  border: 1px solid #6b9b6b;
}

#icons-grid-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6b9b6b, #4a6a4a);
}

/* Для Firefox */
#icons-grid-scroll {
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.6);
  color-scheme: dark;
}

/* Военный стиль для scrollbar в галерее иконок (создание/редактирование типа объекта) */
#create-icon-gallery::-webkit-scrollbar,
#edit-icon-gallery::-webkit-scrollbar {
  width: 8px;
}

#create-icon-gallery::-webkit-scrollbar-track,
#edit-icon-gallery::-webkit-scrollbar-track {
  background: rgba(26,31,26,0.6);
  border-radius: 4px;
  border: 1px solid #2d3a2d;
}

#create-icon-gallery::-webkit-scrollbar-thumb,
#edit-icon-gallery::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a6a4a, #3d5a3d);
  border-radius: 4px;
  border: 1px solid #6b9b6b;
}

#create-icon-gallery::-webkit-scrollbar-thumb:hover,
#edit-icon-gallery::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6b9b6b, #4a6a4a);
}

/* Для Firefox */
#create-icon-gallery,
#edit-icon-gallery {
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.6);
}

/* Стилизация скроллбара для выпадающего меню групп на панели инструментов */
.toolbar-submenu::-webkit-scrollbar {
  width: 8px;
}

.toolbar-submenu::-webkit-scrollbar-track {
  background: rgba(26, 31, 26, 0.6);
  border-radius: 4px;
}

.toolbar-submenu::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a6a4a, #3d5a3d);
  border-radius: 4px;
  border: 1px solid #6b9b6b;
}

.toolbar-submenu::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6b9b6b, #4a6a4a);
}

/* Для Firefox */
.toolbar-submenu {
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.6);
}

.admin-modal-body table {
  width: 100%;
  border-collapse: collapse;
}

.admin-modal-body table thead {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(29,39,29,0.97);
}

.admin-modal-body table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(29,39,29,0.97);
  box-shadow: 0 2px 0 #3d5a3d;
}

.admin-modal-body table tbody tr {
  position: relative;
  z-index: 0;
}

#users-table {
  min-width: 760px;
}

/* На мобильном (portrait-split управляется через CSS в index.php) */

#users-table td:last-child,
#users-table th:last-child {
  white-space: nowrap;
  width: 90px;
}

.admin-modal-body table thead tr {
  background: rgba(29,39,29,0.8);
  text-align: left;
}

.admin-modal-body table th {
  padding: 14px 12px;
  border-bottom: 2px solid #3d5a3d;
  font-weight: 700;
  color: #b8c5b8;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-modal-body table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(61,90,61,0.3);
  font-size: 14px;
  color: #b8c5b8;
}

.admin-modal-body table tbody tr {
  transition: background 0.2s;
}

.admin-modal-body table tbody tr:hover {
  background: rgba(61,90,61,0.2);
}

/* Icon Grid */
.icon-item {
  position: relative;
  background: linear-gradient(180deg, rgba(29,39,29,0.8), rgba(20,30,20,0.9));
  border: 1px solid #3d5a3d;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.icon-item:hover {
  border-color: #6b9b6b;
  background: linear-gradient(180deg, rgba(35,45,35,0.9), rgba(25,35,25,1));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.icon-preview {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,15,10,0.5);
  border: 1px solid #2d4a2d;
  border-radius: 4px;
  padding: 10px;
}

.icon-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.icon-info {
  text-align: center;
  width: 100%;
}

.icon-name {
  font-size: 12px;
  color: #b8c5b8;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-all;
}

.icon-size {
  font-size: 10px;
  color: #8aaa8a;
}

.icon-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: linear-gradient(180deg, #6a4a4a, #5a3d3d);
  color: #ff6b6b;
  border: 1px solid #9b6b6b;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: all 0.2s;
}

.icon-item:hover .icon-delete-btn {
  opacity: 1;
}

.icon-delete-btn:hover {
  background: linear-gradient(180deg, #7a5a5a, #6a4d4d);
  transform: scale(1.1);
}

/* Стили для контекстного меню объектов */
.context-menu-item {
  padding: 7px 12px;
  color: #b8c5b8;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  transition: all 0.2s;
  user-select: none;
}

.context-menu-item i {
  color: #6b9b6b;
  width: 14px;
  text-align: center;
  font-size: 13px;
}

.context-menu-item:hover {
  background: rgba(61,90,61,0.3);
  color: #d0e0d0;
}

.context-menu-item:active {
  background: rgba(61,90,61,0.5);
  transform: scale(0.98);
}

.context-menu-item-danger {
  color: #e74c3c;
}

.context-menu-item-danger i {
  color: #e74c3c;
}

.context-menu-item-danger:hover {
  background: rgba(231,76,60,0.15);
  color: #ff6b6b;
}

.context-menu-item-danger:hover i {
  color: #ff6b6b;
}

/* ── Folders panel in icons modal ──────────────────────────────────── */

#icon-folders-panel {
  width: 200px;
  min-height: 0;
  border-right: 1px solid #3d5a3d;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: rgba(10,15,10,0.3);
}

.icon-folders-header {
  padding: 12px 14px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #6b9b6b;
  border-bottom: 1px solid #2a3a2a;
  user-select: none;
}

.icon-folders-header i {
  margin-right: 6px;
}

#icon-folders-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.6);
}

#icon-folders-list::-webkit-scrollbar {
  width: 8px;
}

#icon-folders-list::-webkit-scrollbar-track {
  background: rgba(26,31,26,0.6);
  border-radius: 4px;
}

#icon-folders-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a6a4a, #3d5a3d);
  border-radius: 4px;
  border: 1px solid #6b9b6b;
}

#icon-folders-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6b9b6b, #4a6a4a);
}

.icon-folders-footer {
  padding: 8px 10px;
  border-top: 1px solid #2a3a2a;
}

.btn-add-folder {
  width: 100%;
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(61,90,61,0.6), rgba(40,60,40,0.7));
  color: #8aaa8a;
  border: 1px solid #4a6a4a;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 7px;
}

.btn-add-folder:hover {
  background: linear-gradient(180deg, rgba(75,110,75,0.7), rgba(55,80,55,0.8));
  color: #b8c5b8;
  border-color: #6b9b6b;
}

/* Folder item */
.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  position: relative;
  user-select: none;
}

.folder-item:hover {
  background: rgba(61,90,61,0.2);
}

.folder-item.active {
  border-left-color: #6b9b6b;
  background: rgba(61,90,61,0.3);
}

.folder-icon {
  font-size: 13px;
  color: #6b9b6b;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.folder-item.active .folder-icon {
  color: #8ec48e;
}

.folder-name {
  flex: 1;
  font-size: 13px;
  color: #a0b8a0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-item.active .folder-name {
  color: #d0e0d0;
  font-weight: 600;
}

.folder-count {
  font-size: 11px;
  color: #5a7a5a;
  background: rgba(61,90,61,0.3);
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.folder-item.active .folder-count {
  background: rgba(107,155,107,0.25);
  color: #8aaa8a;
}

.folder-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}

.folder-item:hover .folder-actions {
  display: flex;
}

.folder-action-btn {
  width: 22px;
  height: 22px;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: #6b9b6b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.15s;
  padding: 0;
}

.folder-action-btn:hover {
  background: rgba(61,90,61,0.4);
  color: #b8c5b8;
}

.folder-action-delete:hover {
  background: rgba(100,40,40,0.5);
  color: #ff8888;
}

.folder-divider {
  height: 1px;
  background: #2a3a2a;
  margin: 4px 10px;
}

/* Пилюля «Новая папка» внутри списка — десктоп: в нижней панели, как обычно */
/* Мобильный: скрывается через .icon-folders-footer display:none, пилюля остаётся в списке */
.folder-item--add {
  color: #8aaa8a;
  border-left: none;
  margin-left: 4px;
  padding-left: 10px;
  border-left: 1px solid #2a3a2a !important;
}

.folder-item--add:hover {
  background: rgba(61,90,61,0.2);
  color: #b8c5b8;
}

/* На десктопе — скрываем пилюлю в списке (там работает штатная кнопка в footer) */
#icon-folders-list .folder-item--add {
  display: none;
}

/* ── Icon card updates ─────────────────────────────────────────────── */

.icon-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.icon-folder-badge {
  font-size: 10px;
  color: #6b9b6b;
  background: rgba(61,90,61,0.3);
  border: 1px solid #3d5a3d;
  border-radius: 10px;
  padding: 1px 7px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.icon-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.icon-item:hover .icon-card-actions {
  opacity: 1;
}

.icon-folder-btn {
  width: 28px;
  height: 28px;
  background: linear-gradient(180deg, #2d5a4a, #264a3a);
  color: #6bcba8;
  border: 1px solid #3d8a6a;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.icon-folder-btn:hover {
  background: linear-gradient(180deg, #3d7a5a, #2d6a4a);
  transform: scale(1.1);
}

.icon-rename-btn {
  width: 28px;
  height: 28px;
  background: linear-gradient(180deg, #2d4a6a, #1e3a5a);
  color: #6baacb;
  border: 1px solid #3d6a8a;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.icon-rename-btn:hover {
  background: linear-gradient(180deg, #3d6a8a, #2d5a7a);
  transform: scale(1.1);
}

.icon-color-btn {
  width: 28px;
  height: 28px;
  background: linear-gradient(180deg, #2d5a4a, #1e4a3a);
  color: #6bcbaa;
  border: 1px solid #3d8a6a;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.icon-color-btn:hover {
  background: linear-gradient(180deg, #3d8a6a, #2d7a5a);
  transform: scale(1.1);
}

/* ─── Color editor dialog ─────────────────────────────────── */
.color-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-editor-dialog {
  background: #141a14;
  border: 1px solid #3d5a3d;
  border-radius: 8px;
  width: 720px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  overflow: hidden;
}

.color-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(10,15,10,0.6);
  border-bottom: 1px solid #2d4a2d;
  color: #c0d8c0;
  font-size: 14px;
}

.color-editor-close-btn {
  background: none;
  border: none;
  color: #8aaa8a;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.color-editor-close-btn:hover { color: #fff; }

.color-editor-body {
  display: flex;
  gap: 0;
  overflow: hidden;
  flex: 1;
}

.color-editor-previews {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(5,10,5,0.4);
  border-right: 1px solid #2d4a2d;
  width: 200px;
  flex-shrink: 0;
  align-items: center;
}

.color-editor-preview-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.color-editor-preview-label {
  font-size: 11px;
  color: #6a8a6a;
  text-align: center;
}

.color-editor-preview-block img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: rgba(255,255,255,0.05);
  border: 1px solid #2d4a2d;
  border-radius: 6px;
  padding: 6px;
}

.color-editor-controls {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-editor-section-title {
  font-size: 12px;
  color: #8aaa8a;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.color-editor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-editor-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.color-editor-item:hover {
  background: rgba(61,90,61,0.3);
  border-color: #3d5a3d;
}

/* Строка "уже динамический (currentColor)" — не интерактивная */
.color-editor-item--dynamic {
  cursor: default;
  opacity: 0.75;
  background: rgba(40,60,80,0.3);
  border-color: #2d4a5a !important;
}
.color-editor-item--dynamic:hover {
  background: rgba(40,60,80,0.3);
  border-color: #2d4a5a;
}
/* Swatch с радужным градиентом для currentColor */
.color-editor-swatch--dynamic {
  background: linear-gradient(135deg, #e74c3c, #f39c12, #2ecc71, #3498db, #9b59b6) !important;
  border-color: rgba(255,255,255,0.3) !important;
}

.color-editor-item input[type=checkbox] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #6bcbaa;
}

.color-editor-swatch {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.color-editor-color-val {
  font-size: 13px;
  color: #d0e0d0;
  font-family: monospace;
}

/* Все <code> внутри списка цветов — светлый текст на тёмном фоне */
.color-editor-list code,
.color-editor-controls code {
  color: #c8dfc8;
  font-family: monospace;
}

.color-editor-attr {
  font-size: 11px;
  color: #6a8a6a;
}

.color-editor-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.color-editor-small-btn {
  padding: 4px 10px;
  font-size: 12px;
  background: rgba(40,60,40,0.6);
  color: #a0c0a0;
  border: 1px solid #3d5a3d;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.color-editor-small-btn:hover { background: rgba(61,90,61,0.8); }

.color-editor-preview-color-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8aaa8a;
  margin-left: auto;
}
.color-editor-preview-color-label input[type=color] {
  width: 32px;
  height: 24px;
  border: 1px solid #3d5a3d;
  border-radius: 3px;
  cursor: pointer;
  background: none;
  padding: 0;
}

.color-editor-hint {
  font-size: 12px;
  color: #6a8a6a;
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(20,30,20,0.5);
  border: 1px solid #2d4a2d;
  border-radius: 4px;
}
.color-editor-hint code { color: #6bcbaa; }

.color-editor-notice {
  font-size: 13px;
  color: #8aaa8a;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-editor-notice code { color: #6bcbaa; }

.color-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid #2d4a2d;
  background: rgba(10,15,10,0.4);
}

.color-editor-btn-cancel {
  padding: 8px 18px;
  background: rgba(40,40,40,0.8);
  color: #a0a0a0;
  border: 1px solid #3d3d3d;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}
.color-editor-btn-cancel:hover { background: rgba(60,60,60,0.8); }

.color-editor-btn-save {
  padding: 8px 20px;
  background: linear-gradient(180deg, #2d6a4a, #1e5a3a);
  color: #a0e0c0;
  border: 1px solid #3d8a6a;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}
.color-editor-btn-save:hover { background: linear-gradient(180deg, #3d8a6a, #2d7a5a); }
.color-editor-btn-save:disabled { opacity: 0.5; cursor: default; }

/* icon-delete-btn inside .icon-card-actions — override absolute positioning */
.icon-card-actions .icon-delete-btn {
  position: static;
  opacity: 1;
}

/* ============================================================
   ICONIFY ONLINE SEARCH  — карточки результатов
   ============================================================ */

/* Вкладки в окне управления иконками */
.icons-tab-bar {
  display: flex;
  align-items: center;
  background: rgba(8,14,8,0.6);
  border-bottom: 1px solid #2a3e2a;
  flex-shrink: 0;
}

.icons-tab-btn {
  padding: 10px 22px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8aaa8a;
  cursor: pointer;
  font-size: 13px;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.icons-tab-btn:hover {
  color: #b0d0b0;
  background: rgba(20,40,20,0.3);
}

.icons-tab-active {
  color: #90c090 !important;
  border-bottom-color: #5a9a5a !important;
  background: rgba(20,40,20,0.45) !important;
}

/* Вкладки внутри шапки модала */
.admin-modal-header .icons-tab-btn {
  width: auto !important;
  height: auto !important;
  padding: 0 14px !important;
  align-self: stretch !important;
  border-bottom: none !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #8aaa8a !important;
  transform: none !important;
  transition: background 0.18s, color 0.18s !important;
  white-space: nowrap !important;
}
.admin-modal-header .icons-tab-btn:hover {
  color: #b0d0b0 !important;
  background: rgba(20,40,20,0.3) !important;
}
.admin-modal-header .icons-tab-active {
  background: rgba(20,50,20,0.6) !important;
  color: #90c090 !important;
  outline: 1px solid #3a6a3a !important;
}

/* Переключатель источника + поиск в одной строке */
.ify-combined-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #1e2e1e;
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.ify-sep {
  width: 1px;
  height: 20px;
  background: #2a3e2a;
  flex-shrink: 0;
  margin: 0 4px;
}

.ify-source-label {
  color: #8aaa8a;
  font-size: 12px;
  white-space: nowrap;
}

.ify-src-btn {
  padding: 4px 12px;
  background: rgba(10,20,10,0.5);
  border: 1px solid #2a3e2a;
  border-radius: 4px;
  color: #8aaa8a;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.18s;
}

.ify-src-btn:hover { border-color: #4a7a4a; color: #b0d0b0; background: rgba(20,40,20,0.4); }

.ify-src-active {
  background: rgba(30,70,30,0.7) !important;
  border-color: #5a9a5a !important;
  color: #90c090 !important;
}

/* Кнопка «Найти» и поле в строке вкладок */
#ify-source-switcher .btn-success {
  background: #1c3a1c;
  border: 1px solid #3a6a3a;
  color: #80cc80;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 28px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
#ify-source-switcher .btn-success:hover {
  background: #234e23;
  border-color: #5a8a5a;
  color: #a0e0a0;
}
#ify-source-switcher input[type="text"] {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  background: rgba(10,15,10,0.7);
  border: 1px solid #3d5a3d;
  border-radius: 4px;
  color: #d0e0d0;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
#ify-source-switcher input[type="text"]:focus {
  outline: none;
  border-color: #6b9b6b;
}
#ify-source-switcher input[type="text"]::placeholder {
  color: #7a9a7a;
}
/* ACP-режим: кнопки и инпут в строке вкладок */
.admin-modal.acp-active #ify-source-switcher .btn-success {
  height: 24px !important;
  padding: 0 10px !important;
  font-size: 11px !important;
}
.admin-modal.acp-active #ify-source-switcher input[type="text"] {
  height: 24px !important;
  font-size: 11px !important;
}
.admin-modal.acp-active .ify-src-btn {
  padding: 3px 10px !important;
  font-size: 11px !important;
}

/* ── Freepik фильтры ───────────────────────────────────────────────────── */
.fp-filters-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 8px;
  border-bottom: 1px solid #1e2e1e;
  flex-wrap: wrap;
  background: rgba(5,10,5,0.4);
}

.fp-filters-label {
  color: #6a8a6a;
  font-size: 11px;
  white-space: nowrap;
  margin-right: 2px;
}

.fp-filter-select {
  font-size: 12px;
  padding: 3px 7px;
  background: rgba(10,20,10,0.8);
  border: 1px solid #2a3e2a;
  border-radius: 4px;
  color: #b0d0b0;
  cursor: pointer;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236a8a6a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
}

.fp-filter-select:hover  { border-color: #4a7a4a; }
.fp-filter-select:focus  { outline: none; border-color: #5a9a5a; }
.fp-filter-select option { background: #0e1a0e; color: #b0d0b0; }

/* ── /Freepik фильтры ─────────────────────────────────────────────────── */

.ify-apikey-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(5,12,5,0.7);
  border-bottom: 1px solid #1e2e1e;
}

.iconify-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 8px;
  background: rgba(10,20,10,0.55);
  border: 1px solid #2a3e2a;
  border-radius: 8px;
  cursor: default;
  transition: border-color 0.18s, background 0.18s;
  text-align: center;
  min-height: 130px;
}

.iconify-card:hover {
  border-color: #4a7a4a;
  background: rgba(20,40,20,0.75);
}

.iconify-card-img {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f0e8;
  border-radius: 6px;
  border: 1px solid #b0c8b0;
  padding: 4px;
  box-sizing: border-box;
  overflow: hidden;
}

.iconify-card-img img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.iconify-card-name {
  font-size: 11px;
  color: #c0d8c0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.iconify-card-prefix {
  font-size: 10px;
  color: #5a7a5a;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iconify-card-add {
  margin-top: auto;
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(30,70,30,0.8);
  border: 1px solid #3a6a3a;
  border-radius: 4px;
  color: #90c090;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.iconify-card-add:hover {
  background: rgba(50,110,50,0.9);
  border-color: #5a8a5a;
  color: #c8e8c8;
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ  (≤ 768px)
   Тулбар переезжает вниз, панели становятся bottom-sheet-ами
   ============================================================ */

/* Мобильный backdrop — затемнение при открытых панелях */
#mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 4900;
  -webkit-tap-highlight-color: transparent;
}
#mobile-backdrop.active { display: block; }

@media (max-width: 768px) {

  /* Статусбар скрыт на мобильных */
  #status-bar { display: none !important; }

  /* ── 1. КАРТА: полный экран, снизу отступ = тулбар ── */
  #map {
    left:   0       !important;
    right:  0       !important;
    top:    0       !important;
    bottom: 56px    !important;
    width:  auto    !important;
    height: auto    !important;
  }
  body.sidebar-open #map { left: 0 !important; }

  /* ── 2. ТУЛБАР: горизонтальная панель снизу ── */
  #toolbar-panel {
    flex-direction:  row          !important;
    left:            0            !important;
    right:           0            !important;
    top:             auto         !important;
    bottom:          0            !important;
    width:           100%         !important;
    height:          56px         !important;
    padding:         0 4px        !important;
    gap:             0            !important;
    border-right:    none         !important;
    border-top:      2px solid #3d5a3d !important;
    justify-content: space-around !important;
    align-items:     center       !important;
    box-shadow:      0 -2px 12px rgba(0,0,0,0.5) !important;
    overflow:        visible      !important;
  }

  /* Разделители в тулбаре: горизонтальные → вертикальные */
  .toolbar-separator {
    width:      1px  !important;
    height:     28px !important;
    margin:     0 2px !important;
    background: #3d5a3d !important;
    flex-shrink: 0 !important;
  }

  /* Распорка «margin-top:auto» — скрыть на мобильном */
  #toolbar-panel > div[style*="margin-top:auto"] {
    display: none !important;
  }

  /* Кнопки тулбара: увеличенные для пальцев */
  #toolbar-panel .toolbar-icon-btn,
  #toolbar-panel > button {
    width:  44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }

  /* ── 3. ВЫПАДАЮЩЕЕ МЕНЮ СЛОЁВ: bottom-sheet ── */
  #layer-dropdown {
    left:          0             !important;
    right:         0             !important;
    top:           auto          !important;
    bottom:        56px          !important;
    width:         100%          !important;
    min-width:     unset         !important;
    max-height:    55vh          !important;
    overflow-y:    auto          !important;
    border-radius: 14px 14px 0 0 !important;
    border-left:   none          !important;
    border-right:  none          !important;
    border-bottom: none          !important;
    z-index:       9999          !important;
    padding:       8px 0         !important;
  }
  #layer-dropdown .layer-option-btn {
    padding:    14px 18px !important;
    font-size:  14px      !important;
  }

  /* ── 4. МЕНЮ ПРОФИЛЯ: bottom-sheet ── */
  #user-dropdown {
    left:          0             !important;
    right:         0             !important;
    top:           auto          !important;
    bottom:        56px          !important;
    min-width:     unset         !important;
    border-radius: 14px 14px 0 0 !important;
    border-left:   none          !important;
    border-right:  none          !important;
    border-bottom: none          !important;
    max-height:    75vh          !important;
    overflow-y:    auto          !important;
    z-index:       9999          !important;
  }
  #user-dropdown a,
  #user-dropdown div[style*="padding:10px 16px"] {
    padding: 14px 20px !important;
    font-size: 14px !important;
  }

  /* ── 5. ПОДМЕНЮ ГЕОМЕТРИЧЕСКИХ ИНСТРУМЕНТОВ: вверх ── */
  #geometry-submenu {
    left:           auto           !important;
    top:            auto           !important;
    bottom:         54px           !important;
    right:          calc(50% - 90px) !important;
    flex-direction: row            !important;
    gap:            4px            !important;
    padding:        6px            !important;
    z-index:        10001          !important;
  }
  #geometry-submenu .geometry-menu-item {
    width:  48px !important;
    height: 48px !important;
  }

  /* ── 6. ПАНЕЛЬ ФИЛЬТРА: bottom-sheet ── */
  #filter-panel {
    left:          0              !important;
    right:         0              !important;
    top:           auto           !important;
    bottom:        56px           !important;
    width:         100%           !important;
    max-height:    72vh           !important;
    border-radius: 14px 14px 0 0  !important;
    border-left:   none           !important;
    border-right:  none           !important;
    border-bottom: none           !important;
    z-index:       5500           !important;
  }

  /* ── 7. ОКНО СВОЙСТВ ОБЪЕКТА: bottom-sheet ── */
  .panel.property-popup {
    left:          0              !important;
    right:         0              !important;
    bottom:        56px           !important;
    top:           auto           !important;
    width:         100%           !important;
    max-width:     100%           !important;
    transform:     none           !important;
    border-radius: 14px 14px 0 0  !important;
    max-height:    78vh           !important;
    padding:       16px 16px 20px !important;
    box-sizing:    border-box     !important;
  }

  /* ── 8. ЛЕВЫЙ САЙДБАР: bottom-sheet (управляется классом is-open) ── */
  #left-sidebar {
    left:          0              !important;
    right:         0              !important;
    width:         100%           !important;
    top:           auto           !important;
    bottom:        56px           !important;
    max-height:    78vh           !important;
    border-radius: 16px 16px 0 0  !important;
    border-right:  none           !important;
    border-top:    2px solid #3d5a3d !important;
    transform:     translateY(calc(100% + 4px)) !important;
    transition:    transform 0.35s cubic-bezier(0.4,0,0.2,1) !important;
    z-index:       5000           !important;
  }
  #left-sidebar.is-open {
    transform: translateY(0) !important;
  }
  /* «Ручка» для drag-to-close */
  #left-sidebar::before {
    content:       '';
    display:       block;
    width:         40px;
    height:        4px;
    background:    #3d5a3d;
    border-radius: 2px;
    margin:        10px auto 2px;
    flex-shrink:   0;
  }

  /* ── 9. КООРДИНАТЫ КУРСОРА: переносим в правый верхний угол карты ── */
  #mouse-position {
    position:   fixed                                         !important;
    top:        calc(8px + env(safe-area-inset-top, 0px))     !important;
    right:      8px                                           !important;
    bottom:     auto                                          !important;
    left:       auto                                          !important;
    font-size:  10px                                          !important;
    padding:    4px 8px                                       !important;
    line-height: 1.4                                          !important;
    max-width:  calc(55vw)                                    !important;
    word-break: break-all                                     !important;
    display:    block                                         !important;
    visibility: visible                                       !important;
    opacity:    1                                             !important;
    z-index:    6000                                          !important;
  }

  /* ── 10. СЧЁТЧИК ОБЪЕКТОВ: над тулбаром, левее центра ── */
  #objects-counter {
    left:   8px   !important;
    right:  auto  !important;
    bottom: 66px  !important;
    top:    auto  !important;
    transform: none !important;
  }

  /* ── 11. КОНТЕКСТНОЕ МЕНЮ: компактные тач-таргеты ── */
  .context-menu-item {
    padding:    7px 12px !important;
    font-size:  12px     !important;
    min-height: 34px     !important;
    display:    flex     !important;
    align-items: center  !important;
    gap:         7px     !important;
  }
  #feature-context-menu {
    min-width: 140px !important;
    max-width: 190px !important;
    padding: 4px     !important;
  }

  /* ── 12. ФОРМА ВХОДА: адаптивная ширина ── */
  #login-overlay > div {
    width:     calc(100% - 24px) !important;
    max-width: 420px             !important;
    padding:   24px 18px         !important;
    box-sizing: border-box       !important;
  }
  #login-username,
  #login-password {
    font-size: 16px !important; /* предотвращаем zoom iOS при фокусе */
  }

  /* ── 13. ПАНЕЛЬ ПОИСКА: полная ширина вверху ── */
  #search-panel {
    left:      8px      !important;
    right:     8px      !important;
    top:       8px      !important;
    width:     auto     !important;
    transform: none     !important;
    max-height: 80vh    !important;
  }

  /* ── 14. АДМИНИСТРАТИВНЫЕ МОДАЛЬНЫЕ ОКНА ── */
  .admin-modal {
    align-items:  flex-end  !important;
    padding:      0         !important;
  }
  .admin-modal-content {
    width:         100vw                       !important;
    max-width:     100vw                       !important;
    max-height:    92vh                        !important;
    margin:        0                           !important;
    border-radius: 16px 16px 0 0              !important;
    border-left:   none                        !important;
    border-right:  none                        !important;
    border-bottom: none                        !important;
    box-sizing:    border-box                  !important;
  }
  .admin-modal-body {
    max-height: calc(92vh - 120px) !important;
  }

  /* ── 15. УВЕДОМЛЕНИЯ (notification-box) ── */
  .notification-overlay {
    align-items: flex-end !important;
    padding:     0        !important;
  }
  .notification-box {
    width:         100%   !important;
    max-width:     100%   !important;
    padding:       20px   !important;
    border-radius: 16px 16px 0 0 !important;
    margin:        0      !important;
    box-sizing:    border-box !important;
  }

  /* ── 16. DRONE TOOLTIP: шире на мобильном ── */
  #drone-tooltip {
    max-width: 85vw !important;
    font-size: 12px !important;
  }

  /* ── 17. КНОПКИ В ФОРМАХ И МОДАЛАХ: крупнее ── */
  .admin-modal-toolbar .toolbar-btn,
  .admin-modal-toolbar button,
  .usg-header-controls button {
    padding:   10px 14px !important;
    font-size: 13px      !important;
    min-height: 44px     !important;
  }

  /* ── 17а. КНОПКА «РЕЖИМ ОБСЛУЖИВАНИЯ» — компактная на мобильном ── */
  /* Скрываем текст, оставляем только иконку + бейдж «ВКЛ» */
  #maint-btn-label {
    display: none !important;
  }
  #maintenance-mode-btn {
    padding:    10px 12px !important;
    flex-shrink: 0        !important;
    min-width:  unset     !important;
  }
  /* Поле поиска растягивается на оставшееся место в тулбаре */
  .admin-modal-toolbar input[type="text"],
  .usg-header-controls input[type="text"] {
    width:    auto     !important;
    flex:     1 1 auto !important;
    min-width: 80px   !important;
  }

  /* ── 18. SELECT и INPUT во всплывающих формах ── */
  select, input[type="text"], input[type="number"],
  input[type="password"], input[type="date"],
  input[type="datetime-local"], textarea {
    font-size: 16px !important; /* предотвращаем zoom iOS */
  }

  /* ── 19. ПАНЕЛЬ СВОЙСТВ ОБЪЕКТА — скролл-область ── */
  .panel.property-popup .props-scroll-area {
    max-height: calc(78vh - 120px) !important;
  }

  /* ── 20. Скрыть кнопку user-profile — дублируется в user-dropdown ── */
  #user-profile-btn {
    display: flex !important; /* оставляем видимым в нижнем тулбаре */
  }
}

/* Тонкий бейдж онлайн-пользователей — мобильный размер */
@media (max-width: 768px) {
  #online-users-badge {
    bottom: 64px !important;
    right:  8px  !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE: Dynamic viewport height + safe area insets
   Решает проблему перекрытия адресной строкой / home indicator
   Требует viewport-fit=cover в meta-тег (уже добавлен)
   ═══════════════════════════════════════════════════════════════ */

/* iOS fullscreen hint overlay */
#ios-fs-hint-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  animation: iosFsHintIn 0.25s ease;
}
@keyframes iosFsHintIn {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ios-fs-hint-box {
  background: #1a2a1a;
  border: 1px solid #3a5a3a;
  border-radius: 16px 16px 12px 12px;
  padding: 22px 24px 20px;
  width: 100%;
  max-width: 420px;
  color: #c8d8c8;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.6);
}
.ios-fs-hint-title {
  font-size: 17px;
  font-weight: 700;
  color: #8fbc5a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ios-fs-hint-text {
  font-size: 14px;
  margin: 0 0 12px;
  line-height: 1.5;
  color: #aabcaa;
}
.ios-fs-hint-steps {
  font-size: 14px;
  line-height: 1.7;
  padding-left: 20px;
  margin: 0 0 18px;
  color: #c8d8c8;
}
.ios-fs-hint-steps li { margin-bottom: 4px; }
.ios-share-icon {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 13px;
  display: inline-block;
  margin: 0 2px;
  color: #5b9bd5;
}
.ios-fs-hint-close {
  display: block;
  width: 100%;
  padding: 11px;
  background: #2d4a2d;
  border: 1px solid #4a7a4a;
  border-radius: 10px;
  color: #8fbc5a;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.ios-fs-hint-close:active { background: #3a5a3a; }

/* ═══════════════════════════════════════════════════════════════
   iOS PWA STANDALONE MODE — точная настройка кнопок под Android
   Применяется когда приложение запущено с главного экрана (добавить в Safari)
   ═══════════════════════════════════════════════════════════════ */
@media (display-mode: standalone) and (max-width: 768px) {
  /* Кнопки: точный размер 44×44 без браузерных добавок */
  #toolbar-panel .toolbar-icon-btn,
  #toolbar-panel > button {
    width:  44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 56px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    flex: 0 0 44px !important;
  }
  /* В portrait-split: навигационная группа */
  #toolbar-nav-group .toolbar-icon-btn,
  #toolbar-nav-group button {
    flex: 1 1 auto !important;
    max-width: 56px !important;
    height: 44px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }
  /* Счётчик объектов: над тулбаром (один ряд) */
  #objects-counter,
  #online-users-badge {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
@media (display-mode: standalone) and (max-width: 768px) and (orientation: portrait) {
  /* Счётчик: над нижним тулбаром (portrait-split: 56px + зазор 12px) */
  #objects-counter,
  #online-users-badge {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* dvh: viewport высота без учёта браузерного хрома (Chrome 108+, iOS 16+) */
@media (max-width: 768px) {
  html, body {
    height: 100vh;    /* fallback */
    height: 100dvh;   /* динамический — подстраивается под адресную строку */
    min-height: -webkit-fill-available; /* Safari < 16 */
  }
}

/* Safe-area padding (работает только при viewport-fit=cover) */
@media (max-width: 768px) {

  /* Нижний тулбар: растягивается до home indicator / нижней панели браузера */
  #toolbar-panel {
    height:         calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px)              !important;
    box-sizing:     border-box                                    !important;
  }

  /* Карта: нижний край = тулбар + safe area; верхний = status bar / notch */
  #map {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    top:    env(safe-area-inset-top, 0px)                 !important;
  }

  /* Bottom-sheets: поднимаем выше home indicator */
  #layer-dropdown,
  #user-dropdown,
  #filter-panel,
  .panel.property-popup,
  #left-sidebar {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Подменю геометрии */
  #geometry-submenu {
    bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Счётчик объектов и бейдж онлайна */
  #objects-counter,
  #online-users-badge {
    bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Панель поиска: не закрывается статус-баром / чёлкой */
  #search-panel {
    top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PORTRAIT SPLIT TOOLBAR
   Портрет: верхняя строка (навигация) + нижняя строка (действия)
   Тулбар остаётся одним элементом — flex-wrap делает 2 ряда
   ═══════════════════════════════════════════════════════════════ */

/* Desktop / landscape: обычный блок в потоке тулбара (display:contents ломал position:fixed) */
#toolbar-nav-group { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 5px; }

@media (max-width: 768px) and (orientation: portrait) {

  /* Тулбар: 2 строки — верхняя (навигация) + нижняя (действия) */
  #toolbar-panel {
    flex-wrap:      wrap                                                        !important;
    height:         calc(48px + 56px + env(safe-area-inset-bottom, 0px))       !important;
    align-content:  flex-start                                                  !important;
    overflow:       visible                                                     !important;
  }

  /* Навигационная группа: первая строка, полная ширина, 48px */
  #toolbar-nav-group {
    display:         flex                   !important;
    width:           100%                   !important;
    height:          48px                   !important;
    flex-shrink:     0                      !important;
    order:           -1                     !important;
    justify-content: space-around           !important;
    align-items:     center                 !important;
    padding:         0 4px                  !important;
    border-bottom:   1px solid #3d5a3d      !important;
    background:      #1a1f1a               !important;
  }

  /* Разделитель внутри верхней строки — вертикальный */
  #toolbar-nav-group .toolbar-separator {
    width:       1px     !important;
    height:      28px    !important;
    margin:      0 2px   !important;
    flex-shrink: 0       !important;
    background:  #3d5a3d !important;
  }

  /* Кнопки в верхней строке — крупнее */
  #toolbar-nav-group .toolbar-icon-btn,
  #toolbar-nav-group button {
    flex:        1 1 auto !important;
    max-width:   56px     !important;
    height:      44px     !important;
  }

  /* Разделитель между группами в нижней строке — убрать */
  .toolbar-group-sep { display: none !important; }

  /* Нижняя строка: action-кнопки растянуты по ширине */
  #toolbar-panel > div[style*="position:relative"],
  #toolbar-panel > button {
    flex: 1 1 auto !important;
  }

  /* Карта: снизу отступ = оба ряда тулбара */
  #map {
    bottom: calc(104px + env(safe-area-inset-bottom, 0px)) !important;
    top:    env(safe-area-inset-top, 0px)                  !important;
  }

  /* Bottom-sheets выше двойного тулбара */
  #layer-dropdown,
  #user-dropdown,
  #filter-panel,
  .panel.property-popup,
  #left-sidebar {
    bottom: calc(104px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Подменю геометрии */
  #geometry-submenu {
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Счётчик и бейдж онлайна */
  #objects-counter,
  #online-users-badge {
    bottom: calc(114px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Поиск и координаты — сверху как обычно */
  #search-panel {
    top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  }
  #mouse-position {
    top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  }
}

/* ══════════════════════════════════════════
   MAP TOOLTIP — всплывающая подсказка объекта
   ══════════════════════════════════════════ */
#map-tooltip {
  position: fixed;
  /* Начальная позиция (0,0) — реальное место задаётся через transform:translate() в JS,
     что обходит layout reflow и обрабатывается GPU compositor */
  left: 0;
  top: 0;
  will-change: transform;   /* Заранее продвигаем слой на GPU — нет создания layer на первом движении */
  z-index: 9500;
  background: rgba(12, 18, 12, 0.96);
  border: 1px solid #3d5a3d;
  border-radius: 6px;
  padding: 9px 13px 10px;
  pointer-events: none;
  max-width: 280px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.65);
  font-size: 12px;
  line-height: 1.4;
  color: #c0d0c0;
  transition: opacity 0.1s;
}
#map-tooltip .tooltip-name {
  color: #d8ead8;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
#map-tooltip .tooltip-type {
  color: #6b9b6b;
  font-size: 11px;
  margin-bottom: 3px;
}
#map-tooltip .tooltip-desc {
  color: #b0c8b0;
  font-size: 11px;
  font-style: italic;
  margin-bottom: 5px;
  white-space: pre-wrap;
  max-width: 240px;
}
#map-tooltip .tooltip-params {
  /* параметры появляются асинхронно */
}
#map-tooltip .tooltip-param-label {
  color: #8aaa8a;
  font-size: 11px;
  font-weight: 600;
}
#map-tooltip .tooltip-param-value {
  color: #d0e0d0;
}
/* ── Ограничения роли «наблюдатель» ── */
/* Скрываем через CSS — не перебивается JS-сбросом style.cssText = '' */
body.viewer-role #geometry-group-btn,
body.viewer-role #geometry-submenu {
  display: none !important;
}

/* ── Координатная сетка: адаптив для мобильных ── */
@media (max-width: 768px) {
  /* Метки осей: мельче шрифт и отступы чтобы не перекрывать контент */
  .axis-mark {
    font-size: 10px !important;
    padding: 1px 3px !important;
  }
  /* Вертикальная ось чуть уже — экономим пространство на узком экране */
  #vertical-axis {
    width: 20px !important;
  }
  /* Горизонтальная ось: отступ сверху для safe-area (notch / строка статуса) */
  #horizontal-axis {
    top: env(safe-area-inset-top, 0px) !important;
  }
}

/* ── Аналитика: мобильная адаптация ── */

/* Базовый стиль грида детализации по часу (работает на всех экранах) */
.analytics-hour-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Мобильная сетка vbar (колонки задаются динамически через JS) */
.vbar-mobile-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr); /* fallback; JS переопределяет через inline style */
  gap: 4px;
  padding: 0 4px 4px;
}
.vbar-mobile-grid > div {
  transition: opacity 0.15s;
  border-radius: 3px;
  overflow: hidden;
}
.vbar-mobile-grid > div:active {
  opacity: 0.7;
}

@media (max-width: 768px) {
  /* Модал — максимум высоты на мобильном */
  #analytics-modal .admin-modal-content {
    padding: 0 !important;
    max-height: 95vh !important;
    height: 95vh !important;
    width: 99% !important;
    border-radius: 8px !important;
  }
  /* В portrait standalone/PWA: полный экран, safe-area сверху */
  @supports (padding-top: env(safe-area-inset-top)) {
    html.portrait-split #analytics-modal .admin-modal-content {
      max-height: 100dvh !important;
      height: 100dvh !important;
      border-radius: 0 !important;
    }
    html.portrait-split #analytics-modal .admin-modal-header {
      padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    }
  }

  /* Убираем лишние отступы области графиков */
  #analytics-charts-area {
    padding: 10px 8px 12px !important;
  }

  /* Строки-гриды → одна колонка */
  #analytics-row-1,
  #analytics-row-2 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Сводная карточка «Всего объектов» — горизонтальная на мобильном */
  #analytics-row-1 > div:first-child > div:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 10px 14px !important;
    text-align: left !important;
  }
  #an-total-features {
    font-size: 28px !important;
    line-height: 1 !important;
  }
  #analytics-row-1 > div:first-child > div:first-child > div:last-child {
    font-size: 12px !important;
    margin-top: 0 !important;
  }

  /* Фильтры: кнопки растягиваются на доступную ширину */
  #analytics-filter-bar {
    gap: 6px !important;
    padding: 7px 8px !important;
  }
  #af-types-wrap,
  #af-users-wrap {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  #af-types-btn,
  #af-users-btn {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Дропдауны фильтров: прижаты к правому краю, не выходят за экран */
  #af-types-dropdown,
  #af-users-dropdown {
    left: auto !important;
    right: 0 !important;
    width: max(240px, 80vw) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 45vh !important;
  }

  /* Строка выбора периода: кнопки компактнее */
  .analytics-period-btn {
    padding: 5px 8px !important;
    font-size: 11px !important;
  }

  /* Карточка с пользователями «drill-back» */
  #analytics-drill-back {
    padding: 7px 8px !important;
    gap: 6px !important;
  }

  /* Детализация по часу: два пайчарта в ряд */
  .analytics-hour-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Фиксированная высота карточек — предотвращает скачки при смене режима вида */
  #card-by-day,
  #card-top-users {
    height: 310px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  /* card-by-hour НЕ фиксируем — в vbar-режиме 24 столбца не влезают в 310px */
  #card-by-hour {
    height: auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  /* Контейнеры графиков: фиксированная высота, прокрутка при переполнении */
  #chart-by-type,
  #chart-by-day,
  #chart-top-users {
    height: 248px !important;
    min-height: unset !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  /* chart-by-hour растёт под контент всегда */
  #chart-by-hour {
    height: auto !important;
    overflow: visible !important;
  }

  /* type-detail-chart создаётся динамически — без ограничений */
  #type-detail-chart,
  #type-detail-hour-chart,
  #user-detail-chart,
  #user-detail-hour-chart {
    height: auto !important;
    overflow: visible !important;
  }

  /* Экшн-график */
  #card-actions { margin-bottom: 4px !important; }
  #chart-actions {
    height: 200px !important;
    overflow: hidden !important;
  }

  /* Паддинг карточек — компактнее */
  #card-by-day,
  #card-by-hour,
  #card-top-users,
  #card-actions {
    padding: 10px 8px !important;
  }

  /* Паддинг панелей детализации */
  #type-detail-panel,
  #hour-detail-panel,
  #user-detail-panel {
    padding: 10px 8px !important;
    margin-bottom: 10px !important;
  }
}

/* На очень узких экранах (≤480px) — пайчарты и некоторые элементы в одну колонку */
@media (max-width: 480px) {
  .analytics-hour-grid {
    grid-template-columns: 1fr !important;
  }

  /* Прячем метку «Фильтр:» — экономим место */
  #analytics-filter-bar > span:first-child {
    display: none !important;
  }

  /* Кнопки периода — самые компактные */
  .analytics-period-btn {
    padding: 4px 6px !important;
    font-size: 10px !important;
  }

  /* Дропдауны фильтров — почти на всю ширину */
  #af-types-dropdown,
  #af-users-dropdown {
    width: calc(100vw - 20px) !important;
  }
}

/* ── Скроллбар модала «Что нового» ── */
#whats-new-list {
  scrollbar-width: thin;
  scrollbar-color: #4a6a4a rgba(26, 31, 26, 0.5);
}
#whats-new-list::-webkit-scrollbar {
  width: 6px;
}
#whats-new-list::-webkit-scrollbar-track {
  background: rgba(26, 31, 26, 0.5);
  border-radius: 4px;
}
#whats-new-list::-webkit-scrollbar-thumb {
  background: #4a6a4a;
  border-radius: 4px;
}
#whats-new-list::-webkit-scrollbar-thumb:hover {
  background: #6b9b6b;
}

/* ================================================================
   UNIFIED ADMIN CONTROL PANEL  (js/admin-panel.js)
   ================================================================ */

:root {
  --acp-w:    calc(100vw - 50px);  /* полная ширина правее левого тулбара */
  --acp-tabs:  64px;               /* ширина колонки вкладок              */
}

/* ── Панель-контейнер ─────────────────────────────────────────── */
#admin-cp {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 24px;
  width: var(--acp-w);
  z-index: 9500;
  display: flex;
  transform: translateX(var(--acp-w));
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  /* Визуальная рамка слева (tab-bar граница) отрисовывается через #acp-tabs */
}
#admin-cp.acp-open {
  transform: translateX(0);
  pointer-events: all;
}

/* ── Полупрозрачная подложка ──────────────────────────────────── */
#acp-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 9499;
}

/* ── Колонка вкладок ──────────────────────────────────────────── */
#acp-tabs {
  width: var(--acp-tabs);
  background: #0a0f0a;
  border-left: 2px solid #3d5a3d;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 9502;
  flex-shrink: 0;
}
#acp-tabs::-webkit-scrollbar { display: none; }

/* ── Кнопка вкладки ───────────────────────────────────────────── */
.acp-tab {
  width: var(--acp-tabs);
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: #5a7a5a;
  background: none;
  border: none;
  border-right: 3px solid transparent;
  padding: 4px 2px;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: color 0.18s, background 0.18s;
}
.acp-tab:hover {
  color: #8aba8a;
  background: rgba(107, 155, 107, 0.12);
}
.acp-tab.active {
  color: #b0d8b0;
  background: rgba(107, 155, 107, 0.22);
  border-right-color: #6b9b6b;
}
.acp-tab i  { font-size: 15px; }
.acp-tab span {
  font-size: 9px;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

/* Разделитель между обычными и super-admin вкладками */
.acp-sep {
  height: 1px;
  background: #2d4a2d;
  margin: 4px 10px;
  flex-shrink: 0;
}

/* Кнопка «Закрыть» */
.acp-close {
  margin-top: auto;
  color: #5a4a4a;
  border-top: 1px solid #2a2a2a;
  min-height: 52px;
}
.acp-close:hover {
  color: #e07070;
  background: rgba(180, 60, 60, 0.15) !important;
}

/* ================================================================
   UNIFIED PANEL STYLE — единый стиль для всех модалов внутри #admin-cp
   Применяется только в контексте .acp-active, не затрагивает
   внешний вид модалов при открытии в обычном режиме.
   ВАЖНО: модалы расположены в <body>, а не внутри #admin-cp,
   поэтому селекторы начинаются с класса .acp-active напрямую.
   ================================================================ */

/* ── Единый фон контейнера ──────────────────────────────────────── */
.admin-modal.acp-active .admin-modal-content,
#map-layers-modal.acp-active > div,
#user-groups-modal.acp-active > div {
  background: #0f1a0f !important;
}

/* ── Заголовок: единый стиль ────────────────────────────────────── */
.admin-modal.acp-active .admin-modal-header {
  padding:         14px 20px !important;
  background:      #182418  !important;
  border-bottom:   1px solid #3d5a3d !important;
  border-radius:   0 !important;
  min-height:      52px !important;
  box-sizing:      border-box !important;
}
.admin-modal.acp-active .admin-modal-header h2 {
  font-size:      14px  !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase !important;
  color:          #a8c0a8 !important;
  font-weight:    700 !important;
}
.admin-modal.acp-active .admin-modal-header h2 i {
  color:     #6b9b6b !important;
  font-size: 15px   !important;
}
/* Скрыть кнопку × — её роль берёт кнопка «Закрыть» в вертикальной вкладке */
.admin-modal.acp-active .admin-modal-header > button:not(.icons-tab-btn) {
  display: none !important;
}

/* map-layers / user-groups: нормализуем inline-стилизованные заголовки */
#map-layers-modal.acp-active  > div > div:first-child,
#user-groups-modal.acp-active > div > div:first-child {
  padding:       14px 20px  !important;
  background:    #182418    !important;
  border-bottom: 1px solid #3d5a3d !important;
  flex-shrink:   0 !important;
  min-height:    52px !important;
  box-sizing:    border-box !important;
  align-items:   center !important;
}
#map-layers-modal.acp-active  > div > div:first-child h3,
#user-groups-modal.acp-active > div > div:first-child h3 {
  font-size:      14px  !important;
  font-weight:    700   !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  color:          #a8c0a8 !important;
  margin:         0 !important;
}
#map-layers-modal.acp-active  > div > div:first-child i,
#user-groups-modal.acp-active > div > div:first-child i {
  color:     #6b9b6b !important;
  font-size: 15px   !important;
}

/* ── Тулбар: единые отступы и фон ──────────────────────────────── */
.admin-modal.acp-active .admin-modal-toolbar {
  padding:       10px 20px !important;
  background:    #0d160d  !important;
  border-bottom: 1px solid #2d4a2d !important;
  gap:           8px !important;
  flex-wrap:     wrap !important;
  align-items:   center !important;
  min-height:    48px !important;
}

/* ── БАЗОВЫЙ токен для всех кнопок в тулбарах внутри панели ── */
.admin-modal.acp-active .admin-modal-toolbar button,
.admin-modal.acp-active .admin-modal-toolbar .btn-success,
.admin-modal.acp-active .admin-modal-toolbar .btn-secondary,
.admin-modal.acp-active .admin-modal-toolbar .toolbar-btn,
.admin-modal.acp-active .admin-modal-toolbar .btn-add-folder {
  height:         30px        !important;
  padding:        0 14px      !important;
  font-size:      12px        !important;
  font-weight:    600         !important;
  line-height:    1           !important;
  border-radius:  4px         !important;
  cursor:         pointer     !important;
  display:        inline-flex !important;
  align-items:    center      !important;
  gap:            6px         !important;
  text-transform: none        !important;
  letter-spacing: 0           !important;
  box-shadow:     none        !important;
  transform:      none        !important;
  white-space:    nowrap      !important;
  transition:     background 0.15s, border-color 0.15s, color 0.15s !important;
}

/* ── ЗЕЛЁНЫЕ кнопки-действия: add / create / upload ── */
.admin-modal.acp-active .admin-modal-toolbar .btn-success,
.admin-modal.acp-active .admin-modal-toolbar .toolbar-btn.create {
  background:   #1c3a1c         !important;
  border:       1px solid #3a6a3a !important;
  color:        #80cc80           !important;
}
.admin-modal.acp-active .admin-modal-toolbar .btn-success:hover,
.admin-modal.acp-active .admin-modal-toolbar .toolbar-btn.create:hover {
  background:   #234e23           !important;
  border-color: #5a8a5a           !important;
  color:        #a0e0a0           !important;
}

/* ── НЕЙТРАЛЬНЫЕ кнопки: secondary / back ── */
.admin-modal.acp-active .admin-modal-toolbar .btn-secondary,
.admin-modal.acp-active .admin-modal-toolbar .toolbar-btn:not(.create),
.admin-modal.acp-active .admin-modal-toolbar .btn-add-folder {
  background:   #151f15           !important;
  border:       1px solid #2a422a !important;
  color:        #6a8a6a           !important;
}
.admin-modal.acp-active .admin-modal-toolbar .btn-secondary:hover,
.admin-modal.acp-active .admin-modal-toolbar .toolbar-btn:not(.create):hover,
.admin-modal.acp-active .admin-modal-toolbar .btn-add-folder:hover {
  background:   #1e2e1e           !important;
  border-color: #3d5a3d           !important;
  color:        #8aaa8a           !important;
}

/* ── Поля поиска в тулбаре ── */
.admin-modal.acp-active .admin-modal-toolbar input[type="text"] {
  padding:    7px 12px !important;
  font-size:  13px     !important;
  height:     30px     !important;
  box-sizing: border-box !important;
}

/* ── Кнопки add/create в теле (body) модалов с inline-стилями ── */
/* Покрывает sub-модали: edit-category, edit-parameter, create/edit-type, tbar-group/button */
.admin-modal.acp-active .admin-modal-body button[type="submit"],
.admin-modal.acp-active .admin-modal-body .cat-form-footer button[type="submit"],
.admin-modal.acp-active .admin-modal-body .tbar-form-footer button[type="submit"],
.admin-modal.acp-active .usg-add-row .btn-success {
  background:    #1c3a1c !important;
  border:        1px solid #3a6a3a !important;
  color:         #80cc80 !important;
  padding:       8px 18px !important;
  font-size:     13px !important;
  font-weight:   600 !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  display:       inline-flex !important;
  align-items:   center !important;
  gap:           6px !important;
  transition:    all 0.15s !important;
}
.admin-modal.acp-active .admin-modal-body button[type="submit"]:hover,
.admin-modal.acp-active .admin-modal-body .cat-form-footer button[type="submit"]:hover,
.admin-modal.acp-active .admin-modal-body .tbar-form-footer button[type="submit"]:hover,
.admin-modal.acp-active .usg-add-row .btn-success:hover {
  background:   #234e23 !important;
  border-color: #5a8a5a !important;
  color:        #a0e0a0 !important;
}

/* ── Кнопки в правой панели usg-right (форма пользователя / группы) ── */
.admin-modal.acp-active .usg-right .btn-success {
  background:    #1c3a1c !important;
  border:        1px solid #3a6a3a !important;
  color:         #80cc80 !important;
  padding:       8px 18px !important;
  font-size:     13px !important;
  font-weight:   600 !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  display:       flex !important;
  justify-content: center !important;
  align-items:   center !important;
  gap:           6px !important;
  transition:    all 0.15s !important;
}
.admin-modal.acp-active .usg-right .btn-success:hover {
  background:   #234e23 !important;
  border-color: #5a8a5a !important;
  color:        #a0e0a0 !important;
}

/* btn-secondary в right-панели */
.admin-modal.acp-active .usg-right .btn-secondary {
  background:    #151f15 !important;
  border:        1px solid #2a422a !important;
  color:         #6a8a6a !important;
  padding:       8px 18px !important;
  font-size:     13px !important;
  font-weight:   600 !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  display:       inline-flex !important;
  align-items:   center !important;
  gap:           6px !important;
  transition:    all 0.15s !important;
}
.admin-modal.acp-active .usg-right .btn-secondary:hover {
  background:   #1e2e1e !important;
  border-color: #3d5a3d !important;
  color:        #8aaa8a !important;
}

/* Кнопки Cancel/Отмена в body (рядом с submit) */
.admin-modal.acp-active .admin-modal-body .cat-form-footer  button[type="button"],
.admin-modal.acp-active .admin-modal-body .tbar-form-footer button[type="button"],
.admin-modal.acp-active .admin-modal-body #edit-category-cancel,
.admin-modal.acp-active .admin-modal-body #edit-parameter-cancel,
.admin-modal.acp-active .admin-modal-body #edit-group-cancel-btn,
.admin-modal.acp-active .admin-modal-body #edit-button-cancel-btn,
.admin-modal.acp-active .admin-modal-body #create-type-cancel-btn,
.admin-modal.acp-active .admin-modal-body #edit-type-cancel-btn {
  background:    #151f15 !important;
  border:        1px solid #2a422a !important;
  color:         #6a8a6a !important;
  padding:       8px 18px !important;
  font-size:     13px !important;
  font-weight:   600 !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  transition:    all 0.15s !important;
}
.admin-modal.acp-active .admin-modal-body .cat-form-footer  button[type="button"]:hover,
.admin-modal.acp-active .admin-modal-body .tbar-form-footer button[type="button"]:hover,
.admin-modal.acp-active .admin-modal-body #edit-category-cancel:hover,
.admin-modal.acp-active .admin-modal-body #edit-parameter-cancel:hover,
.admin-modal.acp-active .admin-modal-body #edit-group-cancel-btn:hover,
.admin-modal.acp-active .admin-modal-body #edit-button-cancel-btn:hover,
.admin-modal.acp-active .admin-modal-body #create-type-cancel-btn:hover,
.admin-modal.acp-active .admin-modal-body #edit-type-cancel-btn:hover {
  background:   #1e2e1e !important;
  border-color: #3d5a3d !important;
  color:        #8aaa8a !important;
}

/* ── Кнопки внутри user-groups (inline-styled) ── */
#user-groups-modal.acp-active .ug-btn-primary {
  background:    #1c3a1c !important;
  border:        1px solid #3a6a3a !important;
  color:         #80cc80 !important;
  padding:       6px 14px !important;
  font-size:     12px !important;
  font-weight:   600 !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  transition:    all 0.15s !important;
}
#user-groups-modal.acp-active .ug-btn-primary:hover {
  background:   #234e23 !important;
  border-color: #5a8a5a !important;
  color:        #a0e0a0 !important;
}

/* ── Кнопки действий в строках таблиц и списков ─────────────────── */

/* Базовый токен: row-btn-* и .btn-* (текст + иконка) */
.admin-modal.acp-active .row-btn-edit,
.admin-modal.acp-active .row-btn-delete,
.admin-modal.acp-active .row-btn-restore,
.admin-modal.acp-active .row-btn-purge,
.admin-modal.acp-active .row-btn-info,
.admin-modal.acp-active .row-btn-params,
.admin-modal.acp-active .btn-edit,
.admin-modal.acp-active .btn-delete,
.admin-modal.acp-active .btn-restore,
.admin-modal.acp-active .btn-purge {
  height:        28px        !important;
  padding:       0 12px      !important;
  font-size:     12px        !important;
  font-weight:   600         !important;
  border-radius: 4px         !important;
  cursor:        pointer     !important;
  display:       inline-flex !important;
  align-items:   center      !important;
  gap:           5px         !important;
  white-space:   nowrap      !important;
  transform:     none        !important;
  box-shadow:    none        !important;
  margin-right:  0           !important;
  transition:    background 0.15s, border-color 0.15s, color 0.15s !important;
}

/* Зелёные: редактировать / восстановить / параметры */
.admin-modal.acp-active .row-btn-edit,
.admin-modal.acp-active .row-btn-restore,
.admin-modal.acp-active .row-btn-params,
.admin-modal.acp-active .btn-edit,
.admin-modal.acp-active .btn-restore {
  background: #1c3a1c !important;
  border:     1px solid #3a6a3a !important;
  color:      #80cc80 !important;
}
.admin-modal.acp-active .row-btn-edit:hover,
.admin-modal.acp-active .row-btn-restore:hover,
.admin-modal.acp-active .row-btn-params:hover,
.admin-modal.acp-active .btn-edit:hover,
.admin-modal.acp-active .btn-restore:hover {
  background:   #234e23 !important;
  border-color: #5a8a5a !important;
  color:        #a0e0a0 !important;
}

/* Красные: удалить */
.admin-modal.acp-active .row-btn-delete,
.admin-modal.acp-active .btn-delete {
  background: #2a1010 !important;
  border:     1px solid #5a2a2a !important;
  color:      #cc7070 !important;
}
.admin-modal.acp-active .row-btn-delete:hover,
.admin-modal.acp-active .btn-delete:hover {
  background:   #3d1a1a !important;
  border-color: #7a4a4a !important;
  color:        #e09090 !important;
}

/* Тёмно-красные: удалить навсегда */
.admin-modal.acp-active .row-btn-purge,
.admin-modal.acp-active .btn-purge {
  background: #1e0a0a !important;
  border:     1px solid #3a1515 !important;
  color:      #aa4444 !important;
}
.admin-modal.acp-active .row-btn-purge:hover,
.admin-modal.acp-active .btn-purge:hover {
  background:   #2e1515 !important;
  border-color: #5a2020 !important;
  color:        #cc6060 !important;
}

/* Синие: история IP / информация */
.admin-modal.acp-active .row-btn-info {
  background: #0e1a2e !important;
  border:     1px solid #2a4a7a !important;
  color:      #6a9acc !important;
}
.admin-modal.acp-active .row-btn-info:hover {
  background:   #162540 !important;
  border-color: #4a6a9a !important;
  color:        #90bae0 !important;
}

/* Кнопки ↑↓ сортировки (row-btn-order) */
.admin-modal.acp-active .row-btn-order {
  width:           26px        !important;
  height:          26px        !important;
  padding:         0           !important;
  font-size:       11px        !important;
  border-radius:   3px         !important;
  cursor:          pointer     !important;
  display:         inline-flex !important;
  align-items:     center      !important;
  justify-content: center      !important;
  background:      #142014     !important;
  border:          1px solid #2a3e2a !important;
  color:           #5a7a5a     !important;
  transform:       none        !important;
  box-shadow:      none        !important;
  transition:      background 0.15s, border-color 0.15s, color 0.15s !important;
}
.admin-modal.acp-active .row-btn-order:hover:not(:disabled) {
  background:   #1e301e !important;
  border-color: #4a6a4a !important;
  color:        #8aaa8a !important;
}
.admin-modal.acp-active .row-btn-order:disabled {
  opacity: 0.35        !important;
  cursor:  not-allowed !important;
}

/* Кнопка toggle (row-btn-toggle): вкл/выкл слоя карты */
.admin-modal.acp-active .row-btn-toggle {
  height:        28px        !important;
  padding:       0 12px      !important;
  font-size:     12px        !important;
  font-weight:   600         !important;
  border-radius: 4px         !important;
  cursor:        pointer     !important;
  display:       inline-flex !important;
  align-items:   center      !important;
  gap:           5px         !important;
  white-space:   nowrap      !important;
  background:    #151f15     !important;
  border:        1px solid #2a422a !important;
  color:         #6a8a6a     !important;
  transition:    background 0.15s, border-color 0.15s, color 0.15s !important;
}
.admin-modal.acp-active .row-btn-toggle:hover {
  background:   #1e301e !important;
  border-color: #4a6a4a !important;
  color:        #90b090 !important;
}

/* Иконочные кнопки (icon-btn): 30x30, только иконка */
.admin-modal.acp-active .icon-btn {
  width:           28px        !important;
  height:          28px        !important;
  padding:         0           !important;
  border-radius:   4px         !important;
  cursor:          pointer     !important;
  display:         inline-flex !important;
  align-items:     center      !important;
  justify-content: center      !important;
  font-size:       12px        !important;
  transform:       none        !important;
  box-shadow:      none        !important;
  transition:      background 0.15s, border-color 0.15s, color 0.15s !important;
}

/* icon-btn зелёные: edit / restore */
.admin-modal.acp-active .icon-btn-edit,
.admin-modal.acp-active .icon-btn-restore {
  background: #1c3a1c !important;
  border:     1px solid #3a6a3a !important;
  color:      #80cc80 !important;
}
.admin-modal.acp-active .icon-btn-edit:hover,
.admin-modal.acp-active .icon-btn-restore:hover {
  background:   #234e23 !important;
  border-color: #5a8a5a !important;
  color:        #a0e0a0 !important;
}

/* icon-btn красные: delete */
.admin-modal.acp-active .icon-btn-delete {
  background: #2a1010 !important;
  border:     1px solid #5a2a2a !important;
  color:      #cc7070 !important;
}
.admin-modal.acp-active .icon-btn-delete:hover {
  background:   #3d1a1a !important;
  border-color: #7a4a4a !important;
  color:        #e09090 !important;
}

/* icon-btn тёмно-красные: purge */
.admin-modal.acp-active .icon-btn-purge {
  background: #1e0a0a !important;
  border:     1px solid #3a1515 !important;
  color:      #aa4444 !important;
}
.admin-modal.acp-active .icon-btn-purge:hover {
  background:   #2e1515 !important;
  border-color: #5a2020 !important;
  color:        #cc6060 !important;
}

/* ── Нормализация toolbar inputs Логи (padding:10px → 30px height) ── */
#activity-logs-modal.acp-active .admin-modal-toolbar select,
#activity-logs-modal.acp-active .admin-modal-toolbar input[type="datetime-local"] {
  height:     30px !important;
  padding:    0 10px !important;
  font-size:  12px !important;
  box-sizing: border-box !important;
}

/* ── Database: зелёная кнопка «Фильтр» (без класса, inline-styled) ── */
#database-modal.acp-active #toggle-db-filter-btn {
  background:   #1c3a1c !important;
  border:       1px solid #3a6a3a !important;
  color:        #80cc80 !important;
}
#database-modal.acp-active #toggle-db-filter-btn:hover {
  background:   #234e23 !important;
  border-color: #5a8a5a !important;
  color:        #a0e0a0 !important;
}

/* ── DANGER кнопки: «Очистить БД» + «Сбросить» в Логах ── */
#database-modal.acp-active      #clear-database-btn,
#activity-logs-modal.acp-active #reset-logs-filters {
  background:   #2a1010 !important;
  border:       1px solid #5a2a2a !important;
  color:        #cc7070 !important;
}
#database-modal.acp-active      #clear-database-btn:hover,
#activity-logs-modal.acp-active #reset-logs-filters:hover {
  background:   #3d1a1a !important;
  border-color: #7a4a4a !important;
  color:        #e09090 !important;
}

/* ── Database: кнопки в фильтр-панели (вне .admin-modal-toolbar) ── */
#database-modal.acp-active #db-filter-panel button {
  height:         28px !important;
  padding:        0 14px !important;
  font-size:      12px !important;
  font-weight:    600 !important;
  border-radius:  4px !important;
  cursor:         pointer !important;
  display:        inline-flex !important;
  align-items:    center !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow:     none !important;
  transition:     background 0.15s, border-color 0.15s, color 0.15s !important;
}
#database-modal.acp-active #db-apply-filter {
  background:   #1c3a1c !important;
  border:       1px solid #3a6a3a !important;
  color:        #80cc80 !important;
}
#database-modal.acp-active #db-apply-filter:hover {
  background:   #234e23 !important;
  border-color: #5a8a5a !important;
  color:        #a0e0a0 !important;
}
#database-modal.acp-active #db-reset-filter {
  background:   #151f15 !important;
  border:       1px solid #2a422a !important;
  color:        #6a8a6a !important;
}
#database-modal.acp-active #db-reset-filter:hover {
  background:   #1e2e1e !important;
  border-color: #3d5a3d !important;
  color:        #8aaa8a !important;
}

/* ── Analytics: кнопки выбора периода ── */
#analytics-modal.acp-active .analytics-period-btn {
  height:        26px !important;
  padding:       0 10px !important;
  font-size:     12px !important;
  font-weight:   500 !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  background:    #131f13 !important;
  border:        1px solid #253525 !important;
  color:         #5a7a5a !important;
  white-space:   nowrap !important;
  transition:    background 0.15s, border-color 0.15s, color 0.15s !important;
}
#analytics-modal.acp-active .analytics-period-btn:hover {
  background:   #1a2e1a !important;
  border-color: #3a5a3a !important;
  color:        #8aaa8a !important;
}
#analytics-modal.acp-active .analytics-period-btn.active {
  background:   #1c3a1c !important;
  border-color: #4a8a4a !important;
  color:        #90d090 !important;
  font-weight:  600 !important;
}

/* ── Analytics: «Применить» диапазон + «← Назад» drill-back ── */
#analytics-modal.acp-active #analytics-custom-range > button,
#analytics-modal.acp-active #analytics-drill-back    > button {
  height:        26px !important;
  padding:       0 12px !important;
  font-size:     12px !important;
  font-weight:   500 !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  background:    #172217 !important;
  border:        1px solid #3a5a3a !important;
  color:         #7a9a7a !important;
  transition:    background 0.15s, border-color 0.15s, color 0.15s !important;
}
#analytics-modal.acp-active #analytics-custom-range > button:hover,
#analytics-modal.acp-active #analytics-drill-back    > button:hover {
  background:   #1e3a1e !important;
  border-color: #5a8a5a !important;
  color:        #a0c0a0 !important;
}

/* ── Analytics: кнопки-триггеры фильтров (типы / пользователи) ── */
#analytics-modal.acp-active #af-types-btn,
#analytics-modal.acp-active #af-users-btn {
  height:        28px !important;
  padding:       0 10px !important;
  font-size:     12px !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  background:    #111811 !important;
  border:        1px solid #2a3a2a !important;
  color:         #8aaa8a !important;
  transition:    background 0.15s, border-color 0.15s, color 0.15s !important;
}
#analytics-modal.acp-active #af-types-btn:hover,
#analytics-modal.acp-active #af-users-btn:hover {
  background:   #172217 !important;
  border-color: #3a5a3a !important;
  color:        #a8c8a8 !important;
}

/* ── Map Layers: кнопка «Добавить слой» (в панели списка) ── */
#map-layers-modal.acp-active #ml-add-btn {
  height:        30px !important;
  padding:       0 14px !important;
  font-size:     12px !important;
  font-weight:   600 !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  background:    #1c3a1c !important;
  border:        1px solid #3a6a3a !important;
  color:         #80cc80 !important;
  display:       inline-flex !important;
  align-items:   center !important;
  gap:           6px !important;
  transition:    background 0.15s, border-color 0.15s, color 0.15s !important;
}
#map-layers-modal.acp-active #ml-add-btn:hover {
  background:   #234e23 !important;
  border-color: #5a8a5a !important;
  color:        #a0e0a0 !important;
}

/* ── Map Layers: форма — Сохранить / Отмена ── */
#map-layers-modal.acp-active #ml-save-btn {
  background:    #1c3a1c !important;
  border:        1px solid #3a6a3a !important;
  color:         #80cc80 !important;
  padding:       8px 18px !important;
  font-size:     13px !important;
  font-weight:   600 !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  transition:    all 0.15s !important;
}
#map-layers-modal.acp-active #ml-save-btn:hover {
  background:   #234e23 !important;
  border-color: #5a8a5a !important;
  color:        #a0e0a0 !important;
}
#map-layers-modal.acp-active #ml-cancel-btn {
  background:    #151f15 !important;
  border:        1px solid #2a422a !important;
  color:         #6a8a6a !important;
  padding:       8px 18px !important;
  font-size:     13px !important;
  font-weight:   600 !important;
  border-radius: 4px !important;
  cursor:        pointer !important;
  transition:    all 0.15s !important;
}
#map-layers-modal.acp-active #ml-cancel-btn:hover {
  background:   #1e2e1e !important;
  border-color: #3d5a3d !important;
  color:        #8aaa8a !important;
}

/* ── Тело: единые отступы и фон ─────────────────────────────────── */
.admin-modal.acp-active .admin-modal-body {
  padding:    16px 20px !important;
  background: #0f1a0f  !important;
}
/* map-layers body */
#map-layers-modal.acp-active .ml-modal-body {
  padding:    16px 20px !important;
  background: #0f1a0f  !important;
}

/* ── Единые поля ввода (ml-input → стиль admin) ─────────────────── */
.acp-active .ml-input {
  background:    #091409 !important;
  border:        1px solid #3d5a3d !important;
  border-radius: 5px !important;
  color:         #d0e0d0 !important;
  padding:       7px 12px !important;
  font-size:     13px !important;
}
.acp-active .ml-input:focus {
  border-color: #6b9b6b !important;
  box-shadow:   0 0 0 2px rgba(107,155,107,0.2) !important;
  outline:      none !important;
}

/* ── Карточки слоёв → стиль строк таблицы ──────────────────────── */
.acp-active .ml-card {
  background:    #141e14 !important;
  border:        1px solid #2a3e2a !important;
  border-radius: 5px !important;
  padding:       10px 14px !important;
}
.acp-active .ml-card:hover {
  background:    #1a2a1a !important;
  border-color:  #3d5a3d !important;
}
.acp-active .ml-card-title { color: #c8d8c8 !important; font-size: 13px !important; }
.acp-active .ml-card-roles { color: #6a8a6a !important; }

/* Кнопки внутри карточек */
.acp-active .ml-btn {
  background:    transparent !important;
  border:        1px solid #3d5a3d !important;
  border-radius: 4px !important;
  color:         #7a9a7a !important;
  padding:       4px 8px !important;
  font-size:     13px !important;
  cursor:        pointer !important;
  transition:    all 0.15s !important;
}
.acp-active .ml-btn:hover {
  background:   rgba(107,155,107,0.15) !important;
  border-color: #6b9b6b !important;
  color:        #d0e0d0 !important;
}
/* ml-btn-edit — нейтральный зелёный */
.acp-active .ml-btn-edit {
  background:   #1c3a1c     !important;
  border-color: #3a6a3a     !important;
  color:        #80cc80     !important;
}
.acp-active .ml-btn-edit:hover {
  background:   #234e23     !important;
  border-color: #5a8a5a     !important;
  color:        #a0e0a0     !important;
}
/* ml-btn-del — красный */
.acp-active .ml-btn-del {
  background:   #2a1010     !important;
  border-color: #5a2a2a     !important;
  color:        #cc7070     !important;
}
.acp-active .ml-btn-del:hover {
  background:   #3d1a1a     !important;
  border-color: #7a4a4a     !important;
  color:        #e09090     !important;
}
/* ml-btn-toggle — нейтральный */
.acp-active .ml-btn-toggle {
  background:   #151f15     !important;
  border-color: #2a422a     !important;
  color:        #6a8a6a     !important;
}
.acp-active .ml-btn-toggle:hover {
  background:   #1e2e1e     !important;
  border-color: #3d5a3d     !important;
  color:        #8aaa8a     !important;
}
/* row-btn-page: кнопки пагинации в БД */
#database-modal.acp-active .row-btn-page {
  height:        30px        !important;
  padding:       0 14px      !important;
  font-size:     12px        !important;
  font-weight:   600         !important;
  border-radius: 4px         !important;
  cursor:        pointer     !important;
  display:       inline-flex !important;
  align-items:   center      !important;
  gap:           6px         !important;
  background:    #1c3a1c     !important;
  border:        1px solid #3a6a3a !important;
  color:         #80cc80     !important;
  transition:    background 0.15s, border-color 0.15s, color 0.15s !important;
}
#database-modal.acp-active .row-btn-page:hover {
  background:   #234e23     !important;
  border-color: #5a8a5a     !important;
  color:        #a0e0a0     !important;
}

/* Все кнопки в .toolbar-item-actions: единая высота 28px,
   не трогаем background/color (они динамические у lock-кнопок) */
#toolbar-management-modal.acp-active .toolbar-item-actions > button {
  height:         28px        !important;
  min-width:      32px        !important;
  padding-top:    0           !important;
  padding-bottom: 0           !important;
  display:        inline-flex !important;
  align-items:    center      !important;
  justify-content:center      !important;
  border-radius:  4px         !important;
  cursor:         pointer     !important;
  font-size:      12px        !important;
  gap:            5px         !important;
  white-space:    nowrap      !important;
}

/* Бейджи */
.acp-active .ml-badge {
  background:    #1a2e1a !important;
  border-color:  #3d5a3d !important;
  color:         #8aba8a !important;
}
.acp-active .ml-group-header {
  color:       #6b9b6b !important;
  font-size:   11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  border-bottom: 1px solid #2d4a2d !important;
  padding:     5px 0 4px !important;
  margin-top:  10px !important;
}

/* ── Метки форм (ml-label → стиль admin) ────────────────────────── */
.acp-active .ml-label {
  font-size:  12px  !important;
  color:      #7a9a7a !important;
  font-weight: 500 !important;
}

/* ── Таблицы ─────────────────────────────────────────────────────── */
.admin-modal.acp-active .admin-modal-body table th {
  padding:    11px 14px !important;
  font-size:  12px !important;
  background: #111c11 !important;
}
.admin-modal.acp-active .admin-modal-body table td {
  padding:    10px 14px !important;
  font-size:  13px !important;
}
.admin-modal.acp-active .admin-modal-body table tbody tr:hover {
  background: rgba(61,90,61,0.18) !important;
}

/* ── Единые тонкие scrollbar для всей панели ─────────────────────── */
.admin-modal.acp-active ::-webkit-scrollbar,
#map-layers-modal.acp-active  ::-webkit-scrollbar,
#user-groups-modal.acp-active ::-webkit-scrollbar  { width: 5px; height: 5px; }
.admin-modal.acp-active ::-webkit-scrollbar-track,
#map-layers-modal.acp-active  ::-webkit-scrollbar-track,
#user-groups-modal.acp-active ::-webkit-scrollbar-track { background: rgba(10,20,10,0.3); }
.admin-modal.acp-active ::-webkit-scrollbar-thumb,
#map-layers-modal.acp-active  ::-webkit-scrollbar-thumb,
#user-groups-modal.acp-active ::-webkit-scrollbar-thumb { background: #3a5a3a; border-radius: 3px; }
.admin-modal.acp-active ::-webkit-scrollbar-thumb:hover,
#map-layers-modal.acp-active  ::-webkit-scrollbar-thumb:hover,
#user-groups-modal.acp-active ::-webkit-scrollbar-thumb:hover { background: #5a8a5a; }

/* ================================================================
   acp-active: модал рендерится внутри панели
   ================================================================ */

@keyframes acpContentIn {
  from {
    clip-path: circle(0px at var(--acp-ripple-x, -32px) var(--acp-ripple-y, 50%));
    opacity: 0.2;
  }
  25% { opacity: 1; }
  to {
    clip-path: circle(200% at var(--acp-ripple-x, -32px) var(--acp-ripple-y, 50%));
    opacity: 1;
  }
}

.admin-modal.acp-active,
#map-layers-modal.acp-active,
#user-groups-modal.acp-active {
  left:       calc(50px + var(--acp-tabs)) !important;  /* левый тулбар + колонка вкладок */
  top:        0 !important;
  right:      0 !important;
  width:      calc(var(--acp-w) - var(--acp-tabs))  !important;
  height:     calc(100vh - 24px) !important;
  background: transparent  !important;
  z-index:    9501         !important;
  animation:  none         !important;
  display:    flex         !important;
  align-items:     flex-start !important;
  justify-content: flex-start !important;
}

/* Внутренний контейнер для .admin-modal */
.admin-modal.acp-active .admin-modal-content {
  width:         100% !important;
  max-width:     none !important;
  height:        100% !important;
  max-height:    none !important;
  border-radius: 0    !important;
  border-top:    none !important;
  border-left:   1px solid #3d5a3d !important;
  border-right:  none !important;
  border-bottom: none !important;
  box-shadow:    none !important;
  animation:     acpContentIn 0.38s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Внутренние контейнеры для map-layers и user-groups (inline-styled) */
#map-layers-modal.acp-active > div,
#user-groups-modal.acp-active > div {
  width:         100%  !important;
  max-width:     none  !important;
  height:        100%  !important;
  max-height:    none  !important;
  border-radius: 0     !important;
  border-top:    none  !important;
  border-left:   1px solid #3d5a3d !important;
  border-right:  none  !important;
  border-bottom: none  !important;
  box-shadow:    none  !important;
  animation:     acpContentIn 0.38s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Скрыть кнопку ✕ внутри панели */
.admin-modal.acp-active .admin-modal-header > button:not(.icons-tab-btn),
#map-layers-modal.acp-active  #ml-close-btn,
#user-groups-modal.acp-active #ug-close-btn {
  display: none !important;
}

/* ================================================================
   ACP CHILD MODALS — дочерние диалоги, открываемые кнопками
   из вкладок панели управления.
   Класс .acp-child добавляется MutationObserver-ом в admin-panel.js
   только когда панель открыта и только для форм-окон
   (тосты success/info/error/warning пропускаются).
   !important необходим для перебивания inline-стилей модалов.
   ================================================================ */

/* ── Внешний контейнер окна ─────────────────────────────────────── */
.acp-child .notification-box {
  background:    #0f1a0f !important;
  border:        1px solid #2d4a2d !important;
  border-radius: 6px      !important;
  box-shadow:    0 12px 48px rgba(0, 0, 0, 0.8) !important;
  overflow:      hidden   !important;
}

/* ── Заголовок (первый дочерний div) ────────────────────────────── */
.acp-child .notification-box > div:first-child {
  background:    linear-gradient(135deg, #182818 0%, #0e1e0e 100%) !important;
  border-bottom: 1px solid #2d4a2d !important;
}

/* Текст заголовка h3 */
.acp-child .notification-box > div:first-child h3 {
  color:          #b0ccb0 !important;
  font-size:      15px    !important;
  font-weight:    600     !important;
}

/* Иконки в заголовке */
.acp-child .notification-box > div:first-child h3 i {
  color: #5a8a5a !important;
}

/* Кнопка закрытия ✕ в заголовке */
.acp-child .notification-box > div:first-child button {
  background: transparent !important;
  border:     none        !important;
  color:      #5a7a5a     !important;
}
.acp-child .notification-box > div:first-child button:hover {
  color:      #c0d8c0                    !important;
  background: rgba(60, 100, 60, 0.2)    !important;
}

/* ── Тело (все div-ы кроме первого) ─────────────────────────────── */
.acp-child .notification-box > div:not(:first-child) {
  background: #0f1a0f !important;
}

/* ── Метки и текст ──────────────────────────────────────────────── */
.acp-child .notification-box label {
  color: #8aaa8a !important;
}
.acp-child .notification-box p {
  color: #7a9a7a !important;
}
.acp-child .notification-box small {
  color: #4a6a4a !important;
}

/* ── Поля ввода ─────────────────────────────────────────────────── */
.acp-child .notification-box input:not([type="checkbox"]),
.acp-child .notification-box select,
.acp-child .notification-box textarea {
  background:    #111e11 !important;
  border:        1px solid #2a4a2a !important;
  border-radius: 4px     !important;
  color:         #c0d8c0 !important;
}
.acp-child .notification-box input:not([type="checkbox"]):focus,
.acp-child .notification-box select:focus,
.acp-child .notification-box textarea:focus {
  border-color: #4a7a4a !important;
  box-shadow:   0 0 0 2px rgba(74, 122, 74, 0.2) !important;
  outline:      none !important;
}
.acp-child .notification-box input:disabled,
.acp-child .notification-box select:disabled {
  background: #0a150a !important;
  color:      #3a5a3a !important;
  cursor:     not-allowed !important;
}

/* ── Кнопки в теле (нейтральный тёмно-зелёный) ─────────────────── */
.acp-child .notification-box > div:not(:first-child) button {
  background:    #162516 !important;
  border:        1px solid #2d4a2d !important;
  color:         #7aaa7a !important;
  border-radius: 4px     !important;
  font-size:     13px    !important;
  cursor:        pointer !important;
  transition:    background 0.15s, border-color 0.15s, color 0.15s !important;
}
.acp-child .notification-box > div:not(:first-child) button:hover {
  background:   #1e3a1e !important;
  border-color: #4a7a4a !important;
  color:        #b0d0b0 !important;
}

/* Акционная кнопка (type="submit") */
.acp-child .notification-box > div:not(:first-child) button[type="submit"] {
  background:  #1a3c1a !important;
  border-color: #3a7a3a !important;
  color:        #90cc90 !important;
  font-weight:  600     !important;
}
.acp-child .notification-box > div:not(:first-child) button[type="submit"]:hover {
  background:   #224e22 !important;
  border-color: #5a9a5a !important;
  color:        #c0e0c0 !important;
}

/* ── Тонкий scrollbar в дочерних окнах ─────────────────────────── */
.acp-child .notification-box ::-webkit-scrollbar        { width: 5px; height: 5px; }
.acp-child .notification-box ::-webkit-scrollbar-track  { background: rgba(10, 20, 10, 0.3); }
.acp-child .notification-box ::-webkit-scrollbar-thumb  { background: #3a5a3a; border-radius: 3px; }
.acp-child .notification-box ::-webkit-scrollbar-thumb:hover { background: #5a8a5a; }

/* ═══════════════════════════════════════════
   ДЕМО-РЕЖИМ — скрытие всех кнопок записи
   ═══════════════════════════════════════════ */

/* --- Кнопки редактирования/удаления в строках таблиц --- */
body.demo-mode .row-btn-edit,
body.demo-mode .row-btn-delete,
body.demo-mode .btn-edit,
body.demo-mode .btn-delete {
  display: none !important;
}

/* --- Кнопки «Создать / Добавить» в заголовках панелей --- */
body.demo-mode .toolbar-btn.create {
  display: none !important;
}

/* --- Кнопки «Сохранить» в формах --- */
body.demo-mode .btn-success {
  display: none !important;
}

/* --- Инструменты рисования на карте --- */
body.demo-mode #geometry-group-btn,
body.demo-mode #geometry-submenu {
  display: none !important;
}

/* --- Кнопка «Сохранить как карту по умолчанию» --- */
body.demo-mode #save-default-map-wrap,
body.demo-mode #save-default-map-btn {
  display: none !important;
}

/* --- Техническое обслуживание --- */
body.demo-mode #maintenance-mode-btn {
  display: none !important;
}

/* --- Управление пользователями/группами --- */
body.demo-mode #usg-add-user-btn,
body.demo-mode #usg-add-group-btn,
body.demo-mode #usg-add-member-row {
  display: none !important;
}

/* --- Слои карты --- */
body.demo-mode #ml-add-btn {
  display: none !important;
}

/* --- Создать трек/дрон --- */
body.demo-mode #create-new-drone {
  display: none !important;
}

/* --- Кнопки добавления точек траектории --- */
body.demo-mode #geo-add-btn,
body.demo-mode #traj-add-btn {
  display: none !important;
}

/* --- Иконки: загрузка и сохранение API-ключа --- */
body.demo-mode #upload-icon-btn,
body.demo-mode #ify-apikey-save {
  display: none !important;
}

/* --- Очистка базы данных --- */
body.demo-mode #clear-database-btn {
  display: none !important;
}

/* --- Кнопка «Сохранить» в панели свойств объекта --- */
body.demo-mode #save-desc {
  display: none !important;
}

/* --- Контекстное меню: удаление/редактирование объекта --- */
body.demo-mode #delete-object,
body.demo-mode #delete-trajectory,
body.demo-mode #add-waypoint,
body.demo-mode #continue-trajectory {
  display: none !important;
}

/* === Landscape-заглушка для мобильных ===
   Показывается JS-ом через screen.orientation.type (физический поворот).
   НЕ реагирует на открытие клавиатуры или изменение размера окна. ====== */
#landscape-block {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #0f140f;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: #c8d8b8;
  font-family: monospace;
  text-align: center;
  padding: 24px;
}
#landscape-block i {
  font-size: 64px;
  color: #4a7a4a;
  animation: lb-rotate 2s ease-in-out infinite;
}
@keyframes lb-rotate {
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(-90deg); }
  60%  { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}
#landscape-block h2 { font-size: 18px; margin: 0; letter-spacing: 1px; color: #d0e0d0; }
#landscape-block p  { font-size: 13px; margin: 0; color: #8a9a8a; max-width: 280px; line-height: 1.5; }