/* AllDash — базовые токены и компоненты (Slate + Blue, по референсу PLT) */
:root {
  --surface-0: #ffffff;
  --surface-50: #f8fafc;
  --surface-100: #f1f5f9;
  --surface-200: #e2e8f0;
  --surface-300: #cbd5e1;
  --surface-400: #94a3b8;
  --surface-500: #64748b;
  --surface-600: #475569;
  --surface-700: #334155;
  --surface-800: #1e293b;
  --surface-900: #0f172a;

  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;

  --success-700: #047857;
  --success-50: #ecfdf5;
  --danger-700: #b91c1c;
  --danger-600: #dc2626;
  --danger-50: #fef2f2;
  --warn-700: #b45309;
  --warn-50: #fffbeb;

  --series-1: #2563eb;
  --series-2: #9268ea;
  --series-3: #0ea5e9;
  --series-4: #10b981;
  --series-5: #f59e0b;
  --series-6: #ef4444;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-1: 0 1px 2px 0 rgba(18, 18, 23, .05);
  --shadow-dialog: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);

  --text: var(--surface-900);
  --text-2: var(--surface-600);
  --text-3: var(--surface-500);
  --muted: var(--surface-400);

  --font: Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-600); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }

.num, .widget-kpi-value, table td { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--primary-600); outline-offset: 2px; border-radius: var(--radius-sm); }

.hidden { display: none !important; }

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--surface-200);
  background: var(--surface-0);
  color: var(--surface-800);
  font-size: 14px; line-height: 20px;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--surface-50); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--primary-600); border-color: var(--primary-600); color: #fff;
}
.btn-primary:hover { background: var(--primary-700); border-color: var(--primary-700); }

.btn-danger-ghost { color: var(--danger-700); }
.btn-danger-ghost:hover { background: var(--danger-50); border-color: #fecaca; }

.btn-block { width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 13px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: none; border-radius: var(--radius);
  background: transparent; color: var(--surface-600);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-100); color: var(--surface-800); }
.icon-btn.active { background: var(--primary-50); color: var(--primary-600); }

/* --- Поля ввода --- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 500; color: var(--surface-700); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 14px; line-height: 20px;
  color: var(--text);
  padding: 7px 10px;
  border: 1px solid var(--surface-300);
  border-radius: var(--radius);
  background: var(--surface-0);
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 1px var(--primary-600);
}
.field .hint { font-size: 12px; color: var(--surface-500); }

/* --- Значки --- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px; line-height: 18px; font-weight: 500;
}
.badge-soon { background: var(--surface-100); color: var(--surface-500); }
.badge-ok { background: var(--success-50); color: var(--success-700); }
.badge-error { background: var(--danger-50); color: var(--danger-700); }
.badge-new { background: var(--primary-50); color: var(--primary-700); }

/* --- Карточки --- */
.card {
  background: var(--surface-0);
  border: 1px solid var(--surface-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

/* --- Сообщение об ошибке --- */
.alert {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px; line-height: 18px;
}
.alert-error { background: var(--danger-50); color: var(--danger-700); border: 1px solid #fecaca; }

/* --- Скроллбары --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-400); background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }
