/* CFO Cockpit «Фонари 1871» - Chart Styles */

/* Chart Container Adjustments */
.chart-wrapper {
  position: relative;
  height: 400px;
  width: 100%;
}

/* Custom Chart Colors */
:root {
  --chart-stars: #2E5C4F;
  --chart-pearls: #D4A017;
  --chart-horses: #B87333;
  --chart-dogs: #C65D3B;
  --chart-problems: #8B4513;
  --chart-neutral: #5C4033;
  --chart-copper: #B87333;
  --chart-linen: #F5F5DC;
}

/* Chart.js Custom Tooltip */
.chartjs-tooltip {
  background: rgba(26, 18, 11, 0.95) !important;
  border: 1px solid var(--accent-copper) !important;
  border-radius: var(--radius-md) !important;
  padding: 12px !important;
  box-shadow: var(--shadow-card) !important;
}

.chartjs-tooltip-title {
  color: var(--accent-linen) !important;
  font-family: var(--font-heading) !important;
  font-size: 14px !important;
  margin-bottom: 8px !important;
}

.chartjs-tooltip-body {
  color: var(--text-primary) !important;
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
}

.chartjs-tooltip-label {
  color: var(--text-secondary) !important;
}

/* Legend Styles */
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
}

.legend-stars { background: var(--chart-stars); }
.legend-pearls { background: var(--chart-pearls); }
.legend-horses { background: var(--chart-horses); }
.legend-dogs { background: var(--chart-dogs); }
.legend-problems { background: var(--chart-problems); }

/* DataTables Customization */
.dataTables_wrapper {
  color: var(--text-primary);
}

.dataTables_length,
.dataTables_filter,
.dataTables_info,
.dataTables_paginate {
  color: var(--text-secondary) !important;
  margin-bottom: 1rem;
}

.dataTables_length select,
.dataTables_filter input {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-copper);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.5rem;
}

.dataTables_filter input:focus {
  outline: none;
  border-color: var(--accent-linen);
}

.dataTables_paginate .paginate_button {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--accent-copper) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.5rem 1rem !important;
  margin: 0 0.25rem !important;
}

.dataTables_paginate .paginate_button:hover {
  background: var(--accent-copper) !important;
  color: white !important;
}

.dataTables_paginate .paginate_button.current {
  background: var(--accent-copper) !important;
  color: white !important;
}

.dataTables_paginate .paginate_button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Status Colors in Tables */
.status-growth { color: #4ade80; font-weight: 600; }
.status-crisis { color: #f87171; font-weight: 600; }
.status-new { color: #fbbf24; font-weight: 600; }
.status-gone { color: #9ca3af; font-weight: 600; }
.status-stable { color: #fb923c; font-weight: 600; }

/* Delta Colors */
.delta-positive { color: #4ade80; }
.delta-negative { color: #f87171; }
.delta-neutral { color: #9ca3af; }

/* Trend Arrows */
.trend-up::before {
  content: "↗️ ";
  color: #4ade80;
}

.trend-down::before {
  content: "↘️ ";
  color: #f87171;
}

.trend-neutral::before {
  content: "➡️ ";
  color: #9ca3af;
}

/* Loading State */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--text-secondary);
}

.loading::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 3px solid var(--accent-copper);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-copper);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-linen);
}
