:root {
  --bg-page: #f1f5f9;
  --top-bar-bg: #0f172a;
  --top-bar-border: rgba(255, 255, 255, 0.1);
  --primary: #1a73e8;
  --primary-hover: #1557b0;
  --text-light: #f8fafc;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --panel-bg: #ffffff;
  --panel-border: #cbd5e1;
  --btn-danger-bg: #9f1239;
  --btn-danger-hover: #881337;
}

/* СТИЛИ ДЛЯ ИНПУТОВ И СЕЛЕКТОВ В МОДАЛЬНОМ ОКНЕ АДМИНКИ (СВЕТЛЫЙ ФОН) */
#modal-admin-oz input,
#modal-admin-oz select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
}
#modal-admin-oz input::placeholder {
  color: #94a3b8 !important;
}
#modal-admin-oz input:focus,
#modal-admin-oz select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
  outline: none !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-page);
  color: var(--text-dark);
}

/* 1. АВТОРИЗАЦИЯ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-card {
  background: #1e293b;
  border: 1px solid var(--top-bar-border);
  border-radius: 20px;
  padding: 36px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: var(--text-light);
}
.header { text-align: center; margin-bottom: 24px; }
.logo { font-size: 38px; margin-bottom: 8px; }
.title { font-size: 22px; font-weight: 700; color: #f8fafc; margin-bottom: 6px; }
.subtitle { font-size: 13px; color: var(--text-muted); }

.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 500; color: #94a3b8; margin-bottom: 6px; }

select, input[type="text"], input[type="date"] {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--top-bar-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: #f8fafc;
  font-size: 13px;
  outline: none;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--primary-hover); }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 20px; display: none; }
.alert-error { background: rgba(159, 18, 57, 0.3); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }
.alert-info { background: rgba(26, 115, 232, 0.3); border: 1px solid rgba(96, 165, 250, 0.4); color: #bae6fd; }

/* 2. ОСНОВНОЙ ИНТЕРФЕЙС И КАРТА */
.app-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.sidebar-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  height: 100%;
  z-index: 1500;
  display: none;
  flex-direction: column;
  background: #ffffff;
  border-right: 1px solid var(--panel-border);
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}
.sidebar-panel.active {
  display: flex;
}

/* ПЛАВАЮЩАЯ КНОПКА — зафиксирована в левом верхнем углу в зоне padding полос меню */
.dept-switcher-wrapper {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 9999 !important;
}

.btn-floating-menu {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
  user-select: none;
}
.btn-floating-menu:hover {
  background: #1e293b;
  border-color: #38bdf8;
}

.dept-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 115px;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 5px;
  z-index: 3000;
}
.dept-dropdown-panel.show {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dept-dropdown-header {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 4px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 2px;
}

/* ДВУХЗОННАЯ СТРОКА ОТДЕЛА (ЛЕВАЯ ЗОНА = ЗАКРЕПЛЕНИЕ МЕТОК, ПРАВАЯ ЗОНА = МЕНЮ) */
.dept-row-split {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.15s ease;
  user-select: none;
}
.dept-row-split:hover {
  border-color: #cbd5e1;
}

.dept-zone-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  cursor: pointer;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
}
.dept-zone-toggle:hover {
  background: #f8fafc;
  color: #0f172a;
}
.dept-row-split.selected .dept-zone-toggle {
  background: #0f172a;
  color: #ffffff;
}

.dept-zone-divider {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
}

.dept-zone-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  cursor: pointer;
  color: #64748b;
  background: #ffffff;
  transition: background 0.15s, color 0.15s;
}
.dept-zone-menu:hover {
  background: #e0f2fe;
  color: #0284c7;
}
.dept-row-split.menu-open .dept-zone-menu {
  background: #0284c7;
  color: #ffffff;
}

/* СТЕК-КОНТЕЙНЕР ДЛЯ ПОЛОС МЕНЮ */
.top-bars-stack {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  background: transparent;
  overflow: hidden;
}
.top-bars-stack .top-bar {
  pointer-events: auto;
}

