
		:root {
			--primary: #00a8ff;
			--secondary: #00d2d3;
			--accent: #ff9ff3;
			--dark: #1a1a2e;
			--darker: #0d0d1a;
		}

		* {
			margin: 0;
			padding: 0;
			box-sizing: border-box;
		}

		body {
			font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
			background: linear-gradient(135deg, var(--darker), var(--dark));
			color: #fff;
			min-height: 100vh;
			overflow: hidden;
		}

		#particles-js {
			position: fixed;
			width: 100%;
			height: 100%;
			top: 0;
			left: 0;
			z-index: -1;
		}
        .pie-marker {
            border-radius: 50%;
            border: 2px solid white;
            box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
            position: relative;
        }


		.container {
			max-width: 100%;
			height: 100vh;
			display: flex;
			flex-direction: column;
		}

		.main-content {
			display: flex;
			flex: 1;
			padding: 20px;
			gap: 20px;
			overflow: hidden;
		}

		#sidebar {
			width: 403px;
			background: rgba(20, 20, 40, 0.9);
			border-radius: 20px;
			padding: 25px;
			backdrop-filter: blur(10px);
			border: 1px solid rgba(0, 168, 255, 0.3);
			box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
			overflow-y: auto;
			scrollbar-width: thin;
			scrollbar-color: var(--primary) rgba(30, 30, 50, 0.7);
		}


		.filter-stat {
		  display: flex;
		  align-items: center;
		  margin-left: 10px;
		  min-width: 100px;
		}

		.percentage-bar {
		  flex: 1;
		  height: 8px;
		  background: rgba(255, 255, 255, 0.1);
		  border-radius: 4px;
		  overflow: hidden;
		  margin-right: 8px;
		}

		.percentage-fill {
		  height: 100%;
		  transition: width 0.3s ease;
		}

		.percentage-text {
		  font-size: 12px;
		  color: rgba(255,255,255,0.7);
		  min-width: 50px;
}

		.filters h2 {
			text-align: center;
			margin-bottom: 30px;
			color: var(--primary);
			font-size: 1.5em;
			text-transform: uppercase;
			letter-spacing: 2px;
		}

		.category-filter h3,
		.source-filter h3 {
			margin-bottom: 20px;
			color: var(--secondary);
			font-size: 1.3em;
			display: flex;
			align-items: center;
		}

		.category-filter h3::before,
		.source-filter h3::before {
			content: '';
			display: inline-block;
			width: 10px;
			height: 10px;
			border-radius: 50%;
			background: var(--secondary);
			margin-right: 10px;
			box-shadow: 0 0 10px var(--secondary);
		}

		.source-filter h3::before {
			background: #9c27b0;
			box-shadow: 0 0 10px #9c27b0;
		}

		.filter-group {
			display: flex;
			flex-direction: column;
			gap: 15px;
			margin-bottom: 20px;
		}

		.filter-group label {
		/*	display: flex;	*/
			align-items: center;
			padding: 12px;
			background: rgba(30, 30, 50, 0.7);
			border-radius: 10px;
			cursor: pointer;
			transition: all 0.3s ease;
			border: 1px solid transparent;
		}

		.filter-group label:hover {
			background: rgba(40, 40, 70, 0.9);
			transform: translateX(5px);
			border-color: var(--primary);
		}

		.filter-group input[type="checkbox"] {
			margin-right: 10px;
			width: 18px;
			height: 18px;
			accent-color: var(--primary);
		}

		.stats {
			margin-top: 30px;
		}

		.stats h3 {
			text-align: center;
			margin-bottom: 20px;
			color: var(--accent);
			font-size: 1.3em;
		}

		.stat-item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-bottom: 15px;
			padding: 15px;
			background: rgba(30, 30, 50, 0.7);
			border-radius: 10px;
			transition: all 0.3s ease;
		}

		.stat-item:hover {
			background: rgba(40, 40, 70, 0.9);
			transform: translateY(-2px);
		}

		.stat-item strong {
			color: var(--primary);
			font-size: 1.4em;
		}

		.percentage-bar {
			height: 8px;
			background: rgba(255, 255, 255, 0.1);
			border-radius: 4px;
			overflow: hidden;
			margin: 8px 0;
		}

		.percentage-fill {
			height: 100%;
			border-radius: 4px;
			transition: width 0.5s ease;
		}

		.percentage-value {
			font-size: 0.8em;
			opacity: 0.8;
			margin-top: 5px;
		}

		#map-container {
			flex: 1;
			border-radius: 20px;
			overflow: hidden;
			box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
			border: 1px solid rgba(0, 168, 255, 0.3);
			position: relative;
		}

		#map {
			height: 100%;
			background: #0a0a14;
		}

		.legend {
			position: absolute;
			bottom: 20px;
			right: 20px;
			background: rgba(20, 20, 40, 0.9);
			padding: 15px;
			border-radius: 15px;
			z-index: 1000;
			backdrop-filter: blur(10px);
			border: 1px solid rgba(0, 168, 255, 0.3);
		}

		.legend h4 {
			margin-bottom: 10px;
			color: var(--primary);
			text-align: center;
		}

		.legend-item {
			display: flex;
			align-items: center;
			margin: 5px 0;
		}

		.legend-color {
			width: 20px;
			height: 20px;
			border-radius: 50%;
			margin-right: 10px;
			border: 2px solid white;
		}

		.stat-source-item {
			display: flex;
			justify-content: space-between;
			margin-bottom: 12px;
			padding: 10px;
			background: rgba(156, 39, 176, 0.1);
			border-radius: 10px;
			transition: all 0.3s ease;
		}

		.stat-source-item:hover {
			background: rgba(156, 39, 176, 0.2);
			transform: translateY(-2px);
		}



