/* ========================================
   ТЕМНАЯ ТЕМА ДЛЯ ДАШБОРДА
   ======================================== */

/* Основной контейнер дашборда */
[data-theme="dark"] .dashboard-container {
  background: #0d1117 !important;
  color: #e2e8f0 !important;
}

/* Заголовок приветствия */
[data-theme="dark"] .welcome-header {
  background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%) !important;
  color: #ffffff !important;
  border: 1px solid #2d3748;
}

[data-theme="dark"] .welcome-title {
  color: #ffffff !important;
}

[data-theme="dark"] .welcome-subtitle {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Карточки метрик */
[data-theme="dark"] .metric-card {
  background: #1a202c !important;
  border: 1px solid #2d3748 !important;
  color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .metric-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  border-color: #4a5568 !important;
}

[data-theme="dark"] .metric-title {
  color: #a0aec0 !important;
}

[data-theme="dark"] .metric-value {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .metric-change {
  color: #a0aec0 !important;
}

[data-theme="dark"] .metric-change.positive {
  color: #68d391 !important;
}

[data-theme="dark"] .metric-change.negative {
  color: #fc8181 !important;
}

/* Иконки метрик в темной теме */
[data-theme="dark"] .icon-orders { 
  background: rgba(102, 126, 234, 0.2) !important; 
  color: #90cdf4 !important; 
}

[data-theme="dark"] .icon-products { 
  background: rgba(72, 187, 120, 0.2) !important; 
  color: #68d391 !important; 
}

[data-theme="dark"] .icon-materials { 
  background: rgba(237, 137, 54, 0.2) !important; 
  color: #f6ad55 !important; 
}

[data-theme="dark"] .icon-bom { 
  background: rgba(49, 130, 206, 0.2) !important; 
  color: #63b3ed !important; 
}

[data-theme="dark"] .icon-progress { 
  background: rgba(118, 75, 162, 0.2) !important; 
  color: #b794f6 !important; 
}

[data-theme="dark"] .icon-efficiency { 
  background: rgba(229, 62, 62, 0.2) !important; 
  color: #fc8181 !important; 
}

/* Карточки быстрых действий */
[data-theme="dark"] .action-card {
  background: #1a202c !important;
  border: 1px solid #2d3748 !important;
  color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .action-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  border-color: #4a5568 !important;
  color: #90cdf4 !important;
  text-decoration: none !important;
}

[data-theme="dark"] .action-icon {
  background: rgba(102, 126, 234, 0.2) !important;
  color: #90cdf4 !important;
}

[data-theme="dark"] .action-title {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .action-card:hover .action-title {
  color: #90cdf4 !important;
}

[data-theme="dark"] .action-card:hover .action-icon {
  background: rgba(102, 126, 234, 0.3) !important;
  color: #90cdf4 !important;
}

/* Дополнительные элементы дашборда */
[data-theme="dark"] .dashboard-section {
  background: #1a202c !important;
  border: 1px solid #2d3748 !important;
}

[data-theme="dark"] .dashboard-section-header {
  background: #2d3748 !important;
  color: #e2e8f0 !important;
  border-bottom: 1px solid #4a5568 !important;
}

/* Графики и диаграммы */
[data-theme="dark"] .chart-container {
  background: #1a202c !important;
  border: 1px solid #2d3748 !important;
}

[data-theme="dark"] .chart-title {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .chart-legend {
  color: #a0aec0 !important;
}

/* Таблицы в дашборде */
[data-theme="dark"] .dashboard-table {
  background: #1a202c !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .dashboard-table th {
  background: #2d3748 !important;
  color: #e2e8f0 !important;
  border-color: #4a5568 !important;
}

[data-theme="dark"] .dashboard-table td {
  border-color: #2d3748 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .dashboard-table tbody tr:hover {
  background: rgba(102, 126, 234, 0.1) !important;
}

/* Статистические элементы */
[data-theme="dark"] .stat-widget {
  background: #1a202c !important;
  border: 1px solid #2d3748 !important;
}

[data-theme="dark"] .stat-widget-header {
  background: #2d3748 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .stat-widget-body {
  color: #e2e8f0 !important;
}

/* Прогресс-бары в дашборде */
[data-theme="dark"] .dashboard-progress {
  background: #2d3748 !important;
}

[data-theme="dark"] .dashboard-progress-bar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Уведомления в дашборде */
[data-theme="dark"] .dashboard-notification {
  background: #1a202c !important;
  border: 1px solid #2d3748 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .dashboard-notification.success {
  border-color: #48bb78 !important;
  background: rgba(72, 187, 120, 0.1) !important;
}

[data-theme="dark"] .dashboard-notification.warning {
  border-color: #ed8936 !important;
  background: rgba(237, 137, 54, 0.1) !important;
}

[data-theme="dark"] .dashboard-notification.error {
  border-color: #e53e3e !important;
  background: rgba(229, 62, 62, 0.1) !important;
}

/* Кнопки в дашборде */
[data-theme="dark"] .dashboard-btn {
  background: #2d3748 !important;
  color: #e2e8f0 !important;
  border: 1px solid #4a5568 !important;
}

[data-theme="dark"] .dashboard-btn:hover {
  background: #4a5568 !important;
  border-color: #718096 !important;
}

[data-theme="dark"] .dashboard-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: #ffffff !important;
  border: none !important;
}

[data-theme="dark"] .dashboard-btn-primary:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
}

/* Адаптивность для темной темы */
@media (max-width: 768px) {
  [data-theme="dark"] .metric-card,
  [data-theme="dark"] .action-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
  }
  
  [data-theme="dark"] .metric-card:hover,
  [data-theme="dark"] .action-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  }
}

/* Дополнительные улучшения для контрастности */
[data-theme="dark"] .metric-card,
[data-theme="dark"] .action-card {
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* Анимации для темной темы */
[data-theme="dark"] .metric-card,
[data-theme="dark"] .action-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-theme="dark"] .metric-card:hover,
[data-theme="dark"] .action-card:hover {
  transform: translateY(-4px) !important;
}

/* Улучшенные градиенты для темной темы */
[data-theme="dark"] .welcome-header {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 50%, #0d1117 100%) !important;
  border: 1px solid #4a5568 !important;
  position: relative !important;
}

[data-theme="dark"] .welcome-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 12px;
  pointer-events: none;
}