/* КВАДРАТНАЯ КНОПКА СВОРУТЬ/РАЗВЕРНУТЬ МЕНЮ (СВЕТЛАЯ, В СТИЛЕ ПОЛОСЫ МЕНЮ) */
.btn-topbar-toggle {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 3000;
  width: 36px;
  height: 36px;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  user-select: none;
}
.btn-topbar-toggle:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0284c7;
}

/* ВЕРХНЯЯ ПАНЕЛЬ ФИЛЬТРОВ */
.top-bar {
  min-height: 56px;
  background: #ffffff;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 4px 56px !important;
  z-index: 2000;
  gap: 8px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow-x: auto;
}

.top-bar.collapsed {
  display: none !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.filters-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow: visible !important;
}

/* СЕЛЕКТОР ОТДЕЛОВ (СП, ТО, БУД) */
.dept-selector-group {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 2px 3px;
  height: 34px;
}
.dept-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  height: 28px;
}
.dept-chip:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}
.dept-chip.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.dept-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

/* ФИЛЬТР ДАТЫ И ПЕРИОДА (FLATPICKR) */
.date-filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 3px 8px;
  height: 34px;
}
.date-mode-select {
  background: transparent;
  border: none;
  color: #1a73e8;
  font-weight: 700;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  padding: 0 4px;
}
.date-input {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 4px !important;
  color: #334155 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  width: 95px !important;
  text-align: center;
  cursor: pointer;
}
.date-input::placeholder {
  color: #64748b;
  font-weight: 500;
}

/* СТИЛИ ВЫПАДАЮЩИХ СПИСКОВ (CUSTOM DROPDOWN) */
.custom-dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-toggle {
  background: #ffffff;
  color: #334155;
  border: 1px solid var(--panel-border);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s;
}
.dropdown-toggle:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.dropdown-toggle span {
  color: var(--primary);
  font-weight: 700;
}

.dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  z-index: 3000;
  flex-direction: column;
  gap: 8px;
  color: var(--text-dark);
}
.dropdown-panel.open {
  display: flex !important;
}

.dd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  font-weight: 600;
}
.dd-header-count {
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}

.dd-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border-radius: 6px;
  padding: 6px 10px;
  border: 1px solid var(--panel-border);
}
.dd-search input {
  background: transparent;
  border: none;
  padding: 0;
  color: #1e293b;
  font-size: 12px;
}

.dd-list {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.dd-item, .dd-item-dual {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s;
}
.dd-item:hover, .dd-item-dual:hover {
  background: #f1f5f9;
}
.dd-item input[type="checkbox"], .dd-item-dual input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}
.item-count-blue {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  margin-left: auto;
}

.btn-pin-panel {
  background: none;
  border: none;
  color: #0d9488;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
}
.btn-pin-panel:hover { color: var(--primary); }

