/* NEXUS — базовые стили */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #273549;
  --border: #334155;
  --primary: #6366f1;
  --primary-light: #818cf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* Карточки */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { opacity: .9; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

/* Формы */
.input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--text-muted); }

label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; display: block; }

/* Бейджи */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-success { background: #14532d; color: #4ade80; }
.badge-warning { background: #451a03; color: #fb923c; }
.badge-info    { background: #1e3a5f; color: #60a5fa; }
.badge-muted   { background: var(--surface2); color: var(--text-muted); }

/* Trust Score */
.trust-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}
.trust-score.high  { color: #4ade80; }
.trust-score.mid   { color: #fbbf24; }
.trust-score.low   { color: #f87171; }

/* Алерт автособытия */
.auto-event {
  background: var(--surface);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 6px 0;
  animation: slideIn .3s ease;
}
.auto-event.enter { border-left-color: var(--success); }
.auto-event.exit  { border-left-color: var(--warning); }
.auto-event-title { font-size: 13px; font-weight: 700; color: var(--text); }
.auto-event-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Offline-баннер */
#offlineBanner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--warning);
  color: #1c1917;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  z-index: 9999;
  display: none;
}
body.offline #offlineBanner { display: block; }

/* Утилиты */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-bold { font-weight: 700; }
.w-full { width: 100%; }