/* Расширенное состояние (добавляется классом expanded) */
#sidebar.expanded {
  width: 750px; /* Расширение на 450px */
}

/* Контейнер кнопок */
.buttons-container {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

/* Стили кнопок (те же футуристичные) */
.stats-toggle {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 0;
  padding: 0;
} 

.stats-button {
  background: linear-gradient(145deg, #0f0f23, #1e1e2f);
  border: 1px solid rgba(0, 255, 255, 0.5);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.stats-button:hover {
  background: linear-gradient(145deg, #16213e, #0f0f23);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 25px rgba(0, 255, 255, 0.6);
  border-color: rgba(0, 255, 255, 0.8);
}

.stats-button.active {
  background: linear-gradient(145deg, #8a2be2, #4b0082);
  color: #ffffff;
  border-color: #8a2be2;
  box-shadow: 0 0 30px rgba(138, 43, 226, 0.8);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Контейнер контента */
#content-area {
  padding: 20px;
  height: calc(100% - 100px); /* Высота минус кнопки */
  overflow-y: auto;
}

.content-view {
  color: #e0e0e0;
}

/* Стили таблицы (тёмные, футуристичные) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: linear-gradient(145deg, #0f0f23, #1e1e2f);
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(138, 43, 226, 0.2);
  overflow: hidden;
  margin-top: 10px;
}

.data-table th, .data-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 255, 255, 0.3);
  color: #e0e0e0;
}

.data-table th {
  background: linear-gradient(145deg, #8a2be2, #4b0082);
  color: #ffffff;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.data-table tr:hover {
  background: rgba(0, 255, 255, 0.1);
}

/* ===== Добавления при доработке ===== */

/* Цветовые статусы в таблице */
.status-new { color: #ff6b6b; font-weight: 600; }
.status-progress { color: #f9ca24; font-weight: 600; }
.status-done { color: #4ecdc4; font-weight: 600; }

/* Сообщение о состоянии таблицы */
.table-status {
  margin: 8px 0;
  font-size: 13px;
  color: #f9ca24;
}

/* Круговая диаграмма в попапе */
.popup-pie {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 10px auto;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Подписи округов на карте */
.district-tooltip {
  background: rgba(20, 20, 40, 0.95);
  border: 1px solid rgba(0, 168, 255, 0.5);
  color: #ffffff;
  border-radius: 8px;
  box-shadow: none;
}

/* Панель временной шкалы на карте */
.timeline {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 230px; /* не перекрывать легенду справа */
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(20, 20, 40, 0.9);
  padding: 10px 15px;
  border-radius: 15px;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 168, 255, 0.3);
}

.timeline-button {
  background: rgba(30, 30, 55, 0.9);
  border: 1px solid rgba(0, 168, 255, 0.6);
  color: #00a8ff;
  font-size: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.timeline-button:hover {
  background: rgba(0, 168, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 168, 255, 0.6);
  transform: scale(1.08);
}

.timeline input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
  cursor: pointer;
}

.timeline-label {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  min-width: 110px;
  text-align: center;
  white-space: nowrap;
}

/* Контейнер графика динамики в сайдбаре */
.chart-container {
  position: relative;
  height: 220px;
  margin: 12px 20px 18px;
  padding: 12px;
  background: rgba(20, 20, 40, 0.9);
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: 15px;
  box-sizing: border-box;
}

/* Управление таблицей: поиск и кнопка добавления */
.table-controls {
  display: flex;
  gap: 10px;
  margin: 0 20px 12px;
  align-items: center;
}

.table-search {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 168, 255, 0.3);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
  font-size: 13px;
}

.table-search:focus {
  border-color: rgba(0, 168, 255, 0.7);
  box-shadow: 0 0 10px rgba(0, 168, 255, 0.25);
}

.table-status.error {
  color: #ff6b6b;
}

.add-btn {
  background: linear-gradient(135deg, #00a8ff, #00d2d3);
  border: none;
  color: #031018;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 15px rgba(0, 210, 211, 0.5);
}

/* Сортируемые заголовки таблицы */
#data-table thead th {
  cursor: pointer;
  user-select: none;
}

#data-table thead th:hover {
  color: #00a8ff;
}

.sort-arrow {
  font-size: 10px;
  margin-left: 4px;
}

/* Модальное окно формы нового обращения */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 15, 0.75);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal {
  width: min(480px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  background: #12122a;
  border: 1px solid rgba(0, 168, 255, 0.4);
  border-radius: 15px;
  padding: 20px 24px 24px;
  box-shadow: 0 0 40px rgba(0, 168, 255, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.modal-header h3 {
  margin: 0;
  color: #00a8ff;
}

.modal-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.7;
}

.modal-close:hover {
  opacity: 1;
}

.modal label {
  display: block;
  margin: 12px 0 4px;
  font-size: 11px;
  color: #9fd8ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal input,
.modal select,
.modal textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 168, 255, 0.3);
  color: #ffffff;
  padding: 8px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: rgba(0, 168, 255, 0.7);
}

.modal textarea {
  min-height: 72px;
  resize: vertical;
}

.modal select option {
  background: #12122a;
}

.form-error {
  color: #ff6b6b;
  font-size: 12px;
  min-height: 16px;
  margin-top: 10px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, #00a8ff, #00d2d3);
  border: none;
  color: #031018;
  font-weight: 700;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* Список обращений в попапе округа */
.popup-appeals {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 6px;
}

.popup-appeal-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.popup-appeal-row .date {
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.popup-cat-row {
  display: flex;
  justify-content: space-between;
  margin: 3px 0;
  font-size: 12px;
  align-items: center;
}

.st-new {
  color: #f9ca24;
  font-weight: 600;
}

.st-progress {
  color: #4ecdc4;
  font-weight: 600;
}

.st-done {
  color: #2ecc71;
  font-weight: 600;
}

.popup-note {
  margin-top: 8px;
  font-size: 11px;
  color: #f9ca24;
}

/* Чип пользователя в KPI-ленте */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(20, 20, 40, 0.9);
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: 15px;
  font-size: 12px;
  flex: 0 0 auto;
}

.user-chip .user-name {
  font-weight: 700;
  color: #ffffff;
}

.user-chip .user-role {
  color: #9fd8ff;
}

.user-chip .user-logout {
  color: #ff6b6b;
  text-decoration: none;
}

.user-chip .user-logout:hover {
  text-decoration: underline;
}

/* Селектор статуса для администратора в таблице */
.status-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 168, 255, 0.4);
  color: #fff;
  border-radius: 8px;
  padding: 3px 6px;
  font-family: inherit;
  font-size: 12px;
}

.status-select option {
  background: #12122a;
}

/* KPI-лента над контейнером */
.kpi-strip {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 14px 24px 0;
}

.kpi-card {
  flex: 1;
  min-width: 170px;
  background: rgba(20, 20, 40, 0.9);
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: 15px;
  padding: 12px 16px;
  box-sizing: border-box;
}

.kpi-card--overdue {
  border-color: rgba(255, 107, 107, 0.45);
}

.kpi-label {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #9fd8ff;
}

.kpi-value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}

.kpi-delta {
  min-height: 16px;
  font-size: 12px;
}

.kpi-delta.good { color: #2ecc71; }
.kpi-delta.bad { color: #ff6b6b; }
.kpi-delta.neutral { color: #f7c948; }
.kpi-delta.flat { color: rgba(255, 255, 255, 0.5); }

.kpi-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
}

.kpi-windows {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.kpi-window {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 168, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  padding: 3px 8px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

.kpi-window.active {
  background: rgba(0, 168, 255, 0.35);
  color: #ffffff;
}

/* Панель среза «категория → источник» */
.cross-panel {
  margin: 0 20px 18px;
  padding: 12px 14px;
  background: rgba(20, 20, 40, 0.9);
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: 15px;
  box-sizing: border-box;
}

.cross-panel select {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 168, 255, 0.3);
  color: #ffffff;
  padding: 7px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.cross-panel select option {
  background: #12122a;
}

.cross-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
  font-size: 12px;
}

.cross-bar-name {
  width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.cross-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.cross-bar-fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.cross-bar-value {
  width: 82px;
  text-align: right;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

.cross-headline {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #9fd8ff;
}

.cross-section-label {
  margin: 12px 0 4px;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #4ecdc4;
  text-transform: uppercase;
}

.cross-bar-name.center-aligned { text-align: center; }

/* Тёмные всплывающие окна Leaflet в стиле интерфейса */
.custom-popup .leaflet-popup-content-wrapper {
  background: rgba(15, 15, 30, 0.95);
  color: #ffffff;
  border: 1px solid rgba(0, 168, 255, 0.4);
  border-radius: 12px;
}

.custom-popup .leaflet-popup-tip {
  background: rgba(15, 15, 30, 0.95);
  border: 1px solid rgba(0, 168, 255, 0.4);
}

.custom-popup hr {
  border-color: rgba(255, 255, 255, 0.15);
}

.custom-popup h3 {
  color: #00a8ff;
}
