/* ── Inputs ───────────────────────────────────────────── */
.input-field {
  width: 100%;
  background-color: #111827;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #f9fafb;
  font-size: 0.875rem;
  transition: border-color 0.15s;
  outline: none;
}
.input-field:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249,115,22,0.15);
}
.input-field::placeholder { color: #6b7280; }

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #f97316;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.625rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.05s;
}
.btn-primary:hover  { background-color: #ea580c; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #1f2937;
  color: #d1d5db;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.625rem;
  border: 1px solid #374151;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn-secondary:hover { background-color: #374151; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: #f87171;
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #7f1d1d;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn-danger:hover { background-color: rgba(239,68,68,0.1); }

/* ── Nav sidebar links ────────────────────────────────── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.9rem;
  color: #9ca3af;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.nav-link:hover { background-color: #1f2937; color: #f9fafb; }
.nav-link.active { background-color: rgba(249,115,22,0.15); color: #f97316; font-weight: 600; }

/* ── Stat cards ───────────────────────────────────────── */
.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: #111827;
  border: 1px solid #1f2937;
  border-radius: 1rem;
  padding: 1.25rem;
}
.stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}
.stat-label { font-size: 0.78rem; color: #9ca3af; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }

/* ── Status badges ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-alarme    { background: rgba(239,68,68,0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-armado    { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.badge-desarmado { background: rgba(34,197,94,0.15);  color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.badge-offline   { background: rgba(234,179,8,0.15);  color: #facc15; border: 1px solid rgba(234,179,8,0.3); }
.badge-online    { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.badge-desconhecido { background: rgba(107,114,128,0.15); color: #9ca3af; border: 1px solid rgba(107,114,128,0.3); }

/* ── Alert blocks ─────────────────────────────────────── */
.alert-success {
  padding: 0.75rem 1rem;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
  border-radius: 0.625rem;
  font-size: 0.875rem;
}
.alert-error {
  padding: 0.75rem 1rem;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  border-radius: 0.625rem;
  font-size: 0.875rem;
}

/* ── Live feed items ──────────────────────────────────── */
.feed-item {
  background: #1f2937;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  border-left: 3px solid #f97316;
  animation: slideIn 0.3s ease;
}
.feed-item.critico { border-left-color: #ef4444; }

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

/* ── Toggle switch ────────────────────────────────────── */
.toggle {
  position: relative;
  display: inline-flex;
  width: 2.75rem;
  height: 1.5rem;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background-color: #374151;
  border-radius: 999px;
  transition: background-color 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 1.1rem;
  width: 1.1rem;
  left: 0.2rem;
  bottom: 0.2rem;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background-color: #f97316; }
.toggle input:checked + .toggle-slider::before { transform: translateX(1.25rem); }

/* ── Table rows ───────────────────────────────────────── */
tbody tr { border-bottom: 1px solid #1f2937; transition: background-color 0.1s; }
tbody tr:hover { background-color: rgba(255,255,255,0.02); }
tbody tr:last-child { border-bottom: none; }