.dd-ok-btn {
  background: #1976d2;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  margin-top: 4px;
  transition: background 0.2s;
}
.dd-ok-btn:hover { background: #1565c0; }

/* ПОИСК ПО НОМЕРУ ЗАДАЧИ */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 2px 4px;
}
.search-wrapper input {
  background: transparent;
  border: none;
  padding: 6px 24px 6px 8px;
  color: #1e293b;
  font-size: 13px;
  width: 130px;
  outline: none;
}
.btn-clear-search {
  position: absolute;
  right: 36px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.btn-clear-search:hover { color: #0f172a; }

.search-btn {
  background: #e2e8f0;
  color: #334155;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.search-btn:hover { background: #cbd5e1; }

.btn-icon {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  color: #ef4444;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: #fef2f2; }

/* ПОЛЬЗОВАТЕЛЬ И ВЫХОД */
.user-info { display: flex; align-items: center; gap: 10px; flex-shrink: 0; white-space: nowrap; }
.user-name { font-size: 13px; font-weight: 600; color: #334155; }
.btn-ts-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  height: 32px;
  transition: background 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.btn-ts-open:hover { background: #0369a1; }
.btn-logout {
  background: var(--btn-danger-bg);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  height: 32px;
}
.btn-logout:hover { background: var(--btn-danger-hover); }

/* САЙДБАР ЗАКРЕПЛЕННЫХ ФИЛЬТРОВ */
.sidebar-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  background: #ffffff;
  border-right: 1px solid var(--panel-border);
  z-index: 1500;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-panel.active { display: flex; }

#map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f8fafc;
  transition: top 0.25s ease, left 0.2s, width 0.2s;
}

/* СТИЛИ ЧЕРНЫХ ЦИФР В КРУГАХ КЛАСТЕРОВ (#000000) */
.marker-cluster div span { color: #000000 !important; font-weight: 800 !important; font-size: 14px !important; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background-color: #fde047 !important; box-shadow: 0 4px 10px rgba(0,0,0,0.25) !important; border: none !important;
}

/* POPUP КАРТОЧКА */
.leaflet-popup-content-wrapper {
  background: #ffffff !important; color: #222222 !important;
  border: 1px solid #e2e8f0 !important; border-radius: 12px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important; padding: 0 !important;
}
.leaflet-popup-content { margin: 12px 14px !important; line-height: 1.4 !important; }
.leaflet-popup-tip { background: #ffffff !important; }

.popup-item-box { background: #ffffff; border-radius: 6px; padding: 8px 10px; border-left: 4px solid #0000ff; margin-bottom: 8px; font-size: 13px; }
.popup-task-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid #f1f5f9; }
.task-num-link { color: #1a73e8; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.copy-icon { font-size: 15px; color: #1a73e8; vertical-align: middle; cursor: pointer; }
.popup-field-row { margin-bottom: 4px; font-size: 13px; color: #334155; }
.popup-field-label { font-weight: 600; color: #1e293b; }
.badge-yellow { background: #fffbeb; color: #92400e; padding: 2px 6px; border-radius: 4px; font-weight: 600; font-size: 12px; }
.dashed-hr { border: 0; border-top: 1px dashed #cbd5e1; margin: 6px 0; }

.hidden { display: none !important; }

/* 3. МОДАЛЬНОЕ ОКНО ТАБЕЛЯ РАБОЧЕГО ВРЕМЕНИ */
.ts-period-select {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f8fafc;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  max-width: 150px;
  flex-shrink: 0;
  height: 32px;
}
.ts-period-select option {
  background: #1e293b;
  color: #f8fafc;
}

.ts-multi-select {
  position: relative;
  display: inline-block;
}

.ts-ms-selected-text {
  display: inline-block;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f8fafc;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-ms-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  z-index: 10001;
  min-width: 200px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  color: #1e293b;
}

.ts-ms-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.ts-ms-btn {
  flex: 1;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: #334155;
}
.ts-ms-btn:hover { background: #e2e8f0; }

.ts-ms-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.ts-ms-option:hover { background: #f8fafc; }
.ts-ms-option input { cursor: pointer; }
.ts-ms-option label { margin: 0; cursor: pointer; color: #1e293b; white-space: nowrap; }

.btn-ts-excel {
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s;
}
.btn-ts-excel:hover { background: #0369a1; }

.ts-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  color: #1e293b;
  min-width: 1100px;
  margin: 0;
  padding: 0;
}

.ts-table th, .ts-table td {
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.ts-table thead th {
  background-color: #e2e8f0 !important;
  color: #0f172a;
  font-weight: 700;
  position: sticky;
  z-index: 10;
  height: 26px;
  padding: 3px 6px;
}

.ts-table thead tr:nth-child(1) th {
  top: 0 !important;
  background-color: #e2e8f0 !important;
  z-index: 12;
  border-top: 1px solid #cbd5e1;
}

.ts-table thead tr:nth-child(2) th {
  top: 26px !important;
  background-color: #e2e8f0 !important;
  z-index: 11;
}

.ts-table thead th.ts-day-weekend {
  background-color: #fee2e2 !important;
  color: #991b1b;
}

.th-sticky-first {
  position: sticky;
  left: 0;
  z-index: 25 !important;
  background-color: #e2e8f0 !important;
  border-left: 1px solid #cbd5e1;
}

.ts-cell-master {
  text-align: left !important;
  font-weight: 600;
  min-width: 160px;
}

.ts-cell-city {
  text-align: left !important;
  color: #64748b;
  min-width: 110px;
}

.ts-day-weekend {
  background-color: #fef2f2 !important;
  color: #991b1b;
}

.ts-day-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
}

.ts-city-header {
  background: #e2e8f0;
  font-weight: 800;
  color: #0f172a;
  text-align: left !important;
}

.ts-city-header td {
  padding: 8px 12px;
  font-size: 13px;
}

.ts-city-footer {
  background: #f8fafc;
  font-weight: 700;
}

.ts-grand-footer {
  background: #bae6fd;
  font-weight: 800;
  color: #0369a1;
}

.ts-col-total {
  background: #f8fafc;
  font-weight: 700;
}

.ts-cell-value {
  font-weight: 700;
  color: #0284c7;
}

.ts-popover {
  position: fixed;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 10002;
  min-width: 160px;
  font-size: 12px;
}

.ts-popover-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  border-bottom: 1px solid #f1f5f9;
}
.ts-popover-item:last-child { border-bottom: none; }
.ts-popover-item span { color: #475569; }
.ts-popover-item strong { color: #0f172a !important; font-weight: 700; }

.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Явный белый фон для поля поиска аварий */
#searchTOAlarmsInput {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #0f172a !important;
}
#searchTOAlarmsInput::placeholder {
  color: #94a3b8 !important;
}

/* Всегда показывать выпадающие списки фильтров поверх любых панелей аварий */
body > .dropdown-panel.open,
.custom-dropdown .dropdown-panel.open,
.dropdown-panel.open {
  z-index: 999999 !important;
}

/* Анимация и эффект нажатия для кнопки Реестра ключей (#btn-to-keys-list) */
#btn-to-keys-list {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none;
}
#btn-to-keys-list:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08) !important;
}
#btn-to-keys-list:active {
  transform: scale(0.90) !important;
  background-color: #e2e8f0 !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15) !important;
}

/* Анимация и эффект нажатия для цветной кнопки-иконки "Все ключи" (.btn-icon-fill-all) */
.btn-icon-fill-all {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none;
}
.btn-icon-fill-all:hover {
  background-color: #1d4ed8 !important;
  box-shadow: 0 3px 8px rgba(29, 78, 216, 0.4) !important;
}
.btn-icon-fill-all:active {
  transform: scale(0.88) !important;
  background-color: #1e40af !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Анимация и эффект нажатия для зелёной кнопки-иконки "Провести" (.btn-icon-submit-key) */
.btn-icon-submit-key {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none;
}
.btn-icon-submit-key:hover {
  background-color: #166534 !important;
  box-shadow: 0 3px 8px rgba(22, 101, 52, 0.4) !important;
}
.btn-icon-submit-key:active {
  transform: scale(0.88) !important;
  background-color: #14532d !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Анимация и эффект нажатия для оранжевой кнопки-иконки "Перенос Мастер-доступов" (.btn-icon-access-approval) */
.btn-icon-access-approval {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none;
}
.btn-icon-access-approval:hover {
  background-color: #7c3714 !important;
  box-shadow: 0 3px 8px rgba(124, 55, 20, 0.45) !important;
}
.btn-icon-access-approval:active {
  transform: scale(0.88) !important;
  background-color: #642b0f !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* Анимация и эффект нажатия для синей кнопки-иконки "Все ключи области" (.btn-icon-region-keys) */
.btn-icon-region-keys {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none;
}
.btn-icon-region-keys:hover {
  background-color: #0369a1 !important;
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.45) !important;
}
.btn-icon-region-keys:active {
  transform: scale(0.88) !important;
  background-color: #075985 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}
