/* ============================================
   ElectroSpec — Design System
   Стиль: Industrial / Утилитарный
   Шрифты: Manrope (body) + JetBrains Mono (data)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Основные цвета */
  --bg-primary:    #0C0E12;
  --bg-secondary:  #14171E;
  --bg-card:       #1A1E28;
  --bg-input:      #10131A;
  --bg-hover:      #1F2432;

  /* Электрический синий — акцент */
  --accent:        #3B82F6;
  --accent-hover:  #2563EB;
  --accent-glow:   rgba(59, 130, 246, 0.15);
  --accent-soft:   rgba(59, 130, 246, 0.08);

  /* Статусы */
  --ok:            #22C55E;
  --ok-bg:         rgba(34, 197, 94, 0.10);
  --warn:          #FACC15;
  --warn-bg:       rgba(250, 204, 21, 0.10);
  --error:         #EF4444;
  --error-bg:      rgba(239, 68, 68, 0.10);

  /* Текст */
  --text-primary:  #E8ECF4;
  --text-secondary:#8892A6;
  --text-muted:    #555E72;

  /* Границы */
  --border:        #232838;
  --border-hover:  #2E3548;

  /* Радиусы */
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     14px;
  --radius-xl:     20px;

  /* Тени */
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 20px var(--accent-glow);

  /* Шрифты */
  --font-body:     'Manrope', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  /* Размеры */
  --sidebar-width: 280px;
  --header-height: 60px;
}

/* ===== Reset & Base ===== */

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59,130,246,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--border);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

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

/* ===== Инпуты ===== */

.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input::placeholder {
  color: var(--text-muted);
}

/* ===== Бейджи ===== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-ok     { background: var(--ok-bg);   color: var(--ok); }
.badge-warn   { background: var(--warn-bg); color: var(--warn); }
.badge-error  { background: var(--error-bg);color: var(--error); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* ===== Карточки ===== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

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

.text-mono { font-family: var(--font-mono); }
.text-sm   { font-size: 0.85rem; }
.text-xs   { font-size: 0.75rem; }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ===== Скроллбар ===== */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Анимации ===== */

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
