/* ========================================
   Современный яркий дизайн для POS системы
   Светлая палитра с градиентами и анимациями
   ======================================== */

:root {
  /* Светлая яркая цветовая палитра */
  --primary-bg: #f0f4ff;
  --secondary-bg: #ffffff;
  --card-bg: #ffffff;
  --accent-blue: #4A90E2;
  --accent-green: #2ECC71;
  --accent-orange: #FF9500;
  --accent-red: #FF3B30;
  --accent-purple: #AF52DE;
  --accent-teal: #00C7BE;
  --accent-pink: #FF2D92;
  
  /* Градиенты */
  --gradient-blue: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-green: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-orange: linear-gradient(135deg, #FFA17F 0%, #FF6B6B 100%);
  --gradient-teal: linear-gradient(135deg, #48c6ef 0%, #6f86d6 100%);
  --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  
  /* Текст */
  --text-primary: #1a1a2e;
  --text-secondary: #6c757d;
  --text-light: #8f9aa8;
  --text-white: #ffffff;
  
  /* Границы и тени */
  --border-color: #e0e6ed;
  --border-light: #f0f3f8;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
  
  /* Радиусы */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Анимация - оптимизированы для быстрой загрузки */
  --transition-fast: 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   ТЁМНАЯ ТЕМА
   ======================================== */

html[data-theme="dark"] {
  --primary-bg: #0d1117;
  --secondary-bg: #161b22;
  --card-bg: #1c2128;
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;
  --accent-teal: #14b8a6;
  --accent-pink: #ec4899;
  
  /* Градиенты для тёмной темы */
  --gradient-blue: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-green: linear-gradient(135deg, #34d399 0%, #059669 100%);
  --gradient-orange: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  --gradient-teal: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  
  /* Текст */
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-light: #6e7681;
  --text-white: #ffffff;
  
  /* Границы и тени */
  --border-color: #30363d;
  --border-light: #21262d;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.7);
}

/* Анимированный фон для тёмной темы */
html[data-theme="dark"] body {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
  background-size: 200% 200%;
  animation: gradientShift 20s ease infinite;
}

html[data-theme="dark"] body::before {
  background: 
    radial-gradient(circle at 20% 30%, rgba(88, 166, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(168, 113, 247, 0.08) 0%, transparent 50%);
  opacity: 1;
  animation: pulseGlow 15s ease-in-out infinite;
}

html[data-theme="dark"] body::after {
  background: 
    radial-gradient(circle at 60% 40%, rgba(88, 166, 255, 0.04) 0%, transparent 60%),
    radial-gradient(circle at 40% 80%, rgba(168, 113, 247, 0.04) 0%, transparent 60%);
  animation: pulseGlow 20s ease-in-out infinite reverse;
}

/* Дополнительные правила для тёмной темы */
html[data-theme="dark"] .btn-secondary {
  background: linear-gradient(135deg, #21262d 0%, #161b22 100%);
  color: #e6edf3;
  border-color: #30363d;
}

html[data-theme="dark"] .btn-secondary::before {
  background: rgba(88, 166, 255, 0.15);
}

html[data-theme="dark"] .btn-secondary:hover {
  background: linear-gradient(135deg, #30363d 0%, #21262d 100%);
  border-color: #58a6ff;
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
  color: #58a6ff;
}

/* Специальные стили для кнопки "Выйти" в тёмной теме */
html[data-theme="dark"] a[href*="logout"].btn-secondary {
  background: linear-gradient(135deg, #3d1a1a 0%, #2a1212 100%);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

html[data-theme="dark"] a[href*="logout"].btn-secondary:hover {
  background: linear-gradient(135deg, #4a1f1f 0%, #3d1a1a 100%);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  color: #ff6b6b;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.15);
}

html[data-theme="dark"] .table thead {
  background: linear-gradient(135deg, #1f6feb 0%, #0969da 100%);
}

html[data-theme="dark"] .table tbody tr:hover {
  background: #21262d;
}

html[data-theme="dark"] .card:hover {
  box-shadow: 
    0 20px 60px rgba(88, 166, 255, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.3);
}

html[data-theme="dark"] .flash {
  border-color: #30363d;
}

html[data-theme="dark"] .flash-success {
  background: #0d3d2e;
  color: #3fb950;
  border-color: #1a5738;
}

html[data-theme="dark"] .flash-error {
  background: #3d0d0d;
  color: #ef4444;
  border-color: #5a1a1a;
}

html[data-theme="dark"] .flash-warning {
  background: #3d2d0d;
  color: #f97316;
  border-color: #5a4019;
}

html[data-theme="dark"] .flash-info {
  background: #0d2d3d;
  color: #58a6ff;
  border-color: #194466;
}

html[data-theme="dark"] .status-badge {
  background: #21262d;
  color: #e6edf3;
  border: 1px solid #30363d;
}

html[data-theme="dark"] .status-active {
  background: #0d3d2e !important;
  color: #3fb950 !important;
  border-color: #1a5738 !important;
}

html[data-theme="dark"] .status-pending {
  background: #3d2d0d !important;
  color: #f97316 !important;
  border-color: #5a4019 !important;
}

html[data-theme="dark"] .status-cancelled {
  background: #3d0d0d !important;
  color: #ef4444 !important;
  border-color: #5a1a1a !important;
}

html[data-theme="dark"] .header {
  background: #161b22;
  border-bottom-color: #30363d;
}

html[data-theme="dark"] .footer {
  background: #161b22;
  border-top-color: #30363d;
  color: #8b949e;
}

html[data-theme="dark"] .footer a {
  color: #58a6ff;
}

html[data-theme="dark"] .user-info {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.15) 0%, rgba(168, 113, 247, 0.15) 100%);
  border-color: rgba(88, 166, 255, 0.3);
  color: #e6edf3;
}

html[data-theme="dark"] .user-info:hover {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.2) 0%, rgba(168, 113, 247, 0.2) 100%);
  border-color: rgba(88, 166, 255, 0.5);
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.2);
}

html[data-theme="dark"] nav a {
  color: #e6edf3;
  background: linear-gradient(135deg, rgba(22, 27, 34, 0.9) 0%, rgba(28, 33, 40, 0.7) 100%);
  border-color: rgba(48, 54, 61, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] nav a::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

html[data-theme="dark"] nav a::after {
  background: rgba(88, 166, 255, 0.15);
}

html[data-theme="dark"] nav a:hover {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.2) 0%, rgba(168, 113, 247, 0.2) 100%);
  color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, 0.4);
  box-shadow: 0 8px 25px rgba(88, 166, 255, 0.4),
              0 0 0 1px rgba(88, 166, 255, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

html[data-theme="dark"] nav a.active {
  background: linear-gradient(135deg, #1f6feb 0%, #0969da 100%);
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(31, 111, 235, 0.6),
              0 0 0 2px rgba(255, 255, 255, 0.3),
              inset 0 2px 4px rgba(255, 255, 255, 0.3),
              inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] nav a.active::after {
  background: rgba(255, 255, 255, 0.15);
  width: 150px;
  height: 150px;
  animation: activeRipple 3s ease-in-out infinite;
}

html[data-theme="dark"] nav a.active:hover {
  box-shadow: 0 10px 30px rgba(31, 111, 235, 0.7),
              0 0 0 3px rgba(255, 255, 255, 0.4),
              inset 0 2px 4px rgba(255, 255, 255, 0.4),
              inset 0 -2px 4px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Универсальное правило для навигационных ссылок при нажатии */
nav a:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

/* Специальные стили для тёмной темы - кнопка "Бот" */
html[data-theme="dark"] nav a[href*="bot"]:not(.active) {
  background: linear-gradient(135deg, rgba(168, 113, 247, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);
  border-color: rgba(168, 113, 247, 0.4);
}

html[data-theme="dark"] nav a[href*="bot"]:not(.active):hover {
  background: linear-gradient(135deg, rgba(168, 113, 247, 0.25) 0%, rgba(59, 130, 246, 0.25) 100%);
  border-color: rgba(168, 113, 247, 0.6);
  box-shadow: 0 6px 20px rgba(168, 113, 247, 0.5);
  color: #c084fc;
}

html[data-theme="dark"] nav a[href*="bot"].active {
  background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  box-shadow: 0 6px 20px rgba(168, 113, 247, 0.7),
              0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Специальные стили для тёмной темы - кнопка "WhatsApp" */
html[data-theme="dark"] nav a[href*="whatsapp"]:not(.active) {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.15) 0%, rgba(25, 214, 152, 0.15) 100%);
  border-color: rgba(37, 211, 102, 0.4);
}

html[data-theme="dark"] nav a[href*="whatsapp"]:not(.active):hover {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.25) 0%, rgba(25, 214, 152, 0.25) 100%);
  border-color: rgba(37, 211, 102, 0.6);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
  color: #34d399;
}

html[data-theme="dark"] nav a[href*="whatsapp"].active {
  background: linear-gradient(135deg, #25D366 0%, #19d698 100%);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.7),
              0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Специальные стили для тёмной темы - кнопка "Настройки" */
html[data-theme="dark"] nav a[href*="settings"]:not(.active) {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.15) 0%, rgba(156, 163, 175, 0.15) 100%);
  border-color: rgba(107, 114, 128, 0.4);
}

html[data-theme="dark"] nav a[href*="settings"]:not(.active):hover {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.25) 0%, rgba(156, 163, 175, 0.25) 100%);
  border-color: rgba(107, 114, 128, 0.6);
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.5);
  color: #9ca3af;
}

html[data-theme="dark"] nav a[href*="settings"].active {
  background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.7),
              0 0 0 2px rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] .brand h1 {
  background: linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="dark"] .welcome-header h1 {
  background: linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Дополнительные элементы для тёмной темы */
html[data-theme="dark"] .panel {
  background: var(--card-bg);
  border-color: var(--border-color);
}

html[data-theme="dark"] .panel:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .card {
  background: rgba(28, 33, 40, 0.8);
  backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .welcome-header h1 {
  background: linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="dark"] .card-icon {
  box-shadow: 
    0 8px 24px rgba(88, 166, 255, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] .card:hover .card-icon {
  box-shadow: 
    0 12px 32px rgba(88, 166, 255, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: iconFloat 2s ease-in-out infinite, iconGlowDark 2s ease-in-out infinite;
}

@keyframes iconGlowDark {
  0%, 100% {
    box-shadow: 
      0 12px 32px rgba(88, 166, 255, 0.5),
      0 6px 16px rgba(0, 0, 0, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 
      0 16px 40px rgba(88, 166, 255, 0.7),
      0 8px 20px rgba(0, 0, 0, 0.7),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
}

html[data-theme="dark"] .card-title {
  color: var(--text-primary);
}

html[data-theme="dark"] .card:hover .card-title {
  background: linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--secondary-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] select::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--text-light);
}

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn {
  background: linear-gradient(135deg, #1f6feb 0%, #0969da 100%);
  color: white !important;
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn:hover {
  transform: none !important;
  box-shadow: 0 6px 20px rgba(31, 111, 235, 0.5);
}

html[data-theme="dark"] .btn-primary:active,
html[data-theme="dark"] .btn:active {
  transform: scale(0.98) !important;
  transition: transform 0.1s ease !important;
}

html[data-theme="dark"] .btn-success {
  background: linear-gradient(135deg, #2ea043 0%, #1a7f37 100%);
  color: white !important;
}

html[data-theme="dark"] .btn-success:hover {
  transform: none !important;
}

html[data-theme="dark"] .btn-success:active {
  transform: scale(0.98) !important;
}

html[data-theme="dark"] .btn-danger {
  background: linear-gradient(135deg, #da3633 0%, #cf222e 100%);
  color: white !important;
}

html[data-theme="dark"] .btn-danger:hover {
  transform: none !important;
}

html[data-theme="dark"] .btn-danger:active {
  transform: scale(0.98) !important;
}

html[data-theme="dark"] .btn-warning {
  background: linear-gradient(135deg, #fb8500 0%, #d97706 100%);
  color: white !important;
}

html[data-theme="dark"] .btn-warning:hover {
  transform: none !important;
}

html[data-theme="dark"] .btn-warning:active {
  transform: scale(0.98) !important;
}

html[data-theme="dark"] .btn-info {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white !important;
}

html[data-theme="dark"] .btn-info:hover {
  transform: none !important;
}

html[data-theme="dark"] .btn-info:active {
  transform: scale(0.98) !important;
}

html[data-theme="dark"] .btn-secondary:hover {
  transform: none !important;
}

html[data-theme="dark"] .btn-secondary:active {
  transform: scale(0.98) !important;
}

html[data-theme="dark"] label {
  color: var(--text-primary);
}

html[data-theme="dark"] .table {
  background: var(--secondary-bg);
}

html[data-theme="dark"] .table td {
  border-bottom-color: var(--border-light);
  color: var(--text-primary);
}

html[data-theme="dark"] .modal-content {
  background: var(--card-bg);
  color: var(--text-primary);
}

html[data-theme="dark"] .close-modal {
  color: var(--text-secondary);
}

html[data-theme="dark"] .close-modal:hover {
  color: var(--text-primary);
}

html[data-theme="dark"] .tag {
  background: #21262d;
  color: #58a6ff;
  border: 1px solid #30363d;
}

html[data-theme="dark"] .contacts-table {
  background: var(--secondary-bg);
}

html[data-theme="dark"] .contacts-table th {
  background: linear-gradient(135deg, #1f6feb 0%, #0969da 100%);
  color: white;
}

html[data-theme="dark"] .contacts-table td {
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-theme="dark"] .template-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

html[data-theme="dark"] .schedule-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

/* Дополнительные компоненты для тёмной темы */
html[data-theme="dark"] .stats-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

html[data-theme="dark"] .filter-section {
  background: var(--secondary-bg);
  border-color: var(--border-color);
}

html[data-theme="dark"] .tabs button {
  color: var(--text-secondary);
  background: transparent;
}

html[data-theme="dark"] .tabs button.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

html[data-theme="dark"] .tabs button:hover {
  color: var(--text-primary);
}

html[data-theme="dark"] .empty-state {
  color: var(--text-secondary);
}

html[data-theme="dark"] .divider {
  background: var(--border-color);
}

html[data-theme="dark"] .badge {
  background: #21262d;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

html[data-theme="dark"] .badge-primary {
  background: rgba(31, 111, 235, 0.2);
  color: var(--accent-blue);
  border-color: rgba(31, 111, 235, 0.4);
}

html[data-theme="dark"] .badge-success {
  background: rgba(63, 185, 80, 0.2);
  color: var(--accent-green);
  border-color: rgba(63, 185, 80, 0.4);
}

html[data-theme="dark"] .badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.4);
}

html[data-theme="dark"] .badge-warning {
  background: rgba(249, 115, 22, 0.2);
  color: var(--accent-orange);
  border-color: rgba(249, 115, 22, 0.4);
}

html[data-theme="dark"] .tooltip {
  background: #21262d;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

html[data-theme="dark"] .dropdown {
  background: var(--card-bg);
  border-color: var(--border-color);
}

html[data-theme="dark"] .dropdown-item {
  color: var(--text-primary);
}

html[data-theme="dark"] .dropdown-item:hover {
  background: #21262d;
}

html[data-theme="dark"] .search-box input {
  background: var(--secondary-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}

html[data-theme="dark"] .pagination button {
  background: var(--secondary-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}

html[data-theme="dark"] .pagination button.active {
  background: linear-gradient(135deg, #1f6feb 0%, #0969da 100%);
  color: white;
}

html[data-theme="dark"] .pagination button:hover:not(.active) {
  background: #21262d;
}

html[data-theme="dark"] h1, 
html[data-theme="dark"] h2, 
html[data-theme="dark"] h3, 
html[data-theme="dark"] h4, 
html[data-theme="dark"] h5, 
html[data-theme="dark"] h6 {
  color: var(--text-primary);
}

html[data-theme="dark"] p {
  color: var(--text-primary);
}

html[data-theme="dark"] a {
  color: var(--accent-blue);
}

html[data-theme="dark"] a:hover {
  color: #79c0ff;
}

html[data-theme="dark"] code {
  background: #21262d;
  color: #ff7b72;
  border: 1px solid var(--border-color);
}

html[data-theme="dark"] pre {
  background: #161b22;
  border-color: var(--border-color);
}

html[data-theme="dark"] pre code {
  background: transparent;
  border: none;
}

html[data-theme="dark"] hr {
  border-color: var(--border-color);
}

html[data-theme="dark"] blockquote {
  border-left-color: var(--border-color);
  color: var(--text-secondary);
}

html[data-theme="dark"] .alert {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

html[data-theme="dark"] .alert-success {
  background: rgba(63, 185, 80, 0.1);
  border-color: rgba(63, 185, 80, 0.3);
  color: var(--accent-green);
}

html[data-theme="dark"] .alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}

html[data-theme="dark"] .alert-warning {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.3);
  color: var(--accent-orange);
}

html[data-theme="dark"] .alert-info {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.3);
  color: var(--accent-blue);
}

html[data-theme="dark"] .checkbox,
html[data-theme="dark"] .radio {
  background: var(--secondary-bg);
  border-color: var(--border-color);
}

html[data-theme="dark"] .checkbox:checked,
html[data-theme="dark"] .radio:checked {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

html[data-theme="dark"] .sidebar {
  background: var(--secondary-bg);
  border-color: var(--border-color);
}

html[data-theme="dark"] .sidebar a {
  color: var(--text-primary);
}

html[data-theme="dark"] .sidebar a:hover {
  background: #21262d;
}

html[data-theme="dark"] .sidebar a.active {
  background: linear-gradient(135deg, #1f6feb 0%, #0969da 100%);
  color: white;
}

html[data-theme="dark"] .breadcrumb {
  color: var(--text-secondary);
}

html[data-theme="dark"] .breadcrumb a {
  color: var(--accent-blue);
}

html[data-theme="dark"] .loading-spinner {
  border-color: var(--border-color);
  border-top-color: var(--accent-blue);
}

html[data-theme="dark"] .progress-bar {
  background: #21262d;
}

html[data-theme="dark"] .progress-fill {
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
}

html[data-theme="dark"] .form-group label {
  color: var(--text-primary);
}

html[data-theme="dark"] .form-error {
  color: var(--accent-red);
}

html[data-theme="dark"] .form-help {
  color: var(--text-secondary);
}

html[data-theme="dark"] select option {
  background: var(--secondary-bg);
  color: var(--text-primary);
}

html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.8);
}

html[data-theme="dark"] .container,
html[data-theme="dark"] .content {
  color: var(--text-primary);
}

/* ========================================
   Базовые стили
   ======================================== */

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

html {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #f0f4f8 100%);
  background-size: 200% 200%;
  animation: gradientShift 20s ease infinite;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Плавные акценты */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.06) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
  animation: pulseGlow 15s ease-in-out infinite;
}

/* Дополнительные легкие акценты */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 60% 40%, rgba(102, 126, 234, 0.03) 0%, transparent 60%),
    radial-gradient(circle at 40% 80%, rgba(118, 75, 162, 0.03) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
  animation: pulseGlow 20s ease-in-out infinite reverse;
}

/* Анимация плавного движения градиента */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Анимация пульсации для акцентов */
@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* ========================================
   Контейнер и структура
   ======================================== */

main {
  flex: 1 0 auto;
  width: 100%;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* ========================================
   Навигация / Header
   ======================================== */

.header {
  background: var(--secondary-bg);
  padding: 16px 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--border-light);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 16px;
}

.brand img,
.brand-logo {
  height: 64px;
  width: auto;
  max-width: 200px;
  min-width: 64px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 10px rgba(102, 126, 234, 0.3));
}

.brand-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand h1 {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}

nav a, .user-info {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

nav a svg,
.user-info svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

nav a svg {
  fill: currentColor;
}

nav a.active svg {
  fill: white;
}

nav a {
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  font-weight: 500;
}

nav a:hover {
  background: rgba(74, 144, 226, 0.1);
  color: var(--accent-blue);
  border-color: rgba(74, 144, 226, 0.3);
  box-shadow: 0 3px 8px rgba(74, 144, 226, 0.2);
}

nav a.active {
  background: var(--gradient-blue);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  border: 1px solid rgba(102, 126, 234, 0.5);
  font-weight: 600;
}

nav a.active:hover {
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

nav a span {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
}

/* Специальные стили для кнопки "Бот" */
nav a[href*="bot"]:not(.active) {
  background: linear-gradient(135deg, rgba(168, 113, 247, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  border: 1px solid rgba(168, 113, 247, 0.3);
}

nav a[href*="bot"]:not(.active):hover {
  background: linear-gradient(135deg, rgba(168, 113, 247, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
  border-color: rgba(168, 113, 247, 0.5);
  box-shadow: 0 6px 20px rgba(168, 113, 247, 0.4);
  color: #a855f7;
}

nav a[href*="bot"].active {
  background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  box-shadow: 0 6px 20px rgba(168, 113, 247, 0.6),
              0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Специальные стили для кнопки "WhatsApp" */
nav a[href*="whatsapp"]:not(.active) {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(25, 214, 152, 0.1) 100%);
  border: 1px solid rgba(37, 211, 102, 0.3);
}

nav a[href*="whatsapp"]:not(.active):hover {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.2) 0%, rgba(25, 214, 152, 0.2) 100%);
  border-color: rgba(37, 211, 102, 0.5);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  color: #25D366;
}

nav a[href*="whatsapp"].active {
  background: linear-gradient(135deg, #25D366 0%, #19d698 100%);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6),
              0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Специальные стили для кнопки "Настройки" */
nav a[href*="settings"]:not(.active) {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.1) 0%, rgba(156, 163, 175, 0.1) 100%);
  border: 1px solid rgba(107, 114, 128, 0.3);
}

nav a[href*="settings"]:not(.active):hover {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.2) 0%, rgba(156, 163, 175, 0.2) 100%);
  border-color: rgba(107, 114, 128, 0.5);
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
  color: #6b7280;
}

nav a[href*="settings"].active {
  background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.6),
              0 0 0 2px rgba(255, 255, 255, 0.2);
}

.user-info {
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(167, 82, 222, 0.1) 100%);
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(74, 144, 226, 0.2);
  transition: all 0.3s ease;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.user-info:hover {
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.15) 0%, rgba(167, 82, 222, 0.15) 100%);
  border-color: rgba(74, 144, 226, 0.4);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.user-info span:first-child {
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* ========================================
   Панели / Cards
   ======================================== */

.panel {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;

  border: 1px solid var(--border-light);

}

.panel:hover {
  box-shadow: var(--shadow-hover);

  border-color: var(--accent-blue);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-light);
}

.panel-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.panel-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* ========================================
   Кнопки
   ======================================== */

.btn, button, input[type="submit"] {
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}

/* Универсальное правило для всех кнопок при нажатии */
.btn:active, 
button:active, 
input[type="submit"]:active,
a.btn:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: transform 0.1s ease !important;
}

/* КРИТИЧЕСКИ ВАЖНО: отключаем все hover эффекты с transform для кнопок */
.btn:hover,
button:hover,
.btn-primary:hover,
.btn-success:hover,
.btn-danger:hover,
.btn-warning:hover,
.btn-info:hover,
.btn-secondary:hover,
a.btn:hover,
input[type="submit"]:hover {
  transform: none !important;
}

.btn-primary, .btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover, .btn:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active, .btn:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

.btn-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.btn-success:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(17, 153, 142, 0.3) !important;
}

.btn-warning {
  background: linear-gradient(135deg, #FFA17F 0%, #FF6B6B 100%);
  color: white;
}

.btn-warning:hover {
  box-shadow: 0 6px 20px rgba(255, 161, 127, 0.4);
}

.btn-warning:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(255, 161, 127, 0.3) !important;
}

.btn-danger {
  background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-danger:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3) !important;
}

.btn-info {
  background: linear-gradient(135deg, #48c6ef 0%, #6f86d6 100%);
  color: white;
}

.btn-info:hover {
  box-shadow: 0 6px 20px rgba(72, 198, 239, 0.4);
}

.btn-info:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(72, 198, 239, 0.3) !important;
}

.btn-secondary {
  background: linear-gradient(135deg, #f0f3f8 0%, #e0e6ed 100%);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(74, 144, 226, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: 0;
}

.btn-secondary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #e0e6ed 0%, #d1d9e0 100%);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: var(--accent-blue);
}

.btn-secondary span {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.btn-secondary:hover span {
  transform: scale(1.1);
}

.btn-secondary:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.btn-secondary:active span {
  transform: scale(1) !important;
}

/* Специальные стили для кнопки "Выйти" */
a[href*="logout"].btn-secondary,
.btn-logout {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
  border-color: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
}

a[href*="logout"].btn-secondary:hover,
.btn-logout:hover {
  background: linear-gradient(135deg, #ffcccc 0%, #ff9999 100%);
  border-color: rgba(255, 59, 48, 0.4);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
  color: #ff1a1a;
  transform: translateY(-2px);
}

a[href*="logout"].btn-secondary span,
.btn-logout svg {
  transition: transform 0.3s ease;
}

a[href*="logout"].btn-secondary:hover span,
.btn-logout:hover svg {
  transform: rotate(15deg) scale(1.15);
}

a[href*="logout"].btn-secondary:active,
.btn-logout:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.2) !important;
}

a[href*="logout"].btn-secondary:active span,
.btn-logout:active svg {
  transform: rotate(0deg) scale(1) !important;
}

.btn.small, .btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn.large, .btn-lg {
  padding: 16px 32px;
  font-size: 17px;
}

/* ========================================
   Кнопка смены темы - Красивый дизайн
   ======================================== */

#themeToggle {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#themeToggle:hover {
  background: rgba(74, 144, 226, 0.1);
  border-color: rgba(74, 144, 226, 0.3);
  box-shadow: 0 3px 8px rgba(74, 144, 226, 0.2);
}

#themeToggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

html[data-theme="dark"] #themeToggle {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] #themeToggle:hover {
  background: rgba(74, 144, 226, 0.2);
  border-color: rgba(74, 144, 226, 0.4);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ========================================
   Формы
   ======================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

input, select, textarea {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--secondary-bg);
  color: var(--text-primary);
  font-size: 15px;

  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);

}

input[type="number"] {
  width: 140px;
}

input[type="date"], input[type="time"] {
  width: auto;
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  height: auto;
  margin-right: 8px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ========================================
   Таблицы
   ======================================== */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 20px 0;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--secondary-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table thead {
  background: var(--gradient-blue);
  color: var(--text-white);
}

.table th {
  padding: 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.table tbody tr {

}

.table tbody tr:hover {
  background: var(--primary-bg);

  box-shadow: var(--shadow-sm);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Статус badges в таблицах */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.status-active {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.status-pending {
  background: linear-gradient(135deg, #FFA17F 0%, #FF9500 100%);
  color: white;
}

.status-closed {
  background: #e0e6ed;
  color: var(--text-secondary);
}

.status-cancelled {
  background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
  color: white;
}

/* ========================================
   Карточки (для главной страницы)
   ======================================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  margin: 40px 0;
  padding: 0 8px;
}

.welcome-header {
  text-align: center;
  margin: 50px 0 40px;
  position: relative;
}

.welcome-header::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

.welcome-header h1 {
  font-size: 48px;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  text-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  letter-spacing: -0.5px;
  position: relative;
  animation: fadeInDown 0.6s ease-out;
}

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

.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px 28px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out backwards;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  box-shadow: 
    0 20px 60px rgba(102, 126, 234, 0.25),
    0 8px 24px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(102, 126, 234, 0.4);
}

.card:active {
  transform: scale(0.98) !important;
  box-shadow: 
    0 10px 30px rgba(102, 126, 234, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 1) !important;
}

.card-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 
    0 8px 24px rgba(102, 126, 234, 0.4),
    0 4px 12px rgba(102, 126, 234, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.card-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.card-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card:hover .card-icon::before {
  width: 120px;
  height: 120px;
}

.card:hover .card-icon::after {
  opacity: 1;
}

.card-icon svg {
  width: 40px;
  height: 40px;
  fill: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}

.card:hover .card-icon {
  box-shadow: 
    0 12px 32px rgba(102, 126, 234, 0.5),
    0 6px 16px rgba(102, 126, 234, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: iconFloat 2s ease-in-out infinite;
}

.card:hover .card-icon svg {
  animation: iconPulse 1.5s ease-in-out infinite;
}

/* Плавные анимации для иконок */
@keyframes iconFloat {
  0%, 100% {
    transform: rotate(8deg) translateY(0);
  }
  50% {
    transform: rotate(8deg) translateY(-5px);
  }
}

@keyframes iconPulse {
  0%, 100% {
    transform: rotate(-8deg);
    opacity: 1;
  }
  50% {
    transform: rotate(-8deg);
    opacity: 0.9;
  }
}

/* Специальные цвета для разных карточек */
.card:nth-child(1) .card-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card:nth-child(1):hover .card-icon {
  animation: iconFloat 2s ease-in-out infinite, iconGlow 2s ease-in-out infinite;
}

.card:nth-child(2) .card-icon {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.card:nth-child(2):hover .card-icon {
  animation: iconFloat 2.2s ease-in-out infinite, iconGlow 2s ease-in-out infinite;
}

.card:nth-child(3) .card-icon {
  background: linear-gradient(135deg, #48c6ef 0%, #6f86d6 100%);
}

.card:nth-child(3):hover .card-icon {
  animation: iconFloat 1.8s ease-in-out infinite, iconGlow 2s ease-in-out infinite;
}

.card:nth-child(4) .card-icon {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.card:nth-child(4):hover .card-icon {
  animation: iconFloat 2.1s ease-in-out infinite, iconGlow 2s ease-in-out infinite;
}

.card:nth-child(5) .card-icon {
  background: linear-gradient(135deg, #48c6ef 0%, #6f86d6 100%);
}

.card:nth-child(5):hover .card-icon {
  animation: iconFloat 1.9s ease-in-out infinite, iconGlow 2s ease-in-out infinite;
}

.card:nth-child(6) .card-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card:nth-child(6):hover .card-icon {
  animation: iconFloat 2s ease-in-out infinite, iconGlow 2s ease-in-out infinite;
}

/* Анимация свечения для разных цветов */
@keyframes iconGlow {
  0%, 100% {
    box-shadow: 
      0 12px 32px rgba(102, 126, 234, 0.5),
      0 6px 16px rgba(102, 126, 234, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow: 
      0 16px 40px rgba(102, 126, 234, 0.7),
      0 8px 20px rgba(102, 126, 234, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
}

.card:nth-child(2):hover .card-icon,
.card:nth-child(4):hover .card-icon {
  animation: iconFloat 2.2s ease-in-out infinite, iconGlowGreen 2s ease-in-out infinite;
}

@keyframes iconGlowGreen {
  0%, 100% {
    box-shadow: 
      0 12px 32px rgba(17, 153, 142, 0.5),
      0 6px 16px rgba(56, 239, 125, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow: 
      0 16px 40px rgba(17, 153, 142, 0.7),
      0 8px 20px rgba(56, 239, 125, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
}

.card:nth-child(3):hover .card-icon,
.card:nth-child(5):hover .card-icon {
  animation: iconFloat 1.9s ease-in-out infinite, iconGlowBlue 2s ease-in-out infinite;
}

@keyframes iconGlowBlue {
  0%, 100% {
    box-shadow: 
      0 12px 32px rgba(72, 198, 239, 0.5),
      0 6px 16px rgba(111, 134, 214, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow: 
      0 16px 40px rgba(72, 198, 239, 0.7),
      0 8px 20px rgba(111, 134, 214, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
}

.card-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  transition: color 0.3s ease;
}

.card:hover .card-title {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-description {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.7;
  min-height: 48px;
}

.card a.btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.card a.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: -1;
}

.card a.btn:hover::before {
  width: 300px;
  height: 300px;
}

.card a.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card a.btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Темная тема для кнопок в карточках */
html[data-theme="dark"] .card a.btn {
  color: white !important;
}

html[data-theme="dark"] .card a.btn-primary,
html[data-theme="dark"] .card a.btn {
  background: linear-gradient(135deg, #1f6feb 0%, #0969da 100%);
  color: white !important;
}

html[data-theme="dark"] .card a.btn-success {
  background: linear-gradient(135deg, #2ea043 0%, #1a7f37 100%);
  color: white !important;
}

html[data-theme="dark"] .card a.btn-info {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white !important;
}

html[data-theme="dark"] .card a.btn-warning {
  background: linear-gradient(135deg, #fb8500 0%, #d97706 100%);
  color: white !important;
}

html[data-theme="dark"] .card a.btn-danger {
  background: linear-gradient(135deg, #da3633 0%, #cf222e 100%);
  color: white !important;
}

/* Убеждаемся, что текст кнопок виден */
html[data-theme="dark"] .btn *,
html[data-theme="dark"] .card a.btn * {
  color: white !important;
  position: relative;
  z-index: 2;
}

/* ========================================
   Flash сообщения
   ======================================== */

.flash-messages {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flash {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;

  font-weight: 500;
}

.flash-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.flash-error {
  background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
  color: white;
}

.flash-info {
  background: var(--gradient-teal);
  color: white;
}

.flash-warning {
  background: var(--gradient-orange);
  color: white;
}

/* ========================================
   Модальные окна
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;

}

.modal {
  background: var(--secondary-bg);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

/* ========================================
   Утилиты
   ======================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.inline { display: inline-flex; }
.inline-block { display: inline-block; }

.hide { display: none; }
.show { display: block; }

/* ========================================
   Адаптивность
   ======================================== */

@media (max-width: 768px) {
  .container {
    padding: 12px;
  }
  
  .header .container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  nav {
    width: 100%;
    justify-content: flex-start;
  }
  
  .panel {
    padding: 16px;
  }
  
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0;
  }
  
  .welcome-header h1 {
    font-size: 32px;
  }
  
  .card {
    padding: 32px 20px;
  }
  
  .card-icon {
    width: 70px;
    height: 70px;
  }
  
  .card-icon svg {
    width: 36px;
    height: 36px;
  }
  
  .card-title {
    font-size: 22px;
  }
  
  .table-wrapper {
    margin: 12px 0;
  }
  
  .table th, .table td {
    padding: 10px;
    font-size: 13px;
  }
  
  .flash-messages {
    left: 20px;
    right: 20px;
    max-width: none;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }
  
  .only-desktop {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .only-mobile {
    display: none !important;
  }
}

/* ========================================
   Дополнительные визуальные элементы
   ======================================== */

/* Прогресс-бар */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-blue);

  border-radius: 10px;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  background: var(--text-primary);
  color: white;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;

  opacity: 0;

  white-space: nowrap;
  font-size: 13px;
  box-shadow: var(--shadow-md);
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ========================================
   LOADING АНИМАЦИИ
   ======================================== */

/* Базовый спиннер */
.spinner {
  border: 4px solid var(--border-light);
  border-top: 4px solid var(--accent-blue);
  border-radius: 50%;
  width: 40px;
  height: 40px;

  margin: 20px auto;
}

/* Двойной спиннер */
.spinner-double {
  position: relative;
  width: 50px;
  height: 50px;
  margin: 20px auto;
}

.spinner-double::before,
.spinner-double::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 3px solid transparent;

}

.spinner-double::before {
  width: 50px;
  height: 50px;
  border-top-color: var(--accent-blue);
  border-right-color: var(--accent-blue);
}

.spinner-double::after {
  width: 35px;
  height: 35px;
  top: 50%;
  left: 50%;

  border-bottom-color: var(--accent-purple);
  border-left-color: var(--accent-purple);
  animation-direction: reverse;
  animation-duration: 1s;
}

/* Dots loader */
.dots-loader {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
}

.dots-loader span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);

}

.dots-loader span:nth-child(1) {
  animation-delay: -0.32s;
}

.dots-loader span:nth-child(2) {
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-light) 0%,
    var(--border-color) 50%,
    var(--border-light) 100%
  );
  background-size: 200% 100%;

  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-md);
}

/* Пульсирующий loader */
.pulse-loader {
  width: 50px;
  height: 50px;
  margin: 20px auto;
  border-radius: 50%;
  background: var(--accent-blue);

}

/* Footer */
.footer {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
  padding: 16px 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  flex-shrink: 0;
  width: 100%;
}

.footer a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--accent-purple);
}

/* Блок поддержки в футере */
.footer-support {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.footer-support-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-support-content svg {
  width: 18px;
  height: 18px;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.footer-support-text {
  white-space: nowrap;
}

.footer-support-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-support-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-blue);
  color: white !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-support-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.footer-support-link:hover {
  background: var(--accent-purple);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  color: white !important;
}

.footer-support-link:active {
  transform: translateY(0);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
  .footer-support {
    flex-direction: column;
    gap: 12px;
  }
  
  .footer-support-content {
    justify-content: center;
  }
  
  .footer-support-text {
    white-space: normal;
    text-align: center;
  }
  
  .footer-support-links {
    justify-content: center;
    width: 100%;
  }
  
  .footer-support-link {
    flex: 1;
    justify-content: center;
    min-width: 120px;
  }
}

html[data-theme="dark"] .footer-support-content svg {
  color: #58a6ff;
}

html[data-theme="dark"] .footer-support-link {
  background: #1f6feb;
}

html[data-theme="dark"] .footer-support-link:hover {
  background: #0969da;
  box-shadow: 0 2px 8px rgba(31, 111, 235, 0.3);
}

/* Улучшенный фокус для доступности */
*:focus-visible {
  outline: 3px solid var(--accent-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ========================================
   ОТКЛЮЧЕНИЕ АНИМАЦИЙ
   ======================================== */

/* Полное отключение всех анимаций, переходов и эффектов */
body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  animation-iteration-count: 1 !important;
}

/* Отключаем все @keyframes анимации */
body.no-animations,
body.no-animations * {
  animation: none !important;
  transition: none !important;
  transform: none !important;
}

/* Сохраняем финальное состояние, но без анимации */
body.no-animations .fade-in,
body.no-animations .slide-up,
body.no-animations .slide-down,
body.no-animations .panel,
body.no-animations .card,
body.no-animations .table-wrapper,
body.no-animations .table tbody tr {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Отключаем hover эффекты с анимациями */
body.no-animations *:hover {
  transition: none !important;
  transform: none !important;
}

/* Отключаем CSS transitions для всех элементов */
body.no-animations * {
  transition-property: none !important;
  will-change: auto !important;
}

/* Оптимизация производительности для длинных страниц */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
