:root {
  --brand-50: #e0e7fa;
  --brand-100: #c1d0ed;
  --brand-500: #4a67d0; /* Основной синий */
  --brand-600: #3a57c0;
  --brand-700: #2a47b0;
  --sidebar-bg: #1c2536; /* Темный фон сайдбара */
  --sidebar-hover: #2a3447; /* Ховер для сайдбара */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --surface-light: #f8fafc;
  --surface-medium: #f1f5f9;
  --border-color: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #facc15;
  --info: #0ea5e9;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text-primary);
  line-height: 1.5;
}

/* App shell */
.app-sidebar {
  background-color: var(--sidebar-bg);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.app-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.app-sidebar .nav-item:hover {
  background-color: var(--sidebar-hover);
  color: #e2e8f0;
}

.app-sidebar .nav-item.active {
  background-color: rgba(74, 103, 208, 0.15);
  color: var(--brand-100);
}

.app-sidebar .nav-item.active svg {
  color: var(--brand-500);
}

/* KPI cards */
.kpi-card {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  border-color: var(--brand-500);
  box-shadow: 0 4px 20px rgba(74, 103, 208, 0.08);
}

.kpi-value {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Position badges */
.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pos-top3 { background-color: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.pos-top10 { background-color: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; }
.pos-top30 { background-color: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.pos-low { background-color: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }
.pos-none { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

.delta-up { color: var(--success); }
.delta-down { color: var(--danger); }
.delta-same { color: var(--text-muted); }

/* Data table */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--surface-light);
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--surface-medium);
  font-size: 0.875rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

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

.data-table tbody tr:hover td {
  background-color: var(--surface-medium);
}

/* Chart container */
.chart-box {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

/* Custom scrollbar */
.custom-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }

/* Form elements */
.form-input,
.form-select {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  background-color: white;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(74, 103, 208, 0.15);
}

.btn-primary {
  background-color: var(--brand-500);
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--brand-600);
}

.btn-secondary {
  background-color: var(--surface-medium);
  color: var(--text-secondary);
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--surface-light);
  border-color: var(--brand-500);
  color: var(--brand-500);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  background-color: var(--surface-medium);
  color: var(--text-primary);
}
