/* ============================================================
   CSS ПЕРЕМЕННЫЕ ДЛЯ ЦВЕТОВОЙ СХЕМЫ
   ============================================================ */

:root {
  /* Основные цвета - светлая тема */
  --font-size: 14px;
  --background: #F4F7FA;
  --foreground: #1A1D2B;
  --card: rgba(255, 255, 255, 0.7);
  --card-foreground: #1A1D2B;
  --popover: rgba(255, 255, 255, 0.95);
  --popover-foreground: #1A1D2B;
  --primary: #1A1D2B;
  --primary-foreground: #ffffff;
  --secondary: #E0E5EC;
  --secondary-foreground: #1A1D2B;
  --muted: #E0E5EC;
  --muted-foreground: #717182;
  --accent: #00BFA5;
  --accent-foreground: #ffffff;
  --destructive: #EF4444;
  --destructive-foreground: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --input: transparent;
  --input-background: rgba(255, 255, 255, 0.5);
  --switch-background: #cbced4;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --ring: #00BFA5;
  --radius: 1rem;
  --sidebar: rgba(244, 247, 250, 0.95);
  --sidebar-foreground: #1A1D2B;
  --sidebar-primary: #00BFA5;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: rgba(0, 191, 165, 0.1);
  --sidebar-accent-foreground: #1A1D2B;
  --sidebar-border: rgba(0, 0, 0, 0.05);
  --sidebar-ring: #00BFA5;
  
  /* Цвета для статусов */
  --color-green-500: #10B981;
  --color-yellow-500: #F59E0B;
  --color-red-500: #EF4444;
  --color-blue-500: #3B82F6;
  --color-gray-400: #9CA3AF;
  
  /* Spacing */
  --spacing: 0.25rem;

  /* Настройки футера: используем переменные, чтобы цвета менялись вместе с темой */
  --footer-background: linear-gradient(to right, #e6eef5, #ced9e4);
  --footer-foreground: #0F1E25;
  --footer-link-color: #0F1E25;
  --footer-link-hover: #00BFA5;
  --footer-button-background: rgba(0, 0, 0, 0.05);
  --footer-button-foreground: #0F1E25;
  --footer-logo-filter: none;
  --footer-logo-filter-hover: brightness(0.85);
}

/* Темная тема */
.dark {
  --background: #0E111A;
  --foreground: #E5E7EB;
  --card: rgba(26, 29, 43, 0.7);
  --card-foreground: #E5E7EB;
  --popover: rgba(26, 29, 43, 0.95);
  --popover-foreground: #E5E7EB;
  --primary: #E5E7EB;
  --primary-foreground: #0E111A;
  --secondary: #1F2937;
  --secondary-foreground: #E5E7EB;
  --muted: #1F2937;
  --muted-foreground: #9CA3AF;
  --accent: #00BFA5;
  --accent-foreground: #ffffff;
  --destructive: #EF4444;
  --destructive-foreground: #ffffff;
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.05);
  --ring: #00BFA5;
  --sidebar: rgba(14, 17, 26, 0.95);
  --sidebar-foreground: #E5E7EB;
  --sidebar-primary: #00BFA5;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: rgba(0, 191, 165, 0.1);
  --sidebar-accent-foreground: #E5E7EB;
  --sidebar-border: rgba(255, 255, 255, 0.05);
  --sidebar-ring: #00BFA5;

  /* Параметры футера для тёмной темы: сохраняем контраст и привычный градиент */
  --footer-background: linear-gradient(to right, #0F1E25, #1a2a3a);
  --footer-foreground: #FFFFFF;
  --footer-link-color: rgba(255, 255, 255, 0.9);
  --footer-link-hover: #3CE43C;
  --footer-button-background: rgba(255, 255, 255, 0.1);
  --footer-button-foreground: #FFFFFF;
  --footer-logo-filter: brightness(0) invert(1);
  --footer-logo-filter-hover: brightness(0) invert(0.8);
}

/* ============================================================
   БАЗОВЫЕ СТИЛИ
   ============================================================ */

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

html {
  font-size: var(--font-size);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================================
   ТИПОГРАФИКА - УЛУЧШЕННОЕ ФОРМАТИРОВАНИЕ
   ============================================================ */

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 0.625rem;
  color: var(--foreground);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.005em;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

h4 {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

p {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.01em;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

label {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--foreground);
}

button {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

input {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* ============================================================
   NEOMORPH И GLASS ЭФФЕКТЫ
   ============================================================ */

.neomorph {
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 
    6px 6px 12px rgba(163, 177, 198, 0.3),
    -6px -6px 12px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
}

.dark .neomorph {
  box-shadow: 
    6px 6px 12px rgba(0, 0, 0, 0.3),
    -6px -6px 12px rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
}

.dark .glass {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================
   КНОПКИ
   ============================================================ */

button {
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: var(--font-weight-medium);
}

/* Кнопка по умолчанию */
.btn,
button.btn-default,
button[type="submit"]:not(.btn-outline):not(.btn-ghost):not(.btn-secondary) {
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
}

.btn:hover,
button.btn-default:hover {
  background-color: rgba(26, 29, 43, 0.9);
}

.dark .btn:hover,
.dark button.btn-default:hover {
  background-color: rgba(229, 231, 235, 0.9);
}

/* Кнопка outline */
.btn-outline,
button.btn-outline {
  background-color: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
}

.btn-outline:hover,
button.btn-outline:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}

.dark .btn-outline:hover,
.dark button.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Кнопка ghost */
.btn-ghost,
button.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
}

.btn-ghost:hover,
button.btn-ghost:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.dark .btn-ghost:hover,
.dark button.btn-ghost:hover {
  background-color: rgba(0, 191, 165, 0.5);
}

/* Кнопка secondary */
.btn-secondary,
button.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
}

.btn-secondary:hover,
button.btn-secondary:hover {
  background-color: rgba(224, 229, 236, 0.8);
}

.dark .btn-secondary:hover,
.dark button.btn-secondary:hover {
  background-color: rgba(31, 41, 55, 0.8);
}

/* Кнопка icon только */
.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: calc(var(--radius) - 2px);
}

/* Размеры кнопок */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.625rem 1.5rem;
  font-size: 1rem;
}

/* ============================================================
   КАРТОЧКИ И БЕЙДЖИ
   ============================================================ */

.card {
  background-color: var(--card);
  color: var(--card-foreground);
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card.neomorph {
  padding: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.625rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  line-height: 1;
}

.badge-default {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-accent {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.badge-destructive {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
}

.badge-success {
  background-color: var(--color-green-500);
  color: white;
}

.badge-warning {
  background-color: var(--color-yellow-500);
  color: white;
}

.badge-error {
  background-color: var(--color-red-500);
  color: white;
}

.badge-info {
  background-color: var(--color-blue-500);
  color: white;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4rem;
  z-index: 1000;
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.header.neomorph {
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .header.neomorph {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0.75rem;
}

.logo-container img {
  height: 2.5rem;
  transition: transform 0.3s ease;
}

.logo-container img:hover {
  transform: scale(1.05);
}

.logo-container span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.main-nav a {
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.5;
  padding: 0.5rem 0.875rem;
  border-radius: calc(var(--radius) - 4px);
  transition: all 0.2s ease;
  border: 1px solid var(--border); /* Тонкая граница вокруг кнопок навигации */
}

.main-nav a:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.dark .main-nav a:hover {
  background-color: rgba(0, 191, 165, 0.5);
}

/* Переключатель темы */
.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: transparent;
  border: 1px solid var(--border); /* Тонкая граница вокруг кнопки переключения темы */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.dark .theme-toggle:hover {
  background-color: rgba(0, 191, 165, 0.5);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ============================================================
   SIDEBAR / PUSH PANEL
   ============================================================ */

.push-panel {
  position: fixed;
  top: 4rem;
  left: 0;
  width: 20rem;
  height: calc(100vh - 4rem);
  background: var(--card);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.push-panel.expanded {
  transform: translateX(0);
}

.push-panel.collapsed {
  transform: translateX(-100%);
}

.push-panel-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.push-panel-header h2 {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--foreground);
  margin: 0;
  flex: 1;
  line-height: 1.4;
}

/* Кнопка закрытия панели */
.panel-close-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.panel-close-btn:hover {
  background-color: var(--destructive);
  border-color: var(--destructive);
  color: var(--destructive-foreground);
}

.panel-close-btn:active {
  transform: scale(0.95);
}

.close-icon {
  width: 1rem;
  height: 1rem;
  color: var(--foreground);
  transition: color 0.2s ease;
}

.panel-close-btn:hover .close-icon {
  color: var(--destructive-foreground);
}

.push-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem;
  gap: 0.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem;
  background-color: transparent;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
  color: var(--muted-foreground);
}

.tab-btn:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.dark .tab-btn:hover {
  background-color: rgba(0, 191, 165, 0.5);
}

.tab-btn.active {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.dark .tab-btn.active {
  background-color: rgba(0, 191, 165, 0.5);
}

.tab-icon {
  font-size: 1.25rem;
}

.tab-label {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.push-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Секции внутри вкладок */
.tab-section {
  margin-bottom: 1.5rem;
}

.tab-section h3 {
  margin: 0 0 0.875rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.4;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
}

.tab-section h3::before {
  content: '▸ ';
  color: var(--accent);
}

/* Стили для групп статусов */
.status-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms;
  /* Светлая тема - белый фон с границей */
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 3px solid;
  color: var(--foreground);
  height: 44px;
  width: 100%;
  box-sizing: border-box;
}

/* Темная тема для заголовков статусов */
.dark .status-group-header {
  background: #253041;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

.status-group-header:hover {
  opacity: 0.9;
}

.dark .status-group-header:hover {
  background: #2d3a4b;
}

.status-group-header .status-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: inherit;
}

.status-group-header .status-icon {
  font-size: 24px;
}

.status-group-items {
  margin-top: 6px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.status-group-items.show {
  display: block;
}

/* Элементы внутри групп статусов */
.status-group-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms;
  /* Светлая тема - белый фон с границей */
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  color: var(--foreground);
  height: 44px;
  width: 100%;
  box-sizing: border-box;
}

/* Стили для изображений внутри элементов статусов */
.status-group-item img {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain;
  margin-right: 4px;
  flex-shrink: 0;
}

/* Темная тема для элементов статусов */
.dark .status-group-item {
  background: #3a4a5e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid #3a4a5e;
  color: #e0e0e0;
}

.status-group-item:hover {
  background: var(--accent);
  border-left-color: var(--accent);
  color: var(--accent-foreground);
}

.dark .status-group-item:hover {
  background: #4a5a6e;
  border-left-color: #34a236;
}

/* Элементы в секциях слоев */
.tab-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 4px;
  /* Светлая тема - белый фон с границей */
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 8px;
  transition: all 200ms;
  cursor: pointer;
  height: 44px;
  width: 100%;
  box-sizing: border-box;
}

/* Темная тема для элементов слоев */
.dark .tab-item {
  background: #3a4a5e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

.tab-item:hover {
  opacity: 0.9;
}

.dark .tab-item:hover {
  background: #4a5a6e;
}

.tab-item.active {
  border-left-color: var(--accent);
  background-color: rgba(0, 191, 165, 0.1);
}

.dark .tab-item.active {
  background-color: rgba(0, 191, 165, 0.15);
  border-left-color: var(--accent);
}

.tab-item input[type="radio"],
.tab-item input[type="checkbox"] {
  margin-right: 0.625rem;
  cursor: pointer;
  accent-color: var(--accent);
}

.tab-item-label {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.tab-item .layer-count {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background-color: var(--muted);
  color: var(--muted-foreground);
  padding: 3px 9px;
  border-radius: 10px;
  min-width: 30px;
  text-align: center;
  margin-left: auto;
  line-height: 1.4;
}

.tab-item:hover .layer-count {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--accent-foreground);
}

.dark .tab-item:hover .layer-count {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Списки слоев */
.base-layers-list,
.overlay-layers-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* Кнопка переключения панели внутри карты */
.push-panel-toggle-container {
  z-index: 1000;
}

.push-panel-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.push-panel-toggle:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
  transform: scale(1.1);
}

.dark .push-panel-toggle:hover {
  background-color: rgba(0, 191, 165, 0.5);
}

.toggle-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--foreground);
  transition: transform 0.3s ease;
}

.push-panel.expanded ~ .push-panel-toggle-container .toggle-icon,
.push-panel-toggle-container .push-panel-toggle.expanded .toggle-icon {
  transform: rotate(180deg);
}

/* Убираем старую кнопку если она была вне карты */
body > .push-panel-toggle {
  display: none !important;
}

/* ============================================================
   БАННЕР ТЕСТОВЫХ ДАННЫХ
   ============================================================ */

.test-data-banner {
  position: fixed;
  top: 4rem;
  left: 0;
  right: 0;
  z-index: 950;
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  color: #ffffff;
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  animation: slideDown 0.3s ease-out;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.test-data-banner.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.test-data-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 1400px;
  justify-content: center;
  position: relative;
}

.test-data-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

.test-data-text {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.test-data-close {
  position: absolute;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: #ffffff;
  padding: 0;
  flex-shrink: 0;
}

.test-data-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.test-data-close svg {
  width: 14px;
  height: 14px;
}

.test-data-close:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Анимация появления баннера */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Анимация пульсации иконки */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Адаптация для темной темы */
.dark .test-data-banner {
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Позиционирование элементов обновляется через JavaScript */

/* ============================================================
   КОНТЕНТ И КАРТА
   ============================================================ */

.main-heading {
  position: fixed;
  top: 4rem;
  left: 0;
  right: 0;
  padding: 0.75rem 1.5rem;
  background-color: var(--background);
  z-index: 900;
  border-bottom: 1px solid var(--border);
  transition: top 0.3s ease-out;
}

.main-heading .subtitle {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--muted-foreground);
  line-height: 1.6;
  letter-spacing: 0.01em;
  margin: 0;
}

.content {
  position: fixed;
  top: calc(4rem + 3rem);
  left: 0;
  right: 0;
  bottom: 60px;
  z-index: 1;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.map-wrapper {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
}

.map-wrapper.neomorph {
  padding: 0.5rem;
}

.map-wrapper #map {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  /* Градиент и цвет текста теперь зависят от активной темы */
  background: var(--footer-background, linear-gradient(to right, #0F1E25, #1a2a3a));
  color: var(--footer-foreground, #FFFFFF);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  width: 100%;
  padding: 0 20px;
  position: relative;
}

.footer-section {
  display: flex;
  align-items: center;
  width: 33.33%;
  /* Фиксируем цвет текста на случай, если блоки будут использоваться без вложенных элементов */
  color: var(--footer-foreground, #FFFFFF);
}

.footer-section.left {
  justify-content: flex-start;
}

.footer-section.center {
  justify-content: center;
}

.footer-section.right {
  justify-content: flex-end;
}

.footer-logo {
  margin-right: 15px;
}

.footer-section.right .footer-logo {
  margin-right: 0;
  margin-left: 15px;
}

.footer-logo img {
  height: 50px;
  transition: transform 0.3s ease;
}

.footer-logo img:hover {
  transform: scale(1.1);
}

.footer-info {
  display: flex;
  flex-direction: column;
  /* Текст внутри информационных блоков берёт цвет из переменной темы */
  color: var(--footer-foreground, #FFFFFF);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.footer-info.text-right {
  text-align: right;
}

.footer-info p {
  margin: 0;
  line-height: 1.5;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.footer-info a {
  /* Ссылки получают свой цвет из переменной, чтобы не теряться на светлой теме */
  color: var(--footer-link-color, #FFFFFF);
  text-decoration: none;
  transition: color 0.3s, text-decoration 0.3s;
}

.footer-info a:hover {
  color: var(--footer-link-hover, #3CE43C);
  text-decoration: underline;
}

.footer-feedback-btn {
  /* Цвета кнопки также завязываем на переменные, чтобы при смене темы она не "растворялась" */
  background-color: var(--footer-button-background, rgba(255, 255, 255, 0.1));
  color: var(--footer-button-foreground, #FFFFFF);
  border: none;
  padding: 8px 20px;
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.5;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.footer-feedback-btn:hover {
  background-color: var(--footer-button-background, rgba(255, 255, 255, 0.2));
  transform: translateY(-2px);
}

.footer-feedback-btn img {
  width: 16px;
  height: 16px;
  margin-left: 8px;
}

#serendipity-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
  /* Фильтр вынесен в переменную, чтобы логотип выглядел корректно на обеих темах */
  filter: var(--footer-logo-filter, brightness(0) invert(1));
}

#serendipity-logo:hover {
  transform: scale(1.05);
  filter: var(--footer-logo-filter-hover, brightness(0) invert(0.8)); /* При наведении используем тему-ориентированный фильтр */
}

.serendipity-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--footer-link-color, #FFFFFF);
  transition: all 0.3s ease;
}

.serendipity-link:hover {
  /* Подсвечиваем ссылку при наведении, используя единый цвет для всех элементов */
  color: var(--footer-link-hover, #3CE43C);
}

.serendipity-text {
  margin-left: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.4;
  transition: opacity 0.3s ease;
}

.serendipity-link:hover .serendipity-text {
  color: inherit;
  opacity: 0.8;
}

/* Адаптивность для мобильных устройств */
@media screen and (max-width: 768px) {
  .serendipity-text {
    font-size: 0.75rem;
  }
  
  .main-heading .subtitle {
    font-size: 0.8125rem;
    line-height: 1.5;
  }
  
  .main-nav a {
    font-size: 0.8125rem;
    padding: 0.4375rem 0.75rem;
  }
}

/* ============================================================
   INPUT И ФОРМЫ
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: var(--input-background);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  color: var(--foreground);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.2);
}

input.glass,
textarea.glass,
select.glass {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark input.glass,
.dark textarea.glass,
.dark select.glass {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================
   ПАНЕЛЬ УПРАВЛЕНИЯ ОБНОВЛЕНИЕМ (ЕДИНЫЙ МОДУЛЬ)
   ============================================================ */

.update-control {
  background-color: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    6px 6px 12px rgba(163, 177, 198, 0.3),
    -6px -6px 12px rgba(255, 255, 255, 0.5);
  min-width: 200px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.dark .update-control {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    6px 6px 12px rgba(0, 0, 0, 0.3),
    -6px -6px 12px rgba(255, 255, 255, 0.02);
}

.update-toggle-button {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s ease;
  text-align: left;
}

.update-toggle-button:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.dark .update-toggle-button:hover {
  background-color: rgba(0, 191, 165, 0.2);
}

.update-toggle-button .toggle-icon {
  font-size: 1rem;
  font-weight: bold;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.update-toggle-button.expanded .toggle-icon {
  transform: rotate(45deg);
}

.update-time-display {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.update-time-display span:first-child {
  font-size: 0.625rem;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.update-time {
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  color: var(--foreground);
}

.update-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1rem;
}

.update-content.expanded {
  max-height: 300px;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.update-now {
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: var(--accent);
  color: var(--accent-foreground);
  border: none;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
}

.update-now:hover {
  background-color: rgba(0, 191, 165, 0.9);
}

.auto-update-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.auto-update-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.interval-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

#update-interval {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: var(--input-background);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  color: var(--foreground);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#update-interval:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.2);
}

.dark #update-interval {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   СТАРЫЙ SIDEBAR (для совместимости)
   ============================================================ */

#sidebar {
  position: fixed;
  top: 4rem;
  right: 0;
  width: 20rem;
  height: calc(100vh - 4rem);
  background: var(--card);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 999;
  overflow-y: auto;
}

#sidebar:not(.collapsed) {
  transform: translateX(0);
}

.sidebar-content {
  padding: 1rem;
}

.status-group {
  margin-bottom: 1rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-foreground);
  cursor: pointer;
  transition: all 0.2s ease;
}

.group-header:hover {
  background: rgba(0, 191, 165, 0.9);
}

.dark .group-header {
  background: rgba(0, 191, 165, 0.5);
}

.dark .group-header:hover {
  background: rgba(0, 191, 165, 0.7);
}

.group-title {
  flex: 1;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.group-counter {
  background: var(--accent-foreground);
  color: var(--accent);
  padding: 0.125rem 0.5rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
}

.status-items {
  padding: 0.5rem;
  display: none;
}

.status-group:not(.collapsed) .status-items {
  display: block;
}

.status-items .status-item {
  padding: 0.5rem;
  margin: 0.25rem 0;
  background: var(--background);
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.status-items .status-item:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.dark .status-items .status-item:hover {
  background: rgba(0, 191, 165, 0.2);
}

.sidebar-toggle {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 998;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-toggle:hover {
  background-color: var(--accent);
  transform: scale(1.1);
}

.dark .sidebar-toggle:hover {
  background-color: rgba(0, 191, 165, 0.5);
}

.sidebar-toggle img {
  width: 1.25rem;
  height: 1.25rem;
}

/* ============================================================
   RESPONSIVE СТИЛИ
   ============================================================ */

@media (max-width: 768px) {
  .header {
    padding: 0 1rem;
  }

  .logo-container span {
    display: none;
  }

  .main-nav {
    display: none;
  }

  .push-panel {
    width: 100%;
    max-width: 20rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-section {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   ДОПОЛНИТЕЛЬНАЯ ТИПОГРАФИКА ДЛЯ КОНТЕНТНЫХ СТРАНИЦ
   ============================================================ */

/* Стили для списков - улучшенное форматирование */
ul, ol {
  margin: 0 0 1rem 0;
  padding-left: 1.75rem;
  line-height: 1.8;
  color: var(--foreground);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

ul ul, ol ol, ul ol, ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

ul ul {
  list-style-type: circle;
}

ul ul ul {
  list-style-type: square;
}

li {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--foreground);
}

li:last-child {
  margin-bottom: 0;
}

/* Стили для выделенного текста */
strong, b {
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: 0.01em;
}

em, i {
  font-style: italic;
  color: var(--foreground);
}

/* Стили для ссылок */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
  font-weight: 500;
  letter-spacing: 0.01em;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Стили для контентных страниц */
body.content-page {
  overflow-y: auto;
  overflow-x: hidden;
}

body.content-page .content {
  position: relative;
  top: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  background-color: var(--background);
  min-height: calc(100vh - 4rem - 60px);
}

body.content-page .content p {
  margin-bottom: 1rem;
  text-align: justify;
  hyphens: auto;
}

body.content-page .content p:last-child {
  margin-bottom: 0;
}

/* Контейнер для функций */
.features-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.feature-column {
  background-color: var(--card);
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dark .feature-column {
  background-color: rgba(26, 29, 43, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.feature-column h3 {
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 1.125rem;
}

.feature-column ul {
  margin: 0;
  padding-left: 1.5rem;
}

.feature-column li {
  margin-bottom: 0.75rem;
}

.feature-column strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--foreground);
  font-size: 1rem;
}

.feature-column ul ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
}

.feature-column ul ul li {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}

/* Улучшенные стили для текста в контентных страницах */
body.content-page .content > p:first-of-type {
  font-size: 1.0625rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: var(--foreground);
}

body.content-page .content > ul:last-child,
body.content-page .content > ol:last-child {
  margin-bottom: 0;
}

/* Адаптивность для контентных страниц */
@media screen and (max-width: 768px) {
  body.content-page .content {
    padding: 1.5rem 1rem;
  }
  
  .features-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .feature-column {
    padding: 1.25rem;
  }
}

/* ============================================================
   АНИМАЦИИ ДЛЯ ИНДИКАТОРОВ СОСТОЯНИЯ В POPUP
   ============================================================ */

/**
 * Анимация мигания для ячеек с предупреждением (оранжевый)
 * Используется когда значения вне нормального диапазона
 */
@keyframes blink-orange {
  0%, 49% {
    background-color: rgba(245, 158, 11, 0.3);
    color: #F59E0B;
  }
  50%, 100% {
    background-color: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
  }
}

/**
 * Анимация мигания для текста с критическим статусом (красный)
 * Используется когда данные отсутствуют или критически неверны
 */
@keyframes blink-red {
  0%, 49% {
    color: #EF4444;
    font-weight: 600;
  }
  50%, 100% {
    color: rgba(239, 68, 68, 0.5);
    font-weight: 600;
  }
}

/**
 * Класс для ячеек с предупреждающим статусом
 * Применяется к ячейкам таблицы в popup при выходе значений за пределы нормы
 */
.blinking-cell-orange {
  animation: blink-orange 1.5s ease-in-out infinite;
  padding: 4px 8px;
  border-radius: 4px;
}

/**
 * Класс для текста с критическим статусом
 * Применяется когда данные отсутствуют (например, "Нет данных")
 */
.blinking-text-red {
  animation: blink-red 1.5s ease-in-out infinite;
}

/* Темная тема - корректировка цветов для анимаций */
.dark .blinking-cell-orange {
  background-color: rgba(245, 158, 11, 0.2);
}

/* Анимации для темной темы */
.dark {
  @keyframes blink-orange {
    0%, 49% {
      background-color: rgba(245, 158, 11, 0.25);
      color: #FBBF24;
    }
    50%, 100% {
      background-color: rgba(245, 158, 11, 0.1);
      color: #FBBF24;
    }
  }

  @keyframes blink-red {
    0%, 49% {
      color: #F87171;
      font-weight: 600;
    }
    50%, 100% {
      color: rgba(248, 113, 113, 0.5);
      font-weight: 600;
    }
  }
}

/* ============================================================
   ФИКСАЦИЯ ЦВЕТА POPUP ДЛЯ LEAFLET
   ============================================================ */

/**
 * Фиксируем цвет текста и фона popup независимо от темы
 * Popup всегда остается светлым с темным текстом для лучшей читаемости
 */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: white !important;
  color: #333 !important;
}

.leaflet-popup-content {
  color: #333 !important;
}

.leaflet-popup-content strong {
  color: #1A1D2B !important;
}

.leaflet-popup-content table {
  color: #333 !important;
}

.leaflet-popup-content table td {
  color: inherit !important;
}

/* Кнопка закрытия popup */
.leaflet-container a.leaflet-popup-close-button {
  color: #757575 !important;
}

.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
  color: #585858 !important;
}

/* Фиксированные цвета для popup трансформаторов и линий */
.leaflet-popup-content h4 {
  color: #1a202c !important;
}

.leaflet-popup-content p {
  color: #2d3748 !important;
}

.leaflet-popup-content .power-section-title,
.leaflet-popup-content .phase-label,
.leaflet-popup-content .phase-value,
.leaflet-popup-content .power-summary {
  color: #2d3748 !important;
}

.leaflet-popup-content .overload-warning {
  color: #c53030 !important;
}


/* ============================================================
   ИНДИКАТОРЫ МОЩНОСТИ И ЗАГРУЗКИ
   ============================================================ */

/**
 * Строка с данными по одной фазе
 * Содержит: label, визуальный индикатор-полоску, числовое значение
 */
.power-phase-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 13px;
}

.phase-label {
  min-width: 60px;
  font-weight: 500;
  color: #666;
}

/**
 * Контейнер для визуального индикатора мощности (полоска)
 */
.power-indicator-bar {
  flex: 1;
  height: 18px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/**
 * Заполнение индикатора (показывает процент загрузки)
 */
.power-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.3s ease;
  position: relative;
}

/**
 * Числовое значение мощности
 */
.phase-value {
  min-width: 65px;
  text-align: right;
  font-weight: 600;
  color: #333;
}

/**
 * Общая мощность (выделена)
 */
.total-power-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.total-power-row .phase-value {
  font-size: 15px;
  color: #1A1D2B;
}

/* ============================================================
   МАРКЕРЫ ТРАНСФОРМАТОРОВ С ПРОГРЕСС-БАРОМ
   ============================================================ */

/**
 * Контейнер для маркера трансформатора с прогресс-баром
 */
.transformer-marker-container {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/**
 * SVG прогресс-бар вокруг маркера
 */
.transformer-progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.transformer-progress-ring circle {
  fill: none;
  stroke-width: 3;
}

.transformer-progress-ring .ring-background {
  stroke: rgba(0, 0, 0, 0.1);
}

.transformer-progress-ring .ring-progress {
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

/**
 * Иконка трансформатора в центре
 */
.transformer-icon {
  position: relative;
  z-index: 2;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/**
 * Анимация мигания для перегруженных трансформаторов (>90%)
 */
@keyframes transformer-overload-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    transform: scale(1.1);
  }
}

.transformer-overload-marker {
  animation: transformer-overload-pulse 1.5s ease-in-out infinite;
}

.transformer-overload-marker .transformer-icon {
  background: #FEE;
  border: 2px solid #EF4444;
}

/**
 * Предупреждение о перегрузке в popup
 */
.overload-warning {
  background: linear-gradient(135deg, #FEE 0%, #FDD 100%);
  border-left: 4px solid #EF4444;
  padding: 12px;
  margin: 10px 0;
  border-radius: 6px;
  font-weight: 600;
  color: #C00;
  display: flex;
  align-items: center;
  gap: 8px;
}

.overload-warning::before {
  content: '⚠️';
  font-size: 20px;
}

/**
 * Секция мощности в popup
 */
.power-section {
  margin: 12px 0;
  padding: 10px;
  background: rgba(0, 191, 165, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(0, 191, 165, 0.2);
}

.power-section-title {
  font-weight: 600;
  color: #00BFA5;
  margin-bottom: 8px;
  font-size: 14px;
}

/**
 * Компактная строка с общим потреблением
 */
.power-summary {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.power-summary strong {
  color: #1A1D2B;
  font-size: 14px;
}

/* Темная тема */
.dark .phase-label {
  color: #9CA3AF;
}

.dark .phase-value,
.dark .total-power-row .phase-value {
  color: #E5E7EB;
}

.dark .power-indicator-bar {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .power-section {
  background: rgba(0, 191, 165, 0.1);
  border-color: rgba(0, 191, 165, 0.3);
}

.dark .power-summary {
  color: #9CA3AF;
}

.dark .power-summary strong {
  color: #E5E7EB;
}

